From 5783d6336f014c05e0e46d7bc35533e70b280582 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 25 Nov 2010 21:44:00 -0500 Subject: Added BehaviorChain to support chains of behaviors. Added FollowMouse parameter to PygameInput to support following of mice. Added component registry to Util which allows any component to access any other component. Some changes to the structure of LightInstallation. --- behaviors/BehaviorChain.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 behaviors/BehaviorChain.py (limited to 'behaviors/BehaviorChain.py') diff --git a/behaviors/BehaviorChain.py b/behaviors/BehaviorChain.py new file mode 100644 index 0000000..15f7d74 --- /dev/null +++ b/behaviors/BehaviorChain.py @@ -0,0 +1,10 @@ +from operationscore.Behavior import * +import Util +import pdb +class BehaviorChain(Behavior): + def processResponse(self, sensorInputs, recursiveInputs): + response = sensorInputs + for behaviorId in self['ChainedBehaviors']: + behavior = Util.getComponentById(behaviorId) + response = behavior.immediateProcessInput(response) + return response -- cgit v1.2.3