Skip to content

Add more validation

Compare
Choose a tag to compare
@Auzzy Auzzy released this 02 Aug 19:37

Adds a few new validations to be performed at board validation time.

  • The number of each tile placed shouldn't exceed it's availability in the game.
  • If a space is home to a railroad, either it must contain that railroad's station, or a space must be left for it. This is true even if that railroad is removed from the game.
  • If a space has a reserved slot for a railroad, either it must contain that railroad's station or a space must be left for it, unless it's either been removed from the game or a particular phase has been reached (e.g. in 1846, phase 4)
  • A board space defines its upgrade_attrs as a list of lists. When placing a tile, its upgrade_attrs must match one of these sublists in its entirety. For example, if the space has [["port", "z"], []], then any tile must either have ["port", "z"] exactly, or [].

I also made a couple behind the scenes tweaks. Namely:

  • Combined all the tile info into one file and had each game just define the tile IDs and their quantities
  • Moved private company close phase into the "rules" structure.