Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/enemies.py

    r229 r235  
    99from nagslang.mutators import FLIP_H
    1010from nagslang.resources import resources
     11
     12
     13def get_editable_enemies():
     14    classes = []
     15    for cls_name, cls in globals().iteritems():
     16        if isinstance(cls, type) and issubclass(cls, Enemy):
     17            if hasattr(cls, 'requires'):
     18                classes.append((cls_name, cls))
     19    return classes
    1120
    1221
     
    3342    def attack(self):
    3443        raise NotImplementedError
     44
     45    @classmethod
     46    def requires(cls):
     47        return [("name", "string"), ("position", "coordinates")]
    3548
    3649
     
    113126        self.set_direction(x_step, y_step)
    114127        super(PatrollingAlien, self).animate()
     128
     129    @classmethod
     130    def requires(cls):
     131        return [("name", "string"), ("position", "coordinates"),
     132                ("end_position", "coordinates")]
Note: See TracChangeset for help on using the changeset viewer.