public override bool Equals(object obj) { SetItem r = obj as SetItem; if (r == null) { return(false); } return(this == r); }
private void FireWildCards(LinkedListNode <ICondition> nextcondition) { // set (a b c) // set (a b ?x) if (!_variables.Contains(_relationship.Set)) { // if the variable does not exist we need to // find the value within each relationship // and fire the children _variables.Add(_relationship.Set); foreach (Relationship r in _knowledge[_relationship.Key]) { if (r.Set.IsMatchTo(_relationship.Set)) { for (int i = 0; i < _relationship.Set.Count; i++) { SetItem item = _relationship.Set[i]; if (item.IsWildcard) { _variables[item.Variable.ID].Value = r.Set[i].Value; } } FireNextCondition(nextcondition); } } _variables.Remove(_relationship.Set); } else { // if the variable does exist, we need to // substitute the value // and fire the children Fire(nextcondition, _relationship.Clone()); } }