First batch of GE API cleanup.

The principle is to replace most get/set methods of logic bricks by direct property access. 
To make porting of game code easier, the properties have usually the same type and use than
the return values/parameters of the get/set methods. 
More details on http://wiki.blender.org/index.php/GameEngineDev/Python_API_Clean_Up

Old methods are still available but will produce deprecation warnings on the console: 

"<method> is deprecated, use the <property> property instead"

You can avoid these messages by turning on the "Ignore deprecation warnings" option in Game menu.

PyDoc is updated to include the new properties and display a deprecation warning
for the get/set methods that are being deprecated.
This commit is contained in:
2008-12-29 16:36:58 +00:00
parent d91daaa5f6
commit 1c663bbc7e
37 changed files with 1184 additions and 249 deletions

View File

@@ -5,9 +5,17 @@ from SCA_IActuator import *
class SCA_PropertyActuator(SCA_IActuator):
"""
Property Actuator
Properties:
@ivar property: the property on which to operate.
@type property: string
@ivar value: the value with which the actuator operates.
@type value: string
"""
def setProperty(prop):
"""
DEPRECATED: use the 'property' property
Set the property on which to operate.
If there is no property of this name, the call is ignored.
@@ -17,12 +25,14 @@ class SCA_PropertyActuator(SCA_IActuator):
"""
def getProperty():
"""
DEPRECATED: use the 'property' property
Returns the name of the property on which to operate.
@rtype: string
"""
def setValue(value):
"""
DEPRECATED: use the 'value' property
Set the value with which the actuator operates.
If the value is not compatible with the type of the
@@ -32,6 +42,7 @@ class SCA_PropertyActuator(SCA_IActuator):
"""
def getValue():
"""
DEPRECATED: use the 'value' property
Gets the value with which this actuator operates.
@rtype: string