RType
Public Member Functions | Protected Attributes | List of all members
AScene Class Reference

#include <AScene.hpp>

Inheritance diagram for AScene:
Inheritance graph
[legend]
Collaboration diagram for AScene:
Collaboration graph
[legend]

Public Member Functions

 AScene (ClientCore *clientCore)
 AScene, constructor of AScene. More...
 
 ~AScene () override=default
 ~AScene, destructor of AScene More...
 
void addComponent (std::shared_ptr< IComponent > component) override
 addComponent, add a component More...
 
std::vector< std::shared_ptr< IComponent > > getComponents () override
 getComponents, get all the components More...
 
void display (sf::RenderWindow &window) override
 display, display the scene More...
 
void handleEvent (const sf::Event &event, sf::RenderWindow &window) override
 handleEvent, handle the event More...
 
void update () override
 update, update the scene More...
 
void pauseScene () override
 pauseScene, pause the scene More...
 
void resumeScene () override
 resumeScene, resume the scene More...
 
void stopScene () override
 stopScene, stop the scene More...
 
 AScene (std::shared_ptr< ServerSocket > serverSocket)
 Construct a new AScene:: AScene object. More...
 
 ~AScene () override=default
 Destroy the AScene:: AScene object. More...
 
void addEntity (std::shared_ptr< IEntity > entity) override
 addEntity, add an entity More...
 
std::vector< std::shared_ptr< IEntity > > getEntities () override
 getEntities, get the entities More...
 
void addService (std::shared_ptr< IService > service) override
 addService, add a service More...
 
std::vector< std::shared_ptr< IService > > getServices () override
 getServices, get the services More...
 
void display () override
 display, display the scene More...
 
void pauseScene () override
 pauseScene, pause the scene More...
 
void resumeScene () override
 resumeScene, resume the scene More...
 
void stopScene () override
 stopScene, stop the scene More...
 
void restartScene () override
 restartScene, restart the scene More...
 
void sendGameState (int clientID) override
 sendGameState, send the game state More...
 
void broadcastGameState () override
 broadcastGameState, broadcast the game state More...
 
- Public Member Functions inherited from IScene
 IScene (ClientCore *clientCore)
 IScene, constructor of IScene. More...
 
virtual ~IScene ()=default
 ~IScene, destructor of IScene More...
 
virtual void receiveData ()=0
 receiveData, receive the data More...
 
- Public Member Functions inherited from ISceneRType
virtual ~ISceneRType ()=default
 Construct a new IScene:: IScene object. More...
 
virtual void update (std::shared_ptr< Event > event, std::shared_ptr< Packet > packet)=0
 update, update the scene More...
 
virtual void initEntities ()=0
 initEntities, init the entities More...
 
virtual void initServices ()=0
 initServices, init the services More...
 

Protected Attributes

std::vector< std::shared_ptr< IComponent > > _components
 
- Protected Attributes inherited from IScene
ClientCore_clientCore
 
timeval _pingTime {}
 
- Protected Attributes inherited from ISceneRType
std::vector< std::shared_ptr< IEntity > > _entities
 
std::vector< std::shared_ptr< IService > > _services
 
std::shared_ptr< ServerSocket_serverSocket
 

Additional Inherited Members

- Public Attributes inherited from IScene
bool continueScene = true
 

Detailed Description

Definition at line 12 of file AScene.hpp.

Constructor & Destructor Documentation

◆ AScene() [1/2]

AScene::AScene ( ClientCore clientCore)
inlineexplicit

AScene, constructor of AScene.

Parameters
clientCore

Definition at line 21 of file AScene.hpp.

References IScene::IScene().

Referenced by GameScene::GameScene(), MainScene::MainScene(), and MenuScene::MenuScene().

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

◆ ~AScene() [1/2]

AScene::~AScene ( )
overridedefault

~AScene, destructor of AScene

◆ AScene() [2/2]

AScene::AScene ( std::shared_ptr< ServerSocket serverSocket)
explicit

Construct a new AScene:: AScene object.

Parameters
serverSocket

Definition at line 16 of file AScene.cpp.

◆ ~AScene() [2/2]

AScene::~AScene ( )
overridedefault

Destroy the AScene:: AScene object.

Member Function Documentation

◆ addComponent()

void AScene::addComponent ( std::shared_ptr< IComponent component)
overridevirtual

addComponent, add a component

addComponent, add a component to the scene

Parameters
component

Implements IScene.

Definition at line 14 of file AScene.cpp.

◆ addEntity()

void AScene::addEntity ( std::shared_ptr< IEntity entity)
overridevirtual

addEntity, add an entity

Parameters
entity

Implements ISceneRType.

Definition at line 25 of file AScene.cpp.

◆ addService()

void AScene::addService ( std::shared_ptr< IService service)
overridevirtual

addService, add a service

Parameters
service

Implements ISceneRType.

Definition at line 43 of file AScene.cpp.

◆ broadcastGameState()

void AScene::broadcastGameState ( )
overridevirtual

broadcastGameState, broadcast the game state

Implements ISceneRType.

Definition at line 119 of file AScene.cpp.

Referenced by LobbyScene::checkSpawnerActivation(), and LobbyScene::update().

Here is the caller graph for this function:

◆ display() [1/2]

void AScene::display ( )
overridevirtual

display, display the scene

Implements ISceneRType.

Definition at line 57 of file AScene.cpp.

◆ display() [2/2]

void AScene::display ( sf::RenderWindow &  window)
overridevirtual

display, display the scene

Parameters
window

Implements IScene.

Definition at line 32 of file AScene.cpp.

◆ getComponents()

std::vector< std::shared_ptr< IComponent > > AScene::getComponents ( )
overridevirtual

getComponents, get all the components

getComponents, get all the components of the scene

Returns
std::vector<std::shared_ptr<IComponent>>

Implements IScene.

Definition at line 23 of file AScene.cpp.

◆ getEntities()

std::vector< std::shared_ptr< IEntity > > AScene::getEntities ( )
overridevirtual

getEntities, get the entities

Returns
entities (std::vector<std::shared_ptr<IEntity>>)

Implements ISceneRType.

Definition at line 34 of file AScene.cpp.

◆ getServices()

std::vector< std::shared_ptr< IService > > AScene::getServices ( )
overridevirtual

getServices, get the services

Returns
services (std::vector<std::shared_ptr<IService>>)

Implements ISceneRType.

Definition at line 52 of file AScene.cpp.

◆ handleEvent()

void AScene::handleEvent ( const sf::Event event,
sf::RenderWindow &  window 
)
overridevirtual

handleEvent, handle the event

Parameters
event
window

Implements IScene.

Definition at line 48 of file AScene.cpp.

◆ pauseScene() [1/2]

void AScene::pauseScene ( )
overridevirtual

pauseScene, pause the scene

Implements IScene.

Definition at line 58 of file AScene.cpp.

◆ pauseScene() [2/2]

void AScene::pauseScene ( )
overridevirtual

pauseScene, pause the scene

Implements IScene.

◆ restartScene()

void AScene::restartScene ( )
overridevirtual

restartScene, restart the scene

Implements ISceneRType.

Definition at line 76 of file AScene.cpp.

References ISceneRType::initEntities(), and ISceneRType::initServices().

Here is the call graph for this function:

◆ resumeScene() [1/2]

void AScene::resumeScene ( )
overridevirtual

resumeScene, resume the scene

Implements IScene.

Definition at line 73 of file AScene.cpp.

◆ resumeScene() [2/2]

void AScene::resumeScene ( )
overridevirtual

resumeScene, resume the scene

Implements IScene.

◆ sendGameState()

void AScene::sendGameState ( int  clientID)
overridevirtual

sendGameState, send the game state

sedGameState, send the game state

Parameters
clientID

Implements ISceneRType.

Definition at line 88 of file AScene.cpp.

Referenced by LobbyScene::update().

Here is the caller graph for this function:

◆ stopScene() [1/2]

void AScene::stopScene ( )
overridevirtual

stopScene, stop the scene

Implements IScene.

Definition at line 88 of file AScene.cpp.

◆ stopScene() [2/2]

void AScene::stopScene ( )
overridevirtual

stopScene, stop the scene

Implements IScene.

◆ update()

void AScene::update ( )
overridevirtual

update, update the scene

Implements IScene.

Definition at line 39 of file AScene.cpp.

Member Data Documentation

◆ _components

std::vector<std::shared_ptr<IComponent> > AScene::_components
protected

Definition at line 82 of file AScene.hpp.


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