コード例 #1
0
 public GameRoom(string n, int i)
 {
     name = n;
     id = i;
     player = new GamePlayer[10];
     for (int j = 0; j < 10; j++)
     {
         player[j] = new GamePlayer(null, null, 0);
     }
 }
コード例 #2
0
 public bool AddPlayer(GamePlayer gp, int seat)
 {
     for (int i = seat; i < player.Length + seat; i++)
     {
         if (player[i % player.Length].active == false)
         {
             player[i % player.Length] = gp;
             player[i % player.Length].active = true;
             if (player_cnt == 1)
             {
                 game_work_thread = new Thread(new ThreadStart(game_work));
                 game_work_thread.Start();
             }
             return true;
         }
     }
     return false;
 }