예제 #1
0
 public string createNewWorld()
 {
     List<PlayerClass.Player> blah = new List<PlayerClass.Player>();
     PlayerClass.Player tempPlayer = new PlayerClass.Player(0001, "Shane");
     PlayerClass.Player tempPlayerw = new PlayerClass.Player(0001, "Wane");
     PlayerClass.Player tempPlayerp = new PlayerClass.Player(0034, "ppane");
     blah.Add(tempPlayer);
     blah.Add(tempPlayerw);
     blah.Add(tempPlayerp);
     GameWorld.GameWorld clientWorld = new GameWorld.GameWorld(blah);
     Random thias = new Random();
     int fourdigit = thias.Next(0001, 9999);
     clientWorld.GameId = fourdigit.ToString();
     threadSafeToComBox("Game World created. \r\nGame ID: ");
     gameList.Items.Add(clientWorld);
     return clientWorld.GameId;
 }
예제 #2
0
 private void newWorld_Click(object sender, EventArgs exc)
 {
     try {
         List<PlayerClass.Player> blah = new List<PlayerClass.Player>();
         PlayerClass.Player tempPlayer = new PlayerClass.Player(0001, "Shane");
         PlayerClass.Player tempPlayerw = new PlayerClass.Player(0001, "Wane");
         PlayerClass.Player tempPlayerp = new PlayerClass.Player(0034, "ppane");
         blah.Add(tempPlayer);
         blah.Add(tempPlayerw);
         blah.Add(tempPlayerp);
         GameWorld.GameWorld temp = new GameWorld.GameWorld(blah);
         Random thias = new Random();
         int fourdigit = thias.Next(0001, 9999);
         textBox1.Text += (fourdigit.ToString() + "\r\n");
         temp.GameId = fourdigit.ToString();
         textBox1.Text += (temp.GameId + "\r\n");
         client.Send(temp);
     }
     catch(TurnOrder.InvalidTurnQueueSizeException except)
     {
         textBox1.Text += ("EXCEPTION: " + except.ToString());
     }
 }