public Board(int width, int height, ISpawnManager spawnManager, ICheckManager checkManager, ICellRegistrator cellRegistrator) { _width = width; _height = height; _spawnManager = spawnManager; _checkManager = checkManager; _cellRegistrator = cellRegistrator; _cells = new ICell[_width, _height]; _checkManager.Board = this; }
public void Create() { _updateManager = new GameObject(StringsAndConst.UPDATE_MANAGER).AddComponent <UpdateManager>(); _logicManager = new GameObject(StringsAndConst.LOGIC_MANAGER).AddComponent <LogicManager>(); GameObject empty = new GameObject("---------------"); _notifier = new Notifier(); _objectStorage = new ObjectStorage(); _objectSetter = new ObjectSetter(_updateManager, _notifier); _inputManager = new InputManager(_notifier); _spawnManager = new SpawnManager(_objectStorage, _objectSetter); _checkManager = new CheckManager(); _board = new Board(width, height, _spawnManager); }
public static bool HaveMatches(ICheckManager checkManager) { for (int i = 0; i < checkManager.Board.Width; i++) { for (int j = 0; j < checkManager.Board.Height; j++) { if (CellIsEmpty(checkManager.Board.Cells[i, j]) == false) { if (checkManager.HaveMatch(checkManager.Board.Cells[i, j])) { return(true); } } } } return(false); }
public PresenterAddressChecking( ICheckManager checkManager, IResultsTableProvider resultsTableProvider, ICheckingControlPanel checkingControlPanel, ITasksStatusIndicator tasksStatusIndicator ) { // проверка адресов checkingControlPanel.IsRun_Changed += async() => { if (checkingControlPanel.IsRun) { // подготовка к проверке tasksStatusIndicator.TasksCompleted = 0; foreach (CheckRow item in resultsTableProvider.CheckRows) { item.ResultPing = StatusChecking.nostarted; item.ResultGet = StatusChecking.nostarted; } // сама проверка await checkManager.RunCheckingAsync( resultsTableProvider.CheckRows, tasksStatusIndicator.Progress ); // постготовка checkingControlPanel.IsRun = false; } else { checkManager.CancelCheckingAsync(); } }; // При вставке нового списака в эту форму обнуляем индикатор задач. resultsTableProvider.CheckRowsChanged += () => { tasksStatusIndicator.TasksCompleted = 0; tasksStatusIndicator.TasksTotalCount = resultsTableProvider.CheckRows.Count(); }; }
private void Initial() { _updateManager = _NavigationManager.MasterManager.UpdateManager; _gameplayLogicManager = new GameObject("Gameplay Logic Manager").AddComponent <GameplayLogicManager>(); GameObject empty = new GameObject("---------------"); _gameplayNotifier = _NavigationManager.MasterManager.GameplayNotifier; _uiNotifier = _NavigationManager.MasterManager.UINotifier; _taskNotifier = new Notifier(); _inputManager = new InputManager(_gameplayNotifier); _spawnManager = _NavigationManager.MasterManager.SpawnManager; _checkManager = new CheckManager(); _taskManager = new TaskManager(_level.LevelTasks); _uiManager = new UIGameplayLevelManager(_level); _buttonsManager = new ButtonsGameplaySceneManager(_uiNotifier); _cellRegistrator = new CellRegistrator(_gameplayNotifier, _updateManager); _board = new Board(_level.BoardWidth, _level.BoardHeight, _spawnManager, _checkManager, _cellRegistrator); }