- connection-grid-square ⇐
@mitchallen/connection-grid-core
Connection Grid Square generated by create
- connection-grid-square-factory
A factory for generating connection grid square objects
- @mitchallen/connection-grid-core
Connection Grid Core
connection-grid-square ⇐ @mitchallen/connection-grid-core
Connection Grid Square generated by create
Extends: @mitchallen/connection-grid-core
- connection-grid-square ⇐
@mitchallen/connection-grid-core
- .getNeighbor(dir) ⇒
string
- .getNeighborDirs(x, y) ⇒
array
- .getNeighbor(dir) ⇒
Returns neighbor for direction
Kind: instance method of connection-grid-square
Param | Type | Description |
---|---|---|
dir | string |
A string representing a direction |
Example (usage)
var cell = grid.getNeighbor(1,1,"S");
Returns an array of neighbors for the cell at x,y
Kind: instance method of connection-grid-square
Param | Type | Description |
---|---|---|
x | number |
X coordinate of cell |
y | number |
Y coordinate of cell |
Example (usage)
var list = grid.getNeighborDirs(1,1);
A factory for generating connection grid square objects
connection-grid-square-factory.create(options) ⇒ connection-grid-square
Factory method that returns a connection grid square object. It takes one spec parameter that must be an object with named parameters.
Kind: static method of connection-grid-square-factory
Param | Type | Description |
---|---|---|
options | Object |
Named parameters for generating a connection grid square |
options.x | number |
The size along the x axis |
options.y | number |
The size along the y axis |
Example (Creating a connection-grid-square)
"use strict";
var gridFactory = require("@mitchallen/connection-grid-square");
let xSize = 5;
let ySize = 6;
var grid = gridFactory.create({ x: xSize, y: ySize });
Connection Grid Core
Kind: global external
See: @mitchallen/connection-grid-core