public Engine() { try { emulatorProcess = Process.GetProcessesByName(processName).FirstOrDefault(); screen = new Screen(emulatorProcess); gameObjectRepository = new GameObjectRepository(); objectClassifier = new ObjectClassifier(gameObjectRepository); imageProcessor = new ImageProcessor(gameObjectRepository, objectClassifier); input = new Input(); gameState = new GameState(); backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += DoWork; } catch (Exception ex) { throw new Exception($"Problem initializing engine : {ex.Message}\r\n{ex.InnerException?.Message}"); } }
public ImageProcessor(GameObjectRepository gameObjectRepository, ObjectClassifier objectClassifier) { this.gameObjectRepository = gameObjectRepository; this.objectClassifier = objectClassifier; }