GameStatList Get() Methods

v4.0

IEnumberable<GameStat> results

These will return an IEnumberable<GameStat> which you can cast .ToList() or .ToArray(), or continue to query against the results.

public IEnumerable<GameStat> GetAllCounters() // can not be trained or modified
public IEnumerable<GameStat> GetAllTrainable()
public IEnumerable<GameStat> GetAllModifiable()
public IEnumerable<GameStat> GetAllTrainableAndModifiable()
public IEnumerable<GameStat> GetAllIsModified() // FinalStat is higher or lower due to other modifications
public IEnumerable<GameStat> GetAllWhereFinalStatGreaterThanPointsAndValue() // FinalStat > Points + FinalValue
public IEnumerable<GameStat> GetAllWhereFinalStatLessThanPointsAndValue() // FinalStat < Points + FinalValue
public 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)

// Examples
Debug.Log($"IHaveStats Actor is not proficient in {GetAllProficiencyLessThan(1f).Count} stats");

foreach(var gameStat in GetAllTrainableAndModifiable().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.

Get all final stat values

Returns Dictionary<string, float> with all GameStats in the list.

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.

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.

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.

Last updated

Was this helpful?