Ignore:
Timestamp:
06/25/10 18:01:54 (10 years ago)
Author:
beliar
Message:

Ticket #200: Patch by Beliar.

  • Merging map_loading_change branch back into trunk

fixes[s:trac, t:200]

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
         1*.pyc 
         2.project 
         3.pydevproject 
        14Thumbs.db 
        2 *.pyc 
    • Property svn:mergeinfo changed
      /branches/map_loading_change (added)merged: 554-562
  • trunk/game/scripts/gamestate.py

    r553 r563  
    2424        self.quest_engine = quest_engine.QuestEngine() 
    2525        self.objects = {} 
    26         self.current_map_file = None 
    2726        self.current_map_name = None 
    28         # these coordinates are only used for saving and loading the game. 
    29         # They do not represent the pc's active location 
    30         self.saved_pc_coordinates = (0,0) 
    3127         
    3228    def getObjectsFromMap(self, map_id): 
     
    3632           @returns: The list of objects on this map. Or an empty list""" 
    3733        if map_id in self.objects: 
    38             return [i for i in self.objects[map_id].values() if map_id in self.objects] 
     34            return [i for i in self.objects[map_id].values() \ 
     35                                        if map_id in self.objects] 
    3936         
    4037        return {} 
     
    5148        if obj_id in self.objects[map_id]: 
    5249            return self.objects[map_id][obj_id] 
     50     
     51    def clearObjects(self): 
     52        """Delete all objects from the state 
     53        """ 
     54        self.objects = {} 
     55         
     56    def getStateForSaving(self): 
     57        """Prepares state for saving 
     58        @type state: dictionary 
     59        @param state: State of the object   
     60        """ 
     61        ret_dict = {} 
     62        ret_dict["CurrentMap"] = self.current_map_name 
     63        return ret_dict 
     64 
     65    def restoreFromState(self, state): 
     66        """Restores the state""" 
     67        self.current_map_name = state["CurrentMap"] 
     68         
Note: See TracChangeset for help on using the changeset viewer.