blob: 2a62f9a5918833550cdb5b6a972653dd663804aa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/**
@module Graph
*/
/** Types for directed graph */
/** Shortuct */
export type Graph = Array<Vertex>;
/** Type for vertex of graph */
export interface Vertex {
edges: Array<Edge>; // Graph is directed so all edges will have from set to `this`
start: boolean;
goal: boolean;
walkable: boolean;
uuid: string;
graph: Graph;
x?: number;
y?: number;
}
/** Type for edge of graph */
export interface Edge {
from: Vertex;
to: Vertex;
weight: number;
}
|