Module GameTypes :: Class SCA_IController
[hide private]
[frames] | no frames]

Class SCA_IController

source code

PyObjectPlus --+        
               |        
          CValue --+    
                   |    
     SCA_ILogicBrick --+
                       |
                      SCA_IController
Known Subclasses:
SCA_ANDController, SCA_NANDController, SCA_NORController, SCA_ORController, SCA_PythonController, SCA_XNORController, SCA_XORController

Base class for all controller logic bricks.

Instance Methods [hide private]
    Deprecated
int
getState()
Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active.
source code
list [SCA_ISensor]
getSensors()
Gets a list of all sensors attached to this controller.
source code
SCA_ISensor
getSensor(name)
Gets the named linked sensor.
source code
list [SCA_IActuator]
getActuators()
Gets a list of all actuators linked to this controller.
source code
SCA_IActuator
getActuator(name)
Gets the named linked actuator.
source code
    Inherited from SCA_ILogicBrick
integer
getExecutePriority()
Gets the execution priority of this logic brick.
source code
KX_GameObject
getOwner()
Gets the game object associated with this logic brick.
source code
 
setExecutePriority(priority)
Sets the priority of this logic brick.
source code
    Inherited from CValue
string
getName()
Returns the name of the CValue.
source code
    Inherited from PyObjectPlus
bool
isA(game_type)
Check if this is a type or a subtype game_type.
source code
Instance Variables [hide private]
sequence supporting index/string lookups and iteration. actuators
a list of actuators linked to this controller.
sequence supporting index/string lookups and iteration. sensors
a list of sensors linked to this controller
int bitmask state
the controllers state bitmask.
bool useHighPriority
When set the controller executes always before all other controllers that dont have this set.
    Inherited from SCA_ILogicBrick
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first).
string name
The name of this CValue derived object (read-only).
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read-only).
    Inherited from PyObjectPlus
bool invalid
Test if the object has been freed by the game engine and is no longer valid.
Method Details [hide private]

getState()

source code 
Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. This for instance will always be true however you could compare with a previous state to see when the state was activated. GameLogic.getCurrentController().state & GameLogic.getCurrentController().owner.state
Returns: int

Deprecated: Use the state property

getSensors()

source code 
Gets a list of all sensors attached to this controller.
Returns: list [SCA_ISensor]

Deprecated: use the sensors property

getSensor(name)

source code 
Gets the named linked sensor.
Returns: SCA_ISensor

Deprecated: use the sensors[name] property

getActuators()

source code 
Gets a list of all actuators linked to this controller.
Returns: list [SCA_IActuator]

Deprecated: Use the actuators property

getActuator(name)

source code 
Gets the named linked actuator.
Returns: SCA_IActuator

Deprecated: use the actuators[name] property


Instance Variable Details [hide private]

actuators

a list of actuators linked to this controller.
  • note: the sensors are not necessarily owned by the same object.
  • note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
Type:
sequence supporting index/string lookups and iteration.

sensors

a list of sensors linked to this controller
  • note: the sensors are not necessarily owned by the same object.
  • note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup.
Type:
sequence supporting index/string lookups and iteration.

state

the controllers state bitmask. This can be used with the GameObject's state to test if the controller is active.
Type:
int bitmask

useHighPriority

When set the controller executes always before all other controllers that dont have this set. note: Order of execution between high priority controllers is not guaranteed.
Type:
bool