public
Created

Settle Objects

  • Download Gist
board_object.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12
Board = {
'hexes': [ {object Hex}, {object Hex}, ... ],
'intersections': [ {object Intersection}, {object Intersections}, ... ],
'edges': [ {object Intersection}, {object Intersection}, ... ],
'grid' [
[ index_of_hex, index_of_hex, ... ], // Maybe after board creation it would be good to get rid of this?
[ index_of_hex, index_of_hex, ... ],
[ index_of_hex, index_of_hex, ... ],
],
'gridWidth': 5,
'gridHeight': 5,
}
edge_object.js
JavaScript
1 2 3 4 5 6
Edge = {
'index': 1,
'intersections': [3, 5]
'hexes': [7, 11, 13]
'token': {object Token}
}
hex_object.js
JavaScript
1 2 3 4 5 6 7 8
Hex = {
'index': 5,
'grid': {'x': 2, 'y': 4}
'type': 'Wheat',
'number': 9,
'intersections': [3, 7, 11, 13, 17, 19]
'edges': [2, 4, 6, 7, 8, 9]
}
intersection_object.js
JavaScript
1 2 3 4 5 6
Intersection = {
'index': 2,
'edges': [2, 4, 6]
'hexes': [3, 5, 7]
'token': {object Token}
}
token_object.js
JavaScript
1 2 3 4
Token = {
player: ('WHITE'|'GREEN'|'RED'|'BLUE'|'N/A'),
token: ('ROAD'|'SETTLEMENT'|'CITY'|'ROBBER'),
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.