public void RemoveState(GoapCondition key) { if (statusDic.ContainsKey(key)) { statusDic.Remove(key); } }
public GoapCondition(GoapCondition status) { _bitmap = new int[MAX]; for (int i = 0; i < MAX; i++) { _bitmap[i] = status._bitmap[i]; } }
public object GetState(GoapCondition key) { object value = null; if (statusDic.TryGetValue(key, out value)) { return(value); } return(value); }
public GoapCondition Remove(GoapCondition effects) { if (effects == null) { return(this); } for (int i = 0; i < MAX; i++) { _bitmap[i] &= ~effects._bitmap[i]; } return(this); }
public bool Contains(GoapCondition goal) { if (goal == null) { return(true); } for (int i = 0; i < MAX; i++) { if ((_bitmap[i] & goal._bitmap[i]) != goal._bitmap[i]) { return(false); } } return(true); }
public void AddState(GoapCondition key, object value) { statusDic[key] = value; }
protected void SetGoal(GoapCondition condition, object value) { goalStatus.AddState(condition, value); }