Skip to main content
All types are imported from the cambc module:
This gives you: Team, EntityType, ResourceType, Environment, Direction, Position, GameConstants, GameError, and Controller.

Team

EntityType

ResourceType

Environment

Direction

Direction methods

tuple[int, int]
Return the (dx, dy) step for this direction. North is (0, -1), East is (1, 0), etc.
Direction
Return the direction rotated 45° counterclockwise.
Direction
Return the direction rotated 45° clockwise.
Direction
Return the opposite direction (180°).

Position

A named tuple with x and y integer fields.

Position methods

Position
Return a new position offset by the direction delta.
int
Return the squared Euclidean distance to another position.
Direction
Return the closest 45° Direction approximation toward other.

Usage

GameError

Raised when a player issues an invalid action (e.g., building on an occupied tile, moving with cooldown > 0).