public void ChangeTurns()
    {
        switch (currentGameMode)
        {
        case GameMode.SINGLEPLAYER:
            switch (CurrentTurn)
            {
            case CurrentPlayerTurn.PLAYER_ONE:
                CurrentTurn = CurrentPlayerTurn.AI_TURN;
                break;

            case CurrentPlayerTurn.AI_TURN:
                CurrentTurn = CurrentPlayerTurn.PLAYER_ONE;
                break;
            }
            break;

        case GameMode.MULTIPLAYER:
            switch (CurrentTurn)
            {
            case CurrentPlayerTurn.PLAYER_ONE:
                CurrentTurn = CurrentPlayerTurn.PLAYER_TWO;
                break;

            case CurrentPlayerTurn.PLAYER_TWO:
                CurrentTurn = CurrentPlayerTurn.PLAYER_ONE;
                break;
            }
            break;
        }
    }
Beispiel #2
0
 public void ChangeCurrentPlayerTurn()
 {
     if (CurrentPlayerTurn.Equals(m_Player1))
     {
         CurrentPlayerTurn = m_Player2;
     }
     else
     {
         CurrentPlayerTurn = m_Player1;
     }
 }
        public async void AdvanceTurn()
        {
            //get the next player id
            var turn = TurnQueue.Find(CurrentPlayerTurn);

            if (turn.Next == null)
            {
                CurrentPlayerTurn = TurnQueue.First.Value;
            }
            else
            {
                CurrentPlayerTurn = turn.Next.Value;
            }

            //reset counts
            Roll         = 0;
            RollAttempts = 0;
            //notify players
            await SendMessageAsync(new GameMessageUnity(RoomID, "NEXTTURN", CurrentPlayerTurn.ToString()))
            .ConfigureAwait(false);
        }