Changeset 110


Ignore:
Timestamp:
06/09/09 04:01:11 (10 years ago)
Author:
maximinus_parpg
Message:

Cleaned up and simplified world.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/world.py

    r105 r110  
    3838# however, any logic needed to resolve this should sit in engine.py 
    3939 
    40 class MapListener(fife.MapChangeListener): 
    41     """This class listens to changes happening on the map. 
    42        Since in theory we initiate these ourselves, do we need this class?""" 
    43     def __init__(self, map): 
     40class Map(fife.MapChangeListener): 
     41    def __init__(self, fife_map): 
    4442        fife.MapChangeListener.__init__(self) 
    45  
    46     def onMapChanged(self, map, changedLayers): 
    47         pass 
    48  
    49     def onLayerCreate(self, map, layer): 
    50         pass 
    51  
    52     def onLayerDelete(self, map, layer): 
    53         pass 
    54  
    55 class Map: 
    56     def __init__(self, fife_map): 
    57         self.listener = MapListener 
    5843        self.map = fife_map 
    5944 
     
    10691        self.reset() 
    10792        self.map = loadMapFile(filename, self.engine) 
    108         self.maplistener = MapListener(self.map) 
     93        self.maplistener = Map(self.map) 
    10994 
    11095        # there must be a PC object on the objects layer! 
     
    125110        self.outline_render = fife.InstanceRenderer.getInstance(self.cameras['main']) 
    126111         
    127         # set the rnder text 
     112        # set the render text 
    128113        rend = fife.FloatingTextRenderer.getInstance(self.cameras['main']) 
    129114        text = self.engine.getGuiManager().createFont('fonts/rpgfont.png', 
Note: See TracChangeset for help on using the changeset viewer.