From 2736307c1d6d67868ca54a3df951f9e959efedd0 Mon Sep 17 00:00:00 2001 From: rcoh Date: Mon, 20 Dec 2010 14:50:08 -0500 Subject: Util cleanup is done! Util.py is now refactored into the util module. Woo! RCOH --- behaviors/DecayBehavior.py | 3 ++- behaviors/EchoBehavior.py | 3 ++- behaviors/RunningBehavior.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'behaviors') diff --git a/behaviors/DecayBehavior.py b/behaviors/DecayBehavior.py index edc833d..56e1686 100644 --- a/behaviors/DecayBehavior.py +++ b/behaviors/DecayBehavior.py @@ -1,5 +1,6 @@ from operationscore.Behavior import * from pixelevents.DecayEvent import * +import util.Strings as Strings import Util import pdb class DecayBehavior(Behavior): @@ -7,7 +8,7 @@ class DecayBehavior(Behavior): ret = [] for sensory in sensorInputs: outDict = {} - outDict[Util.location] = sensory[Util.location] + outDict[Strings.LOCATION] = sensory[Strings.LOCATION] outDict['PixelEvent'] = \ DecayEvent.generate(self['DecayType'],self['Coefficient'], sensory['Color']) ret.append(outDict) diff --git a/behaviors/EchoBehavior.py b/behaviors/EchoBehavior.py index a11558a..002f8fb 100644 --- a/behaviors/EchoBehavior.py +++ b/behaviors/EchoBehavior.py @@ -1,4 +1,5 @@ from operationscore.Behavior import * +import util.Strings as Strings import Util import pdb class EchoBehavior(Behavior): @@ -6,7 +7,7 @@ class EchoBehavior(Behavior): ret = [] for sensory in sensorInputs: outDict = {} - outDict[Util.location] = sensory[Util.location] + outDict[Strings.LOCATION] = sensory[Strings.LOCATION] outDict['Color'] = (255,0,0) ret.append(outDict) return ret diff --git a/behaviors/RunningBehavior.py b/behaviors/RunningBehavior.py index 4f51898..1969162 100644 --- a/behaviors/RunningBehavior.py +++ b/behaviors/RunningBehavior.py @@ -1,5 +1,6 @@ from operationscore.Behavior import * import util.ComponentRegistry as compReg +import util.Geo as Geo import pdb import Util class RunningBehavior(Behavior): @@ -13,9 +14,9 @@ class RunningBehavior(Behavior): outDict['Dir'] = 1 #to the right if not 'StepSize' in outDict: outDict['StepSize'] = self['StepSize'] - outDict['Location']= Util.addLocations(outDict['Location'], + outDict['Location']= Geo.addLocations(outDict['Location'], (outDict['StepSize']*outDict['Dir'],0)) - if not Util.pointWithinBoundingBox(outDict['Location'], \ + if not Geo.pointWithinBoundingBox(outDict['Location'], \ compReg.getComponent('Screen').getSize()): outDict['Dir'] *= -1 ret.append(outDict) -- cgit v1.2.3