Module map18xx::tile [] [src]

Representation of tiles

Items within a hex are usually given in hexagon-space. This is a 3D space where the axis are at 60° to each other. An example of the axis is given below. Note that the orientation of the axis when the hexagons are oriented with horizontal edges differs from when the hexagons are oriented with vertical edges.

Instead of using coordinates in hexagon-space there are these position codes that can be used as a shortcut. North is the upper edge on a hexagon that has horizontal edges, it is the top left edge on hexagons that are oriented vertically.

  • N: north edge
  • NE: north east edge
  • NW: north west edge
  • S: south edge
  • SE: south east edge
  • SW: south west edge
  • C: center of hexagon

Coordinate system

Modules

colors

Standard colors that can be used

Structs

City

City on the tile

Path

Path on the tile

RevenueTrack

Track which shows revenue for different phases

Stop

Stop on the tile

Terrain

Terrain on a tile

Text

Text on the tile

Tile

The specification of a tile to be used in the game

TileDefinition

Definition of tile layout, does not include color or name

Enums

Coordinate

Represents named or hex space coordinate

TerrainType

Types of terrain that can be present

TextAnchor

Text anchor position for text on tile

Traits

TileSpec

Attributes that are common between Tile and TileDefinition

Functions

definitions

Reads and parses all tile definitions in ./tiledefs/

direction_to_angle

Converts a compass direction to a number of degrees of rotation