/// <summary> /// Creates a new PartyData object from the given Party object. /// </summary> public PartySaveData(Party party) : this() { // check the parameter if (party == null) { throw new ArgumentNullException("party"); } // create and add the serializable player data foreach (Player player in party.Players) { players.Add(new PlayerSaveData(player)); } // add the items inventory.AddRange(party.Inventory); // store the amount of gold held by the party partyGold = party.PartyGold; // add the monster kill data for the active quest foreach (string monsterName in party.MonsterKills.Keys) { monsterKillNames.Add(monsterName); monsterKillCounts.Add(party.MonsterKills[monsterName]); } }
/// <summary> /// Heal the party back to their correct values for level + gear. /// </summary> private void HealParty(Party party) { // check the parameter if (party == null) { throw new ArgumentNullException("party"); } // reset the statistics for each player foreach (Player player in party.Players) { player.StatisticsModifiers = new StatisticsValue(); } }
/// <summary> /// Calculate the charge for the party's stay at the inn. /// </summary> private int GetChargeForParty(Party party) { // check the parameter if (party == null) { throw new ArgumentNullException("party"); } return inn.ChargePerPlayer * party.Players.Count; }