forked from CSGOLeaks/supremacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentlist.h
48 lines (40 loc) · 1.38 KB
/
entlist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
// pre-declare.
class Entity;
class IEntityListener {
public:
virtual void OnEntityCreated( Entity *ent ) = 0;
// virtual void OnEntitySpawned( Entity *ent ) = 0; // note - dex; doesn't seem used on the client?
virtual void OnEntityDeleted( Entity *ent ) = 0;
};
class CEntInfo {
public:
Entity* m_pEntity;
int m_SerialNumber;
CEntInfo* m_pPrev;
CEntInfo* m_pNext;
};
class IClientEntityList {
public:
enum indices : size_t {
GETCLIENTENTITY = 3,
GETCLIENTENTITYFROMHANDLE = 4,
GETHIGHESTENTITYINDEX = 6,
};
public:
template< typename t = Entity* >
__forceinline t GetClientEntity( int index ) {
return util::get_method< t( __thiscall* )( decltype( this ), int ) >( this, GETCLIENTENTITY )( this, index );
}
template< typename t = Entity* >
__forceinline t GetClientEntityFromHandle( EHANDLE handle ) {
return util::get_method< t( __thiscall* )( decltype( this ), EHANDLE ) >( this, GETCLIENTENTITYFROMHANDLE )( this, handle );
}
template< typename t = Entity* >
__forceinline t GetClientEntityFromHandle( ulong_t handle ) {
return util::get_method< t( __thiscall* )( decltype( this ), ulong_t ) >( this, GETCLIENTENTITYFROMHANDLE )( this, handle );
}
__forceinline int GetHighestEntityIndex( ) {
return util::get_method< int( __thiscall* )( decltype( this ) ) >( this, GETHIGHESTENTITYINDEX )( this );
}
};