got rid of dependency injection, it doesn't add anything at this point and only slows down things and makes a mess. Also some refactoring.
This commit is contained in:
@@ -45,9 +45,9 @@ import org.newdawn.slick.util.Log;
|
||||
import lzma.streams.LzmaOutputStream;
|
||||
import yugecin.opsudance.core.errorhandling.ErrorHandler;
|
||||
import yugecin.opsudance.core.events.EventBus;
|
||||
import yugecin.opsudance.core.inject.Inject;
|
||||
import yugecin.opsudance.events.BubbleNotificationEvent;
|
||||
import yugecin.opsudance.options.Configuration;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
/**
|
||||
* Captures osu! replay data.
|
||||
@@ -57,9 +57,6 @@ import yugecin.opsudance.options.Configuration;
|
||||
*/
|
||||
public class Replay {
|
||||
|
||||
@Inject
|
||||
public Configuration config;
|
||||
|
||||
/** The associated file. */
|
||||
private File file;
|
||||
|
||||
|
||||
@@ -30,22 +30,15 @@ import java.nio.file.StandardCopyOption;
|
||||
|
||||
import org.newdawn.slick.util.Log;
|
||||
import yugecin.opsudance.core.events.EventBus;
|
||||
import yugecin.opsudance.core.inject.Inject;
|
||||
import yugecin.opsudance.core.inject.InstanceContainer;
|
||||
import yugecin.opsudance.events.BubbleNotificationEvent;
|
||||
import yugecin.opsudance.options.Configuration;
|
||||
|
||||
import static yugecin.opsudance.core.InstanceContainer.*;
|
||||
|
||||
/**
|
||||
* Importer for replay files.
|
||||
*/
|
||||
public class ReplayImporter {
|
||||
|
||||
@Inject
|
||||
private InstanceContainer instanceContainer;
|
||||
|
||||
@Inject
|
||||
private Configuration config;
|
||||
|
||||
/** The subdirectory (within the replay import directory) to move replays that could not be imported. */
|
||||
private final String FAILED_IMPORT_DIR = "failed";
|
||||
|
||||
@@ -55,10 +48,6 @@ public class ReplayImporter {
|
||||
/** The total number of replays to import. */
|
||||
private File[] files;
|
||||
|
||||
@Inject
|
||||
public ReplayImporter() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the importer for each OSR file in the replay import dir, adding the replay
|
||||
* to the score database and moving the file into the replay directory.
|
||||
@@ -87,7 +76,7 @@ public class ReplayImporter {
|
||||
// import OSRs
|
||||
for (File file : files) {
|
||||
fileIndex++;
|
||||
Replay r = instanceContainer.injectFields(new Replay(file));
|
||||
Replay r = new Replay(file);
|
||||
try {
|
||||
r.loadHeader();
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user