diff mamba/engine.py @ 15:ad2bcbf492bf

Hook up top-level habitat support.
author Simon Cross <hodgestar@gmail.com>
date Sun, 11 Sep 2011 13:34:18 +0200
parents f5846a46e9c5
children 6d195a3a4557
line wrap: on
line diff
--- a/mamba/engine.py	Sun Sep 11 13:30:55 2011 +0200
+++ b/mamba/engine.py	Sun Sep 11 13:34:18 2011 +0200
@@ -7,7 +7,10 @@
 
 class Engine(object):
     def __init__(self):
-        pass
+        self._habitat = None
+
+    def set_habitat(self, habitat):
+        self._habitat = habitat
 
     def run(self):
         """Game loop."""
@@ -18,9 +21,19 @@
             for ev in events:
                 if ev.type is QUIT:
                     return
+                self._habitat.dispatch(ev)
+            self._habitat.draw()
             flip()
 
 
+class Habitat(object):
+    def dispatch(self, ev):
+        pass
+
+    def draw(self):
+        pass
+
+
 class UserEvent(object):
 
     utype = "UNKNOWN"