added command line, added basic character

This commit is contained in:
2025-06-12 00:17:59 +03:00
parent 64c0f41884
commit af4f0c3cad
65 changed files with 262985 additions and 304 deletions

64
engine/gamemode.cpp Normal file
View 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();
}