Skip to content

Latest commit

 

History

History
95 lines (71 loc) · 3.58 KB

DOC-API.md

File metadata and controls

95 lines (71 loc) · 3.58 KB

Modules

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

External

@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.getNeighbor(dir) ⇒ string

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"); 

connection-grid-square.getNeighborDirs(x, y) ⇒ array

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); 

connection-grid-square-factory

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 });

@mitchallen/connection-grid-core

Connection Grid Core

Kind: global external
See: @mitchallen/connection-grid-core