New conversion_c module
Posted: Mon Jan 27, 2014 1:38 pm
What would be the proper way to retrieve a CPlayerInfo or CPlayerGenerator instance? Importing * from conversion_c is throwing me a few errors.
Code: Select all
from player_c import CPlayerGenerator
Code: Select all
# Converting to an index from other types
index_from_edict
index_from_basehandle
index_from_inthandle
index_from_pointer
index_from_userid
index_from_playerinfo
# Converting to an Edict instance from other types
edict_from_index
edict_from_basehandle
edict_from_inthandle
edict_from_pointer
edict_from_userid
edict_from_playerinfo
# Converting to a CBaseHandle instance from other types
basehandle_from_index
basehandle_from_edict
basehandle_from_inthandle
basehandle_from_pointer
basehandle_from_userid
basehandle_from_playerinfo
# Converting to an integer handle from other types
inthandle_from_index
inthandle_from_edict
inthandle_from_basehandle
inthandle_from_pointer
inthandle_from_userid
inthandle_from_playerinfo
# Converting to a CBaseEntity pointer from other types
pointer_from_index
pointer_from_edict
pointer_from_basehandle
pointer_from_inthandle
pointer_from_userid
pointer_from_playerinfo
# Converting to a userid from other types
userid_from_index
userid_from_edict
userid_from_basehandle
userid_from_inthandle
userid_from_pointer
userid_from_playerinfo
# Converting to a PlayerInfo instance from other types
playerinfo_from_index
playerinfo_from_edict
playerinfo_from_basehandle
playerinfo_from_inthandle
playerinfo_from_pointer
playerinfo_from_userid
satoon101 wrote:The main reason for the conversions being implemented is that previously you could instantiate a CPlayerInfo instance by using either a userid or the CEdict instance. We wanted to get away from allowing multiple types to allow instantiation, so instead we decided providing conversion functions was a better way to go.