Exemple #1
0
        private DiscColor ToggleDisc(ActivePlayer player)
        {
            var opponentsDisc = player.Disc == DiscColor.Black ? DiscColor.White : DiscColor.Black;

            if (Board.HasMoves(opponentsDisc))
            {
                return(opponentsDisc);
            }
            if (Board.HasMoves(player.Disc))
            {
                return(player.Disc);
            }

            return(null);
        }
Exemple #2
0
 private void OnGameStarted(ActivePlayer player, GameStatus currentState)
 {
     GameStarted?.Invoke(this, player, new GameStartedEventArgs(currentState, player));
 }
Exemple #3
0
 private bool IsPlayersTurn(ActivePlayer player) => player.Disc == _discOfNextMove;