/
gamerules.h
50 lines (42 loc) · 1.76 KB
/
gamerules.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
#ifndef _INCLUDE_COMPCTRL_GAMERULES_H_
#define _INCLUDE_COMPCTRL_GAMERULES_H_
#include "extension.h"
class GameRulesManager
{
// management
public:
void Enable();
void Disable();
bool IsRunning() { return m_hooksSetup && m_hooksEnabled; }
// calls
public:
void Call_CTFGameRules_SetWinningTeam(int team, int iWinReason, bool bForceMapReset = true, bool bSwitchTeams = false, bool bDontAddScore = false, bool bFinal = false);
void Call_CTFGameRules_SetStalemate(int iReason, bool bForceMapReset = true, bool bSwitchTeams = false);
void Call_CTFGameRules_HandleSwitchTeams();
// hooks
public:
void Hook_CTFGameRules_SetWinningTeam(int team, int iWinReason, bool bForceMapReset = true, bool bSwitchTeams = false, bool bDontAddScore = false, bool bFinal = false);
void Hook_CTFGameRules_SetStalemate(int iReason, bool bForceMapReset = true, bool bSwitchTeams = false);
void Hook_CTFGameRules_HandleSwitchTeams();
void Hook_CTFGameRules_BetweenRounds_Start();
void Hook_CTFGameRules_BetweenRounds_End();
void Hook_CTFGameRules_BetweenRounds_Think();
void Hook_CTFGameRules_RestartTournament();
bool Hook_CTFGameRules_CheckWinLimit(bool bAllowEnd = true, int iIncrementScores = 0);
private:
bool m_hooksSetup;
bool m_hooksEnabled;
int m_setWinningTeamHook;
int m_setStalemateHook;
int m_handleSwitchTeamsHook;
int m_betweenRoundsStartHook;
int m_betweenRoundsEndHook;
int m_betweenRoundsThinkHook;
int m_restartTournamentHook;
int m_checkWinLimitHook;
};
cell_t CompCtrl_SetWinningTeam(IPluginContext *pContext, const cell_t *params);
cell_t CompCtrl_SetStalemate(IPluginContext *pContext, const cell_t *params);
cell_t CompCtrl_SwitchTeams(IPluginContext *pContext, const cell_t *params);
extern GameRulesManager g_GameRulesManager;
#endif //_INCLUDE_COMPCTRL_GAMERULES_H_