3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.IGame Class Referenceabstract

Base interface for a game class. More...

#include <IGame.hpp>

Inheritance diagram for Engine3DRadSpace.IGame:

Public Member Functions

void Exit ()
void AppendScene (string path)
template<Service S>
void AddService (S *service)
 Adds an service to this game. The service must be derived from IService.
IService * GetService (const std::type_index &type)
 Gets the service of the given type. If the service is not found, nullptr is returned.
template<Service S>
S * GetService (Tag< S > dummy)
 Gets the service of type S. If the service is not found, nullptr is returned.
virtual IService * RequireService (const std::type_index &type)
 Requires a service of the given type. If the service is not found, it is attempted to be created.
template<Service S>
S * RequireService (Tag< S > dummy)
 Requires a service of type S. If the service is not found, it is attempted to be created.
virtual void Exit ()=0
 Exits the game.
std::unordered_map< std::type_index, IService * >::iterator begin ()
 Begin iterator for services in the game.
std::unordered_map< std::type_index, IService * >::iterator end ()
 End iterator for services in the game.
virtual bool WasInitialized () const noexcept=0
 Was ::Initialized() called on this instance?
virtual bool WasLoaded () const noexcept=0
 Was ::Load() called on this instance?
virtual bool IsEditor () const noexcept=0
 Is this game instance an editor?
virtual void AppendScene (const std::filesystem::path &path)=0
virtual ~IGame ()=default

Protected Member Functions

 IGame ()=default
 IGame (const IGame &)=delete
IGame & operator= (const IGame &)=delete
 IGame (IGame &&) noexcept=default
IGame & operator= (IGame &&) noexcept=default

Protected Attributes

std::unordered_map< std::type_index, IService * > _services

Properties

bool WasInitialized [get]
bool WasLoaded [get]

Detailed Description

Base interface for a game class.

Constructor & Destructor Documentation

◆ IGame() [1/3]

Engine3DRadSpace.IGame.IGame ( )
protecteddefault

◆ IGame() [2/3]

Engine3DRadSpace.IGame.IGame ( const IGame & )
protecteddelete

◆ IGame() [3/3]

Engine3DRadSpace.IGame.IGame ( IGame && )
protecteddefaultnoexcept

◆ ~IGame()

virtual Engine3DRadSpace.IGame.~IGame ( )
virtualdefault

Member Function Documentation

◆ AddService()

template<Service S>
void Engine3DRadSpace.IGame.AddService ( S * service)
inline

Adds an service to this game. The service must be derived from IService.

Template Parameters
SType of the service to add.
Parameters
servicePointer to the service to add.

◆ AppendScene() [1/2]

void Engine3DRadSpace.IGame.AppendScene ( string path)

◆ AppendScene() [2/2]

virtual void Engine3DRadSpace.IGame.AppendScene ( const std::filesystem::path & path)
pure virtual

Implemented in Engine3DRadSpace.Game.

◆ begin()

std::unordered_map< std::type_index, IService * >::iterator IGame::begin ( )

Begin iterator for services in the game.

Returns
_services.begin()

◆ end()

std::unordered_map< std::type_index, IService * >::iterator IGame::end ( )

End iterator for services in the game.

Returns
_services.end()

◆ Exit() [1/2]

void Engine3DRadSpace.IGame.Exit ( )

◆ Exit() [2/2]

virtual void Engine3DRadSpace.IGame.Exit ( )
pure virtual

Exits the game.

Implemented in Engine3DRadSpace.Game, and Engine3DRadSpace.InstIGame.

◆ GetService() [1/2]

IService * IGame::GetService ( const std::type_index & type)

Gets the service of the given type. If the service is not found, nullptr is returned.

Parameters
typeType of the service to get.
Returns
Pointer to the service of the given type, or nullptr if not found.

◆ GetService() [2/2]

template<Service S>
S * Engine3DRadSpace.IGame.GetService ( Tag< S > dummy)
inline

Gets the service of type S. If the service is not found, nullptr is returned.

Template Parameters
SType of the service to get.
Parameters
dummyA dummy parameter to deduce the type S.
Returns
Pointer to the service of type S, or nullptr if not found.

◆ IsEditor()

virtual bool Engine3DRadSpace.IGame.IsEditor ( ) const
pure virtualnoexcept

Is this game instance an editor?

Returns
True if this instance is an editor.

summary> Appends a scene to the game.

Parameters
pathPath to the scene to append.

Implemented in EditorGame, and Engine3DRadSpace.Game.

◆ operator=() [1/2]

IGame & Engine3DRadSpace.IGame.operator= ( const IGame & )
protecteddelete

◆ operator=() [2/2]

IGame & Engine3DRadSpace.IGame.operator= ( IGame && )
protecteddefaultnoexcept

◆ RequireService() [1/2]

IService * IGame::RequireService ( const std::type_index & type)
virtual

Requires a service of the given type. If the service is not found, it is attempted to be created.

Parameters
typeType of the service to require.
Returns
Pointer to the service of the given type.

Reimplemented in Engine3DRadSpace.Game.

◆ RequireService() [2/2]

template<Service S>
S * Engine3DRadSpace.IGame.RequireService ( Tag< S > dummy)
inline

Requires a service of type S. If the service is not found, it is attempted to be created.

Template Parameters
SType of the service to require.
Returns
Pointer to the service of type S.

◆ WasInitialized()

virtual bool Engine3DRadSpace.IGame.WasInitialized ( ) const
pure virtualnoexcept

Was ::Initialized() called on this instance?

Returns
Was ::Initialized() called on this instance.

Implemented in Engine3DRadSpace.Game.

◆ WasLoaded()

virtual bool Engine3DRadSpace.IGame.WasLoaded ( ) const
pure virtualnoexcept

Was ::Load() called on this instance?

Returns
Was ::Load() called on this instance.

Implemented in Engine3DRadSpace.Game.

Member Data Documentation

◆ _services

std::unordered_map<std::type_index, IService*> Engine3DRadSpace.IGame._services
protected

Property Documentation

◆ WasInitialized

bool Engine3DRadSpace.IGame.WasInitialized
get

◆ WasLoaded

bool Engine3DRadSpace.IGame.WasLoaded
get

The documentation for this class was generated from the following files:
  • E:/3DRadSpace/3DRadSpace_CSharp/IGame.cs
  • E:/3DRadSpace/Engine3DRadSpace/Core/IGame.hpp
  • E:/3DRadSpace/Engine3DRadSpace/Core/IGame.cpp