6 int m_OnePlayingManagerID;
7 bool m_bOnePlayingTestSuccess =
false;
10 int m_OnePlayingSAADPSID;
11 bool m_bOnePlayingSAADEnded =
false;
14 int m_OnePlayingSAPSID;
15 bool m_bOnePlayingSAEnded =
false;
19 float m_StopAccumulatedTime;
20 static const float STOP_ACCUMULATED_TIME_STOP_CUTOFF = 2;
21 static const float STOP_ACCUMULATED_TIME_PLAY_CUTOFF = 3;
22 bool m_bStopWasStopped =
false;
23 bool m_bStopWasResumed =
false;
24 bool m_bStopEnded =
false;
45 m_OnePlayingManagerID = InsertManager(pm);
49 ParticleSource p = pm.CreateParticleById(
ParticleList.EXPLOSION_LANDMINE,
new ParticleProperties(player.GetPosition() + player.GetDirection() * 3,
true));
50 p.GetEvents().Event_OnParticleEnd.Insert(PassOnePlaying);
54 return BTFR(p.IsParticlePlaying());
59 TFResult TestOnePlayingStandAloneAutoDestroy()
64 p.GetEvents().Event_OnParticleEnd.Insert(OnePlayingSAADEnded);
66 m_OnePlayingSAADPSID = m_ParticleSources.Insert(p);
70 return BTFR(p.IsParticlePlaying());
80 p.GetEvents().Event_OnParticleEnd.Insert(OnePlayingSAEnded);
81 p.DisableAutoDestroy();
83 m_OnePlayingSAPSID = m_ParticleSources.Insert(p);
87 return BTFR(p.IsParticlePlaying());
99 return BTFR(p.IsParticlePlaying());
110 p.GetEvents().Event_OnParticleEnd.Insert(StopEnded);
111 p.DisableAutoDestroy();
113 m_StopPSID = m_ParticleSources.Insert(p);
117 return BTFR(p.IsParticlePlaying());
126 if (GetManager(m_OnePlayingManagerID, pm))
131 if (p.IsParticlePlaying())
137 return BTFR(m_bOnePlayingTestSuccess);
154 if (m_ParticleSources.IsValidIndex(m_OnePlayingSAADPSID))
159 if (p.IsParticlePlaying())
165 if (m_bOnePlayingSAADEnded)
180 return BTFR(m_bOnePlayingSAADEnded);
192 if (m_ParticleSources.IsValidIndex(m_OnePlayingSAPSID))
197 if (p.IsParticlePlaying())
206 return BTFR(m_bOnePlayingSAEnded);
224 m_StopAccumulatedTime += dt;
226 if (m_ParticleSources.IsValidIndex(m_StopPSID))
231 if (p.IsParticlePlaying())
233 if (!m_bStopWasStopped && m_StopAccumulatedTime > STOP_ACCUMULATED_TIME_STOP_CUTOFF)
236 m_StopAccumulatedTime = 0;
237 m_bStopWasStopped =
true;
246 if (!
Assert(m_bStopWasStopped))
250 else if (!m_bStopWasResumed && m_StopAccumulatedTime > STOP_ACCUMULATED_TIME_PLAY_CUTOFF)
253 m_bStopWasResumed =
true;
255 else if (m_bStopEnded)
282 m_bOnePlayingTestSuccess =
true;
290 m_bOnePlayingSAADEnded =
true;
296 m_bOnePlayingSAEnded =
true;