Skip to content

Instantly share code, notes, and snippets.

@underhilllabs
Last active March 2, 2021 14:17
Show Gist options
  • Save underhilllabs/d90e6e4f2e543983b8bb5e79f201cc8c to your computer and use it in GitHub Desktop.
Save underhilllabs/d90e6e4f2e543983b8bb5e79f201cc8c to your computer and use it in GitHub Desktop.
18xx.games Module Game skeleton
require_relative "../base"
require_relative "meta"
module Engine
module Game
module G18Example
class Game < Game::Base
include_meta(G18Example::Meta)
BANK_CASH = 10_000
# define certificate limits at different player counts
CERT_LIMIT = {}
CURRENCY_FORMAT_STR = '$%d'
# define player starting money at differenet player counts
STARTING_CASH = {}
# define tiles used in game, see TILES.md
# can define new ones or use standard
TILES = {}
# define the hexes of the map
HEXES = {}
# define cities on hexes on map
LOCATION_NAMES = {}
# define phases, what triggers them, what they affect
PHASES = []
# define the stock market 1D, 2D, etc
MARKET = []
# define the roster of trains: cost, name
TRAINS = []
# define privates: cost, name, abilities
COMPANIES = []
# define corporations: names, symbols, float, logo, tokens
CORPORATIONS = []
# define steps in Stock Round (if non-standard)
# Steps can be standard or
# new ones defined in this modules steps folder.
def stock_round
end
# define steps in Operating Round (if non-standard)
# Steps can be standard or
# new ones defined in this modules steps folder.
def operating_round(round_num)
end
# any extra setup tasks go here
def setup
super
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment