From 136d4c34badc12b72f5c3541fcdaf2b1459af408 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 May 2009 01:48:14 +0000 Subject: deprecate controller.getActuator(name) and controller.getSensor(name) for controller.actuators[name] and controller.sensors[name] Made a read-only sequence type for logic brick sensors and actuators which can access single items or be used like a list or dictionary. We could use a python dictionary or CValueList but that would be slower to create. So you can do... for s in controller.sensors: print s print controller.sensors["Sensor"] print controller.sensors[0] sensors = list(controller.sensors) This sequence type keeps a reference to the proxy it came from and will raise an error on access if the proxy has been removed. --- source/gameengine/Expressions/PyObjectPlus.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'source/gameengine/Expressions') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 7d302246c70..7026db5b8a4 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -981,6 +981,5 @@ void PyObjectPlus::SetDeprecationWarningFirst(WarnLink* wlink) {m_base_wlink_f void PyObjectPlus::SetDeprecationWarningLinkLast(WarnLink* wlink) {m_base_wlink_last= wlink;} void PyObjectPlus::NullDeprecationWarning() {m_base_wlink_first= m_base_wlink_last= NULL;} - #endif //NO_EXP_PYTHON_EMBEDDING -- cgit v1.2.3