Example #1
0
 def createItem(self, identifier, item_data, world, item_type):
     if not item_data["description"].has_key("view_name"):
         item_data["description"]["view_name"] = (
          item_data["description"]["real_name"])
     item = createEntity(item_data, identifier, world, None)
     item.containable.item_type = item_type
     self.game_state.addObject(identifier, None, item)
     self.updateObjectDB(world)
     return item
Example #2
0
 def createMapObject (self, layer, attributes, inst_id, world):
     """Create an object and add it to the current map.
        @type layer: fife.Layer
        @param layer: FIFE layer object exists in
        @type attributes: Dictionary
        @param attributes: Dictionary of all object attributes
        @type instance: fife.Instance
        @param instance: FIFE instance corresponding to the object
        @return: The created object"""
     # create the extra data
     extra = {}
     if layer is not None:
         extra['fifeagent'] = {}
         extra['fifeagent']['layer'] = layer
     
     obj = createEntity(attributes, inst_id, world, extra)
     if obj:
         self.addObject(layer, obj)
     return obj