private MovingRule SetMovingRuleForGame(MovingRuleType ruleType) { return(ruleType switch { MovingRuleType.HorizontalAndVertical => new MovingOnCardinalPointsRule(_gameBoard), MovingRuleType.Diagonal => new DiagonalMovingRule(_gameBoard), MovingRuleType.Free => new FreeMoveRule(_gameBoard), _ => new FreeMoveRule(_gameBoard) });
private void InitializeFields() { _players = new List <Player>(); _playerAreas = new List <PlayerArea>(); _random = new Random(); _gameFormat = (int)_gameOptions.Format; _movingType = (MovingRuleType)PlayerPrefs.GetInt("GAME_TYPE"); _movingRule = SetMovingRuleForGame(_movingType); _gameBoard.InitializeBoard(this); _gameBoard.FigureMoved += OnGameBoardFigureMoved; _gameBoard.FigureMoving += OnGameBoardFigureMoving; }
private void SetDescriptionThree(bool state) { if (state) { _optionThreeLabel.gameObject.SetActive(true); _optionThreeDescription.gameObject.SetActive(true); _selectedRuleType = MovingRuleType.Free; } else { _optionThreeLabel.gameObject.SetActive(false); _optionThreeDescription.gameObject.SetActive(false); } }
private void SetDescriptionTwo(bool state) { if (state) { _optionTwoLabel.gameObject.SetActive(true); _optionTwoDescription.gameObject.SetActive(true); _selectedRuleType = MovingRuleType.Diagonal; } else { _optionTwoLabel.gameObject.SetActive(false); _optionTwoDescription.gameObject.SetActive(false); } }
private void SetDescriptionOne(bool state) { if (state) { _optionOneLabel.gameObject.SetActive(true); _optionOneDescription.gameObject.SetActive(true); _selectedRuleType = MovingRuleType.HorizontalAndVertical; } else { _optionOneLabel.gameObject.SetActive(false); _optionOneDescription.gameObject.SetActive(false); } }