public void add_Player(Player player) { Boolean found = false; for(int i = 0; i < 5; i++) { if (table[i] == null && found == false) { table[i] = player; found = true; } } if (found == false) { Console.WriteLine("Sorry " + player.get_Name() + ", this table is full."); } }
public void remove_Player(Player player) { Boolean found_Player = false; for(int i = 0; i < 5; i++) { if (table[i] != null) { if (table[i].get_Name() == player.get_Name()) { table[i] = null; found_Player = true; } } } if (!found_Player) { Console.WriteLine(player.get_Name() + " was not found in the table."); } }