public Graph(ANode <TMove> init) { this.First = init; this.Opened = new List <ANode <TMove> >(); this.Closed = new List <ANode <TMove> >(); }
public ANode <TMove> FindIfExist(ANode <TMove> n) { if (this.Closed.Count < this.Opened.Count) { return(this.FindIfExistInClosed(n) ?? this.FindIfExistInOpened(n)); } return(this.FindIfExistInOpened(n) ?? this.FindIfExistInClosed(n)); }
public ANode <TMove> FindIfExistInClosed(ANode <TMove> n) { foreach (var node in this.Closed) { if (n.Equals(node)) { return(node); } } return(null); }
public abstract bool SameAs(ANode <TMove> mate);
public abstract double Heuristics(ANode <TMove> final);
public void Attach(ANode <TMove> child, TMove moveFromParentToChild) { child.Parent = this; child.MoveFromParent = moveFromParentToChild; }
public void Finish(ANode <TMove> final) { this.Last = final; }