These will return an IEnumberable<GameStat> which you can cast .ToList() or .ToArray(), or continue to query against the results.
publicIEnumerable<GameStat> GetAllCounters() // can not be trained or modifiedpublic IEnumerable<GameStat> GetAllTrainable()public IEnumerable<GameStat> GetAllModifiable()public IEnumerable<GameStat> GetAllTrainableAndModifiable()public IEnumerable<GameStat> GetAllIsModified() // FinalStat is higher or lower due to other modificationspublic IEnumerable<GameStat> GetAllWhereFinalStatGreaterThanPointsAndValue() // FinalStat > Points + FinalValuepublic IEnumerable<GameStat> GetAllWhereFinalStatLessThanPointsAndValue() // FinalStat < Points + FinalValuepublic IEnumerable<GameStat> GetAllFinalStatGreaterThan(float value)public IEnumerable<GameStat> GetAllFinalStatLessThan(float value)public IEnumerable<GameStat> GetAllFinalStatIs(float value)public IEnumerable<GameStat> GetAllPointsGreaterThan(float value)public IEnumerable<GameStat> GetAllPointsLessThan(float value)public IEnumerable<GameStat> GetAllPointsIs(float value)public IEnumerable<GameStat> GetAllProficiencyGreaterThan(float value)public IEnumerable<GameStat> GetAllProficiencyLessThan(float value)public IEnumerable<GameStat> GetAllProficiencyIs(float value)// These have an optional bool includePoints. When false, FinalValue will be considered, // otehrwise, FinalValue + Points will be considered.public IEnumerable<GameStat> GetAllValueGreaterThan(float value,bool includePoints =true)public IEnumerable<GameStat> GetAllValueLessThan(float value,bool includePoints =true)public IEnumerable<GameStat> GetAllValueIs(float value,bool includePoints =true)// ExamplesDebug.Log($"IHaveStats Actor is not proficient in {GetAllProficiencyLessThan(1f).Count} stats");foreach(var gameStat inGetAllTrainableAndModifiable().Where(x =>x.Points>10)){gameStat.AddPoints(-1); // Remove one Point from each!}
Dictionaries of GameStats
These methods each will return a Dictionary with a group of GameStat objects from the list. Most have addtional options in method signature. See the examples below the methods list.
Returns Dictionary<string, float> with all GameStats in the list.
/* Optional parametersbool keyIsObjectName = true // if false, key will be Uid()bool recompute = false // if true, stats will be recomputedbool recomputeTree = false // if true, all stats in tree are recomputed*/var allFinalStats =gameStatList.GetAllFinalStats();
Get points of "Counter" stats or all stats
Returns Dictionary<string, float> with the Point value for all "Counter" stats, or all GameStats in the list. Counter stats are those which can't be trained or modified.
/* Optional parametersbool keyIsObjectName = true // if false, key will be Uid()bool countersOnly = true // if false, all stats will be included*/var allCounters =gameStatList.GetAllPoints();
Get GameStats for Counters, Trainable, Modifiable
Returns Dictionary<string, GameStat> with the those that are Counters, Trainable, Modifiable, or those that are both Trainable and Modifiable.
/* Optional parametersbool keyIsObjectName = true // if false, key will be Uid()*/var allCounterGameStats =gameStatList.GetAllCounterStats();var allTrainableGameStats =gameStatList.GetAllTrainableStats();var allModifiableGameStats =gameStatList.GetAllModifiableStats();var allSkillGameStats =gameStatList.GetAllTrainableAndModifiableStats();
Get Modified Stats
Returns Dictionary<string, GameStat> with the those that are currently modified, which means the Final Stat value is greater than or less than the sum of Points + BaseValue.
/* Optional parametersbool keyIsObjectName = true // if false, key will be Uid()bool includeAll = true // if false, will only include those greater than or less thanbool greaterThan = true // if false, we will only include those less than*/var allModifiedGameStats =gameStatList.GetAllModifiedStats();var allStatsModifiedGreater =gameStatList.GetAllModifiedStats(true,false);var allStatsModifiedLess =gameStatList.GetAllModifiedStats(true,false,false);