DayZ 1.24
Loading...
Searching...
No Matches
ParticleBase.c File Reference

Go to the source code of this file.

Classes

class  ParticleEvents
 Invokers for ParticleBase events, called from events. More...
 

Functions

void ParticleBase ()
 ctor
 
override bool IsParticle ()
 Have script recognize this as a Particle without casting.
 
Playback

Methods regarding playing/stopping of particle

void PlayParticle (int particle_id=-1)
 Method to tell the particle to start playing.
 
bool PlayParticleEx (int particle_id=-1, int flags=0)
 Method to tell the particle to start playing.
 
bool StopParticle (int flags=0)
 Method to tell the particle to stop playing.
 
bool ResetParticle ()
 Method to tell the particle to reset.
 
bool RestartParticle ()
 Method to tell the particle to restart (reset + play)
 
bool IsParticlePlaying ()
 Ask if the particle is still playing.
 
ParticleEvents GetEvents ()
 Get the events.
 
Events

ParticleBase events For ParticleSource, these are handed on C++ side For more information, read ParticleEvents

void OnParticleStart ()
 Event when the particle starts.
 
void OnParticleStop ()
 Event when the particle stops.
 
void OnParticleReset ()
 Event when the particle is restarted.
 
void OnParticleEnd ()
 Event when the particle ends.
 
void OnParticleParented (IEntity parent)
 Event when the particle receives a parent.
 
void OnParticleUnParented (IEntity parent)
 Event when the particle is orphaned.
 

Variables

class ParticleEvents m_IsPlaying
 Engine base class with internal functionality.
 
ref ParticleEvents m_EventInvokers
 Event invokers.
 

Function Documentation

◆ GetEvents()

ParticleEvents GetEvents ( )
protected

Get the events.

Returns
ParticleEvents If there is any events set, this will return them so that additional functionality can be bound to them

Definition at line 158 of file ParticleBase.c.

159 {
160 return m_EventInvokers;
161 }
ref ParticleEvents m_EventInvokers
Event invokers.

References m_EventInvokers.

Referenced by OnAllocation(), OnAllocationEnd(), OnParticleEnd(), OnParticleParented(), OnParticleReset(), OnParticleStart(), OnParticleStop(), and OnParticleUnParented().

◆ IsParticle()

override bool IsParticle ( )
protected

Have script recognize this as a Particle without casting.

Definition at line 77 of file ParticleBase.c.

78 {
79 return true;
80 }

◆ IsParticlePlaying()

bool IsParticlePlaying ( )
protected

Ask if the particle is still playing.

Returns
bool Whether the particle is playing

Definition at line 145 of file ParticleBase.c.

146 {
147 ErrorEx("Not implemented.", ErrorExSeverity.WARNING);
148 return false;
149 }
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx

References ErrorEx.

◆ OnParticleEnd()

void OnParticleEnd ( )
protected

Event when the particle ends.

Note
Looping particles will never end

Definition at line 201 of file ParticleBase.c.

202 {
203 GetEvents().Event_OnParticleEnd.Invoke(this);
204 }
ParticleEvents GetEvents()
Get the events.
ref ScriptInvoker Event_OnParticleEnd
Called when particle ends.

References ParticleEvents::Event_OnParticleEnd, and GetEvents().

Referenced by Particle::OnCheckAutoDelete().

◆ OnParticleParented()

void OnParticleParented ( IEntity parent)
protected

Event when the particle receives a parent.

Definition at line 209 of file ParticleBase.c.

210 {
211 GetEvents().Event_OnParticleParented.Invoke(this);
212 }
ref ScriptInvoker Event_OnParticleParented
Called when particle receives a parent.

References ParticleEvents::Event_OnParticleParented, and GetEvents().

◆ OnParticleReset()

void OnParticleReset ( )
protected

Event when the particle is restarted.

Definition at line 192 of file ParticleBase.c.

193 {
194 GetEvents().Event_OnParticleReset.Invoke(this);
195 }
ref ScriptInvoker Event_OnParticleReset
Called when particle is reset.

References ParticleEvents::Event_OnParticleReset, and GetEvents().

◆ OnParticleStart()

void OnParticleStart ( )
protected

Event when the particle starts.

Definition at line 174 of file ParticleBase.c.

175 {
176 m_IsPlaying = true;
177 GetEvents().Event_OnParticleStart.Invoke(this);
178 }
class ParticleEvents m_IsPlaying
Engine base class with internal functionality.
ref ScriptInvoker Event_OnParticleStart
Called when particle starts playing.

References ParticleEvents::Event_OnParticleStart, GetEvents(), and m_IsPlaying.

Referenced by Particle::PlayParticleEx().

◆ OnParticleStop()

void OnParticleStop ( )
protected

Event when the particle stops.

Definition at line 183 of file ParticleBase.c.

184 {
185 m_IsPlaying = false;
186 GetEvents().Event_OnParticleStop.Invoke(this);
187 }
ref ScriptInvoker Event_OnParticleStop
Called when particle stops playing.

References ParticleEvents::Event_OnParticleStop, GetEvents(), and m_IsPlaying.

Referenced by Particle::OnCheckAutoDelete(), and Particle::StopParticle().

◆ OnParticleUnParented()

void OnParticleUnParented ( IEntity parent)
protected

Event when the particle is orphaned.

Definition at line 217 of file ParticleBase.c.

218 {
220 }
ref ScriptInvoker Event_OnParticleUnParented
Called when particle is orphaned.

References ParticleEvents::Event_OnParticleUnParented, and GetEvents().

◆ ParticleBase()

void ParticleBase ( )
protected

ctor

Definition at line 70 of file ParticleBase.c.

71 {
73 }
Invokers for ParticleBase events, called from events.

References m_EventInvokers.

◆ PlayParticle()

void PlayParticle ( int particle_id = -1)
protected

Method to tell the particle to start playing.

Parameters
particle_idint Particle ID registered in ParticleList to start playing
Returns
bool Whether the particle successfully started

Definition at line 93 of file ParticleBase.c.

94 {
95 ErrorEx("Not implemented.", ErrorExSeverity.WARNING);
96 }

References ErrorEx.

Referenced by ParticleFireEndStart(), ParticleFireStartStart(), ParticleFireWindyNoIgniteStart(), ParticleNormalFireStart(), ParticleNormalSmokeStart(), FireplaceBase::ParticleNormalSmokeStart(), ParticleSmallFireStart(), ParticleSmallSmokeStart(), FireplaceBase::ParticleSmallSmokeStart(), ParticleSteamEndStart(), ParticleSteamExtinguishingStart(), and ParticleWetNoIgniteStart().

◆ PlayParticleEx()

bool PlayParticleEx ( int particle_id = -1,
int flags = 0 )
protected

Method to tell the particle to start playing.

Parameters
particle_idint Particle ID registered in ParticleList to start playing
flagsint Flags to pass to the playing
Returns
bool Whether the particle successfully started

Definition at line 104 of file ParticleBase.c.

105 {
106 ErrorEx("Not implemented.", ErrorExSeverity.WARNING);
107 return false;
108 }

References ErrorEx.

◆ ResetParticle()

bool ResetParticle ( )
protected

Method to tell the particle to reset.

Returns
bool Whether the particle successfully reset

Definition at line 125 of file ParticleBase.c.

126 {
127 ErrorEx("Not implemented.", ErrorExSeverity.WARNING);
128 return false;
129 }

References ErrorEx.

◆ RestartParticle()

bool RestartParticle ( )
protected

Method to tell the particle to restart (reset + play)

Returns
bool Whether the particle successfully restarted

Definition at line 135 of file ParticleBase.c.

136 {
137 ErrorEx("Not implemented.", ErrorExSeverity.WARNING);
138 return false;
139 }

References ErrorEx.

◆ StopParticle()

bool StopParticle ( int flags = 0)
protected

Method to tell the particle to stop playing.

Parameters
flagsint Flags to pass to the stopping
Returns
bool Whether the particle successfully stopped

Definition at line 115 of file ParticleBase.c.

116 {
117 ErrorEx("Not implemented.", ErrorExSeverity.WARNING);
118 return false;
119 }

References ErrorEx.

Referenced by ParticleFireEndStop(), ParticleFireStartStop(), ParticleNormalFireStop(), ParticleNormalSmokeStop(), ParticleSmallFireStop(), ParticleSmallSmokeStop(), ParticleSteamEndStop(), ParticleSteamExtinguishingStop(), ParticleWetNoIgniteStop(), and StopAllParticlesAndSounds().

Variable Documentation

◆ m_EventInvokers

ref ParticleEvents m_EventInvokers
protected

Event invokers.

Definition at line 66 of file ParticleBase.c.

Referenced by GetEvents(), and ParticleBase().

◆ m_IsPlaying

class ParticleEvents m_IsPlaying

Engine base class with internal functionality.

Note
Is NOT intended for direct creation As this does not have an actual particle Use either Particle or ParticleSource Whether the particle is currently playing