Exemplo n.º 1
0
Arquivo: world.py Projeto: parpg/parpg
 def __init__(self, engine):
     '''
     Constructor
     @param engine: Instance of the active fife engine
     @type engine: fife.Engine
     '''
     World.__init__(self, engine)
Exemplo n.º 2
0
 def __init__(self, application):
     self.application = application
     self.object_db = {}
     GameVariables.add_callback(self.update_game_variables)
     self.register_mandatory_components()
     yaml.add_representer(RPGEntity, self.entity_representer,
                          yaml.SafeDumper)
     yaml.add_constructor('!Entity', self.entity_constructor,
                          yaml.SafeLoader)
     yaml.add_representer(helpers.DoublePointYaml,
                          helpers.double_point_representer,
                          yaml.SafeDumper)
     yaml.add_constructor("!DoublePoint",
                          helpers.double_point_constructor,
                          yaml.SafeLoader)
     yaml.add_representer(helpers.DoublePoint3DYaml,
                          helpers.double_point_3d_representer,
                          yaml.SafeDumper)
     yaml.add_constructor("!DoublePoint3D",
                          helpers.double_point_3d_constructor,
                          yaml.SafeLoader)
     World.__init__(self, application.engine)
     self.entities = RPGWorldEntitySet(self)
     self._full_extent = EntityExtent(self, self.entities)
     self._entity_delete_callbacks = set()
     self.__entity_cache = {}
Exemplo n.º 3
0
 def __init__(self, application):
     self.application = application
     self.object_db = {}
     GameVariables.add_callback(self.update_game_variables)
     if not Agent.registered_as:
         Agent.register()
     if not FifeAgent.registered_as:
         FifeAgent.register()
     if not General.registered_as:
         General.register()
     yaml.add_representer(RPGEntity, self.entity_representer)
     yaml.add_constructor('!Entity', self.entity_constructor,
                          yaml.SafeLoader)
     World.__init__(self, application.engine)