예제 #1
0
        public MainController()
        {
            _playerController = new EyePlayerController();

            _controller = new EyeController(_playerController);
            _controller.EventManager.NewToken += EventManagerNewToken;

            _modules              = new ModuleCollection();
            _modules.ModuleAdded += (sender, module) =>
            {
                modulesCheckedListBox.Items.Add(module, module.Enabled);

                modulesComboBox.Items.Add(module);
                if (modulesComboBox.Items.Count == 1)
                {
                    modulesComboBox.SelectedIndex = 0;
                }
            };

            _eventsCounter = new EventsCounter();
            _eventsCounter.CombatLogEventsCountChange += EventsCounterOnCombatLogEventsCountChange;
            _eventsCounter.GameStateEventsCountChange += EventsCounterOnGameStateEventsCountChange;
            _controller.EventManager.Subscribe(_eventsCounter);

            _gameEndedEvent            = new GameEndedEvent();
            _gameEndedEvent.GameEnded += GameEnded;
            _controller.EventManager.Subscribe(_gameEndedEvent);

            InitializeComponent();

            LoadModules();
        }
예제 #2
0
        public EyeController(EyePlayerController playerController)
        {
            _playerController = playerController;

            _network = new EyeServer();

            _networkGameStateListener       = new NetworkGameStateListener(Network);
            _networkCombatLogListener       = new NetworkCombatLogListener(Network);
            _eyeStateListener               = new EyeStateListener(_networkGameStateListener);
            _eyeStateListener.DataReceived += (sender, entry) => _entry = entry;

            _stateEventManager = new EyeStateEventManager(_eyeStateListener, _networkCombatLogListener);
        }