UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

84 lines 1.91 kB
export type EdgeDirectionType = number; export namespace EdgeDirectionType { let Undirected: number; let Forward: number; let Backward: number; } /** * @template N */ export class Edge<N> { /** * @template N * @param {N} a * @param {N} b */ constructor(a: N_1, b: N_1); /** * * @type {N} */ first: N_1; /** * * @type {N} */ second: N_1; /** * @type {EdgeDirectionType} */ direction: EdgeDirectionType; /** * * @param {N} node * @return {boolean} */ contains(node: N): boolean; /** * * @param {N} source * @param {N} target * @returns {boolean} True iff the edge contains both source and target and allows transition from source to target */ validateTransition(source: N, target: N): boolean; /** * Provided one of the associated nodes - returns the other one, if supplied node is not connecting the edge - returns first node (unintended behaviour) * @param {N} node * @returns {N} */ other(node: N): N; /** * * @returns {boolean} */ traversableForward(): boolean; /** * * @returns {boolean} */ traversableBackward(): boolean; /** * Checks direction of the edge, if the edge is directed towards supplied node - returns true, false otherwise * @param {N} node * @returns {boolean} */ isDirectedTowards(node: N): boolean; /** * Checks direction of the edge, if the edge is directed away from the supplied node - returns true, false otherwise * @param {N} node * @returns {boolean} */ isDirectedAwayFrom(node: N): boolean; /** * * @returns {N[]} */ get nodes(): N[]; toString(): string; /** * * @type {boolean} */ isEdge: boolean; } //# sourceMappingURL=Edge.d.ts.map