private void CheckOverallBoost(BoostCharacteristics boostAttempt) { var currentOverallBoost = _set.Sum(b => b.Value.BoostValue); if( currentOverallBoost + (int)boostAttempt > 2 ) throw new AttempToBoostOverallCharacteristicOfMoreThanToTwoException(); }
public void Boost(BoostCharacteristics boost = BoostCharacteristics.OfOne) { if (boost == default(BoostCharacteristics)) throw new AttempToBoostWithDefaultCharacterisitcBoostException(_name); var castedBoost = (int)boost; var resultingBoost = BoostValue + castedBoost; if (resultingBoost > 2) throw new AttempToBoostCharacteristicOfMoreThanTwoException(_name); BoostValue = resultingBoost; }
public HeroBuilder BoostSpirit(BoostCharacteristics boost = BoostCharacteristics.OfOne) { _boosterSet.BoostSpirit(boost); return this; }
public void BoostSpirit(BoostCharacteristics boost = BoostCharacteristics.OfOne) { CheckOverallBoost(boost); _set[_spiritKey].Boost(boost); }
public void BoostStrength(BoostCharacteristics boost = BoostCharacteristics.OfOne) { CheckOverallBoost(boost); _set[_strengthKey].Boost(boost); }