Syntax: Select all
if PLATFORM == 'windows':
raise NotImplementedError("UNIX Only")
class CCSGameRules(CustomType, metaclass=manager):
# 5 5 void CCSGameRules::LevelInitPostEntity(void)
LevelInitPostEntity = manager.virtual_function(
5 if PLATFORM == 'windows' else 5,
[],
DataType.VOID
)
# void CCSGameRules::RestartRound(void)
RestartRound = server['_ZN12CCSGameRules12RestartRoundEv'].make_function(
Convention.CDECL,
[DataType.POINTER],
DataType.VOID
)
_m_iMapHasVIPSafetyZone_offset = None if PLATFORM == 'windows' else 756
@property# 0 is uninit 1 is yes 2 is no
def m_iMapHasVIPSafetyZone(self):
return self.get_int(offset=self._m_iMapHasVIPSafetyZone_offset)
@m_iMapHasVIPSafetyZone.setter
def m_iMapHasVIPSafetyZone(self, value):
return self.set_int(value, offset=self._m_iMapHasVIPSafetyZone_offset)
c_gamerules = make_object(CCSGameRules, pointer)
So to call LevelInitPostEntity I would do
Syntax: Select all
c_gamerules.LevelInitPostEntity()
But to call RestartRound I would have to include the pointer manually (obviously)
Syntax: Select all
c_gamerules.RestartRound(pointer)
What's the proper way to use a symbol in a CustomType class so it automatically uses the pointer as the 1st argument?
So that I can just use
Syntax: Select all
c_gamerules.RestartRound()
Also let me know if there's a better (buildin) way to do the offset setting/getting.
Thanks
(I didn't include the imports/the code to get the pointer to keep it to the point, let me know if you need it anyway)