pyhexlib.tokens module

class pyhexlib.tokens.DirectionToken(token_id, image=None, rc=None, direction=Direction.NORTH)[source]

Bases: Token

Parameters:
  • token_id (int | str)

  • image (pygame.Surface)

  • direction (Direction)

__repr__()[source]

Return a concise developer representation for DirectionToken.

Shows the token id, grid coordinate (rc), the direction name, the computed angle (degrees) and whether an image surface is present.

Return type:

str

property angle
class pyhexlib.tokens.FreeToken(token_id, image=None, rc=None, angle=None)[source]

Bases: Token

Parameters:
  • token_id (int | str)

  • image (pygame.Surface)

  • angle (int)

__repr__()[source]

Return a concise developer representation for DirectionToken.

Shows the token id, grid coordinate (rc), the direction name, the computed angle (degrees) and whether an image surface is present.

Return type:

str

property angle
class pyhexlib.tokens.SimpleToken(token_id, image=None, rc=None)[source]

Bases: Token

Parameters:
  • token_id (int | str)

  • image (pygame.Surface)

property angle
class pyhexlib.tokens.Token(token_id, image=None, rc=None)[source]

Bases: ABC

Parameters:
  • token_id (int | str)

  • image (pygame.Surface)

  • rc (Hexagon)

__repr__()[source]

Return a concise developer representation for DirectionToken.

Shows the token id, grid coordinate (rc), the direction name, the computed angle (degrees) and whether an image surface is present.

Return type:

str

abstract property angle: pygame.Surface
property image