Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r235 r229  
    99from nagslang.resources import resources
    1010from nagslang.events import DoorEvent
    11 
    12 
    13 def get_editable_game_objects():
    14     classes = []
    15     for cls_name, cls in globals().iteritems():
    16         if isinstance(cls, type) and hasattr(cls, 'requires'):
    17             classes.append((cls_name, cls))
    18     return classes
    1911
    2012
     
    145137        return True
    146138
    147     @classmethod
    148     def requires(cls):
    149         """Hints for the level editor"""
    150         return [("name", "string")]
    151 
    152139
    153140class FloorSwitch(GameObject):
     
    168155        )
    169156
    170     @classmethod
    171     def requires(cls):
    172         return [("name", "string"), ("position", "coordinates")]
    173 
    174157
    175158class Note(GameObject):
     
    186169            render.TextOverlay(message),
    187170        )
    188 
    189     @classmethod
    190     def requires(cls):
    191         return [("name", "string"), ("position", "coordinates"),
    192                 ("message", "text")]
    193171
    194172
     
    209187            puzzle.StateProxyPuzzler(state_source),
    210188        )
    211 
    212     @classmethod
    213     def requires(cls):
    214         return [("name", "string"), ("position", "coordinates"),
    215                 ("state_source", "puzzler")]
    216189
    217190
     
    228201        )
    229202
    230     @classmethod
    231     def requires(cls):
    232         return [("name", "string"), ("position", "coordinates"),
    233                 ("state_source", "puzzler")]
    234 
    235203
    236204class Door(GameObject):
     
    258226        if self.puzzler.get_state():
    259227            DoorEvent.post(self.destination, self.dest_pos)
    260 
    261     @classmethod
    262     def requires(cls):
    263         return [("name", "string"), ("position", "coordinates"),
    264                 ("destination", "level name"), ("dest_pos", "coordinate"),
    265                 ("key_state", "puzzler")]
    266228
    267229
     
    288250            return False
    289251        return True
    290 
    291     @classmethod
    292     def requires(cls):
    293         return [("name", "string"), ("end1", "coordinates"),
    294                 ("end2", "coordinates"), ("key_state", "puzzler")]
Note: See TracChangeset for help on using the changeset viewer.