turn_system module

class core.gameCreation.turn_system.TurnManager

Bases: object

Manages turn-based scheduling and execution of callbacks.

current_turn

The current turn number.

Type:

int

_scheduled

List of scheduled callbacks as tuples (target_turn, callback, data).

Type:

list

next_turn()

Advance to the next turn and dispatch any scheduled callbacks.

schedule_in(turns: int, callback, data)

Schedule a callback to be executed after a given number of turns.

Parameters:
  • turns (int) – Number of turns to wait before executing the callback.

  • callback (callable) – The function to call when the scheduled turn is reached.

  • data (any) – Data to pass to the callback function.