Skip to content

Instantly share code, notes, and snippets.

@thetrav
Last active February 22, 2018 07:40
Show Gist options
  • Save thetrav/8197d97967c80fc6c2ee0218a739c868 to your computer and use it in GitHub Desktop.
Save thetrav/8197d97967c80fc6c2ee0218a739c868 to your computer and use it in GitHub Desktop.
psuedo code for a turn based offworld trading company
for each tick
for each company
execute destruction orders
productionBuildings
add resourceSource inputs
add stockPile inputs
add autoBuy inputs
consume power
produce goods
commission transports
calculate distances & fuel requirements
fuel from stocks
fuel from autobuy
move transports
load transports
unload transports
execute orders
HQ upgrade
market buy/sell
debt payments
share buy/sale
apply interest
resolve land acquisition
resolve buildings under construction
apply colony consumption
check for colony growth
apply market forces
check win/lose conditions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment