-
Notifications
You must be signed in to change notification settings - Fork 0
/
cGame.h
470 lines (388 loc) · 21.3 KB
/
cGame.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
///////////////////////////////////////////////////////
//*-------------------------------------------------*//
//| Part of Project One (https://www.maus-games.at) |//
//*-------------------------------------------------*//
//| Copyright (c) 2010 Martin Mauersics |//
//| Released under the zlib License |//
//*-------------------------------------------------*//
///////////////////////////////////////////////////////
#pragma once
#ifndef _P1_GUARD_GAME_H_
#define _P1_GUARD_GAME_H_
// TODO 3: FindPlayer may find player outside of area (during resurrection)
// TODO 2: [MF] removing ghost status (player, enemy, bullet) should reset firsthit properties of all related collision-pairs somehow (maybe add own collision-tracker and merge with the one in player-class) [RP]
// TODO 3: repair enemy only in coop ? (not duel)
// TODO 4: move play-sounds into special-effects class
// TODO 3: repair enemy should be rendered on same height as m_aPlayer[i].RenderMiddle(); or first as TOP
// TODO 3: on restart, music is blended in without smooth transition (mission, segment)
// ****************************************************************
// game definitions
#define GAME_PLAYERS (PLAYERS) // default number of players
#define GAME_HELPERS (HELPERS) //
#define GAME_CONTINUES (CONTINUES) //
#define GAME_INTRO_OFFSET (0.4f) //
#define GAME_INTRO_DURATION (4.1f) //
#define GAME_RAISE_DEFAULT (0u) //
#define GAME_GOAL_FACTOR (10.0f) //
#define GAME_GOAL_MARGIN (0.1f) //
enum eGameStatus : coreUint16
{
GAME_STATUS_INTRO = 0x0001u, //
GAME_STATUS_OUTRO = 0x0002u, //
GAME_STATUS_PLAY = 0x0004u, //
GAME_STATUS_LOADING = 0x0008u, //
GAME_STATUS_DEFEATED = 0x0010u, //
GAME_STATUS_CONTINUE = 0x0020u, // TODO 1: still needed?
GAME_STATUS_QUICK = 0x0040u, //
GAME_STATUS_NAMELESS = 0x0080u, //
GAME_STATUS_FINISHED = 0x0100u //
};
enum eGameOutro : coreUint8
{
GAME_OUTRO_MISSION = 0u, //
GAME_OUTRO_SEGMENT, //
GAME_OUTRO_BEGINNING, //
GAME_OUTRO_ENDING_NORMAL, //
GAME_OUTRO_ENDING_SECRET //
};
enum eGameKind : coreUint8
{
GAME_KIND_ALL = 0u, //
GAME_KIND_MISSION, //
GAME_KIND_SEGMENT, //
GAME_KIND_MAX //
};
enum eGameType : coreUint8
{
GAME_TYPE_SOLO = 0u, // (opposite of MULTI)
GAME_TYPE_COOP, //
GAME_TYPE_DUEL, //
GAME_TYPE_MAX //
};
enum eGameMode : coreUint8
{
GAME_MODE_STANDARD = 0u, //
GAME_MODE_PACIFIST, //
GAME_MODE_MASOCHIST, //
GAME_MODE_MAX //
};
enum eGameDifficulty : coreUint8
{
GAME_DIFFICULTY_EASY = 0u, //
GAME_DIFFICULTY_NORMAL, //
GAME_DIFFICULTY_HARD, //
GAME_DIFFICULTY_MAX //
};
enum eGameFlag : coreUint8
{
GAME_FLAG_TASK = 0x01u, //
GAME_FLAG_TASK_EXTRA = 0x02u, //
GAME_FLAG_FRAGMENT = 0x04u //
};
struct sGameOptions final
{
coreUint8 iKind; //
coreUint8 iType; //
coreUint8 iMode; //
coreUint8 iDifficulty; //
coreUint8 iFlags; //
coreUint8 aiShield [GAME_PLAYERS]; //
coreUint8 aaiWeapon [GAME_PLAYERS][PLAYER_EQUIP_WEAPONS]; //
coreUint8 aaiSupport[GAME_PLAYERS][PLAYER_EQUIP_SUPPORTS]; //
};
// ****************************************************************
//
static constexpr coreInt32 GAME_MISSION_LIST_MAIN[] =
{
cIntroMission ::ID,
cViridoMission ::ID,
cNevoMission ::ID,
cHarenaMission ::ID,
cRutilusMission::ID,
cGeluMission ::ID,
cCalorMission ::ID,
cMuscusMission ::ID,
cAterMission ::ID,
cBonus1Mission ::ID,
cBonus2Mission ::ID,
cErrorMission ::ID
};
static constexpr coreInt32 GAME_MISSION_LIST_DEMO[] =
{
cIntroMission ::ID,
cViridoMission::ID,
cNevoMission ::ID
};
struct sMissionData final
{
coreInt32 iID; //
const coreChar* pcName; //
coreVector3 vColor; //
coreVector3 vColor2; //
coreVector2 vIcon; //
const coreChar* pcBoss; //
};
static constexpr sMissionData g_aMissionData[] =
{
{cIntroMission ::ID, cIntroMission ::Name, cCloudBackground ::Color, cCloudBackground ::Color2, cCloudBackground ::Icon, cIntroBoss ::Name},
{cViridoMission ::ID, cViridoMission ::Name, cGrassBackground ::Color, cGrassBackground ::Color2, cGrassBackground ::Icon, cTorusBoss ::Name},
{cNevoMission ::ID, cNevoMission ::Name, cSeaBackground ::Color, cSeaBackground ::Color2, cSeaBackground ::Icon, cLeviathanBoss ::Name},
{cHarenaMission ::ID, cHarenaMission ::Name, cDesertBackground ::Color, cDesertBackground ::Color2, cDesertBackground ::Icon, cTigerBoss ::Name},
{cRutilusMission::ID, cRutilusMission::Name, cSpaceBackground ::Color, cSpaceBackground ::Color2, cSpaceBackground ::Icon, cMessierBoss ::Name},
{cGeluMission ::ID, cGeluMission ::Name, cVolcanoBackground::Color, cVolcanoBackground::Color2, cVolcanoBackground::Icon, cCholBoss ::Name},
{cCalorMission ::ID, cCalorMission ::Name, cSnowBackground ::Color, cSnowBackground ::Color2, cSnowBackground ::Icon, cZerothBoss ::Name},
{cMuscusMission ::ID, cMuscusMission ::Name, cMossBackground ::Color, cMossBackground ::Color2, cMossBackground ::Icon, cGemingaBoss ::Name},
{cAterMission ::ID, cAterMission ::Name, cDarkBackground ::Color, cDarkBackground ::Color2, cDarkBackground ::Icon, cProjectOneBoss::Name},
{cBonus1Mission ::ID, cBonus1Mission ::Name, cDarkBackground ::Color, cDarkBackground ::Color2, cDarkBackground ::Icon, cVausBoss ::Name}, // #
{cBonus2Mission ::ID, cBonus2Mission ::Name, cDarkBackground ::Color, cDarkBackground ::Color2, cDarkBackground ::Icon, cNautilusBoss ::Name} // #
};
// ****************************************************************
//
struct sFragmentData final
{
coreUintW iIndex; //
coreVector2 vOffset; //
coreVector2 vShift; //
coreVector2 vSize; //
coreVector3 vColor; //
};
static constexpr sFragmentData g_aFragmentData[] =
{
{8u, coreVector2(760.0f, 1024.0f - 837.0f) / 1024.0f, coreVector2(-0.01f, 0.0f), coreVector2(264.0f,369.0f) / 1024.0f, cCloudBackground ::Color2 * 0.9f},
{4u, coreVector2( 0.0f, 1024.0f - 1023.0f) / 1024.0f, coreVector2( 0.0f, 0.02f), coreVector2(372.0f,370.0f) / 1024.0f, cGrassBackground ::Color2 * 0.9f},
{5u, coreVector2( 0.0f, 1024.0f - 1023.0f) / 1024.0f, coreVector2( 0.0f, -0.01f), coreVector2(520.0f,647.0f) / 1024.0f, cSeaBackground ::Color2 * 0.9f},
{1u, coreVector2( 0.0f, 1024.0f - 516.0f) / 1024.0f, coreVector2( 0.01f, 0.0f), coreVector2(452.0f,517.0f) / 1024.0f, cDesertBackground ::Color2 * 0.9f},
{6u, coreVector2(439.0f, 1024.0f - 783.0f) / 1024.0f, coreVector2( 0.0f, 0.0f), coreVector2(588.0f,533.0f) / 1024.0f, cSpaceBackground ::Color2 * 0.9f},
{2u, coreVector2(252.0f, 1024.0f - 453.0f) / 1024.0f, coreVector2( 0.0f, 0.005f), coreVector2(524.0f,454.0f) / 1024.0f, cVolcanoBackground::Color2 * 0.9f},
{7u, coreVector2(378.0f, 1024.0f - 1023.0f) / 1024.0f, coreVector2( 0.0f, 0.01f), coreVector2(648.0f,329.0f) / 1024.0f, cSnowBackground ::Color2 * 0.9f},
{3u, coreVector2(638.0f, 1024.0f - 328.0f) / 1024.0f, coreVector2( 0.0f, -0.005f), coreVector2(388.0f,329.0f) / 1024.0f, cMossBackground ::Color2 * 0.9f},
{9u, coreVector2(250.0f, 1024.0f - 773.0f) / 1024.0f, coreVector2( 0.0f, 0.0f), coreVector2(524.0f,524.0f) / 1024.0f, coreVector3(0.7f,0.7f,0.7f)},
{0u, coreVector2(0.0f,0.0f), coreVector2( 0.0f, 0.0f), coreVector2(0.0f,0.0f), cDarkBackground ::Color2 * 0.9f}, // #
{0u, coreVector2(0.0f,0.0f), coreVector2( 0.0f, 0.0f), coreVector2(0.0f,0.0f), cDarkBackground ::Color2 * 0.9f} // #
};
static constexpr coreUintW g_aiFragmentOrder[] = {7u, 3u, 6u, 0u, 4u, 5u, 1u, 2u};
#define FRAGMENT_POSITION(x) (g_aFragmentData[x].vOffset + g_aFragmentData[x].vSize * 0.5f - 0.5f)
#define FRAGMENT_DIRECTION (coreVector2(1.0f,1.0f).Normalized())
STATIC_ASSERT(ARRAY_SIZE(g_aFragmentData) >= FRAGMENTS)
STATIC_ASSERT(ARRAY_SIZE(g_aFragmentData) == ARRAY_SIZE(g_aMissionData))
// ****************************************************************
// depth-level management
#define DEPTH_PUSH {g_pGame->PushDepthLevel(1u);}
#define DEPTH_PUSH_DOUBLE {g_pGame->PushDepthLevel(2u);}
#define DEPTH_PUSH_SHIP {g_pGame->PushDepthLevelShip();}
#define DEPTH_POP {g_pGame->PopDepthLevel(1u);}
#define __DEPTH_GROUP_SHIP {this->ChangeDepthLevel(8u, 10u);} // 2 levels, static
#define __DEPTH_GROUP_BOTTOM {m_iDepthDebug = 10u; m_iDepthLevel = 20u;} // 10 levels, dynamic, 3 in game
#define __DEPTH_GROUP_UNDER {} // shared with DEPTH_GROUP_BOTTOM
#define __DEPTH_GROUP_OVER {m_iDepthDebug = BIT(7u); m_iDepthLevel = 8u;} // 8 levels, dynamic, 3 in game (can use DEPTH_PUSH_SHIP)
#define __DEPTH_GROUP_TOP {m_iDepthDebug = 0u;} // shared with DEPTH_GROUP_OVER
#define __DEPTH_RESET {this->ChangeDepthLevel(0u, 20u);}
// ****************************************************************
// game class
class cGame final
{
private:
cPlayer m_aPlayer[GAME_PLAYERS]; // player objects
cHelper m_aHelper[GAME_HELPERS]; //
cTracker m_Tracker; //
cEnemyManager m_EnemyManager; // enemy manager
cBulletManager m_BulletManagerPlayer; // low-priority bullet manager
cBulletManager m_BulletManagerEnemy; // high-priority bullet manager
cItemManager m_ItemManager; //
cShieldManager m_ShieldManager; //
cCrashManager m_CrashManager; //
cExhaustManager m_ExhaustManager; //
cBulletManager m_BulletManagerPlayerTop;
cInterface m_Interface; // interface overlay
cCombatText m_CombatText; // combat text overlay
cRepairEnemy* m_pRepairEnemy; //
const coreInt32* m_piMissionList; // (should never be NULL)
coreUintW m_iNumMissions; //
cMission* m_pCurMission; // currently active mission (should never be NULL)
coreUintW m_iCurMissionIndex; //
cTimeTable m_TimeTable; //
coreFlow m_fTimeInOut; //
coreFlow m_fMusicFade; //
coreFloat m_fMusicSpeed; //
coreFloat m_fMusicVolume; //
coreFlow m_fHitDelay; //
coreFlow m_fVanishDelay; //
coreBool m_bDefeatDelay; //
coreUint8 m_iContinuesLeft; //
coreUint8 m_iContinuesMax; //
coreUint8 m_iRaise; //
coreUint8 m_iDepthLevel; //
coreUint8 m_iDepthDebug; //
coreUint8 m_iOutroType; //
coreUint8 m_iOutroSub; //
coreBool m_bRainbow; //
coreBool m_bVisibleCheck; //
coreUint8 m_iRepairMove; //
sGameOptions m_Options; //
coreUint16 m_iVersion; //
coreUint16 m_iStatus; //
public:
cGame(const sGameOptions oOptions, const coreInt32* piMissionList, const coreUintW iNumMissions)noexcept;
~cGame();
DISABLE_COPY(cGame)
// render and move the game
void Render();
void Move();
// render and move the overlay separately
void RenderOverlay();
void MoveOverlay();
//
void MoveAlways();
// control active mission
void LoadMissionID (const coreInt32 iID, const coreUint8 iTakeFrom = 0u, const coreUint8 iTakeTo = TAKE_MISSION);
void LoadMissionIndex(const coreUintW iIndex, const coreUint8 iTakeFrom = 0u, const coreUint8 iTakeTo = TAKE_MISSION);
void LoadNextMission();
void CloseMission();
//
void StartIntro();
void StartOutro(const coreUint8 iType, const coreUint8 iSub = 0u);
//
void FadeMusic(const coreFloat fSpeed);
void CancelFadeMusic();
inline void SetMusicVolume(const coreFloat fVolume) {m_fMusicVolume = fVolume;}
//
void PlayHitSound (const coreVector3 vPosition);
void PlayReflectSound(const coreVector3 vPosition);
void PlayVanishSound (const coreVector3 vPosition);
//
void UseContinue();
void UseNext();
void UseRestart();
//
void DisableMissionName();
//
void RepairPlayer();
//
void ChangeDepthLevel (const coreUint8 iLevelNear, const coreUint8 iLevelFar)const;
void PushDepthLevel (const coreUint8 iLevels);
void PushDepthLevelShip();
void PopDepthLevel (const coreUint8 iLevels);
//
coreVector3 CalculateCamShift()const;
//
#if 1
inline coreUint32 RaiseValue(const coreUint32 iValue)const {return iValue;}
#else
inline coreUint32 RaiseValue(const coreUint32 iValue)const {return (iValue * (100u + m_iRaise)) / (100u + GAME_RAISE_DEFAULT);}
#endif
//
inline void SetRainbow (const coreBool bCheck) {m_bRainbow = bCheck;}
inline void SetVisibleCheck(const coreBool bCheck) {m_bVisibleCheck = bCheck;}
inline void SetRepairMove (const coreUintW iIndex, const coreBool bMove) {ASSERT(iIndex < GAME_PLAYERS) SET_BIT(m_iRepairMove, iIndex, bMove)}
inline coreBool HasRepairMove(const coreUintW iIndex) {ASSERT(iIndex < GAME_PLAYERS) return HAS_BIT(m_iRepairMove, iIndex);}
//
inline void HideHelpers () {for(coreUintW i = 0u; i < GAME_HELPERS; ++i) if(m_aHelper[i].HasStatus(HELPER_STATUS_DEAD)) m_aHelper[i].SetPosition(coreVector3(HIDDEN_POS, 0.0f));}
inline void KillHelpers () {for(coreUintW i = 0u; i < GAME_HELPERS; ++i) m_aHelper[i].Kill(false);}
//inline void KillRepairEnemy() {if(m_pRepairEnemy->GetPlayer()) m_pRepairEnemy->TakeDamage(m_pRepairEnemy->GetCurHealth(), ELEMENT_NEUTRAL, coreVector2(0.0f,0.0f), NULL);}
//
void PrefetchBoss();
//
coreBool SkipLoadingBoss ()const;
coreBool SkipLoadingCache()const;
//
RETURN_NONNULL cPlayer* FindPlayerSide(const coreVector2 vPosition);
RETURN_NONNULL cPlayer* FindPlayerDual(const coreUintW iIndex);
template <typename F> FORCE_INLINE void ForEachPlayer (F&& nFunction); // [](cPlayer* OUTPUT pPlayer, const coreUintW i) -> void
template <typename F> FORCE_INLINE void ForEachPlayerAll(F&& nFunction); // [](cPlayer* OUTPUT pPlayer, const coreUintW i) -> void
//
inline coreBool IsMulti ()const {return (this->GetType () != GAME_TYPE_SOLO);}
inline coreBool IsCoop ()const {return (this->GetType () == GAME_TYPE_COOP);}
inline coreBool IsDuel ()const {return (this->GetType () == GAME_TYPE_DUEL);}
inline coreBool IsPacifist ()const {return (this->GetMode () == GAME_MODE_PACIFIST);}
inline coreBool IsMasochist()const {return (this->GetMode () == GAME_MODE_MASOCHIST);}
inline coreBool IsEasy ()const {return (this->GetDifficulty() == GAME_DIFFICULTY_EASY);}
inline coreBool IsHard ()const {return (this->GetDifficulty() == GAME_DIFFICULTY_HARD);}
inline coreBool IsTask ()const {return HAS_FLAG(this->GetFlags(), GAME_FLAG_TASK);}
inline coreBool IsTaskExtra()const {return HAS_FLAG(this->GetFlags(), GAME_FLAG_TASK_EXTRA);}
inline coreBool IsFragment ()const {return HAS_FLAG(this->GetFlags(), GAME_FLAG_FRAGMENT);}
inline coreBool IsVersion (const coreUint16 iVersion)const {return (this->GetVersion () >= iVersion);}
//
inline coreUintW GetPlayerIndex(const cPlayer* pPlayer)const {ASSERT(pPlayer) return (pPlayer - &m_aPlayer[0]);}
coreBool IsAlone()const;
// access game objects
inline cPlayer* GetPlayer (const coreUintW iIndex) {ASSERT(iIndex < GAME_PLAYERS) return &m_aPlayer[iIndex];}
inline cHelper* GetHelper (const coreUint8 iElement) {ASSERT(iElement - ELEMENT_WHITE < GAME_HELPERS) return &m_aHelper[iElement - ELEMENT_WHITE];}
inline cTracker* GetTracker () {return &m_Tracker;}
inline cEnemyManager* GetEnemyManager () {return &m_EnemyManager;}
inline cBulletManager* GetBulletManagerPlayer() {return &m_BulletManagerPlayer;}
inline cBulletManager* GetBulletManagerEnemy () {return &m_BulletManagerEnemy;}
inline cItemManager* GetItemManager () {return &m_ItemManager;}
inline cShieldManager* GetShieldManager () {return &m_ShieldManager;}
inline cCrashManager* GetCrashManager () {return &m_CrashManager;}
inline cExhaustManager* GetExhaustManager () {return &m_ExhaustManager;}
inline cInterface* GetInterface () {return &m_Interface;}
inline cCombatText* GetCombatText () {return &m_CombatText;}
inline cRepairEnemy* GetRepairEnemy ()const {ASSERT(m_pRepairEnemy) return m_pRepairEnemy;}
inline cMission* GetCurMission ()const {ASSERT(m_pCurMission) return m_pCurMission;}
inline const coreUintW& GetCurMissionIndex ()const {return m_iCurMissionIndex;}
inline cTimeTable* GetTimeTable () {return &m_TimeTable;}
inline cBulletManager* GetBulletManagerPlayerTop() {return &m_BulletManagerPlayerTop;}
// get object properties
inline coreUint8 GetNumPlayers ()const {return this->IsMulti() ? GAME_PLAYERS : 1u;}
inline const coreInt32* GetMissionList ()const {ASSERT(m_piMissionList) return m_piMissionList;}
inline const coreUintW& GetNumMissions ()const {return m_iNumMissions;}
inline const coreUint8& GetContinuesLeft()const {return m_iContinuesLeft;}
inline const coreUint8& GetContinuesMax ()const {return m_iContinuesMax;}
inline coreUint8 GetContinuesCur ()const {return m_iContinuesMax - m_iContinuesLeft;}
inline const coreUint8& GetRaise ()const {return m_iRaise;}
inline const coreUint8& GetOutroType ()const {return m_iOutroType;}
inline const coreBool& GetRainbow ()const {return m_bRainbow;}
inline const sGameOptions& GetOptions ()const {return m_Options;}
inline const coreUint8& GetKind ()const {return m_Options.iKind;}
inline const coreUint8& GetType ()const {return m_Options.iType;}
inline const coreUint8& GetMode ()const {return m_Options.iMode;}
inline const coreUint8& GetDifficulty ()const {return m_Options.iDifficulty;}
inline const coreUint8& GetFlags ()const {return m_Options.iFlags;}
inline const coreUint16& GetVersion ()const {return m_iVersion;}
inline const coreUint16& GetStatus ()const {return m_iStatus;}
//
static coreUint8 CalcMedal (const coreFloat fTime, const coreFloat* pfMedalGoal);
static coreFloat CalcMedalTime (const coreFloat fTime, const coreFloat* pfMedalGoal);
static coreFloat CalcMedalMiss (const coreFloat fTime, const coreFloat* pfMedalGoal);
static coreUint32 CalcBonusTime (const coreFloat fTime, const coreFloat* pfMedalGoal);
static coreUint32 CalcBonusMedal (const coreUint8 iMedal);
static coreUint32 CalcBonusBadge (const coreUint8 iBadge);
static coreUint32 CalcBonusSurvive(const coreUint32 iDamageTaken, const coreBool bWasDead);
//
static coreUint8 CalcRaiseSpeed (const coreUint8 iValue);
static coreUint8 CalcRaiseShield(const coreUint8 iValue);
private:
//
coreBool __HandleIntro();
coreBool __HandleOutro();
void __HandleDefeat();
void __HandleCollisions();
void __HandleRainbow();
//
void __ClearAll(const coreBool bAnimated);
};
// ****************************************************************
//
template <typename F> FORCE_INLINE void cGame::ForEachPlayer(F&& nFunction)
{
//
for(coreUintW i = 0u, ie = this->GetNumPlayers(); i < ie; ++i)
{
cPlayer* pPlayer = &m_aPlayer[i];
if(pPlayer->HasStatus(PLAYER_STATUS_DEAD)) continue;
//
nFunction(pPlayer, i);
}
}
// ****************************************************************
//
template <typename F> FORCE_INLINE void cGame::ForEachPlayerAll(F&& nFunction)
{
//
for(coreUintW i = 0u, ie = this->GetNumPlayers(); i < ie; ++i)
{
//
nFunction(&m_aPlayer[i], i);
}
}
#endif // _P1_GUARD_GAME_H_