pymasep.common.initializer.initializer
Classes
Initializer used to initialize the value of BaseObject. |
Module Contents
- class pymasep.common.initializer.initializer.Initializer(game, initializer_dict)
Initializer used to initialize the value of BaseObject. An initializer can be executed by the Engine (by default) or processed by the Interface.
An initializer is created from a dictionary. The format is the following:
name: name of the initializer used as id
value_type: for Characteristic, the type of the value (as string)
subclass_initializer: name of sub initializer used to initialize sub BaseObject. These initializers must already exist in the game
- Parameters:
game – the game where the initializer is created
initializer_dict (dict) – the dictionary used to create the initializer
- INIT_TYPE_ENGINE = 'Engine'
Initializer by the Engine
- INIT_TYPE_INTERFACE = 'Interface'
Initializer by the Interface
- game
- name
name of the initializer used as id
- value_type
type of the value (as string) for Characteristic
- subclass_initializer
name of sub initializers used to initialize sub BaseObject
- init_type
initializer by engine by default
- apply(base_object)
Apply the initializer.
- Parameters:
base_object – The BaseObject to initialize
- Return type:
None