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 resultpublicvirtualGameConditionGet(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
publicvirtualboolTryGet(Condition condition,outGameCondition found)public virtual bool TryGet(GameCondition gameCondition, out GameCondition found) => TryGet(gameCondition.Uid(), out found, source);
public virtual bool TryGet(string uid,outGameCondition found){ found =Get(uid);return found !=null;}// Get an IEnumberable<GameCondition> result -- none of these will handle addIfNullpublicvirtualIEnumerable<GameCondition> GetAll(Condition condition)public virtual IEnumerable<GameCondition> GetAll(GameCondition gameCondition)public virtual IEnumerable<GameCondition> GetAll(string uid)public bool TryGetAll(Condition condition,outIEnumerable<GameCondition> found)public bool TryGetAll(GameCondition gameCondition,outIEnumerable<GameCondition> found)public bool TryGetAll(string uid,outIEnumerable<GameCondition> found,IHaveStats source =null)
Get conditions that are from a specific IHaveStats source
// Get one: Returns the first if there are multiplepublicvirtualGameConditionGetFromSource(Condition condition,IHaveStats source)public virtual GameCondition GetFromSource(GameCondition gameCondition,IHaveStats source)public virtual GameCondition GetFromSource(string uid,IHaveStats source)public bool TryGetFromSource(Condition condition,outGameCondition found,IHaveStats source)public bool TryGetFromSource(GameCondition gameCondition,outGameCondition found,IHaveStats source)public bool TryGetFromSource(string uid,outGameCondition found,IHaveStats source)// Get allpublic virtual IEnumerable<GameCondition> GetAllFromSource(Condition condition,IHaveStats source)public virtual IEnumerable<GameCondition> GetAllFromSource(GameCondition gameCondition,IHaveStats source)public virtual IEnumerable<GameCondition> GetAllFromSource(string uid,IHaveStats source)public bool TryGetAllFromSource(Condition condition,outIEnumerable<GameCondition> found,IHaveStats source)public bool TryGetAllFromSource(GameCondition gameCondition,outIEnumerable<GameCondition> found,IHaveStats source)public bool TryGetAllFromSource(string uid,outIEnumerable<GameCondition> found,IHaveStats source)// Exampleif (TryGetAllFromSource(magicCastingEnemy,outvar found)){ // Do something with all of the conditions from magicCastingEnemy}