Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
VideoGame Class Reference

#include <VideoGame.h>

+ Collaboration diagram for VideoGame:

Public Member Functions

 VideoGame ()
 
virtual ~VideoGame ()
 
void SetState (GameState s)
 
GameState GetState () const
 
bool IsPaused () const
 
void Pause ()
 
void Resume ()
 
void RequestQuit ()
 
void SetViewportLayout (short playerID)
 
EntityID AddPlayerEntity (string _playerPrefabName="Player")
 
bool RemovePlayerEntity (const EntityID eid)
 
void RegisterLoadedPlayerEntity (EntityID entity)
 
bool IsInputDeviceAvailable () const
 
bool SaveGame (int slot=0)
 
bool LoadGame (int slot=0)
 
virtual void RegisterPrefabItems ()
 
void InitializeAITestScene ()
 

Static Public Member Functions

static VideoGameGetInstance ()
 
static VideoGameGet ()
 

Public Attributes

Worldworld = World::GetInstance()
 
GameRulesgamerules = GameRules::GetInstance()
 
GameMenugamemenu = GameMenu::GetInstance()
 
QuestManagerquestmanager = QuestManager::GetInstance()
 
ViewportManagerviewport = ViewportManager::GetInstance()
 
std::vector< EntityIDm_playersEntity
 

Static Public Attributes

static short m_playerIdCounter = 0
 

Private Attributes

string name
 
GameState m_state = GameState::GameState_Running
 

Detailed Description

Definition at line 21 of file VideoGame.h.

Constructor & Destructor Documentation

◆ VideoGame()

VideoGame::VideoGame ( )

◆ ~VideoGame()

VideoGame::~VideoGame ( )
virtual

Definition at line 41 of file VideoGame.cpp.

References SYSTEM_LOG.

Member Function Documentation

◆ AddPlayerEntity()

EntityID VideoGame::AddPlayerEntity ( string  _playerPrefabName = "Player")

◆ Get()

static VideoGame & VideoGame::Get ( )
inlinestatic

Definition at line 34 of file VideoGame.h.

References GetInstance().

Referenced by GameMenu::Activate(), GameMenu::Deactivate(), World::InstantiateEntity(), GameEventConsumeSystem::Process(), World::RegisterPlayerEntity(), and GameMenu::ValidateSelection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInstance()

static VideoGame & VideoGame::GetInstance ( )
inlinestatic

Definition at line 29 of file VideoGame.h.

References GetComponentTypeID_Static().

Referenced by Get(), and GameEngine::Initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetState()

GameState VideoGame::GetState ( ) const
inline

Definition at line 43 of file VideoGame.h.

References GameStateManager::GetState().

+ Here is the call graph for this function:

◆ InitializeAITestScene()

void VideoGame::InitializeAITestScene ( )

Definition at line 579 of file VideoGame.cpp.

References VisualSprite_data::color, PrefabFactory::CreateEntity(), PrefabFactory::Get(), World::Get(), World::GetComponent(), GetComponentTypeID_Static(), INVALID_ENTITY_ID, Identity_data::isPersistent, and Position_data::position.

Referenced by VideoGame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsInputDeviceAvailable()

bool VideoGame::IsInputDeviceAvailable ( ) const

Definition at line 152 of file VideoGame.cpp.

References InputsManager::Get(), InputsManager::GetAvailableJoystickCount(), GetComponentTypeID_Static(), and InputsManager::IsKeyboardAssigned().

Referenced by AddPlayerEntity(), and RegisterLoadedPlayerEntity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsPaused()

bool VideoGame::IsPaused ( ) const
inline

Definition at line 44 of file VideoGame.h.

References GameStateManager::IsPaused().

+ Here is the call graph for this function:

◆ LoadGame()

bool VideoGame::LoadGame ( int  slot = 0)
inline

Definition at line 64 of file VideoGame.h.

Referenced by GameEventConsumeSystem::Process().

+ Here is the caller graph for this function:

◆ Pause()

void VideoGame::Pause ( )
inline

Definition at line 46 of file VideoGame.h.

References GameState_Paused, and SetState().

Referenced by GameMenu::Activate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterLoadedPlayerEntity()

void VideoGame::RegisterLoadedPlayerEntity ( EntityID  entity)

◆ RegisterPrefabItems()

void VideoGame::RegisterPrefabItems ( )
virtual

Definition at line 295 of file VideoGame.cpp.

Referenced by VideoGame().

+ Here is the caller graph for this function:

◆ RemovePlayerEntity()

bool VideoGame::RemovePlayerEntity ( const EntityID  eid)

Definition at line 147 of file VideoGame.cpp.

◆ RequestQuit()

void VideoGame::RequestQuit ( )
inline

Definition at line 48 of file VideoGame.h.

References GameState_Quit, and SetState().

Referenced by GameMenu::ValidateSelection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Resume()

void VideoGame::Resume ( )
inline

Definition at line 47 of file VideoGame.h.

References GameState_Running, and SetState().

Referenced by GameMenu::Deactivate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveGame()

bool VideoGame::SaveGame ( int  slot = 0)
inline

Definition at line 63 of file VideoGame.h.

◆ SetState()

void VideoGame::SetState ( GameState  s)
inline

Definition at line 38 of file VideoGame.h.

References GetComponentTypeID_Static(), m_state, and GameStateManager::SetState().

Referenced by Pause(), RequestQuit(), and Resume().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetViewportLayout()

void VideoGame::SetViewportLayout ( short  playerID)

Member Data Documentation

◆ gamemenu

GameMenu& VideoGame::gamemenu = GameMenu::GetInstance()

Definition at line 86 of file VideoGame.h.

◆ gamerules

GameRules& VideoGame::gamerules = GameRules::GetInstance()

Definition at line 85 of file VideoGame.h.

◆ m_playerIdCounter

short VideoGame::m_playerIdCounter = 0
static

◆ m_playersEntity

std::vector<EntityID> VideoGame::m_playersEntity

Definition at line 91 of file VideoGame.h.

Referenced by AddPlayerEntity(), RegisterLoadedPlayerEntity(), and SetViewportLayout().

◆ m_state

GameState VideoGame::m_state = GameState::GameState_Running
private

Definition at line 97 of file VideoGame.h.

Referenced by SetState().

◆ name

string VideoGame::name
private

Definition at line 95 of file VideoGame.h.

Referenced by VideoGame().

◆ questmanager

QuestManager& VideoGame::questmanager = QuestManager::GetInstance()

Definition at line 87 of file VideoGame.h.

◆ viewport

Definition at line 88 of file VideoGame.h.

Referenced by SetViewportLayout(), and VideoGame().

◆ world

World& VideoGame::world = World::GetInstance()

Definition at line 84 of file VideoGame.h.

Referenced by AddPlayerEntity(), and RegisterLoadedPlayerEntity().


The documentation for this class was generated from the following files: