static void Main(string[] args) { RankGameRoom room101 = new RankGameRoom(); Player player01 = new Player("penspanic"); Player player02 = new Player("Geun Hee"); player01.Join(room101); player02.Join(room101); room101.GameStart(); }
public void Join(Player player) { if (playerList.Count == capacity) { player.Notify("This room is full!"); return; } playerList.Add(player); player.Notify(joinMessage); foreach (Player eachPlayer in playerList) { if (eachPlayer == player) continue; eachPlayer.Notify(player.name + " Joined!"); } }