/// <summary> /// Constructor to add one player to the party. /// </summary> /// <param name="player">Player to have with created class</param> public PartyClass(CharacterBase player) { party.Add(player); // Gives the first player the ID and map the event party[0].ID = 0; party[0].Ready += ReadyHandler; }
/// <summary> /// Constructor to add three separate players to the party /// </summary> /// <param name="first">First player to have with created class</param> /// <param name="second">Second player to have with created class</param> /// <param name="third">Third player to have with created class</param> public PartyClass(CharacterBase first, CharacterBase second, CharacterBase third) { party.Add(first); party.Add(second); party.Add(third); // Gives IDs to all the players and map them to the event handler for (int i = 0; i < party.Count; i++) { party[i].ID = i; party[i].Ready += ReadyHandler; } }