GameConditionList Get() Methods

v4.0

Conditions have an additional concept for the "source" of the condition, which may modify the effect the condition has on the target. There are additional Get() methods which include this concept.

In the Get() methods below, the source will be required when addIfNull is true, and the GameCondition is added. Otherwise, these will return the current GameCondition, which whatever value is already present for the IHaveStats source.

// Get a single result
public virtual GameCondition Get(Condition condition, bool addIfNull = false, IHaveStats source = null)
public virtual GameCondition Get(GameCondition gameCondition, bool addIfNull = false, IHaveStats source = null)
public virtual GameCondition Get(string uid, bool addIfNull = false, IHaveStats source = null)

Additional Get() methods which do not handle addIfNull

public virtual bool TryGet(Condition condition, out GameCondition found)
public virtual bool TryGet(GameCondition gameCondition, out GameCondition found) => TryGet(gameCondition.Uid(), out found, source);
public virtual bool TryGet(string uid, out GameCondition found)
{
    found = Get(uid);
    return found != null;
}

// Get an IEnumberable<GameCondition> result -- none of these will handle addIfNull
public virtual IEnumerable<GameCondition> GetAll(Condition condition)
public virtual IEnumerable<GameCondition> GetAll(GameCondition gameCondition)
public virtual IEnumerable<GameCondition> GetAll(string uid)

public bool TryGetAll(Condition condition, out IEnumerable<GameCondition> found)
public bool TryGetAll(GameCondition gameCondition, out IEnumerable<GameCondition> found)
public bool TryGetAll(string uid, out IEnumerable<GameCondition> found, IHaveStats source = null)

Get conditions that are from a specific IHaveStats source

Get by Display Name

Last updated

Was this helpful?