Class

Grid

Grid()

The grid.

Members

number

# size

The grid size.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 39

GridField

# start

The starting grid field.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 46

Methods

# getField(vec) → {GridField}

Get the field at a position.

Parameters:
Name Type Description
vec Vec2

The 2d vector of the position.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 148

The grid field.

GridField

# getNeighbors(vec) → {Array.<GridField>}

Get reachable neighbors for a position

Parameters:
Name Type Description
vec Vec2

The position to find the neighbors for.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 156

The list of neighbors.

Array.<GridField>

# insideBorders(vec) → {boolean}

decide whether a position lies inside the grid borders.

Parameters:
Name Type Description
vec Vec2

The position.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 140

Whether a position lies inside the borders.

boolean

# isWall(vec) → {boolean}

Whether the position is a wall.

Parameters:
Name Type Description
vec Vec2

The position.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 132

boolean

# size() → {number}

The grid size.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 117

number

# start() → {GridField}

The starting grid field.

View Source core/src/Games/GridWorld/Grid/Grid.ts, line 124

GridField