entities.datamaps module

Provides DataMap functionality for entities.

class entities.datamaps.DataMap

Bases: instance

__init__()

Raises an exception This class cannot be instantiated from Python

find((DataMap)arg1, (str)arg2) TypeDescription :

Find a type description based on its field name or external name.

Return type:

TypeDescription

find_offset((DataMap)arg1, (str)name) int :

Return the offset of a type description by searching for its name. Return -1 if the property wasn’t found.

Return type:

int

property base

Return the next data map in the class hierarchy.

Return type:

DataMap

property chains_validated

None( (_entities._datamaps.DataMap)arg1) -> bool

property class_name

Return the name of the class described by this data map.

Return type:

str

property length

Return the number of type descriptions hold by this data map.

Return type:

int

property optimized_datamap

Not implemented on this engine.

property packed_offsets_computed

None( (_entities._datamaps.DataMap)arg1) -> bool

property packed_size

None( (_entities._datamaps.DataMap)arg1) -> int

class entities.datamaps.EntityProperty(instance, prop_type, networked, offset)[source]

Bases: object

Class used to store property information for verification.

__init__(instance, prop_type, networked, offset)[source]

Store the base attributes on instantiation.

property instance

Return the instance_property instance for the class.

property networked

Return whether the property is networked.

property offset

Returns the offset of the property.

property prop_type

Return the type of the property.

class entities.datamaps.FieldType

Bases: enum

BOOLEAN = _entities._datamaps.FieldType.BOOLEAN
CHARACTER = _entities._datamaps.FieldType.CHARACTER
CLASSPTR = _entities._datamaps.FieldType.CLASSPTR
COLOR32 = _entities._datamaps.FieldType.COLOR32
CUSTOM = _entities._datamaps.FieldType.CUSTOM
EDICT = _entities._datamaps.FieldType.EDICT
EHANDLE = _entities._datamaps.FieldType.EHANDLE
EMBEDDED = _entities._datamaps.FieldType.EMBEDDED
FLOAT = _entities._datamaps.FieldType.FLOAT
FUNCTION = _entities._datamaps.FieldType.FUNCTION
INPUT = _entities._datamaps.FieldType.INPUT
INTEGER = _entities._datamaps.FieldType.INTEGER
INTEGER64 = None
INTERVAL = _entities._datamaps.FieldType.INTERVAL
MATERIALINDEX = _entities._datamaps.FieldType.MATERIALINDEX
MATRIX3X4_WORLDSPACE = _entities._datamaps.FieldType.MATRIX3X4_WORLDSPACE
MODELINDEX = _entities._datamaps.FieldType.MODELINDEX
MODELNAME = _entities._datamaps.FieldType.MODELNAME
POSITION_VECTOR = _entities._datamaps.FieldType.POSITION_VECTOR
QUATERNION = _entities._datamaps.FieldType.QUATERNION
SHORT = _entities._datamaps.FieldType.SHORT
SOUNDNAME = _entities._datamaps.FieldType.SOUNDNAME
STRING = _entities._datamaps.FieldType.STRING
TICK = _entities._datamaps.FieldType.TICK
TIME = _entities._datamaps.FieldType.TIME
TYPECOUNT = _entities._datamaps.FieldType.TYPECOUNT
VECTOR = _entities._datamaps.FieldType.VECTOR
VECTOR2D = _entities._datamaps.FieldType.VECTOR2D
VECTOR4D = None
VMATRIX = _entities._datamaps.FieldType.VMATRIX
VMATRIX_WORLDSPACE = _entities._datamaps.FieldType.VMATRIX_WORLDSPACE
VOID = _entities._datamaps.FieldType.VOID
names = {'BOOLEAN': _entities._datamaps.FieldType.BOOLEAN, 'CHARACTER': _entities._datamaps.FieldType.CHARACTER, 'CLASSPTR': _entities._datamaps.FieldType.CLASSPTR, 'COLOR32': _entities._datamaps.FieldType.COLOR32, 'CUSTOM': _entities._datamaps.FieldType.CUSTOM, 'EDICT': _entities._datamaps.FieldType.EDICT, 'EHANDLE': _entities._datamaps.FieldType.EHANDLE, 'EMBEDDED': _entities._datamaps.FieldType.EMBEDDED, 'FLOAT': _entities._datamaps.FieldType.FLOAT, 'FUNCTION': _entities._datamaps.FieldType.FUNCTION, 'INPUT': _entities._datamaps.FieldType.INPUT, 'INTEGER': _entities._datamaps.FieldType.INTEGER, 'INTERVAL': _entities._datamaps.FieldType.INTERVAL, 'MATERIALINDEX': _entities._datamaps.FieldType.MATERIALINDEX, 'MATRIX3X4_WORLDSPACE': _entities._datamaps.FieldType.MATRIX3X4_WORLDSPACE, 'MODELINDEX': _entities._datamaps.FieldType.MODELINDEX, 'MODELNAME': _entities._datamaps.FieldType.MODELNAME, 'POSITION_VECTOR': _entities._datamaps.FieldType.POSITION_VECTOR, 'QUATERNION': _entities._datamaps.FieldType.QUATERNION, 'SHORT': _entities._datamaps.FieldType.SHORT, 'SOUNDNAME': _entities._datamaps.FieldType.SOUNDNAME, 'STRING': _entities._datamaps.FieldType.STRING, 'TICK': _entities._datamaps.FieldType.TICK, 'TIME': _entities._datamaps.FieldType.TIME, 'TYPECOUNT': _entities._datamaps.FieldType.TYPECOUNT, 'VECTOR': _entities._datamaps.FieldType.VECTOR, 'VECTOR2D': _entities._datamaps.FieldType.VECTOR2D, 'VMATRIX': _entities._datamaps.FieldType.VMATRIX, 'VMATRIX_WORLDSPACE': _entities._datamaps.FieldType.VMATRIX_WORLDSPACE, 'VOID': _entities._datamaps.FieldType.VOID}
values = {0: _entities._datamaps.FieldType.VOID, 1: _entities._datamaps.FieldType.FLOAT, 2: _entities._datamaps.FieldType.STRING, 3: _entities._datamaps.FieldType.VECTOR, 4: _entities._datamaps.FieldType.QUATERNION, 5: _entities._datamaps.FieldType.INTEGER, 6: _entities._datamaps.FieldType.BOOLEAN, 7: _entities._datamaps.FieldType.SHORT, 8: _entities._datamaps.FieldType.CHARACTER, 9: _entities._datamaps.FieldType.COLOR32, 10: _entities._datamaps.FieldType.EMBEDDED, 11: _entities._datamaps.FieldType.CUSTOM, 12: _entities._datamaps.FieldType.CLASSPTR, 13: _entities._datamaps.FieldType.EHANDLE, 14: _entities._datamaps.FieldType.EDICT, 15: _entities._datamaps.FieldType.POSITION_VECTOR, 16: _entities._datamaps.FieldType.TIME, 17: _entities._datamaps.FieldType.TICK, 18: _entities._datamaps.FieldType.MODELNAME, 19: _entities._datamaps.FieldType.SOUNDNAME, 20: _entities._datamaps.FieldType.INPUT, 21: _entities._datamaps.FieldType.FUNCTION, 22: _entities._datamaps.FieldType.VMATRIX, 23: _entities._datamaps.FieldType.VMATRIX_WORLDSPACE, 24: _entities._datamaps.FieldType.MATRIX3X4_WORLDSPACE, 25: _entities._datamaps.FieldType.INTERVAL, 26: _entities._datamaps.FieldType.MODELINDEX, 27: _entities._datamaps.FieldType.MATERIALINDEX, 28: _entities._datamaps.FieldType.VECTOR2D, 29: _entities._datamaps.FieldType.TYPECOUNT}
class entities.datamaps.InputData

Bases: instance

__init__((object)arg1) None

__init__( (object)arg1) -> object

property activator

Return the activator.

Return type:

BaseEntity

property caller

Return the caller.

Return type:

BaseEntity

property output_index

Return the output index.

Return type:

int

property value

Return the value.

Return type:

Variant

class entities.datamaps.InputFunction

Bases: Function

__init__((object)self, (TypeDescription)desc, (_memory.Function)function, (object)entity) None :

Instantiate the function instance and store the base attributes.

Parameters:
  • desc (TypeDescription) – The descriptor of the input bound to this instance.

  • function (Function) – The function of the input.

  • entity (BaseEntity) – The entity this input is bound to.

Raises:

TypeError – If the given descriptor is not an input.

class entities.datamaps.Interval

Bases: instance

__init__((object)arg1) None
property range

None( (_entities._datamaps.Interval)arg1) -> float

property start

None( (_entities._datamaps.Interval)arg1) -> float

class entities.datamaps.TypeDescription

Bases: instance

__init__()

Raises an exception This class cannot be instantiated from Python

property embedded_datamap

None( (_entities._datamaps.TypeDescription)arg1) -> _entities._datamaps.DataMap

property external_name

Return the external name of the field.

Return type:

str

property flags

Return the flags of the field.

Return type:

int

property flat_group

Not implemented on this engine.

property flat_offset

Not implemented on this engine.

property function

Return the input function as a pointer.

Return type:

Pointer

property input_function

Return a callable function if the field is an input function.

property name

Return the name of the field.

Return type:

str

property offset

Return the offset of the field.

Return type:

int

property override_count

None( (_entities._datamaps.TypeDescription)arg1) -> int

property override_field

None( (_entities._datamaps.TypeDescription)arg1) -> _entities._datamaps.TypeDescription

property packed_offset

None( (_entities._datamaps.TypeDescription)arg1) -> int

property save_restore

None( (_entities._datamaps.TypeDescription)arg1) -> object

property size

Return the size of the field.

Return type:

int

property size_in_bytes

None( (_entities._datamaps.TypeDescription)arg1) -> int

property tolerance

None( (_entities._datamaps.TypeDescription)arg1) -> float

property type

Return the type of the field.

Return type:

FieldType

class entities.datamaps.TypeDescriptionFlags(*values)[source]

Bases: IntFlag

TypeDescription flags wrapper enumerator.

FUNCTIONTABLE = 32
GLOBAL = 1
INDEX = 4096
INPUT = 8
INSENDTABLE = 256
KEY = 4
MODELINDEX = 2048
NOERRORCHECK = 1024
OUTPUT = 16
OVERRIDE = 128
PRIVATE = 512
PTR = 64
SAVE = 2
VIEW_NEVER = 32768
VIEW_OTHER_PLAYER = 8192
VIEW_OWN_TEAM = 16384
class entities.datamaps.Variant

Bases: instance

__init__((object)arg1) None
get_bool((Variant)arg1) bool :

Return the value as a boolean.

Return type:

bool

get_color((Variant)arg1) _colors.Color :

Return the value as a color.

Return type:

Color

get_entity((Variant)arg1) object :

Return the value as a handle.

Return type:

BaseHandle

get_float((Variant)arg1) float :

Return the value as a floating value.

Return type:

float

get_int((Variant)arg1) int :

Return the value as an integer.

Return type:

int

get_string((Variant)arg1) str :

Return the value as a string.

Return type:

str

get_vector((Variant)arg1) _mathlib.Vector :

Return the value as a vector.

Return type:

Value

set_bool((Variant)arg1, (bool)arg2) None :

Set the value as a boolean.

set_color((Variant)arg1, (_colors.Color)arg2) None :

Set the value as a color.

set_entity((Variant)arg1, (object)arg2) None :

Set the value as an entity.

set_float((Variant)arg1, (float)arg2) None :

Set the value as a floating value.

set_int((Variant)arg1, (_engines._sound.Channel)arg2) None :

Set the value as an integer.

set_string((Variant)arg1, (str)arg2) None :

Set the value as a string.

set_vector((Variant)arg1, (_mathlib.Vector)arg2) None :

Set the value as a Vector.

property type

Return the type of the value.

Return type:

FieldType