Skip to content

Instantly share code, notes, and snippets.

@ctriolo
Created March 20, 2012 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ctriolo/2142315 to your computer and use it in GitHub Desktop.
Save ctriolo/2142315 to your computer and use it in GitHub Desktop.
Settle Objects
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 = {
'index': 1,
'intersections': [3, 5]
'hexes': [7, 11, 13]
'token': {object Token}
}
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 = {
'index': 2,
'edges': [2, 4, 6]
'hexes': [3, 5, 7]
'token': {object Token}
}
Token = {
player: ('WHITE'|'GREEN'|'RED'|'BLUE'|'N/A'),
token: ('ROAD'|'SETTLEMENT'|'CITY'|'ROBBER'),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment