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

Class PyObjectPlus

source code

Known Subclasses:
CValue, BL_Shader, KX_BlenderMaterial, KX_ConstraintWrapper, KX_PhysicsObjectWrapper, KX_Scene, KX_VehicleWrapper

PyObjectPlus base class of most other types in the Game Engine.

Instance Methods [hide private]
bool
isA(game_type)
Check if this is a type or a subtype game_type.
source code
Instance Variables [hide private]
bool invalid
Test if the object has been freed by the game engine and is no longer valid.
Method Details [hide private]

isA(game_type)

source code 
Check if this is a type or a subtype game_type.
Parameters:
  • game_type (string or type) - the name of the type or the type its self from the GameTypes module.
Returns: bool
True if this object is a type or a subtype of game_type.

Instance Variable Details [hide private]

invalid

Test if the object has been freed by the game engine and is no longer valid.

Normally this is not a problem but when storing game engine data in the GameLogic module, KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data. Calling an attribute or method on an invalid object will raise a SystemError.

The invalid attribute allows testing for this case without exception handling.
Type:
bool