maat.SimpleStateManager class

Helper class for dynamically saving and loading states into a MaatEngine.

❱   Constructors

SimpleStateManager(str states_dir [, str base_filename = "", bool delete_on_load = True])

Create a new state manager

states_dir The directory where to store files containing serialized states
base_filename (Optional) The base name for serialized state files. The files will be named base_filename_0, base_filename_1, etc
delete_on_load (Optional) If set to True, delete serialized state file from the disk when loading the state into the MaatEngine

❱   Methods

enqueue_state( MaatEngine engine)

Add engine's current state to the state queue

engine The engine whos state to save

bool dequeue_state( MaatEngine engine)

Load next pending state into an engine. Returns True on success and false if there are no more states to load

engine The engine in whom to load the next state in the queue