/// <summary> /// Creates a strategy that computes resistance multipliers based on suplied resistance values from /// the resistance container. /// </summary> /// <param name="resistContainer">Resistance container that has the resist values.</param> public LinearResistanceMultiplierStrategy(IStatsContainer <ResistanceStatType> resistContainer) { if (resistContainer == null) { throw new ArgumentNullException(nameof(resistContainer)); } resistanceContainer = resistContainer; }
public static Character AddStats(this Character character, IStatsContainer stats) { foreach (var stat in stats.Stats) { var charStat = character.Stats[stat.Key]; var statDice = stat.Value; if (stat.Value.Constant != 0) { charStat.Moddifiers.Add(stats.GroupTypeName, stat.Value.Constant); } if (statDice.DieNumber == 0 || statDice.DieSides == 0) continue; var statRoll = statDice.Roll().PureSum; charStat.Moddifiers.Add($@"{stats.GroupTypeName}\StatRoll", statRoll); } return character; }
public static int GetMaxMapKeyValue <TStatType>(this IStatsContainer <TStatType> statsContainer) where TStatType : struct, IConvertible { return(GetMaxMapKeyValue <TStatType>()); }
/// <summary> /// Creates a strategy that computes resistance multipliers based on suplied resistance values from /// the resistance container. /// </summary> /// <param name="resistContainer">Resistance container that has the resist values.</param> public LinearResistanceMultiplierStrategy(IStatsContainer <ResistanceStatType> resistContainer) { resistanceContainer = resistContainer; }