UNPKG

the-world-engine

Version:

three.js based, unity like game engine for browser

60 lines 987 B
export class PathNode { Hs; zs; t_; s_; e_; i_; r_; constructor(t, s) { this.Hs = t; this.zs = s; this.t_ = 0; this.s_ = 0; this.e_ = 0; this.r_ = null; this.i_ = true; } calculateFCost() { this.e_ = this.t_ + this.s_; } equals(t) { return this.Hs === t.Hs && this.zs === t.zs; } get x() { return this.Hs; } get y() { return this.zs; } get gCost() { return this.t_; } set gCost(t) { this.t_ = t; } get hCost() { return this.s_; } set hCost(t) { this.s_ = t; } get fCost() { return this.e_; } set fCost(t) { this.e_ = t; } get isWalkable() { return this.i_; } set isWalkable(t) { this.i_ = t; } get previousNode() { return this.r_; } set previousNode(t) { this.r_ = t; } }