added command line, added basic character
This commit is contained in:
64
engine/gamemode.cpp
Normal file
64
engine/gamemode.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "gamemode.h"
|
||||
#include "playerstart.h"
|
||||
#include "tier1/utlvector.h"
|
||||
|
||||
CGameMode *pCurrentMode = NULL;
|
||||
|
||||
void CGameMode::RoundBegin( void )
|
||||
{
|
||||
size_t i = 0;
|
||||
for (auto &start: g_PlayerStarts)
|
||||
{
|
||||
start->RoundEnd();
|
||||
}
|
||||
for (auto &player: g_clients)
|
||||
{
|
||||
CPlayerStart *pSelectedStart = NULL;
|
||||
for (auto &start: g_PlayerStarts)
|
||||
{
|
||||
if (start->m_bIsRunning == false)
|
||||
pSelectedStart = start;
|
||||
};
|
||||
pSelectedStart->RoundStart(player);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void CGameMode::RoundEnd( void )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IGameModeManager::Init( void )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void IGameModeManager::Frame( void )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void IGameModeManager::StartGameMode(CGameMode *pGameMode)
|
||||
{
|
||||
if (pCurrentMode)
|
||||
pCurrentMode->RoundEnd();
|
||||
pCurrentMode = pGameMode;
|
||||
if (pCurrentMode)
|
||||
pCurrentMode->RoundBegin();
|
||||
}
|
||||
|
||||
CGameMode *IGameModeManager::GetCurrentMode( void )
|
||||
{
|
||||
return pCurrentMode;
|
||||
}
|
||||
|
||||
void IGameModeManager::RestartCurrentMode( void )
|
||||
{
|
||||
if (!pCurrentMode)
|
||||
return;
|
||||
pCurrentMode->RoundEnd();
|
||||
pCurrentMode->RoundBegin();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user