-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticles.inc
More file actions
67 lines (59 loc) · 1.41 KB
/
particles.inc
File metadata and controls
67 lines (59 loc) · 1.41 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
**
*/
#if defined _PARTICLES_included
#endinput
#endif
#define _PARTICLES_included
#include <thelpers/thelpers>
#define PARTICLE_SYSTEM_CLASSNAME "info_particle_system"
#define INVALID_PARTICLE_SYSTEM view_as<CParticleSystem>(INVALID_ENTITY)
methodmap CParticleSystem < CBaseEntity {
public static CParticleSystem UpCast(CBaseEntity i_ent)
{
char s_classname[] = PARTICLE_SYSTEM_CLASSNAME;
if (!i_ent.GetClassname(s_classname, sizeof(s_classname)))
{
return INVALID_PARTICLE_SYSTEM;
}
if (!StrEqual(s_classname, PARTICLE_SYSTEM_CLASSNAME))
{
return INVALID_PARTICLE_SYSTEM;
}
return view_as<CParticleSystem>(i_ent);
}
public CParticleSystem(int i_ent_index)
{
CBaseEntity i_ent = new CBaseEntity(i_ent_index);
if (i_ent == INVALID_ENTITY)
{
return INVALID_PARTICLE_SYSTEM;
}
return CParticleSystem.UpCast(i_ent);
}
public bool Start()
{
return this.AcceptInput("Start");
}
public bool Stop()
{
return this.AcceptInput("Stop");
}
public bool Kill()
{
return this.AcceptInput("Kill");
}
public void Activate()
{
ActivateEntity(this.Ref);
}
public bool SetEffectName(const char[] s_effect_name)
{
return this.KeyValue("effect_name", s_effect_name);
}
public static CParticleSystem Create(int i_force_edict_index = -1)
{
CBaseEntity i_ent = CBaseEntity.CreateByName(PARTICLE_SYSTEM_CLASSNAME, i_force_edict_index);
return CParticleSystem.UpCast(i_ent);
}
}