68 lines
2.0 KiB
Ucode
68 lines
2.0 KiB
Ucode
class ICCME_GameStateBase extends Object
|
|
abstract;
|
|
|
|
// Interface definition
|
|
function ICCME_EventListenerBase API_AddEventListeners(class<ICCME_EventListenerBase> TEventListener);
|
|
function API_AddCustomPostEvent(ICCME_Event_CustomBase Event);
|
|
function API_CheckEndGame(optional bool ForceEndGame);
|
|
function ICCME_Stats_Player API_GetPlayerStats(int PlayerIdx);
|
|
function int API_GetNbPlayer();
|
|
function ICCME_Stats_Flag API_GetFlagStats(int TeamIdx);
|
|
function int API_GetNbFlag();
|
|
|
|
// Static helpers libs
|
|
static function ICCME_GameStateBase GetInstance(LevelInfo BaseLevel)
|
|
{
|
|
local ICCME_MutBase A_ICCME_Mut;
|
|
local Mutator MNext;
|
|
local int nBInstances;
|
|
|
|
nBInstances = 0;
|
|
MNext=BaseLevel.Game.BaseMutator;
|
|
while(MNext!=None)
|
|
{
|
|
if(ICCME_MutBase(MNext)!=None)
|
|
{
|
|
A_ICCME_Mut=ICCME_MutBase(MNext);
|
|
nBInstances++;
|
|
}
|
|
MNext=MNext.NextMutator;
|
|
}
|
|
|
|
if(nBInstances>1)
|
|
{
|
|
Warn("===========================================================");
|
|
Warn("Found Multiple instance of CCME_Mut...");
|
|
Warn("This is not supported, Check your installation / config");
|
|
Warn("Loading Aborded");
|
|
Warn("===========================================================");
|
|
DisplayHelp();
|
|
|
|
return None;
|
|
}
|
|
|
|
if(A_ICCME_Mut!=None)
|
|
{
|
|
return A_ICCME_Mut.GetInstance();
|
|
}
|
|
|
|
Warn("===========================================================");
|
|
Warn("!! Can not found CCME_Mut :-/ !!");
|
|
Warn("Loading Aborded");
|
|
Warn("===========================================================");
|
|
DisplayHelp();
|
|
|
|
return None;
|
|
}
|
|
|
|
static function DisplayHelp()
|
|
{
|
|
Warn("===========================================================");
|
|
Warn("!! ChaChaMutEngine Installation Reminder");
|
|
Warn("IChaChaMutEngineVx in ServerPackages");
|
|
Warn("ChaChaMutEngineV<x>_<y>_<z> in ServerPackages");
|
|
Warn("ChaChaMutEngineV<x>_<y>_<z>.CCME_Mut in Mutator list");
|
|
Warn("<x> must match on both IChaChaMutEngine and ChaChaMutEngine");
|
|
Warn("=> DO NOT load ChaChaMutEngineVx_y_z.CCME_Mut as an Actor !");
|
|
Warn("===========================================================");
|
|
} |