Ejemplo n.º 1
0
 public static void StartGame()
 {
     SetGame(1);
     foreach (KeyValuePair <int, string> keyValue in playerList_Color)
     {
         int    c = keyValue.Key;
         string s = keyValue.Value;
         if (s == "rosso")
         {
             DataSender.SendTurn(keyValue.Key); // mando al player la notifica che sia il suo turno
             Console.WriteLine("turno del player " + keyValue.Key);
         }
     }
     turno = 1;
 }
Ejemplo n.º 2
0
        public static void PassaTurno()
        {
            turno++;
            string s       = "";
            int    control = turno % Nplayer; //

            switch (control)
            {
            case 0:
            {
                turno++;
                s = "nero";
                break;
            }

            case 1:
            {
                if (Nplayer > 2)
                {
                    turno++;
                    s = "blu";
                }
                else
                {
                    turno++;
                    s = "rosso";
                }
                break;
            }

            case 2:
            {
                if (Nplayer > 3)
                {
                    turno++;
                    s = "viola";
                }
                else
                {
                    turno++;
                    s = "rosso";
                }
                break;
            }

            case 3:
            {
                if (Nplayer > 4)
                {
                    turno++;
                    s = "verde";
                }
                else
                {
                    turno++;
                    s = "rosso";
                }
                break;
            }

            case 4:
            {
                if (Nplayer > 5)
                {
                    turno++;
                    s = "giallo";
                }
                else
                {
                    turno++;
                    s = "rosso";
                }
                break;
            }

            case 5:
            {
                turno++;
                s = "rosso";
                break;
            }
            }
            foreach (KeyValuePair <int, string> keyValue in playerList_Color)
            {
                int    c = keyValue.Key;
                string v = keyValue.Value;
                if (s == v)
                {
                    DataSender.SendTurn(keyValue.Key); // mando al player la notifica che sia il suo turno
                    Console.WriteLine("turno del player " + keyValue.Key);
                }
            }
        }