import { Tile } from '../core/Components' ; /**
 * Represents a search Tree Node
 */ export class Node { parent : Node | null = null ; readonly children : Node [ ] = [ ] ; readonly tile : Tile ; constructor ( tile ) { this . tile = tile ; } addChild ( child ) { child . parent = this ; this . children . push ( child ) ; } } /**
 * Represents an heuristic weighted aStar search tree node
 */ export class AStarNode extends Node { readonly g : number ; readonly fScore : number ; constructor ( tile , g , fScore ) { super ( tile ) ; this . g = g ; this . fScore = fScore ; } f ( ) { return this . fScore ; } } /**
 * Represents an heuristic weighted Best First search tree node
 */ export class BestFirstNode extends Node { readonly h : number ; constructor ( tile , h ) { super ( tile ) ; this . h = h ; } } /**
 * Represents an heuristic weighted Dijkstra tree node
 */ export class DijkstraNode extends Node { readonly g : number ; constructor ( tile , g ) { super ( tile ) ; this . g = g ; } }