Beispiel #1
0
    def __new__(cls, world, identifier):

        entity = super().__new__(cls, world)
        if not General.registered_as:
            General.register()
        getattr(entity, General.registered_as).identifier = identifier
        return entity
Beispiel #2
0
    def __new__(cls, world, identifier):

        entity = super().__new__(cls, world)
        if not General.registered_as:
            General.register()
        getattr(entity, General.registered_as).identifier = identifier
        return entity
Beispiel #3
0
 def register_mandatory_components(self):
     """Registers the mandatory components"""
     if not Agent.registered_as:
         Agent.register()
     if not FifeAgent.registered_as:
         FifeAgent.register()
     if not General.registered_as:
         General.register()
Beispiel #4
0
 def configure(self):
     """Configure the worlds components and systems"""
     World.configure(self)
     components = ComponentManager.get_components()
     for name, component in components.iteritems():
         setattr(self.components, name, component)
     systems = SystemManager.get_systems()
     for name, system in systems.iteritems():
         setattr(self.systems, name, system)
     if not General.registered_as:
         General.register()
Beispiel #5
0
 def configure(self):
     """Configure the worlds components and systems"""
     World.configure(self)
     components = ComponentManager.get_components()
     for name, component in components.items():
         setattr(self.components, name, component)
     systems = SystemManager.get_systems()
     for name, system in systems.items():
         setattr(self.systems, name, system)
     if not General.registered_as:
         General.register()
Beispiel #6
0
 def __init__(self, fife_map, name, camera, regions, application):
     self.__map = fife_map
     self.__name = name
     self.__regions = regions
     self.__entities = {}
     self.__camera = fife_map.getCamera(camera)
     self.__application = application
     if not FifeAgent.registered_as:
         FifeAgent.register()
     if not Agent.registered_as:
         Agent.register()
     if not General.registered_as:
         General.register()
Beispiel #7
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)
Beispiel #8
0
 def __init__(self, fife_map_or_filename, view_name, camera, regions,
              application):
     self.__map = fife_map_or_filename
     self.__camera = camera
     if self.is_loaded:
         self.__setup_map_data()
     self.__view_name = view_name
     self.__regions = regions
     self.__entities = {}
     self.__application = application
     if not FifeAgent.registered_as:
         FifeAgent.register()
     if not Agent.registered_as:
         Agent.register()
     if not General.registered_as:
         General.register()
Beispiel #9
0
    def __init__(self, world, identifier):

        Entity.__init__(self, world)
        if not General.registered_as:
            General.register()
        getattr(self, General.registered_as).identifier = identifier