3#include "GameEngine.hpp"
4#include "collision/collisionBuffer.hpp"
5#include "inputAction/InputAction.hpp"
6#include "inputAction/inputMapping.hpp"
8#include "factoryDataDriven/factoryDataDriven.hpp"
9#include "sceneManager/sceneManager.hpp"
11#include <unordered_set>
13#include "rtkAudiManagerAdapter.hpp"
14#include "rtkWindowAdapter.hpp"
16#include "NetworkClient.hpp"
17#include "scene/gameScene.hpp"
18#include "scene/menuScene.hpp"
19#include "scene/networkConnectionScene.hpp"
21namespace rtype::events {
30struct PlayerShotEvent {};
35namespace rtype::client {
84 void createBindings();
90 const protocol::CreateEntityPayload &payload);
92 const protocol::DestroyEntityPayload &payload);
94 const protocol::SnapshotPayload &payload);
96 std::unordered_map<protocol::NetworkEntityId, std::size_t> _networkEntities;
97 std::unordered_set<std::uint32_t> _pendingEntityQueries;
98 std::unordered_set<std::uint32_t> _destroyedEntities;
99 std::array<std::uint16_t, 4> _playerArchetypes{};
100 std::uint32_t _lastServerTick = 0;
101 rtk::RenderWindow _window;
103 RtkAudioAdapter _adapterAudioManager;
110 NetworkConnectionScene, GameScene>
Adapts the window of the graphical library to the IsRenderWindow concept.
Definition rtkWindowAdapter.hpp:20
Holds the active scene and switches between a fixed set of scenes.
Definition sceneManager.hpp:32
Collisions detected during the current frame.
Definition collisionBuffer.hpp:24
bool shouldContinue() const
Tells the engine whether to keep running.
Definition game.cpp:301
void onLoad(rtk::EngineContext &context)
Registers components, loads blueprints, binds inputs, adds the systems and starts the network client.
Definition game.cpp:56
void onUnload(rtk::EngineContext &context)
Destroys replicated entities, exits the scene and stops the network client.
Definition game.cpp:440
void onUpdate(rtk::EngineContext &context, float dt)
Applies network events and replication messages, then updates the active scene.
Definition game.cpp:303
Game()
Opens the 1280x720 window and creates the menu scene.
Definition game.cpp:53
UDP client that performs the handshake, sends inputs and decodes server messages.
Definition NetworkClient.hpp:71
SceneType
Identifiers of the client scenes.
Definition sceneType.hpp:12
Engine services handed to the game and its scenes.
Definition EngineContext.hpp:20