actions

Use the Actions static methods to construct Action-type objects.

Exports: Actions, Action, MoveAction, SkipAction, SplatAction, DashAction, ShootPaintballAction, TurnLeftAction, TurnRightAction, FaceDirectionAction, Turn180Action

Actions

Static factories (immutable results).

Methods

Method Returns Description
move() MoveAction Move one hex forward.
skip() SkipAction Do nothing.
splat() SplatAction Paint in-grid neighbors of current cell.
dash(distance) DashAction Move distance hexes forward; paints only the destination.
shoot_paintball() ShootPaintballAction Paint along ray in facing until edge or another bot.
turn_left(steps=1) TurnLeftAction Rotate left by steps.
turn_right(steps=1) TurnRightAction Rotate right by steps.
face_direction(direction) FaceDirectionAction direction is int or HexDirection
turn_180() Turn180Action Face opposite direction.

Action

Type alias (union) for any legal return value from decide: MoveAction, SkipAction, SplatAction, DashAction, ShootPaintballAction, TurnLeftAction, TurnRightAction, FaceDirectionAction, Turn180Action.

MoveAction

No instance attributes.

SkipAction

No instance attributes.

SplatAction

No instance attributes.

DashAction

Attributes

Attribute Type Description
distance int Steps straight ahead (facing); engine expects range 2–6.

ShootPaintballAction

No instance attributes.

TurnLeftAction

Attributes

Attribute Type Description
steps int Add to direction index mod 6 (default 1).

TurnRightAction

Attributes

Attribute Type Description
steps int Subtract from direction index mod 6 (default 1).

FaceDirectionAction

Attributes

Attribute Type Description
direction HexDirection Absolute facing.

Turn180Action

No instance attributes.