private void AddIfNotZero(string name, DiceRoll value) { if (value.GetFixedAmount() != 0 || (value.Dice != null && value.Dice.Any())) { Parts.Add(new KeyValuePair <string, DiceRoll>(name, value)); } }
private void AddCircumstancesIfNotZero(string name, string condition, DiceRoll value) { if (value.GetFixedAmount() != 0 || (value.Dice != null && value.Dice.Any())) { var description = string.Format("Condition: '{0}' ({1})", condition, name); Circumstances.Add(new KeyValuePair <string, DiceRoll>(description, value)); } }
public void SetFixedBonus(DiceRoll bonusFromCharge) { FixedValue = bonusFromCharge.GetFixedAmount(); Dice = new DiceRoll { FixedAmount = 0, Dice = bonusFromCharge.GetDice() }; }