Skip to content

Instantly share code, notes, and snippets.

@lulebe
lulebe / gamedata.md
Last active January 2, 2018 19:19
Kreuzzüge Gamedata structure

Kreuzzüge gamedata structure proposal

Faction = enum {CRUSADERS, SARACEN}
GameType = enum {SINGLEPLAYER, MULTIPLAYER_LOCAL, MULTIPLAYER_REMOTE}
UnitType = enum {GUARD, ARCHER, SHIP...}

The actual enum order for Units will be provided later, but will be ordered by how units are listed within each recruiting building, in the following order: Foot, Horse, Artillery, Ship, Air. So the Guard will have ID 1 and the Bird the highest ID. All enums are serialized to Integers starting with Index 1, to avoid null-check issues in javascript because 0 == false there.

{

/*
external calls:
- unit.initiative
- unit.computeDistance(unit)
- unit.reduceAmmo()
- unit.getHurt()
- unit.getSpecialTerrainBonus()
- computeDamage //see below
*/