Module SCA_PythonController
[hide private]
[frames] | no frames]

Source Code for Module SCA_PythonController

 1  # $Id: SCA_PythonController.py 15444 2008-07-05 17:05:05Z lukep $ 
 2  # Documentation for SCA_PythonController 
 3  from SCA_IController import * 
 4   
5 -class SCA_PythonController(SCA_IController):
6 """ 7 A Python controller uses a Python script to activate it's actuators, 8 based on it's sensors. 9 """ 10
11 - def getSensors():
12 """ 13 Gets a list of all sensors attached to this controller. 14 15 @rtype: list [L{SCA_ISensor}] 16 """
17 - def getSensor(name):
18 """ 19 Gets the named linked sensor. 20 21 @type name: string 22 @rtype: L{SCA_ISensor} 23 """
24 - def getActuators():
25 """ 26 Gets a list of all actuators linked to this controller. 27 28 @rtype: list [L{SCA_IActuator}] 29 """
30 - def getActuator(name):
31 """ 32 Gets the named linked actuator. 33 34 @type name: string 35 @rtype: L{SCA_IActuator} 36 """
37 - def getScript():
38 """ 39 Gets the Python script this controller executes. 40 41 @rtype: string 42 """
43 - def setScript(script):
44 """ 45 Sets the Python script this controller executes. 46 47 @type script: string. 48 """
49 - def getState():
50 """ 51 Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. 52 This for instance will always be true however you could compare with a previous state to see when the state was activated. 53 GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() 54 55 @rtype: int 56 """
57