RType
Public Member Functions | List of all members
GameScene Class Reference

#include <GameScene.hpp>

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

Public Member Functions

 GameScene (ClientCore *clientCore, std::shared_ptr< ClientSocket > socket)
 GameScene, constructor of GameScene. More...
 
 ~GameScene () override=default
 ~GameScene, destructor of GameScene More...
 
void init_scene ()
 init_scene, init the scene More...
 
void handleEvent (const sf::Event &event, sf::RenderWindow &window) override
 handleEvent, handle the event More...
 
void receiveData () override
 receiveData, receive the data More...
 
sf::Texture getTextureByType (Type type) const
 getTextureByType, get the texture by type More...
 
void initTextures ()
 initTextures, init the textures More...
 
- Public Member Functions inherited from AScene
 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...
 
- 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...
 

Additional Inherited Members

- Public Attributes inherited from IScene
bool continueScene = true
 
- Protected Attributes inherited from AScene
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
 

Detailed Description

Definition at line 15 of file GameScene.hpp.

Constructor & Destructor Documentation

◆ GameScene()

GameScene::GameScene ( ClientCore clientCore,
std::shared_ptr< ClientSocket socket 
)

GameScene, constructor of GameScene.

Construct a new Game Scene:: Game Scene object.

Parameters
clientCore
socket

Definition at line 21 of file GameScene.cpp.

References AScene::AScene(), GameScene(), init_scene(), and initTextures().

Referenced by GameScene().

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

◆ ~GameScene()

GameScene::~GameScene ( )
overridedefault

~GameScene, destructor of GameScene

Member Function Documentation

◆ getTextureByType()

sf::Texture GameScene::getTextureByType ( Type  type) const

getTextureByType, get the texture by type

Parameters
type
type
Returns
texture of the type

Definition at line 281 of file GameScene.cpp.

◆ handleEvent()

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

handleEvent, handle the event

Parameters
event
window

Implements IScene.

Definition at line 322 of file GameScene.cpp.

References IScene::_clientCore, packet::code, packet::data, packet::data_size, EVENT, MESSAGE, and ClientCore::setCurrentScene().

Here is the call graph for this function:

◆ init_scene()

void GameScene::init_scene ( )

init_scene, init the scene

Definition at line 32 of file GameScene.cpp.

Referenced by GameScene().

Here is the caller graph for this function:

◆ initTextures()

void GameScene::initTextures ( )

initTextures, init the textures

Definition at line 289 of file GameScene.cpp.

Referenced by GameScene().

Here is the caller graph for this function:

◆ receiveData()

void GameScene::receiveData ( )
overridevirtual

receiveData, receive the data

receiveData, receive data from the server

Implements IScene.

Definition at line 76 of file GameScene.cpp.

References IScene::_pingTime.


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