GPR5100 - Rollback
Loading...
Searching...
No Matches
simulation_app.h
1#pragma once
2#include "client.h"
3#include "simulation_client.h"
4#include "simulation_server.h"
5#include "engine/app.h"
6#include "game/game_globals.h"
7
8#include <SFML/Graphics/RenderTexture.hpp>
9
10namespace game
11{
15class SimulationApp final : public core::App
16{
17public:
19
20 void Begin() override;
21
22 void Update(sf::Time dt) override;
23
24 void End() override;
25
26 void DrawImGui() override;
27
28 void Draw(sf::RenderTarget& window) override;
29
30 void OnEvent(const sf::Event& event) override;
31private:
32 std::array<std::unique_ptr<SimulationClient>, maxPlayerNmb> clients_;
33 std::array<sf::RenderTexture, maxPlayerNmb> clientsFramebuffers_;
34 SimulationServer server_;
35 sf::Sprite screenQuad_;
36 sf::Vector2u windowSize_;
37};
38}
App is an interface for applications that need to init/update/destroy, draw and get event from OS.
Definition: app.h:12
SimulationApp is an application that owns SimulationClient and SimulationServer.
Definition: simulation_app.h:16
SimulationServer is a Server that delays Packet internally before "receiving" them and then sends the...
Definition: simulation_server.h:25
constexpr std::uint32_t maxPlayerNmb
mmaxPlayerNmb is a integer constant that defines the maximum number of player per game
Definition: game_globals.h:37