Přeskočit obsah

CAST - data type conversion functions

External functions for data type conversion and pointer casting.

Cast_PointerToInstance

Cast_PointerToInstance

Converts memory address (pointer) to an instance

func instance Cast_PointerToInstance(var int address) {};
  • address - object pointer
  • return - instance of the object

Cast_InstanceToPointer

Cast_InstanceToPointer

Converts instance to a memory address (pointer)

func int Cast_InstanceToPointer( var instance object) {};
  • object - object instance
  • return - memory address (pointer) of the object

Cast_PointerToNpc

Cast_PointerToNpc

Casts memory address (pointer) to an NPC

func C_NPC Cast_PointerToNpc( var int address) {};
  • address - npc pointer
  • return - NPC instance

Cast_PointerToItem

Cast_PointerToItem

Casts memory address (pointer) to an Item

func C_ITEM Cast_PointerToItem( var int address) {};
  • address - item pointer
  • return - Item instance

Cast_InstanceIsNpc

Cast_InstanceIsNpc

Checks whether object is an NPC

func int Cast_InstanceIsNpc( var instance object) {};
  • object - object to check
  • return - TRUE or FALSE

Cast_InstanceIsItem

Cast_InstanceIsItem

Checks whether object is an Item

func int Cast_InstanceIsItem( var instance object) {};
  • object - object to check
  • return - TRUE or FALSE

Cast_InstanceIsMob

Cast_InstanceIsMob

Checks whether object is an MOB

func int Cast_InstanceIsMob( var instance object) {};
  • object - object to check
  • return - TRUE or FALSE

Cast_GetInstanceIndex

Cast_GetInstanceIndex

Returns symbolID of the object, returns -1 when not found

func int Cast_GetInstanceIndex( var instance object) {};
  • object - instance of an object
  • return - symbol table index, -1 when not found

Cast_GetClassID

Cast_GetClassID

Returns the class identifier of a class by its name

func int Cast_GetClassID( var string className ) {};
  • className - name of the class
  • return - class identifier

Cast_GetVobClassID

Cast_GetVobClassID

Returns class identifier of the zCObject vob class

func int Cast_GetVobClassID( var instance object ) {};
  • object - object instance
  • return - class zCObject identifier

Cast_CheckVobClassID

Cast_CheckVobClassID

Checks if the classId class is the parent class of the object

func int Cast_CheckVobClassID( var int classId, var instance object ) {};
  • classId - class identifier, from Cast_GetClassID function
  • object - object instance
  • return - class zCObject identifier