2#include "bullet_manager.h"
4#include "physics_manager.h"
5#include "player_character.h"
7#include "engine/transform.h"
23 Frame createdFrame = 0;
48 void StartNewFrame(Frame newFrame);
61 void ConfirmFrame(Frame newValidatedFrame,
const std::array<PhysicsState, maxPlayerNmb>& serverPhysicsState);
63 [[nodiscard]] Frame GetLastValidateFrame()
const {
return lastValidateFrame_; }
64 [[nodiscard]] Frame GetLastReceivedFrame(
PlayerNumber playerNumber)
const {
return lastReceivedFrame_[playerNumber]; }
65 [[nodiscard]] Frame GetCurrentFrame()
const {
return currentFrame_; }
66 [[nodiscard]]
const core::TransformManager& GetTransformManager()
const {
return currentTransformManager_; }
67 [[nodiscard]]
const PlayerCharacterManager& GetPlayerCharacterManager()
const {
return currentPlayerManager_; }
78 [[nodiscard]]
const std::array<PlayerInput, windowBufferSize>& GetInputs(
PlayerNumber playerNumber)
const
80 return inputs_[playerNumber];
104 Frame lastValidateFrame_ = 0;
108 Frame currentFrame_ = 0;
112 Frame testedFrame_ = 0;
114 std::array<std::uint32_t, maxPlayerNmb> lastReceivedFrame_{};
115 std::array<std::array<PlayerInput, windowBufferSize>,
maxPlayerNmb> inputs_{};
120 std::vector<CreatedEntity> createdEntities_;
Degree is an utility class that describes degree angles (0 to 360). It can be easily converted to Rad...
Definition: angle.h:56
Manages the entities in an array using bitwise operations to know if it has components.
Definition: entity.h:35
BulletManager is a ComponentManager that holds all the Bullet in one place. It will automatically des...
Definition: bullet_manager.h:24
GameManager is a class which manages the state of the game. It is shared between the client and the s...
Definition: game_manager.h:27
OnTriggerInterface is an interface for classes that needs to be called when two boxes are in contact....
Definition: physics_manager.h:46
PhysicsManager is a class that holds both BodyManager and BoxManager and manages the physics fixed up...
Definition: physics_manager.h:75
PlayerCharacterManager is a ComponentManager that holds all the PlayerCharacter in the game.
Definition: player_character.h:27
RollbackManager is a class that manages all the rollback mechanisms of the game. It contains two copi...
Definition: rollback_manager.h:32
void ValidateFrame(Frame newValidateFrame)
ValidateFrame is a method that validates all the frames from lastValidateFrame_ to newValidateFrame....
Definition: rollback_manager.cpp:141
void SimulateToCurrentFrame()
SimulateToCurrentFrame is a method that simulates all players with new inputs, method call only by th...
Definition: rollback_manager.cpp:29
void DestroyEntity(core::Entity entity)
DestroyEntity is a method that does not destroy the entity definitely, but puts the DESTROY flag on....
Definition: rollback_manager.cpp:371
void ConfirmFrame(Frame newValidatedFrame, const std::array< PhysicsState, maxPlayerNmb > &serverPhysicsState)
ConfirmFrame is a method that confirms the new validate frame by checking the Physics State checksums...
Definition: rollback_manager.cpp:214
void SetPlayerInput(PlayerNumber playerNumber, PlayerInput playerInput, Frame inputFrame)
SetPlayerInput is a method that set the input of a certain player on a certain game frame....
Definition: rollback_manager.cpp:94
std::uint32_t Entity
Entity is the type used to define an game world entity. An Entity is just an index,...
Definition: entity.h:17
std::uint8_t PlayerNumber
PlayerNumber is a type used to define the number of the player. Starting from 0 to maxPlayerNmb.
Definition: game_globals.h:22
std::uint8_t PlayerInput
PlayerInput is a type defining the input data from a player.
Definition: game_globals.h:103
constexpr std::uint32_t maxPlayerNmb
mmaxPlayerNmb is a integer constant that defines the maximum number of player per game
Definition: game_globals.h:37
std::uint16_t PhysicsState
PhysicsState is the type of the physics state checksum.
Definition: packet_type.h:31
Vec2f is a utility class that represents a mathematical 2d vector.
Definition: vec2.h:12
CreatedEntity is a struct that contains information on the newly created entities....
Definition: rollback_manager.h:21