pymasep.common.initializer.initializer_container ================================================ .. py:module:: pymasep.common.initializer.initializer_container Classes ------- .. autoapisummary:: pymasep.common.initializer.initializer_container.InitializerContainer Module Contents --------------- .. py:class:: InitializerContainer(game, initializer_dict) Bases: :py:obj:`pymasep.common.initializer.initializer.Initializer` Initializer used to initialize a Container 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 - type: type of initialization. ALL: all the objects in obj_init will be created. BUY: the player must choose the objects to buy - obj_init : dictionary containing the name of the objects that could be created/bought as the keys. Values are dictionaries with three keys: "cost", the cost of the object, 'template': the template to create the object and 'initializer' used to initialize the object. :param game: the game where the initializer is created :param initializer_dict: the dictionary used to create the initializer .. py:attribute:: type type of the initializer .. py:attribute:: obj_init object creation and initialization .. py:method:: apply(base_object) Apply the initializer. :param base_object: The Container to initialize with all objects in the initializer .. py:method:: apply_with_params(base_object, list_obj_to_create) Create objects in the container and set the container state as 'run' :param base_object: The Container to initialize with list_obj_to_create objects :param list_obj_to_create: the objects to create in the container. This list contains all names of the objects. These names must be in the obj_init dictionary keys. May be None or empty