public static bool checkIfPlayerExists(Player player) { for (int i = 0; i<players.Count; i++) if (players[i].ID == player.ID) return true; return false; }
public static String getTag(Player player) { for (int i = 0; i < players.Count; i++) if (players[i].ID == player.ID) return tags[i]; throw new Exception("Player does not exist."); }
public static void addPlayer(Player player, String tag) { if(checkIfTagExists(tag)) throw new Exception("A player with that tag already exists in the PlayerManager."); players.Add(player); tags.Add(tag); UpdateManager.addUpdateRegister(new UpdateRegister(player, "player-" + tag)); }