home · contact · privacy
Add multi-class thing type system.
[plomrogue2-experiments] / new / plomrogue / things.py
index a80e9e40913e9eac6e06221577cfe5815477a1a5..2decc6709f747113e888edc9327f406c8e43739c 100644 (file)
@@ -3,11 +3,11 @@ from plomrogue.errors import GameError
 
 
 class ThingBase:
+    type_ = '?'
 
-    def __init__(self, world, id_, type_='?', position=[0,0]):
+    def __init__(self, world, id_, position=[0,0]):
         self.world = world
         self.id_ = id_
-        self.type_ = type_
         self.position = position
 
 
@@ -126,3 +126,13 @@ class Thing(ThingBase):
             if stencil[thing.position] == '.':
                 visible_things += [thing]
         return visible_things
+
+
+
+class ThingHuman(Thing):
+    type_ = 'human'
+
+
+
+class ThingMonster(Thing):
+    type_ = 'monster'