Board

Board module
Source:
Properties:
Name Type Description
occupiedSlots Map List of occupied slots on the board
components Map List of components on the board
closed boolean Indicates whether the circuit on the board is closed or not
circuits Array.<Circuit> Each item in this array stores a Circuit object

Methods

(protected) addCircuit(circuit)

Source:
See:
Adds given circuit to the array of circuits
Parameters:
Name Type Description
circuit Circuit

Board(widthopt, heightopt) → {Board}

Source:
Board
Example
let board = Board(100, 100);
Parameters:
Name Type Attributes Default Description
width number <optional>
10 Width of the board - 0 indexed
height number <optional>
10 Height of the board - 0 indexed
Returns:
Type
Board

getActiveSources() → {Array.<Components>}

Source:
Get array of active source Components
Returns:
Type
Array.<Components>

hasType(type) → {Boolean}

Source:
Returns true if Component Type is found on the Board
Parameters:
Name Type Description
type ComponentType
Returns:
Type
Boolean

hasUnfinishedNode() → {Boolean}

Source:
Returns true if any true node has any untraveled components
Returns:
Type
Boolean

(protected) place(component, positions)

Source:
See:
Place Component pins into respective Slots
Uses Slot#add
Parameters:
Name Type Description
component Component
positions Array.<Positions>

(protected) remove(component)

Source:
See:
Remove Component from its Slots
Uses Slot#remove
Parameters:
Name Type Description
component Component