public void DoesNothingIfStartingWealthIsNullForClass() { var cls = Class.CreateForTesting(); var character = CharacterTestTemplates.AverageBob(); character.SetClass(cls); var action = new StartingWealth(); action.ExecuteStep(character); }
public void IfAfterFirstLevelPickStartValueFromWealthList() { var character = CharacterTestTemplates.Barbarian(); character.SetLevel(2); var action = new StartingWealth(wealthGateway); action.ExecuteStep(character); Assert.Equal(character.Inventory.CoinPurse.Value, 2000); }
public void CalculatesWealthBasedOnTheDiceInGoldPiecesTimesTen() { var cls = Class.CreateForTesting(); cls.StartingWealthDice = SilverNeedle.Dice.DiceStrings.ParseDice("2d6"); var character = CharacterTestTemplates.AverageBob(); character.SetClass(cls); var action = new StartingWealth(); action.ExecuteStep(character); Assert.True(character.Inventory.CoinPurse.Gold.Pieces > 19); Assert.True(character.Inventory.CoinPurse.Gold.Pieces < 121); }
/// <summary> /// Serves as a hash function for a <see cref="World"/> object. /// </summary> /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a /// hash table.</returns> public override int GetHashCode() { unchecked { return(((Id != null ? Id.GetHashCode() : 0) * 397) ^ (Name != null ? Name.GetHashCode() : 0) ^ (Description != null ? Description.GetHashCode() : 0) ^ (Author != null ? Author.GetHashCode() : 0) ^ (ResourcePack != null ? ResourcePack.GetHashCode() : 0) ^ (Version != null ? Version.GetHashCode() : 0) ^ Width.GetHashCode() ^ Height.GetHashCode() ^ BaseProvinceIncome.GetHashCode() ^ BaseProvinceRecruitment.GetHashCode() ^ BaseFactionRecruitment.GetHashCode() ^ MinTroopsPerAttack.GetHashCode() ^ HoldingSlotsPerFaction.GetHashCode() ^ StartingWealth.GetHashCode() ^ StartingTroops.GetHashCode() ^ HoldingsPrice.GetHashCode() ^ (Tiles != null ? Tiles.GetHashCode() : 0) ^ (Layers != null ? Layers.GetHashCode() : 0)); } }