示例#1
0
    public static void StartTurn(int _toClient, TurnSystem.RoundType _round)
    {
        using (Packet _packet = new Packet((int)ServerPackets.startTurn))
        {
            _packet.Write(_toClient);
            _packet.Write((int)_round);

            SendTCPDataToAll(_packet);
        }
    }
    public static void StartTurn(Packet _packet)
    {
        int currentPlayer = _packet.ReadInt();

        TurnSystem.RoundType round = (TurnSystem.RoundType)_packet.ReadInt();
        UIManager.instance.UpdateCurrentPlayerColor(currentPlayer);
        GameManager.instance.SetCurrentPlayer(currentPlayer);
        for (int i = 1; i <= GameManager.cursors.Count; i++)
        {
            if (currentPlayer == i)
            {
                GameManager.instance.BeginTurn(i, round);
            }
            else
            {
                GameManager.cursors[i].EndTurn();
            }
        }
    }
示例#3
0
 public void BeginTurn(int player, TurnSystem.RoundType _round)
 {
     cursors[player].StartTurn();
     Debug.Log($"Last Round: {round}, Current Round{_round} ");
     if (_round != round)
     {
         round = _round;
         if (round == TurnSystem.RoundType.Reveal)
         {
             if (games > 1)
             {
                 UIManager.instance.ToggleEndUI();
             }
             UIManager.instance.ToggleRevealUI();
             UIManager.instance.InitializeRevealButtons(); // Calls Initialize on Reveal Manager
             UIManager.instance.NextGoalLine();
         }
         else if (round == TurnSystem.RoundType.Place)
         {
             UIManager.instance.ToggleRevealUI();
             UIManager.instance.TogglePlaceUI();
         }
         else if (round == TurnSystem.RoundType.End)
         {
             UIManager.instance.ResetPillDisplays();
             ClearCups();
             UIManager.instance.ResetRevealedGoals();
             UIManager.instance.WriteEndScreen();
             UIManager.instance.ToggleEndUI();
             games++;
         }
     }
     else if (round == TurnSystem.RoundType.Reveal)
     {
         UIManager.instance.NextGoalLine();
     }
 }