Parcourir la source

gbe.nodes.Node given 'hidden' methods intended to be used by astate machine. This, in effect, makes a Node tree the core of a game state machine

master
Bryan Miller il y a 6 ans
Parent
révision
8435bfa423
1 fichiers modifiés avec 17 ajouts et 0 suppressions
  1. +17
    -0
      game/gbe/nodes.py

+ 17
- 0
game/gbe/nodes.py Voir le fichier

@@ -187,6 +187,23 @@ class Node:
return c
return None

def _init(self):
if hasattr(self, "on_init"):
self.on_init()
for c in self._NODE_DATA["children"]:
c._init()

def _close(self):
if hasattr(self, "on_close"):
self.on_close()
for c in self._NODE_DATA["children"]:
c._close()

def _pause(self):
if hasattr(self, "on_pause"):
self.on_pause()
for c in self._NODE_DATA["children"]:
c._pause()

def _update(self, dt):
if hasattr(self, "on_update"):

Chargement…
Annuler
Enregistrer