diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-10 05:48:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-10 05:48:14 +0400 |
commit | 136d4c34badc12b72f5c3541fcdaf2b1459af408 (patch) | |
tree | 2fc2952fb508234c74f9b1f1151dfea6dc242303 /source/gameengine/Expressions/PyObjectPlus.cpp | |
parent | f155da0039104af88379bb354674e32ef2595960 (diff) |
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.
Diffstat (limited to 'source/gameengine/Expressions/PyObjectPlus.cpp')
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
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 |