My Project
Public Member Functions | List of all members
Client Class Reference

The Client class, it defines a client and its interactions with the server. More...

#include <Client.hpp>

Public Member Functions

 Client (std::map< std::string, std::string > &configurationFiles)
 Construct a new Client object. More...
 
 ~Client ()
 Destroy the Client object.
 
void setUpEcs ()
 Set the Up Ecs object.
 
void setUpSystems ()
 Set the Up Systems object.
 
void setUpComponents ()
 Set the Up Components object.
 
void machineRun ()
 A method to launch the core features of a client.
 
void tryToConnect ()
 A method to try to connect to a target server.
 
void disconnect ()
 A method to call juste before a client is deconected.
 
void loadButtons (std::string const &filepath, Sparse_array< component::casset_t > &assets)
 A method to load the assets of the buttons. More...
 
void loadImages (std::string const &filepath, Sparse_array< component::casset_t > &assets)
 A method to load the assets of the images. More...
 
void loadTexts (std::string const &filepath)
 A method to load the assets of the text. More...
 
void createText (nlohmann::json const &oneData, std::array< float, 2 > pos, int scene, std::string const &ref)
 Create a Text object. More...
 
void createImage (nlohmann::json const &oneData, std::array< float, 2 > pos, int scene, const std::string &ref, Sparse_array< component::casset_t > &assets)
 Create a Image object. More...
 

Detailed Description

The Client class, it defines a client and its interactions with the server.

Constructor & Destructor Documentation

◆ Client()

Client::Client ( std::map< std::string, std::string > &  configurationFiles)

Construct a new Client object.

Parameters
configurationFilesconfiguration files

Member Function Documentation

◆ createImage()

void Client::createImage ( nlohmann::json const &  oneData,
std::array< float, 2 >  pos,
int  scene,
const std::string &  ref,
Sparse_array< component::casset_t > &  assets 
)

Create a Image object.

Parameters
oneDataJson Data where is stored the data
posPosition of the image
sceneScene id where add the image
refReference of the image
assetsThe sparse array of assets

◆ createText()

void Client::createText ( nlohmann::json const &  oneData,
std::array< float, 2 >  pos,
int  scene,
std::string const &  ref 
)

Create a Text object.

Parameters
oneDataJson Data where is stored the data
posPosition of the text
sceneScene id where add the text
refReference of the text

◆ loadButtons()

void Client::loadButtons ( std::string const &  filepath,
Sparse_array< component::casset_t > &  assets 
)

A method to load the assets of the buttons.

Parameters
filepathPath of the file containing all buttons
assetsThe sparse array of assets

◆ loadImages()

void Client::loadImages ( std::string const &  filepath,
Sparse_array< component::casset_t > &  assets 
)

A method to load the assets of the images.

Parameters
filepathPath of the file containing all images
assetsThe sparse array of assets

◆ loadTexts()

void Client::loadTexts ( std::string const &  filepath)

A method to load the assets of the text.

Parameters
filepathPath of the file containing all texts

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