GPR5100 - Rollback
Loading...
Searching...
No Matches
bullet_manager.h
1#pragma once
2#include <SFML/System/Time.hpp>
3
4#include "game_globals.h"
5
6namespace game
7{
11struct Bullet
12{
13 float remainingTime = 0.0f;
14 PlayerNumber playerNumber = INVALID_PLAYER;
15};
16
17class GameManager;
18
23class BulletManager : public core::ComponentManager<Bullet, static_cast<core::EntityMask>(ComponentType::BULLET)>
24{
25public:
26 explicit BulletManager(core::EntityManager& entityManager, GameManager& gameManager);
27 void FixedUpdate(sf::Time dt);
28private:
29 GameManager& gameManager_;
30};
31}
ComponentManager is a class that owns Component in a contiguous array. Component indexing is done wit...
Definition: component.h:33
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
constexpr auto INVALID_PLAYER
INVALID_PLAYER is an integer constant that defines an invalid player number.
Definition: game_globals.h:26
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
Bullet is a struct that contains info about a player bullet (when it will be destroyed and whose play...
Definition: bullet_manager.h:12