Example #1
0
        public static bool checkIfPlayerExists(Player player)
        {
            for (int i = 0; i<players.Count; i++)
                if (players[i].ID == player.ID)
                    return true;

            return false;
        }
Example #2
0
        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.");
        }
Example #3
0
        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));
        }