diff --git a/AnimationHandler_8h_source.html b/AnimationHandler_8h_source.html index 0729684..730b400 100644 --- a/AnimationHandler_8h_source.html +++ b/AnimationHandler_8h_source.html @@ -124,8 +124,7 @@ $(function(){initNavTree('AnimationHandler_8h_source.html',''); initResizable(tr
1#pragma once
2#include <cstdint>
-
-
3struct Animation
+
3struct Animation
4{
5 uint8_t index;
6 uint8_t frames;
@@ -140,7 +139,6 @@ $(function(){initNavTree('AnimationHandler_8h_source.html',''); initResizable(tr
15 this->speed = speed;
16 }
17};
-
18
19
20
diff --git a/ColliderComponent_8h_source.html b/ColliderComponent_8h_source.html index e47fea5..09c9b3f 100644 --- a/ColliderComponent_8h_source.html +++ b/ColliderComponent_8h_source.html @@ -130,32 +130,40 @@ $(function(){initNavTree('ColliderComponent_8h_source.html',''); initResizable(t
6#include "Vector2D.h"
7
-
9
-
-
10class ColliderComponent : public Component
-
11{
-
12public:
-
13 SDL_Rect collider;
-
14 const char* tag;
-
15 TransformComponent* transform;
-
16 bool hasCollision; //added for removing collision of destroyed projectiles
-
17 float hitboxScale; //adds a seperate variable for the scale of the hitbox (not the sprite) so each sprite can have a different hitbox size if needed
-
18
-
19 bool isProjectile = false;
-
20
-
21 ColliderComponent(const char* tag);
-
22 ColliderComponent(const char* tag, float hitboxScale);
-
23
-
24 void init() override;
-
25 void update(uint_fast16_t diffTime) override;
-
26 void removeCollision();
-
27
-
28 void handleCollision(Vector2D& characterPos, SDL_Rect& characterCollider, SDL_Rect& componentCollider);
-
29};
+
9
+
+
11class ColliderComponent : public Component
+
12{
+
13public:
+
14 SDL_Rect& getCollider() { return collider; }
+
+
15 const char* getTag() const { return tag; }
+
+
16 bool hasCollision() const { return collision; }
+
17
+
20 ColliderComponent(const char* tag);
+
21
+
25 ColliderComponent(const char* tag, float hitboxScale);
+
26
+
27 void init() override;
+
28 void update(uint_fast16_t diffTime) override;
+
30 void removeCollision();
+
31private:
+
32 SDL_Rect collider;
+
33 const char* tag;
+
34 TransformComponent* transform;
+
35 bool collision; //added for removing collision of destroyed projectiles
+
36 float hitboxScale; //adds a seperate variable for the scale of the hitbox (not the sprite) so each sprite can have a different hitbox size if needed
+
37};
-
Definition Component.h:8
-
Definition TransformComponent.h:9
-
Definition Vector2D.h:7
+
+
+
SDL_Rect & getCollider()
Definition ColliderComponent.h:14
+
const char * getTag() const
Definition ColliderComponent.h:15
+
void removeCollision()
Removes the collision of an entity.
Definition ColliderComponent.cpp:43
+
bool hasCollision() const
Definition ColliderComponent.h:16
+
ColliderComponent(const char *tag)
Constructor for ColliderComponent.
Definition ColliderComponent.cpp:9
+
Adds a transform to an entity when added via entity.addComponent()
Definition TransformComponent.h:11
diff --git a/CollisionHandler_8h.html b/CollisionHandler_8h.html index fe6cf5c..94ced73 100644 --- a/CollisionHandler_8h.html +++ b/CollisionHandler_8h.html @@ -120,9 +120,7 @@ $(function(){initNavTree('CollisionHandler_8h.html',''); initResizable(true); })
-Classes | -Typedefs | -Variables
+Classes
CollisionHandler.h File Reference
@@ -154,19 +152,8 @@ This graph shows which files directly or indirectly include this file:

Classes

class  CollisionHandler + Class responsible for collision detection and handling. More...
  - - - - -

-Typedefs

-using IntersectionBitSet = std::bitset<DIRECTION_C>
 
- - -

-Variables

-constexpr uint8_t DIRECTION_C = 4
 
diff --git a/CollisionHandler_8h_source.html b/CollisionHandler_8h_source.html index c7ae00c..eefe3a9 100644 --- a/CollisionHandler_8h_source.html +++ b/CollisionHandler_8h_source.html @@ -147,48 +147,48 @@ $(function(){initNavTree('CollisionHandler_8h_source.html',''); initResizable(tr
26
27using IntersectionBitSet = std::bitset<DIRECTION_C>;
28// [IntersectionBitSet]
-
29
-
-
30class CollisionHandler
-
31{
-
32private:
-
33 Manager& manager;
-
34
-
35public:
-
36
-
37 CollisionHandler(Manager& mManager) :
-
38 manager(mManager) { };
-
39 ~CollisionHandler();
-
40
-
41 static IntersectionBitSet getIntersection( // intersections relative to entityA
-
42 Entity* entityA,
-
43 Entity* entityB,
-
44 Vector2D posModA = Vector2D(0,0),
-
45 Vector2D posModB = Vector2D(0,0));
-
46 static IntersectionBitSet getIntersectionWithBounds( // will fail to determine direction if speed high enough to switch from no collision to full overlap in one tick
-
47 Entity* entity,
-
48 Vector2D posMod = Vector2D(0,0));
-
49
-
50 // temporary function, remove once game.cpp cleaned up
-
51 std::vector<ColliderComponent*> getColliders(
-
52 std::initializer_list<Entity::GroupLabel> const& groupLabels,
-
53 std::initializer_list<Entity*> const& excludedEntities = {});
-
54
-
69 template<typename T>
-
70 T getAnyIntersection(
-
71 Entity* entity,
-
72 Vector2D posMod = {},
-
73 std::initializer_list<Entity::GroupLabel> const& groupLabels = {},
-
74 std::initializer_list<Entity*> const& excludedEntities = {});
-
75
-
76 void update();
-
77};
+
29
+
+
31class CollisionHandler
+
32{
+
33private:
+
34 Manager& manager;
+
35
+
36public:
+
37
+
38 CollisionHandler(Manager& mManager) :
+
39 manager(mManager) { };
+
40 ~CollisionHandler();
+
41
+
46 static IntersectionBitSet getIntersection(
+
47 Entity* entityA,
+
48 Entity* entityB,
+
49 Vector2D posModA = Vector2D(0,0),
+
50 Vector2D posModB = Vector2D(0,0));
+
51 static IntersectionBitSet getIntersectionWithBounds( // will fail to determine direction if speed high enough to switch from no collision to full overlap in one tick
+
52 Entity* entity,
+
53 Vector2D posMod = Vector2D(0,0));
+
54
+
55 // temporary function, remove once game.cpp cleaned up
+
56 std::vector<ColliderComponent*> getColliders(
+
57 std::initializer_list<Entity::GroupLabel> const& groupLabels,
+
58 std::initializer_list<Entity*> const& excludedEntities = {});
+
59
+
74 template<typename T>
+ +
76 Entity* entity,
+
77 Vector2D posMod = {},
+
78 std::initializer_list<Entity::GroupLabel> const& groupLabels = {},
+
79 std::initializer_list<Entity*> const& excludedEntities = {});
+
80
+
81 void update();
+
82};
-
Definition ColliderComponent.h:11
+
Adds a collision box to an entity when added via entity.addComponent()
Definition ColliderComponent.h:12
+
static IntersectionBitSet getIntersection(Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0))
Checks for intersections relative to entityA.
Definition CollisionHandler.cpp:15
T getAnyIntersection(Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={})
Tests entity against all entities with the specified labels for a collision.
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
Is responsible for managing all entities.
Definition Manager.h:23
-
Definition Vector2D.h:7
diff --git a/Component_8h_source.html b/Component_8h_source.html index 292df10..9e0bf6f 100644 --- a/Component_8h_source.html +++ b/Component_8h_source.html @@ -128,19 +128,16 @@ $(function(){initNavTree('Component_8h_source.html',''); initResizable(true); })
4
5class Entity;
6
-
-
7class Component
+
7class Component
8{
9public:
-
10 Entity* entity;
+
10 Entity* entity;
11
12 virtual void init() {}
13 virtual void update(uint_fast16_t diffTime) {}
14
-
15 virtual ~Component() = default;
+
15 virtual ~Component() = default;
16};
-
-
Component
Definition Component.h:8
Entity
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
diff --git a/DataComponent_8h_source.html b/DataComponent_8h_source.html index ee4090f..46684a3 100644 --- a/DataComponent_8h_source.html +++ b/DataComponent_8h_source.html @@ -130,31 +130,24 @@ $(function(){initNavTree('DataComponent_8h_source.html',''); initResizable(true)
6#include <optional>
7#include "Component.h"
8
-
-
9class DataComponent : public Component
+
9class DataComponent : public Component
10{
11public:
12 DataComponent() {};
13 ~DataComponent() {};
20 template <typename T>
-
21 void setEntry(const std::string& key, const T& value) { dataMap.insert_or_assign(key, value); }
+
21 void setEntry(const std::string& key, const T& value) { dataMap.insert_or_assign(key, value); }
22
29 template<typename T>
-
-
30 std::optional<T> getEntry(std::string key) const {
+
30 std::optional<T> getEntry(std::string key) const {
31 if (!this->dataMap.contains(key)) return std::nullopt;
32 const std::any& value = this->dataMap.at(key);
33 if (value.type() != typeid(T)) { return std::nullopt; }
34 return std::any_cast<T>(value);
35 }
-
36private:
37 std::map<std::string, std::any> dataMap;
38};
-
-
Component
Definition Component.h:8
-
DataComponent::setEntry
void setEntry(const std::string &key, const T &value)
Set a key-value pair of any type in the data map.
Definition DataComponent.h:21
-
DataComponent::getEntry
std::optional< T > getEntry(std::string key) const
Get a value of type T from the data map.
Definition DataComponent.h:30
diff --git a/ECS_8h_source.html b/ECS_8h_source.html index bb41b94..99510ca 100644 --- a/ECS_8h_source.html +++ b/ECS_8h_source.html @@ -127,7 +127,7 @@ $(function(){initNavTree('ECS_8h_source.html',''); initResizable(true); });
3#include "Component.h"
4#include "Constants.h"
5
-
6class Component;
+
6class Component;
7class Entity;
8class Manager;
9
@@ -145,7 +145,6 @@ $(function(){initNavTree('ECS_8h_source.html',''); initResizable(true); });
21 static ComponentID typeID = getNewComponentTypeID();
22 return typeID;
23}
-
Component
Definition Component.h:8
Entity
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
Manager
Is responsible for managing all entities.
Definition Manager.h:23
diff --git a/Entity_8h_source.html b/Entity_8h_source.html index 822d4c8..32674ee 100644 --- a/Entity_8h_source.html +++ b/Entity_8h_source.html @@ -140,7 +140,7 @@ $(function(){initNavTree('Entity_8h_source.html',''); initResizable(true); });
16#include "SpriteComponent.h"
17
18class Manager;
-
19class Component;
+
19class Component;
20
21using ComponentBitSet = std::bitset<MAX_COMPONENTS>;
22using GroupBitSet = std::bitset<MAX_GROUPS>;
@@ -150,110 +150,106 @@ $(function(){initNavTree('Entity_8h_source.html',''); initResizable(true); });
34class Entity
35{
36public:
-
37
-
-
45 enum class GroupLabel
-
46 {
-
47 MAPTILES,
-
48 PLAYERS,
-
49 ENEMIES,
-
50 COLLIDERS,
-
51 PROJECTILE,
-
52 HEARTS,
-
53 POWERUPS
-
54 };
+
+
38 enum class GroupLabel
+
39 {
+ + + + + + +
46 };
-
55
+
47
+
+
51 explicit Entity(Manager& mManager) :
+
52 manager(mManager) { };
+
+
53
+
54 void update(uint_fast16_t diffTime) const;
+
55
+
56 bool isActive() const { return this->active; }
-
59 explicit Entity(Manager& mManager) :
-
60 manager(mManager) { };
+
59 void destroy() {
+
60 this->active = false;
+ +
62 this->getComponent<ColliderComponent>().removeCollision();
+
63 }
+
64 }
-
61
-
62 void update(uint_fast16_t diffTime) const;
-
63
-
64 bool isActive() const { return this->active; }
-
-
67 void destroy() {
-
68 this->active = false;
- -
70 this->getComponent<ColliderComponent>().removeCollision();
-
71 }
-
72 }
+
65#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
66 bool hasGroup(Group mGroup);
+
67 void addGroup(Group mGroup);
+
68 void delGroup(Group mGroup);
+
69 std::bitset<MAX_GROUPS> getGroupBitSet();
+
70#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
71
+
73 Manager& getManager() { return manager; };
+
74
+
+
75 template <typename T> bool hasComponent() const
+
76 {
+
77 return componentBitSet[getComponentTypeID<T>()];
+
78 }
-
73
-
74 bool hasGroup(Group mGroup);
-
75 void addGroup(Group mGroup);
-
76 void delGroup(Group mGroup);
-
79 std::bitset<MAX_GROUPS> getGroupBitSet();
-
80
-
82 Manager& getManager() { return manager; };
-
83
-
-
84 template <typename T> bool hasComponent() const
-
85 {
-
86 return componentBitSet[getComponentTypeID<T>()];
-
87 }
+
79
+
+
82 template <typename T, typename...TArgs> T& addComponent(TArgs&&...mArgs)
+
83 {
+
84 T* c(new T(std::forward<TArgs>(mArgs)...));
+
85 c->entity = this;
+
86 std::shared_ptr<Component> uPtr{ c };
+
87 this->components.at(getComponentTypeID<T>()) = std::move(uPtr);
+
88
+
89 componentArray[getComponentTypeID<T>()] = c;
+
90 componentBitSet[getComponentTypeID<T>()] = true;
+
91
+
92 c->init();
+
93 return *c;
+
94 };
-
88
-
-
91 template <typename T, typename...TArgs> T& addComponent(TArgs&&...mArgs)
-
92 {
-
93 T* c(new T(std::forward<TArgs>(mArgs)...));
-
94 c->entity = this;
-
95 std::shared_ptr<Component> uPtr{ c };
-
96 this->components.at(getComponentTypeID<T>()) = std::move(uPtr);
-
97
-
98 componentArray[getComponentTypeID<T>()] = c;
-
99 componentBitSet[getComponentTypeID<T>()] = true;
-
100
-
101 c->init();
-
102 return *c;
-
103 };
+
95
+
+
99 template <typename T> T& getComponent() const
+
100 {
+
101 auto ptr(componentArray[getComponentTypeID<T>()]);
+
102 return *static_cast<T*>(ptr);
+
103 }
-
104
-
-
105 template <typename T> T& getComponent() const
-
106 {
-
107 auto ptr(componentArray[getComponentTypeID<T>()]);
-
108 return *static_cast<T*>(ptr);
-
109 }
+
104
+
+
107 template <typename T> std::shared_ptr<T> getComponentAsPointer() const
+
108 {
+
109 return std::static_pointer_cast<T>(components.at(getComponentTypeID<T>()));
+
110 }
-
110
-
111 template <typename T> std::shared_ptr<T> getComponentAsPointer() const
-
112 {
-
113 return std::static_pointer_cast<T>(components.at(getComponentTypeID<T>()));
-
114 }
-
115
-
116private:
-
117 Manager& manager;
-
118 bool active = true;
-
119 std::array<std::shared_ptr<Component>, MAX_COMPONENTS> components;
-
120
-
121 ComponentArray componentArray = {};
-
122 ComponentBitSet componentBitSet;
-
123 GroupBitSet groupBitSet;
-
124};
+
111
+
112private:
+
113 Manager& manager;
+
114 bool active = true;
+
115 std::array<std::shared_ptr<Component>, MAX_COMPONENTS> components;
+
116
+
117 ComponentArray componentArray = {};
+
118 ComponentBitSet componentBitSet;
+
119 GroupBitSet groupBitSet;
+
120};
-
Definition Component.h:8
-
void destroy()
Definition Entity.h:67
-
void addGroup(Group mGroup)
Definition Entity.cpp:19
-
GroupLabel
Used for rendering order (last is highest) or retrieving entities of group.
Definition Entity.h:46
-
@ PROJECTILE
Definition Entity.h:51
-
@ POWERUPS
Definition Entity.h:53
-
@ MAPTILES
Entity using TileComponent.
Definition Entity.h:47
-
@ HEARTS
Definition Entity.h:52
-
@ COLLIDERS
Fixed collider entity, e.g. a wall.
Definition Entity.h:50
-
@ PLAYERS
Primary entity in player controll.
Definition Entity.h:48
-
@ ENEMIES
Definition Entity.h:49
-
bool hasComponent() const
Definition Entity.h:84
-
Entity(Manager &mManager)
Definition Entity.h:59
-
Manager & getManager()
Definition Entity.h:82
-
bool hasGroup(Group mGroup)
Definition Entity.cpp:14
-
T & getComponent() const
<
Definition Entity.h:105
-
std::bitset< MAX_GROUPS > getGroupBitSet()
Definition Entity.cpp:30
-
void delGroup(Group mGroup)
Definition Entity.cpp:25
-
T & addComponent(TArgs &&...mArgs)
Adds specified type as component and calls Component::init()
Definition Entity.h:91
-
bool isActive() const
Definition Entity.h:64
+
void destroy()
Definition Entity.h:59
+
GroupLabel
Some premade Entity groups used to avoid checking all entities for everything all of the time.
Definition Entity.h:39
+
@ PROJECTILE
Definition Entity.h:43
+
@ POWERUPS
Definition Entity.h:45
+
@ MAPTILES
Entity using TileComponent, internal use.
Definition Entity.h:40
+
@ HEARTS
Definition Entity.h:44
+
@ COLLIDERS
Fixed collider entity, e.g. a wall.
Definition Entity.h:42
+
@ PLAYERS
Primary entity in player control, used to be able to interact with pickupables.
Definition Entity.h:41
+
bool hasComponent() const
Definition Entity.h:75
+
Entity(Manager &mManager)
Definition Entity.h:51
+
Manager & getManager()
Definition Entity.h:73
+
T & getComponent() const
Access a specific component of an entity.
Definition Entity.h:99
+
T & addComponent(TArgs &&...mArgs)
Adds specified type as component and calls Component::init()
Definition Entity.h:82
+
bool isActive() const
Definition Entity.h:56
+
std::shared_ptr< T > getComponentAsPointer() const
Access a specific component of an entity as a pointer.
Definition Entity.h:107
void update(uint_fast16_t diffTime) const
Call each frame to update all components.
Definition Entity.cpp:7
Is responsible for managing all entities.
Definition Manager.h:23
diff --git a/EventManager_8h_source.html b/EventManager_8h_source.html index 7cc968f..ccc6181 100644 --- a/EventManager_8h_source.html +++ b/EventManager_8h_source.html @@ -134,18 +134,15 @@ $(function(){initNavTree('EventManager_8h_source.html',''); initResizable(true);
10
11typedef std::function<SDL_AppResult(SDL_EventType, SDL_Event* const)> EventListener;
12
-
- +
13class EventManager {
14public:
- +
15 EventManager();
16
17 void registerListener(EventListener listener, std::initializer_list<Uint32> eventTypes);
18 SDL_AppResult handleEvent(SDL_Event* const event);
19private:
20 std::map<Uint32, std::vector<EventListener>> eventListeners = std::map<Uint32, std::vector<EventListener>>();
21};
-
-
EventManager()
Definition EventManager.cpp:13
diff --git a/GameFactory_8h_source.html b/GameFactory_8h_source.html index c2fafce..39b8432 100644 --- a/GameFactory_8h_source.html +++ b/GameFactory_8h_source.html @@ -133,15 +133,14 @@ $(function(){initNavTree('GameFactory_8h_source.html',''); initResizable(true);
9
10#include "Game.h"
11
-
12class GameInternal;
+
12class GameInternal;
13
-
-
14class GameFactory {
+
14class GameFactory {
15public:
-
16 using CreateFunc = std::function<Game*()>;
+
16 using CreateFunc = std::function<Game*()>;
17
-
18 static GameFactory& instance() {
-
19 static GameFactory factory;
+
18 static GameFactory& instance() {
+
19 static GameFactory factory;
20 return factory;
21 }
22
@@ -149,12 +148,12 @@ $(function(){initNavTree('GameFactory_8h_source.html',''); initResizable(true);
24 this->creatorFunc = createFunc;
25 }
26
-
27 Game* create(GameInternal* gameInternal) {
+
27 Game* create(GameInternal* gameInternal) {
28 if (this->creatorFunc == nullptr) {
29 throw std::runtime_error("No game implementation registered!");
30 return nullptr;
31 }
-
32 Game* game = (this->creatorFunc)();
+
32 Game* game = (this->creatorFunc)();
33 game->gameInternal = gameInternal;
34 return game;
35 }
@@ -162,10 +161,6 @@ $(function(){initNavTree('GameFactory_8h_source.html',''); initResizable(true);
37private:
38 CreateFunc creatorFunc = nullptr;
39};
-
-
GameFactory
Definition GameFactory.h:14
-
GameInternal
Definition GameInternal.h:31
-
Game
Definition Game.h:6
diff --git a/GameInternal_8h_source.html b/GameInternal_8h_source.html index f8d52cb..61fef3d 100644 --- a/GameInternal_8h_source.html +++ b/GameInternal_8h_source.html @@ -149,10 +149,9 @@ $(function(){initNavTree('GameInternal_8h_source.html',''); initResizable(true);
25class TextureManager;
26class SoundManager;
27class Map;
-
28class Game;
+
28class Game;
29
-
-
30class GameInternal
+
30class GameInternal
31{
32public:
33 GameInternal();
@@ -170,19 +169,19 @@ $(function(){initNavTree('GameInternal_8h_source.html',''); initResizable(true);
45
46 /* static */ SDL_Renderer* renderer = nullptr;
47 /* static */ SDL_Event event;
-
48 /* static */ CollisionHandler* collisionHandler;
-
49 /* static */ PickupManager* pickupManager;
-
50 /* static */ TextureManager* textureManager;
-
51 /* static */ SoundManager* soundManager;
-
52 /* static */ InputManager* inputManager;
-
53 RenderManager* renderManager;
-
54 EventManager* eventManager;
-
55 InteractionManager* interactionManager;
+
48 /* static */ CollisionHandler* collisionHandler;
+
49 /* static */ PickupManager* pickupManager;
+
50 /* static */ TextureManager* textureManager;
+
51 /* static */ SoundManager* soundManager;
+
52 /* static */ InputManager* inputManager;
+
53 RenderManager* renderManager;
+
54 EventManager* eventManager;
+
55 InteractionManager* interactionManager;
56
-
57 Manager manager;
-
58 Map* map; // game specific, might not be needed for all types of games
+
57 Manager manager;
+
58 Map* map; // game specific, might not be needed for all types of games
59
-
60 ConfigLoader* config;
+
60 ConfigLoader* config;
61
62 std::vector<Entity*>& tiles;
63 std::vector<Entity*>& players;
@@ -195,7 +194,7 @@ $(function(){initNavTree('GameInternal_8h_source.html',''); initResizable(true);
70
71private:
72
-
73 Game* gameInstance;
+
73 Game* gameInstance;
74
75 int counter = 0;
76 bool running = true;
@@ -203,17 +202,8 @@ $(function(){initNavTree('GameInternal_8h_source.html',''); initResizable(true);
78
79 Uint64 lastFrameTime = 0;
80};
-
-
CollisionHandler
Definition CollisionHandler.h:31
-
ConfigLoader
Enables configuration of specific engine variables via a custom JSON file.
Definition ConfigLoader.h:24
-
EventManager
Definition EventManager.h:13
-
Game
Definition Game.h:6
-
InputManager
Definition InputManager.h:12
-
InteractionManager
Definition InteractionManager.h:16
-
Manager
Is responsible for managing all entities.
Definition Manager.h:23
-
Map
Definition Map.h:15
-
PickupManager
Definition PickupManager.h:15
-
RenderManager
Definition RenderManager.h:7
+
CollisionHandler
Class responsible for collision detection and handling.
Definition CollisionHandler.h:32
+
Map
Class responsible for the creation and management of the map or background.
Definition Map.h:16
SoundManager
Handles music and sound.
Definition SoundManager.h:21
TextureManager
A manager for loading, caching, and drawing textures.
Definition TextureManager.h:25
diff --git a/GameRegistryHelper_8h_source.html b/GameRegistryHelper_8h_source.html index 1787792..6e2b9ac 100644 --- a/GameRegistryHelper_8h_source.html +++ b/GameRegistryHelper_8h_source.html @@ -128,27 +128,24 @@ $(function(){initNavTree('GameRegistryHelper_8h_source.html',''); initResizable(
4
5namespace vego {
6 template<typename T>
-
-
7 class GameRegistryHelper {
+
7 class GameRegistryHelper {
8 public:
9 [[deprecated("GameRegistryHelper() does not take a className anymore")]]
10 GameRegistryHelper(const std::string& className) {
11 static_assert(std::is_base_of<Game, T>::value, "Your class must inherit from Game");
12 GameFactory::instance().registerClass(
-
13 []() -> Game* { return new T; }
+
13 []() -> Game* { return new T; }
14 );
15 };
16
17 GameRegistryHelper() {
18 static_assert(std::is_base_of<Game, T>::value, "Your class must inherit from Game");
19 GameFactory::instance().registerClass(
-
20 []() -> Game* { return new T; }
+
20 []() -> Game* { return new T; }
21 );
22 };
23 };
-
24}
-
Game
Definition Game.h:6
diff --git a/Game_8h_source.html b/Game_8h_source.html index 06b95d1..aa0712e 100644 --- a/Game_8h_source.html +++ b/Game_8h_source.html @@ -124,30 +124,24 @@ $(function(){initNavTree('Game_8h_source.html',''); initResizable(true); });
1#pragma once
2
-
3class GameInternal;
+
3class GameInternal;
4
5// TODO: add managers here
-
-
6class Game {
+
6class Game {
7public:
-
8 virtual ~Game() {}
+
8 virtual ~Game() {}
9
10 virtual void init() = 0;
11 virtual void update(uint_fast16_t diffTime) = 0;
12
-
21 virtual std::optional<std::string> setConfigFilePath() {return std::nullopt;}
+
21 virtual std::optional<std::string> setConfigFilePath() {return std::nullopt;}
22
- +
23 GameInternal* gameInternal;
24};
-
25
26
27// game factory include to simplify imports in implementation
28#include "GameFactory.h"
-
Definition GameInternal.h:31
-
Definition Game.h:6
-
GameInternal * gameInternal
Definition Game.h:23
-
virtual std::optional< std::string > setConfigFilePath()
Sets the path for a custom config file.
Definition Game.h:21
diff --git a/HealthComponent_8h_source.html b/HealthComponent_8h_source.html index 889313a..23ea529 100644 --- a/HealthComponent_8h_source.html +++ b/HealthComponent_8h_source.html @@ -132,8 +132,7 @@ $(function(){initNavTree('HealthComponent_8h_source.html',''); initResizable(tru
8
9class Manager;
10
-
-
11class HealthComponent : public Component
+
11class HealthComponent : public Component
12{
13public:
14
@@ -154,8 +153,6 @@ $(function(){initNavTree('HealthComponent_8h_source.html',''); initResizable(tru
29
30 int health;
31};
-
-
Component
Definition Component.h:8
Manager
Is responsible for managing all entities.
Definition Manager.h:23
diff --git a/InputComponent_8h_source.html b/InputComponent_8h_source.html index c0d4e4d..b3d90cf 100644 --- a/InputComponent_8h_source.html +++ b/InputComponent_8h_source.html @@ -211,8 +211,7 @@ $(function(){initNavTree('InputComponent_8h_source.html',''); initResizable(true
87 GRAVE
88};
89
-
-
90class InputComponent : public Component
+
90class InputComponent : public Component
91{
92public:
93 InputComponent();
@@ -229,8 +228,6 @@ $(function(){initNavTree('InputComponent_8h_source.html',''); initResizable(true
104 std::map<Key, SDL_Scancode> m_keyMappings;
105 void InitKeyMappings();
106};
-
-
Component
Definition Component.h:8
diff --git a/InputManager_8h_source.html b/InputManager_8h_source.html index 865ca40..1a13896 100644 --- a/InputManager_8h_source.html +++ b/InputManager_8h_source.html @@ -132,140 +132,142 @@ $(function(){initNavTree('InputManager_8h_source.html',''); initResizable(true);
8#include <functional>
9#include <vector>
10#include <iostream>
-
11
-
-
12class InputManager {
-
13public:
-
14 enum class EventType {
-
15 KeyDown,
-
16 KeyUp
-
17 };
-
18
-
19 enum class Key
-
20 {
-
21 UP,
-
22 DOWN,
-
23 LEFT,
-
24 RIGHT,
-
25 SPACE,
-
26 ENTER,
-
27 ESCAPE,
-
28 TAB,
-
29 BACKSPACE,
-
30 DELETE,
-
31 HOME,
-
32 END,
-
33 PAGE_UP,
-
34 PAGE_DOWN,
-
35 INSERT,
-
36 CAPS_LOCK,
-
37 LEFT_SHIFT,
-
38 RIGHT_SHIFT,
-
39 LEFT_CTRL,
-
40 RIGHT_CTRL,
-
41 LEFT_ALT,
-
42 RIGHT_ALT,
-
43 F1,
-
44 F2,
-
45 F3,
-
46 F4,
-
47 F5,
-
48 F6,
-
49 F7,
-
50 F8,
-
51 F9,
-
52 F10,
-
53 F11,
-
54 F12,
-
55 A,
-
56 B,
-
57 C,
-
58 D,
-
59 E,
-
60 F,
-
61 G,
-
62 H,
-
63 I,
-
64 J,
-
65 K,
-
66 L,
-
67 M,
-
68 N,
-
69 O,
-
70 P,
-
71 Q,
-
72 R,
-
73 S,
-
74 T,
-
75 U,
-
76 V,
-
77 W,
-
78 X,
-
79 Y,
-
80 Z,
-
81 NUM_0,
-
82 NUM_1,
-
83 NUM_2,
-
84 NUM_3,
-
85 NUM_4,
-
86 NUM_5,
-
87 NUM_6,
-
88 NUM_7,
-
89 NUM_8,
-
90 NUM_9,
-
91 LEFT_BRACKET,
-
92 RIGHT_BRACKET,
-
93 SEMICOLON,
-
94 APOSTROPHE,
-
95 COMMA,
-
96 PERIOD,
-
97 SLASH,
-
98 BACKSLASH,
-
99 GRAVE
-
100 };
-
101
-
-
102 struct InputAction {
-
103 std::string name;
-
104 std::vector<Key> bindings;
-
105 std::function<void(bool)> callback;
-
106 };
+
11
+
+
14class InputManager {
+
15public:
+
+
17 enum class Key
+
18 {
+
19 UP,
+
20 DOWN,
+
21 LEFT,
+
22 RIGHT,
+
23 SPACE,
+
24 ENTER,
+
25 ESCAPE,
+
26 TAB,
+
27 BACKSPACE,
+
28 DELETE,
+
29 HOME,
+
30 END,
+
31 PAGE_UP,
+
32 PAGE_DOWN,
+
33 INSERT,
+
34 CAPS_LOCK,
+
35 LEFT_SHIFT,
+
36 RIGHT_SHIFT,
+
37 LEFT_CTRL,
+
38 RIGHT_CTRL,
+
39 LEFT_ALT,
+
40 RIGHT_ALT,
+
41 F1,
+
42 F2,
+
43 F3,
+
44 F4,
+
45 F5,
+
46 F6,
+
47 F7,
+
48 F8,
+
49 F9,
+
50 F10,
+
51 F11,
+
52 F12,
+
53 A,
+
54 B,
+
55 C,
+
56 D,
+
57 E,
+
58 F,
+
59 G,
+
60 H,
+
61 I,
+
62 J,
+
63 K,
+
64 L,
+
65 M,
+
66 N,
+
67 O,
+
68 P,
+
69 Q,
+
70 R,
+
71 S,
+
72 T,
+
73 U,
+
74 V,
+
75 W,
+
76 X,
+
77 Y,
+
78 Z,
+
79 NUM_0,
+
80 NUM_1,
+
81 NUM_2,
+
82 NUM_3,
+
83 NUM_4,
+
84 NUM_5,
+
85 NUM_6,
+
86 NUM_7,
+
87 NUM_8,
+
88 NUM_9,
+
89 LEFT_BRACKET,
+
90 RIGHT_BRACKET,
+
91 SEMICOLON,
+
92 APOSTROPHE,
+
93 COMMA,
+
94 PERIOD,
+
95 SLASH,
+
96 BACKSLASH,
+
97 GRAVE
+
98 };
-
107
-
108 InputManager();
-
109 ~InputManager();
-
110
-
111 void init(); // see if necessary
-
112 void processEvents();
-
113 void registerAction(const std::string& actionName, const std::vector<Key>& keys, std::function<void(bool)> callback, const std::string& context);
-
114
-
115 void setActiveContext(const std::string& context);
-
116 std::string getActiveContext() const;
-
117
-
118 //void rebindAction(const std::string& actionName, const std::vector<Key>& newBindings, const std::string& context);
-
119 //void removeBindings(const std::string& actionName, const std::string& context);
-
120 //std::vector<Key> getBindings(const std::string& actionName, const std::string& context) const;
-
121 std::vector<InputAction*> getActionsByKey(const Key key) const;
-
122
-
123 SDL_AppResult handleEvent(SDL_EventType type, SDL_Event* const event);
-
124
-
125 void initKeyMap();
-
126private:
-
127 // TODO: flesh this out to avoid loops in process actions
-
128 // additionally to actionsByContext, not instead
-
129 std::map<std::string, std::map<Key, std::vector<InputAction*>>> actionsByContextAndKey;
-
130
-
131 std::map<Key, SDL_Scancode> keyMap;
-
132 std::string activeContext;
-
133};
+
99
+
+
104 struct InputAction {
+
105 std::string name;
+
106 std::vector<Key> bindings;
+
107 std::function<void(bool)> callback;
+
108 };
-
134
-
135std::ostream& operator<<(std::ostream& os, InputManager::Key key);
-
136std::ostream& operator<<(std::ostream& os, const InputManager::InputAction& action);
-
137std::ostream& operator<<(std::ostream& os, const InputManager::InputAction* action);
-
138std::ostream& operator<<(std::ostream& os, const std::vector<InputManager::InputAction>& actions);
-
139std::ostream& operator<<(std::ostream& os, const std::vector<InputManager::InputAction*>& actions);
-
Definition InputManager.h:102
+
109
+
110 InputManager();
+
111 ~InputManager();
+
112
+
113 void init(); // see if necessary
+
114 void processEvents();
+
120 void registerAction(const std::string& actionName, const std::vector<Key>& keys, std::function<void(bool)> callback, const std::string& context = "Default");
+
121
+
124 void setActiveContext(const std::string& context);
+
125
+
127 std::string getActiveContext() const;
+
128
+
129 //void rebindAction(const std::string& actionName, const std::vector<Key>& newBindings, const std::string& context);
+
130 //void removeBindings(const std::string& actionName, const std::string& context);
+
131 //std::vector<Key> getBindings(const std::string& actionName, const std::string& context) const;
+
132 std::vector<InputAction*> getActionsByKey(const Key key) const;
+
133
+
134 SDL_AppResult handleEvent(SDL_EventType type, SDL_Event* const event);
+
135
+
136 void initKeyMap();
+
137private:
+
138 // TODO: flesh this out to avoid loops in process actions
+
139 // additionally to actionsByContext, not instead
+
140 std::map<std::string, std::map<Key, std::vector<InputAction*>>> actionsByContextAndKey;
+
141
+
142 std::map<Key, SDL_Scancode> keyMap;
+
143 std::string activeContext;
+
144};
+
+
145
+
146std::ostream& operator<<(std::ostream& os, InputManager::Key key);
+
147std::ostream& operator<<(std::ostream& os, const InputManager::InputAction& action);
+
148std::ostream& operator<<(std::ostream& os, const InputManager::InputAction* action);
+
149std::ostream& operator<<(std::ostream& os, const std::vector<InputManager::InputAction>& actions);
+
150std::ostream& operator<<(std::ostream& os, const std::vector<InputManager::InputAction*>& actions);
+
void setActiveContext(const std::string &context)
set the active context, is "Default" by default
Definition InputManager.cpp:271
+
std::string getActiveContext() const
Get the active context.
Definition InputManager.cpp:275
+
Key
A list of every key that can be bound to an action.
Definition InputManager.h:18
+
void registerAction(const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context="Default")
Register an action with a name, key bindings, and a callback function.
Definition InputManager.cpp:251
+
InputAction struct to represent an action and its bindings.
Definition InputManager.h:104
diff --git a/InteractionComponent_8h_source.html b/InteractionComponent_8h_source.html index 16d4491..0cefb1e 100644 --- a/InteractionComponent_8h_source.html +++ b/InteractionComponent_8h_source.html @@ -128,23 +128,23 @@ $(function(){initNavTree('InteractionComponent_8h_source.html',''); initResizabl
4#include "InteractionListener.h"
5
6#include <functional>
-
7
-
-
8class InteractionComponent : public Component, public InteractionListener
-
9{
-
10public:
-
15 InteractionComponent(std::function<void(void*,void*)> callback);
-
16
-
20 void interact(void* actor, void* data) override;
-
21
-
25 std::shared_ptr<Vector2D> getPosition() override;
-
26private:
-
27 std::function<void(void*,void*)> interactionCallback;
-
28};
+
7
+
+
10class InteractionComponent : public Component, public InteractionListener
+
11{
+
12public:
+
17 InteractionComponent(std::function<void(void*,void*)> callback);
+
18
+
19 void init() override;
+
23 void interact(void* actor, void* data) override;
+
24
+
28 std::shared_ptr<Vector2D> getPosition() override;
+
29private:
+
30 std::function<void(void*,void*)> interactionCallback;
+
31};
-
Definition Component.h:8
-
std::shared_ptr< Vector2D > getPosition() override
Internal function to use as reference for targeting.
Definition InteractionComponent.cpp:16
-
void interact(void *actor, void *data) override
Internal function to be called when an interaction event is triggered.
Definition InteractionComponent.cpp:10
+
std::shared_ptr< Vector2D > getPosition() override
Internal function to use as reference for targeting.
Definition InteractionComponent.cpp:21
+
void interact(void *actor, void *data) override
Internal function to be called when an interaction event is triggered.
Definition InteractionComponent.cpp:15
InteractionComponent(std::function< void(void *, void *)> callback)
Constructor for the InteractionComponent.
Definition InteractionComponent.cpp:5
diff --git a/InteractionListener_8h_source.html b/InteractionListener_8h_source.html index 2b0d4ca..02d79df 100644 --- a/InteractionListener_8h_source.html +++ b/InteractionListener_8h_source.html @@ -127,8 +127,7 @@ $(function(){initNavTree('InteractionListener_8h_source.html',''); initResizable
3#include "Vector2D.h"
4#include <memory>
5
-
-
6class InteractionListener {
+
6class InteractionListener {
7public:
8 InteractionListener() { };
9 virtual ~InteractionListener() { };
@@ -140,7 +139,6 @@ $(function(){initNavTree('InteractionListener_8h_source.html',''); initResizable
15 }
16
17};
-
diff --git a/InteractionManager_8h_source.html b/InteractionManager_8h_source.html index 46514ed..32cbc92 100644 --- a/InteractionManager_8h_source.html +++ b/InteractionManager_8h_source.html @@ -135,10 +135,9 @@ $(function(){initNavTree('InteractionManager_8h_source.html',''); initResizable(
11#include <ranges>
12
13// TODO: ranges concept to avoid to<vector> in cpp
-
14typedef std::function<std::shared_ptr<InteractionListener>(Vector2D*, std::vector<std::shared_ptr<InteractionListener>>)> TargetingFunc;
+
14typedef std::function<std::shared_ptr<InteractionListener>(Vector2D*, std::vector<std::shared_ptr<InteractionListener>>)> TargetingFunc;
15
-
-
16class InteractionManager {
+
16class InteractionManager {
17public:
18 InteractionManager();
19 InteractionManager (const InteractionManager&) = delete;
@@ -158,8 +157,6 @@ $(function(){initNavTree('InteractionManager_8h_source.html',''); initResizable(
33 std::vector<std::weak_ptr<InteractionListener>> listeners;
34 std::array<TargetingFunc, 256> targetingFuncs;
35};
-
-
Vector2D
Definition Vector2D.h:7
diff --git a/Manager_8h_source.html b/Manager_8h_source.html index 7a653b8..965d19f 100644 --- a/Manager_8h_source.html +++ b/Manager_8h_source.html @@ -133,37 +133,37 @@ $(function(){initNavTree('Manager_8h_source.html',''); initResizable(true); });
9#include "Constants.h"
10#include "Entity.h"
11
-
12class GameInternal;
+
12class GameInternal;
22class Manager
23{
24public:
-
25 Manager(GameInternal* game) : game(game) {};
+
25 Manager(GameInternal* game) : game(game) {};
26
27 void update(uint_fast16_t diffTime);
30 void refresh();
31
-
32 void addToGroup(Entity* mEntity, Group mGroup);
-
33 std::vector<Entity*>& getGroup(Group mGroup);
-
34
-
35 std::vector<Entity*> getAll();
-
36
-
37 Entity& addEntity();
-
38
-
39 GameInternal* getGame() { return this->game; };
-
40
-
41private:
-
42 GameInternal* game;
-
43 std::vector<std::unique_ptr<Entity>> entities;
-
44 std::array<std::vector<Entity*>, MAX_GROUPS> entitiesByGroup;
-
45};
+
32#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
33 void addToGroup(Entity* mEntity, Group mGroup);
+
34 std::vector<Entity*>& getGroup(Group mGroup);
+
35#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
36
+
38 std::vector<Entity*> getAll();
+
39
+
41 Entity& addEntity();
+
42
+
44 GameInternal* getGame() { return this->game; };
+
45
+
46private:
+
47 GameInternal* game;
+
48 std::vector<std::unique_ptr<Entity>> entities;
+
49 std::array<std::vector<Entity*>, MAX_GROUPS> entitiesByGroup;
+
50};
Entity
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
-
GameInternal
Definition GameInternal.h:31
-
Manager::getGroup
std::vector< Entity * > & getGroup(Group mGroup)
Definition Manager.cpp:40
-
Manager::addEntity
Entity & addEntity()
Creates and returns a new, empty entity.
Definition Manager.cpp:54
-
Manager::addToGroup
void addToGroup(Entity *mEntity, Group mGroup)
Definition Manager.cpp:35
-
Manager::getAll
std::vector< Entity * > getAll()
Definition Manager.cpp:45
+
Manager::getGame
GameInternal * getGame()
Definition Manager.h:44
+
Manager::addEntity
Entity & addEntity()
Add a new entity to the game.
Definition Manager.cpp:54
+
Manager::getAll
std::vector< Entity * > getAll()
Returns all entities currently loaded in the game.
Definition Manager.cpp:45
Manager::update
void update(uint_fast16_t diffTime)
Definition Manager.cpp:30
Manager::refresh
void refresh()
Definition Manager.cpp:9
diff --git a/Map_8h_source.html b/Map_8h_source.html index 4cd40ce..b161e12 100644 --- a/Map_8h_source.html +++ b/Map_8h_source.html @@ -134,44 +134,43 @@ $(function(){initNavTree('Map_8h_source.html',''); initResizable(true); });
10#include <tmxlite/TileLayer.hpp>
11#include <tmxlite/Types.hpp>
12
-
13class GameInternal;
-
-
14class Map
-
15{
-
16public:
-
23 Map(const char* path);
-
24 void generateTiles();
-
25private:
-
26 // struct required for initialisation
-
27 struct MapData {
-
28 const std::vector<tmx::Tileset>* tileSets;
-
29 const std::vector<tmx::Layer::Ptr>* mapLayers;
-
30 const tmx::Vector2u* mapSize;
-
31 const tmx::Vector2u* mapTileSize;
-
32 const std::vector<std::string>* texturePaths;
-
33 };
-
34
-
35 struct TileSetData {
-
36 std::string texturePath{};
-
37 tmx::Vector2f textureSize;
-
38 uint32_t tileCount{};
-
39 tmx::Vector2u tileCount2D;
-
40 uint32_t firstGID{};
-
41 };
-
42
-
43 tmx::Map map;
-
44 Map::MapData mapData;
-
45 std::vector<std::function<void()>> tileConstructors;
-
46
-
47 void loadTileLayer(const tmx::TileLayer& layer);
-
48 static void addTile(float x, float y, const tmx::Vector2u& mapTileSize, int u, int v, int zIndex, std::string texturePath, bool hasCollision);
-
49
-
50 template<typename T>
-
51 static std::optional<T> getLayerProperty(const std::vector<tmx::Property>& properties, std::string propertyName) { return std::nullopt; };
-
52};
+
13class GameInternal;
+
+
15class Map
+
16{
+
17public:
+
24 Map(const char* path);
+
26 void generateTiles();
+
27private:
+
28 // struct required for initialisation
+
29 struct MapData {
+
30 const std::vector<tmx::Tileset>* tileSets;
+
31 const std::vector<tmx::Layer::Ptr>* mapLayers;
+
32 const tmx::Vector2u* mapSize;
+
33 const tmx::Vector2u* mapTileSize;
+
34 const std::vector<std::string>* texturePaths;
+
35 };
+
36
+
37 struct TileSetData {
+
38 std::string texturePath{};
+
39 tmx::Vector2f textureSize;
+
40 uint32_t tileCount{};
+
41 tmx::Vector2u tileCount2D;
+
42 uint32_t firstGID{};
+
43 };
+
44
+
45 tmx::Map map;
+
46 Map::MapData mapData;
+
47 std::vector<std::function<void()>> tileConstructors;
+
48
+
49 void loadTileLayer(const tmx::TileLayer& layer);
+
50 static void addTile(float x, float y, const tmx::Vector2u& mapTileSize, int u, int v, int zIndex, std::string texturePath, bool collision);
+
51
+
52 template<typename T>
+
53 static std::optional<T> getLayerProperty(const std::vector<tmx::Property>& properties, std::string propertyName) { return std::nullopt; };
+
54};
-
Definition GameInternal.h:31
-
void generateTiles()
Generates the map based on the loaded definition.
Definition Map.cpp:180
+
void generateTiles()
Used to generate the tiles of a previously loaded map.
Definition Map.cpp:180
Map(const char *path)
Loads a .tmx map.
Definition Map.cpp:55
diff --git a/PickupComponent_8h_source.html b/PickupComponent_8h_source.html index c44926b..3605952 100644 --- a/PickupComponent_8h_source.html +++ b/PickupComponent_8h_source.html @@ -126,21 +126,20 @@ $(function(){initNavTree('PickupComponent_8h_source.html',''); initResizable(tru
2
3#include <functional>
4#include "Component.h"
-
5
-
-
6class PickupComponent : public Component
-
7{
-
8public:
-
13 PickupComponent(std::function<void (Entity*)> func);
-
14 ~PickupComponent() {};
-
15
-
16 void update(uint_fast16_t diffTime) override;
+
5
+
+
8class PickupComponent : public Component
+
9{
+
10public:
+
15 PickupComponent(std::function<void (Entity*)> func);
+
17
-
18private:
-
19 std::function<void (Entity*)> pickupFunc;
-
20};
+
18 void update(uint_fast16_t diffTime) override;
+
19
+
20private:
+
21 std::function<void (Entity*)> pickupFunc;
+
22};
-
Definition Component.h:8
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
PickupComponent(std::function< void(Entity *)> func)
Construct a new Powerup Component object.
Definition PickupComponent.cpp:14
diff --git a/PickupManager_8h_source.html b/PickupManager_8h_source.html index 6912973..2627b17 100644 --- a/PickupManager_8h_source.html +++ b/PickupManager_8h_source.html @@ -132,30 +132,25 @@ $(function(){initNavTree('PickupManager_8h_source.html',''); initResizable(true)
8#include "Entity.h"
9#include "SoundEffects.h"
10
-
11class Vector2D;
+
11class Vector2D;
12class Manager;
13
-
-
14class PickupManager
+
14class PickupManager
15{
16public:
17
-
18 PickupManager(Manager* manager);
+
18 PickupManager(Manager* manager);
19 ~PickupManager();
20
-
21 void createPowerup(Vector2D pos, std::function<void (Entity*)> pickupFunc, Textures texture);
+
21 void createPowerup(Vector2D pos, std::function<void (Entity*)> pickupFunc, Textures texture);
22
-
23 Vector2D calculateSpawnPosition();
+
23 Vector2D calculateSpawnPosition();
24
25private:
26
-
27 Manager* man;
+
27 Manager* man;
28};
-
-
Entity
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
Manager
Is responsible for managing all entities.
Definition Manager.h:23
-
Textures
Forward declaration of the Textures enum class.
-
Vector2D
Definition Vector2D.h:7
diff --git a/PlayerComponent_8h_source.html b/PlayerComponent_8h_source.html index d8a8885..b0dac11 100644 --- a/PlayerComponent_8h_source.html +++ b/PlayerComponent_8h_source.html @@ -126,15 +126,11 @@ $(function(){initNavTree('PlayerComponent_8h_source.html',''); initResizable(tru
2
3#include "Component.h"
4
-
-
5class PlayerComponent : public Component
+
5class PlayerComponent : public Component
6{
7public:
8private:
9};
-
-
Component
Definition Component.h:8
-
PlayerComponent
Definition PlayerComponent.h:6
diff --git a/ProjectileComponent_8h_source.html b/ProjectileComponent_8h_source.html index 87d2367..a79ba3b 100644 --- a/ProjectileComponent_8h_source.html +++ b/ProjectileComponent_8h_source.html @@ -131,13 +131,12 @@ $(function(){initNavTree('ProjectileComponent_8h_source.html',''); initResizable
7
8class TransformComponent;
9
-
-
10class ProjectileComponent : public Component
+
10class ProjectileComponent : public Component
11{
12 //can maybe be split in separate .cpp file
13
14public:
-
15 ProjectileComponent(int range, int speed, Vector2D direction, Entity* owner, SoundEffects soundEffect)
+
15 ProjectileComponent(int range, int speed, Vector2D direction, Entity* owner, SoundEffects soundEffect)
16 : range(range), speed(speed), direction(direction), owner(owner), soundEffect(soundEffect) {}
17 ~ProjectileComponent() {}
18
@@ -145,23 +144,19 @@ $(function(){initNavTree('ProjectileComponent_8h_source.html',''); initResizable
20 void update(uint_fast16_t diffTime) override;
21
22private:
-
23 TransformComponent* transformComponent;
+
23 TransformComponent* transformComponent;
24
25 int range = 0;
26 float speed = 0;
27 float distance = 0;
28
-
29 Entity* owner = nullptr;
+
29 Entity* owner = nullptr;
30
-
31 Vector2D direction;
+
31 Vector2D direction;
32
33 SoundEffects soundEffect;
34};
-
-
Component
Definition Component.h:8
-
Entity
Main class for any object in game, stores associations, labeling and components.
Definition Entity.h:35
-
TransformComponent
Definition TransformComponent.h:9
-
Vector2D
Definition Vector2D.h:7
+
TransformComponent
Adds a transform to an entity when added via entity.addComponent()
Definition TransformComponent.h:11
diff --git a/RenderManager_8h_source.html b/RenderManager_8h_source.html index f2a18e2..7583bf3 100644 --- a/RenderManager_8h_source.html +++ b/RenderManager_8h_source.html @@ -128,8 +128,7 @@ $(function(){initNavTree('RenderManager_8h_source.html',''); initResizable(true)
4
5#include "RenderObject.h"
6
-
-
7class RenderManager {
+
7class RenderManager {
8public:
9 RenderManager() {};
10
@@ -138,23 +137,20 @@ $(function(){initNavTree('RenderManager_8h_source.html',''); initResizable(true)
13 * \param renderObject The object to be removed
14 * \sa RenderObject
15 */
-
16 void remove(RenderObject* obj);
+
16 void remove(RenderObject* obj);
17 /*
18 * Add an object to be rendered
19 * \param renderObject The object to be rendered
20 * \sa RenderObject
21 */
-
22 void add(RenderObject* obj);
+
22 void add(RenderObject* obj);
23
-
24 void renderAll();
+
24 void renderAll();
25
26private:
27 std::vector<RenderObject*> renderObjects;
28 bool isSorted;
29};
-
-
RenderManager::renderAll
void renderAll()
Render all objects. If the list has been modified, sorts it based on z-index first.
Definition RenderManager.cpp:5
-
RenderObject
Definition RenderObject.h:6
diff --git a/RenderObject_8h_source.html b/RenderObject_8h_source.html index c655bf8..2e400d0 100644 --- a/RenderObject_8h_source.html +++ b/RenderObject_8h_source.html @@ -124,15 +124,14 @@ $(function(){initNavTree('RenderObject_8h_source.html',''); initResizable(true);
1#pragma once
2
-
3class RenderManager;
+
3class RenderManager;
4
-
-
5class RenderObject
+
5class RenderObject
6{
7public:
8 virtual void draw() = 0;
9
-
10 RenderObject(int zIndex, RenderManager* renderManager);
+
10 RenderObject(int zIndex, RenderManager* renderManager);
11 ~RenderObject();
12
13 int getZIndex() { return this->zIndex; };
@@ -149,10 +148,8 @@ $(function(){initNavTree('RenderObject_8h_source.html',''); initResizable(true);
23 int zIndex = 0;
24
25protected:
-
26 RenderManager* renderManager;
+
26 RenderManager* renderManager;
27};
-
-
Definition RenderManager.h:7
Comparitor to compare two ptr based on z-index.
Definition RenderObject.h:16
diff --git a/SoundManager_8h_source.html b/SoundManager_8h_source.html index 59c2bd1..4e611b4 100644 --- a/SoundManager_8h_source.html +++ b/SoundManager_8h_source.html @@ -133,7 +133,7 @@ $(function(){initNavTree('SoundManager_8h_source.html',''); initResizable(true);
9#include "BackgroundMusic.h"
10#include "SoundEffects.h"
11
-
12class GameInternal;
+
12class GameInternal;
13
20class SoundManager
@@ -201,7 +201,6 @@ $(function(){initNavTree('SoundManager_8h_source.html',''); initResizable(true);
108 static void addSingleSoundEffect(SoundEffects soundEffect, const char* path);
109};
-
GameInternal
Definition GameInternal.h:31
SoundManager::playSound
static void playSound(SoundEffects sound, bool canOverlap, int loops, int volume, int channel)
Handles playing of sound effects.
Definition SoundManager.cpp:53
SoundManager::pauseMusic
static void pauseMusic()
Handles pausing music track.
Definition SoundManager.cpp:122
SoundManager::addSoundEffects
static void addSoundEffects(const std::map< SoundEffects, const char * > &effects)
Initializes sound-effects and adds them to a cache.
Definition SoundManager.cpp:177
diff --git a/SpriteComponent_8h_source.html b/SpriteComponent_8h_source.html index e3758ae..db7d000 100644 --- a/SpriteComponent_8h_source.html +++ b/SpriteComponent_8h_source.html @@ -136,64 +136,65 @@ $(function(){initNavTree('SpriteComponent_8h_source.html',''); initResizable(tru
12#include "RenderObject.h"
13
14class TransformComponent;
-
15
-
-
16class SpriteComponent : public Component, public RenderObject
-
17{
-
18public:
-
19 int animationIndex = 0;
-
20
-
21 std::map<std::string, std::unique_ptr<Animation>>* animations = nullptr;
-
22
-
23private:
-
24 TransformComponent* transform;
-
25 SDL_Texture* texture;
-
26 SDL_FRect srcRect, destRect;
-
27
-
28 Textures textureEnum;
-
29
-
30 bool animated = false;
-
31 uint8_t frames = 0;
-
32 uint8_t speed = 100;
-
33 bool flipped = false;
-
34
-
35 int textureXOffset;
-
36 int textureYOffset;
-
37
-
38 //there should be a better solution as this variable is only used for the loading of the tmx map
-
39 //TODO: improve this in the future and also remove it from the scope of the developer
-
40 const char* path;
-
41
-
42public:
-
43 //debug
-
44 Textures getTexture() { return this->textureEnum; }
-
45
+
16
+
+
17class SpriteComponent : public Component, public RenderObject
+
18{
+
19public:
+
20 int animationIndex = 0;
+
21
+
22 std::map<std::string, std::unique_ptr<Animation>>* animations = nullptr;
+
23
+
24private:
+
25 TransformComponent* transform;
+
26 SDL_Texture* texture;
+
27 SDL_FRect srcRect, destRect;
+
28
+
29 Textures textureEnum;
+
30
+
31 bool animated = false;
+
32 uint8_t frames = 0;
+
33 uint8_t speed = 100;
+
34 bool flipped = false;
+
35
+
36 int textureXOffset;
+
37 int textureYOffset;
+
38
+
39 //there should be a better solution as this variable is only used for the loading of the tmx map
+
40 //TODO: improve this in the future and also remove it from the scope of the developer
+
41 const char* path;
+
42
+
43public:
+
44 //debug
+
45 Textures getTexture() { return this->textureEnum; }
46
47
-
48 SpriteComponent(Textures texture, int zIndex);
-
49 SpriteComponent(Textures texture, int xOffset, int yOffset, int zIndex);
-
50 SpriteComponent(const char* path, int xOffset, int yOffset, int zIndex);
-
51 SpriteComponent(
-
52 Textures texture,
-
53 bool isAnimated,
-
54 std::map<std::string, std::unique_ptr<Animation>>* animationList,
-
55 std::string defaultAnimation,
-
56 int zIndex);
-
57 ~SpriteComponent();
-
58
-
59 void setTexture(Textures texture);
-
60 void setMapTileTexture(const char* path);
-
61
-
62 void init() override;
-
63 void update(uint_fast16_t diffTime) override;
-
64 void draw() override;
-
65 void playAnimation(std::string type);
-
66 void setDirection(Direction direction);
-
67};
+
48
+
52 SpriteComponent(Textures texture, int zIndex);
+
53
+
58 SpriteComponent(Textures texture, int xOffset, int yOffset, int zIndex);
+
63 SpriteComponent(const char* path, int xOffset, int yOffset, int zIndex);
+ +
71 Textures texture,
+
72 bool isAnimated,
+
73 std::map<std::string, std::unique_ptr<Animation>>* animationList,
+
74 std::string defaultAnimation,
+
75 int zIndex);
+ +
77
+
78 void setTexture(Textures texture);
+
79 void setMapTileTexture(const char* path);
+
80
+
81 void init() override;
+
82 void update(uint_fast16_t diffTime) override;
+
83 void draw() override;
+
84 void playAnimation(std::string type);
+
85 void setDirection(Direction direction);
+
86};
-
Definition Component.h:8
+
SpriteComponent(Textures texture, int zIndex)
Constructor for SpriteComponent.
Definition SpriteComponent.cpp:18
Forward declaration of the Textures enum class.
-
Definition TransformComponent.h:9
+
Adds a transform to an entity when added via entity.addComponent()
Definition TransformComponent.h:11
diff --git a/StatEffectsComponent_8h_source.html b/StatEffectsComponent_8h_source.html index a6fe912..af4417a 100644 --- a/StatEffectsComponent_8h_source.html +++ b/StatEffectsComponent_8h_source.html @@ -137,22 +137,18 @@ $(function(){initNavTree('StatEffectsComponent_8h_source.html',''); initResizabl
15};
16
-
-
17class StatEffectsComponent : public Component{
+
17class StatEffectsComponent : public Component{
18public:
19 StatEffectsComponent() {};
20 ~StatEffectsComponent() {};
21
22 void init() override;
23 void update(uint_fast16_t diffTime) override;
-
29 void addEffect(uint32_t duration, std::function<void()> resetFunction);
+
29 void addEffect(uint32_t duration, std::function<void()> resetFunction);
30
31private:
32 std::vector<StatEffect> effects = {};
33};
-
-
Component
Definition Component.h:8
-
StatEffectsComponent::addEffect
void addEffect(uint32_t duration, std::function< void()> resetFunction)
Add a stat effect to the entity.
Definition StatEffectsComponent.cpp:24
StatEffect
Struct to hold the duration, reset function and start time of a stat effect.
Definition StatEffectsComponent.h:11
StatEffect::resetFunction
std::function< void()> resetFunction
Function to reset the effect, will be called on expiry of duration.
Definition StatEffectsComponent.h:13
StatEffect::duration
uint32_t duration
Duration of the effect in milliseconds.
Definition StatEffectsComponent.h:12
diff --git a/TileComponent_8h_source.html b/TileComponent_8h_source.html index a5b74d0..566baaf 100644 --- a/TileComponent_8h_source.html +++ b/TileComponent_8h_source.html @@ -134,16 +134,15 @@ $(function(){initNavTree('TileComponent_8h_source.html',''); initResizable(true)
10class SpriteComponent;
11class TransformComponent;
12
-
-
13class TileComponent : public Component
+
13class TileComponent : public Component
14{
15public:
-
16 TransformComponent* transform;
-
17 SpriteComponent* sprite;
+
16 TransformComponent* transform;
+
17 SpriteComponent* sprite;
18
19 SDL_Rect tileRect;
20 int tileID;
-
21 Textures texture;
+
21 Textures texture;
22
23 TileComponent() = default;
24 TileComponent(int x, int y, int w, int h, int id, const std::map<int, std::pair<Textures, bool>>* textureDict);
@@ -159,11 +158,8 @@ $(function(){initNavTree('TileComponent_8h_source.html',''); initResizable(true)
34private:
35 bool collision;
36};
-
-
Component
Definition Component.h:8
-
SpriteComponent
Definition SpriteComponent.h:17
-
Textures
Forward declaration of the Textures enum class.
-
TransformComponent
Definition TransformComponent.h:9
+
SpriteComponent
SpriteComponent class to handle sprite rendering and animation.
Definition SpriteComponent.h:18
+
TransformComponent
Adds a transform to an entity when added via entity.addComponent()
Definition TransformComponent.h:11
diff --git a/TransformComponent_8h_source.html b/TransformComponent_8h_source.html index 8e1ae20..43b8d9c 100644 --- a/TransformComponent_8h_source.html +++ b/TransformComponent_8h_source.html @@ -128,32 +128,30 @@ $(function(){initNavTree('TransformComponent_8h_source.html',''); initResizable(
4#include "Vector2D.h"
5#include "Constants.h"
6#include "DataComponent.h"
-
7
-
-
8class TransformComponent : public Component
-
9{
-
10public:
-
11 Vector2D position; // TODO: change to int to save CPU time -> possibly subpixel coordinates
-
12 Vector2D direction;
-
13
-
14 int height = 32;
-
15 int width = 32;
-
16 int scale = 1;
-
17
-
18 explicit TransformComponent(int scale = 1);
-
19 TransformComponent(float x, float y, int scale = 1);
-
20 TransformComponent(float x, float y, int w, int h, int scale = 1);
-
21
-
22 void init() override;
-
24 void update(uint_fast16_t diffTime) override;
-
25 void setPositionAfterCollision(Vector2D& positionChange);
-
26 int getSpeed();
-
27
-
28};
+
7
+
+
10class TransformComponent : public Component
+
11{
+
12public:
+
13 Vector2D position; // TODO: change to int to save CPU time -> possibly subpixel coordinates
+
14 Vector2D direction;
+
15
+
16 int height = 32;
+
17 int width = 32;
+
18 int scale = 1;
+
19
+
21 explicit TransformComponent(int scale = 1);
+
22 TransformComponent(float x, float y, int scale = 1);
+
23 TransformComponent(float x, float y, int w, int h, int scale = 1);
+
24
+
25 void init() override;
+
26 void update(uint_fast16_t diffTime) override;
+
27 void setPositionAfterCollision(Vector2D& positionChange);
+
28 int getSpeed();
+
29
+
30};
-
Definition Component.h:8
-
void update(uint_fast16_t diffTime) override
Definition TransformComponent.cpp:43
-
Definition Vector2D.h:7
+
TransformComponent(int scale=1)
Definition TransformComponent.cpp:16
diff --git a/VEGO_8h_source.html b/VEGO_8h_source.html index 6997d07..84f8492 100644 --- a/VEGO_8h_source.html +++ b/VEGO_8h_source.html @@ -128,10 +128,9 @@ $(function(){initNavTree('VEGO_8h_source.html',''); initResizable(true); });
4 extern GameInternal* game;
5}
6
-
7inline GameInternal& VEGO_Game() {
+
7inline GameInternal& VEGO_Game() {
8 return *vego::game;
9};
-
GameInternal
Definition GameInternal.h:31
diff --git a/Vector2D_8h_source.html b/Vector2D_8h_source.html index 3c80f4a..66467a9 100644 --- a/Vector2D_8h_source.html +++ b/Vector2D_8h_source.html @@ -127,8 +127,7 @@ $(function(){initNavTree('Vector2D_8h_source.html',''); initResizable(true); });
3#include <SDL3/SDL.h>
4#include <SDL3/SDL_rect.h>
5
-
-
6class Vector2D
+
6class Vector2D
7{
8public:
9 float x;
@@ -146,10 +145,8 @@ $(function(){initNavTree('Vector2D_8h_source.html',''); initResizable(true); });
21 Vector2D& operator*(const int& i);
22 Vector2D& zero();
23};
-
24
-
25SDL_Rect operator+(const SDL_Rect& rect, const Vector2D& vector2D);
-
Vector2D
Definition Vector2D.h:7
+
25SDL_Rect operator+(const SDL_Rect& rect, const Vector2D& vector2D);
diff --git a/annotated.html b/annotated.html index a8773a8..7b40688 100644 --- a/annotated.html +++ b/annotated.html @@ -124,45 +124,23 @@ $(function(){initNavTree('annotated.html',''); initResizable(true); });
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 12]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
 Nvego
 CGameRegistryHelper
 CAnimation
 CColliderComponent
 CCollisionHandler
 CComponent
 CConfigLoaderEnables configuration of specific engine variables via a custom JSON file
 CDataComponent
 CEntityMain class for any object in game, stores associations, labeling and components
 CEventManager
 CGame
 CGameFactory
 CGameInternal
 CHealthComponent
 CInputComponent
 CInputManager
 CInputAction
 CInteractionComponent
 CInteractionEventdataStructStruct to hold data for interaction events. This struct is used to pass data to the interaction manager when an interaction event is triggered
 CInteractionListener
 CInteractionManager
 CManagerIs responsible for managing all entities
 CMap
 CPickupComponent
 CPickupManager
 CPlayerComponent
 CProjectileComponent
 CRenderManager
 CRenderObject
 CZIndexComparatorComparitor to compare two ptr based on z-index
 CSoundManagerHandles music and sound
 CSpriteComponent
 CStatEffectStruct to hold the duration, reset function and start time of a stat effect
 CStatEffectsComponent
 CTextureManagerA manager for loading, caching, and drawing textures
 CTexturesForward declaration of the Textures enum class
 CTileComponent
 CTransformComponent
 CVector2D
 CColliderComponentAdds a collision box to an entity when added via entity.addComponent()
 CCollisionHandlerClass responsible for collision detection and handling
 CConfigLoaderEnables configuration of specific engine variables via a custom JSON file
 CEntityMain class for any object in game, stores associations, labeling and components
 CInputManagerInputManager class to handle input events and actions
 CInputActionInputAction struct to represent an action and its bindings
 CInteractionComponentInteractionComponent class to handle interaction events
 CInteractionEventdataStructStruct to hold data for interaction events. This struct is used to pass data to the interaction manager when an interaction event is triggered
 CManagerIs responsible for managing all entities
 CMapClass responsible for the creation and management of the map or background
 CPickupComponentPickupComponent class to handle pickup events
 CSoundManagerHandles music and sound
 CSpriteComponentSpriteComponent class to handle sprite rendering and animation
 CStatEffectStruct to hold the duration, reset function and start time of a stat effect
 CTextureManagerA manager for loading, caching, and drawing textures
 CTexturesForward declaration of the Textures enum class
 CTransformComponentAdds a transform to an entity when added via entity.addComponent()
diff --git a/annotated_dup.js b/annotated_dup.js index 7ecd119..340d674 100644 --- a/annotated_dup.js +++ b/annotated_dup.js @@ -1,41 +1,19 @@ var annotated_dup = [ - [ "vego", null, [ - [ "GameRegistryHelper", "classvego_1_1GameRegistryHelper.html", null ] - ] ], - [ "Animation", "structAnimation.html", null ], - [ "ColliderComponent", "classColliderComponent.html", null ], + [ "ColliderComponent", "classColliderComponent.html", "classColliderComponent" ], [ "CollisionHandler", "classCollisionHandler.html", "classCollisionHandler" ], - [ "Component", "classComponent.html", null ], [ "ConfigLoader", "classConfigLoader.html", null ], - [ "DataComponent", "classDataComponent.html", "classDataComponent" ], [ "Entity", "classEntity.html", "classEntity" ], - [ "EventManager", "classEventManager.html", "classEventManager" ], - [ "Game", "classGame.html", "classGame" ], - [ "GameFactory", "classGameFactory.html", null ], - [ "GameInternal", "classGameInternal.html", null ], - [ "HealthComponent", "classHealthComponent.html", null ], - [ "InputComponent", "classInputComponent.html", null ], [ "InputManager", "classInputManager.html", "classInputManager" ], [ "InteractionComponent", "classInteractionComponent.html", "classInteractionComponent" ], [ "InteractionEventdataStruct", "structInteractionEventdataStruct.html", "structInteractionEventdataStruct" ], - [ "InteractionListener", "classInteractionListener.html", null ], - [ "InteractionManager", "classInteractionManager.html", null ], [ "Manager", "classManager.html", "classManager" ], [ "Map", "classMap.html", "classMap" ], [ "PickupComponent", "classPickupComponent.html", "classPickupComponent" ], - [ "PickupManager", "classPickupManager.html", null ], - [ "PlayerComponent", "classPlayerComponent.html", null ], - [ "ProjectileComponent", "classProjectileComponent.html", null ], - [ "RenderManager", "classRenderManager.html", "classRenderManager" ], - [ "RenderObject", "classRenderObject.html", "classRenderObject" ], [ "SoundManager", "classSoundManager.html", null ], - [ "SpriteComponent", "classSpriteComponent.html", null ], + [ "SpriteComponent", "classSpriteComponent.html", "classSpriteComponent" ], [ "StatEffect", "structStatEffect.html", "structStatEffect" ], - [ "StatEffectsComponent", "classStatEffectsComponent.html", "classStatEffectsComponent" ], [ "TextureManager", "classTextureManager.html", "classTextureManager" ], [ "Textures", "classTextures.html", null ], - [ "TileComponent", "classTileComponent.html", null ], - [ "TransformComponent", "classTransformComponent.html", "classTransformComponent" ], - [ "Vector2D", "classVector2D.html", null ] + [ "TransformComponent", "classTransformComponent.html", "classTransformComponent" ] ]; \ No newline at end of file diff --git a/classColliderComponent-members.html b/classColliderComponent-members.html index 1448abb..1f7eec7 100644 --- a/classColliderComponent-members.html +++ b/classColliderComponent-members.html @@ -125,20 +125,12 @@ $(function(){initNavTree('classColliderComponent.html',''); initResizable(true);

This is the complete list of members for ColliderComponent, including all inherited members.

- - - - - - - - - - - - - - + + + + + +
collider (defined in ColliderComponent)ColliderComponent
ColliderComponent(const char *tag) (defined in ColliderComponent)ColliderComponent
ColliderComponent(const char *tag, float hitboxScale) (defined in ColliderComponent)ColliderComponent
entity (defined in Component)Component
handleCollision(Vector2D &characterPos, SDL_Rect &characterCollider, SDL_Rect &componentCollider) (defined in ColliderComponent)ColliderComponent
hasCollision (defined in ColliderComponent)ColliderComponent
hitboxScale (defined in ColliderComponent)ColliderComponent
init() override (defined in ColliderComponent)ColliderComponentvirtual
isProjectile (defined in ColliderComponent)ColliderComponent
removeCollision() (defined in ColliderComponent)ColliderComponent
tag (defined in ColliderComponent)ColliderComponent
transform (defined in ColliderComponent)ColliderComponent
update(uint_fast16_t diffTime) override (defined in ColliderComponent)ColliderComponentvirtual
~Component()=default (defined in Component)Componentvirtual
ColliderComponent(const char *tag)ColliderComponent
ColliderComponent(const char *tag, float hitboxScale)ColliderComponent
getCollider()ColliderComponentinline
getTag() constColliderComponentinline
hasCollision() constColliderComponentinline
removeCollision()ColliderComponent
diff --git a/classColliderComponent.html b/classColliderComponent.html index 84066cd..c91d1ef 100644 --- a/classColliderComponent.html +++ b/classColliderComponent.html @@ -121,69 +121,96 @@ $(function(){initNavTree('classColliderComponent.html',''); initResizable(true);
Public Member Functions | -Public Attributes | List of all members
ColliderComponent Class Reference
-
-Inheritance diagram for ColliderComponent:
-
-
-
[legend]
-
-Collaboration diagram for ColliderComponent:
-
-
-
[legend]
+ +

Adds a collision box to an entity when added via entity.addComponent() + More...

+ +

#include <ColliderComponent.h>

- + + + + + + + + - + + - - - - + - - -

Public Member Functions

ColliderComponent (const char *tag)
SDL_Rect & getCollider ()
 
const char * getTag () const
 
bool hasCollision () const
 
 ColliderComponent (const char *tag)
 Constructor for ColliderComponent.
 
ColliderComponent (const char *tag, float hitboxScale)
 ColliderComponent (const char *tag, float hitboxScale)
 Constructor for ColliderComponent.
 
void init () override
 
void update (uint_fast16_t diffTime) override
 
void removeCollision ()
 Removes the collision of an entity.
 
-void handleCollision (Vector2D &characterPos, SDL_Rect &characterCollider, SDL_Rect &componentCollider)
 
- - - - - - - - - - - - - - - -

-Public Attributes

-SDL_Rect collider
 
-const char * tag
 
-TransformComponenttransform
 
-bool hasCollision
 
-float hitboxScale
 
-bool isProjectile = false
 
- Public Attributes inherited from Component
-Entityentity
 
+

Detailed Description

+

Adds a collision box to an entity when added via entity.addComponent()

+

Constructor & Destructor Documentation

+ +

◆ ColliderComponent() [1/2]

+ +
+
+ + + + + + + +
ColliderComponent::ColliderComponent (const char * tag)
+
+ +

Constructor for ColliderComponent.

+
Parameters
+ + +
tagThe tag of the collider, can be any char*
+
+
+ +
+
+ +

◆ ColliderComponent() [2/2]

+ +
+
+ + + + + + + + + + + +
ColliderComponent::ColliderComponent (const char * tag,
float hitboxScale )
+
+ +

Constructor for ColliderComponent.

+
Parameters
+ + + +
tagThe tag of the collider, can be any char*
hitboxScaleThe scale of the collider, used to scale the collider size, default is 1.0f and takes up the 32x32 pixels
+
+
+ +
+

Member Function Documentation

- -

◆ init()

+ +

◆ getCollider()

@@ -192,7 +219,7 @@ bool isProjectile = fa - + @@ -200,17 +227,16 @@ bool 
void ColliderComponent::init SDL_Rect & ColliderComponent::getCollider ( ) isProjectile = fa
-overridevirtual +inline
- -

Reimplemented from Component.

+
Returns
the collider of the entity
- -

◆ update()

+ +

◆ getTag()

@@ -219,20 +245,45 @@ bool isProjectile = fa - + - - + +
void ColliderComponent::update const char * ColliderComponent::getTag (uint_fast16_t diffTime)) const
-overridevirtual +inline
+
Returns
the tag of the entity
-

Reimplemented from Component.

+
+
+ +

◆ hasCollision()

+ +
+
+ + + + + +
+ + + + + + + +
bool ColliderComponent::hasCollision () const
+
+inline
+
+
Returns
the collision state of the entity
diff --git a/classColliderComponent.js b/classColliderComponent.js new file mode 100644 index 0000000..27f8ff1 --- /dev/null +++ b/classColliderComponent.js @@ -0,0 +1,9 @@ +var classColliderComponent = +[ + [ "ColliderComponent", "classColliderComponent.html#ab2b8fbba2f80f7b9bbf70504f8c3c670", null ], + [ "ColliderComponent", "classColliderComponent.html#a29b7a4326327382ec473730a07f57b9a", null ], + [ "getCollider", "classColliderComponent.html#a334729b3c9b86cf7ee99b908f100a043", null ], + [ "getTag", "classColliderComponent.html#a4438054178328402309cf72589f4f163", null ], + [ "hasCollision", "classColliderComponent.html#a916be6c5f07a15fbd4f198be4c3c5a5f", null ], + [ "removeCollision", "classColliderComponent.html#a6ac04cfb252c5712d53aaa30603165e3", null ] +]; \ No newline at end of file diff --git a/classColliderComponent__coll__graph.map b/classColliderComponent__coll__graph.map deleted file mode 100644 index de5c421..0000000 --- a/classColliderComponent__coll__graph.map +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/classColliderComponent__coll__graph.md5 b/classColliderComponent__coll__graph.md5 deleted file mode 100644 index 0afa083..0000000 --- a/classColliderComponent__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -12c7ffbfb4eeeebc33e50a8cbba6d99a \ No newline at end of file diff --git a/classColliderComponent__coll__graph.svg b/classColliderComponent__coll__graph.svg deleted file mode 100644 index d644cd3..0000000 --- a/classColliderComponent__coll__graph.svg +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - -ColliderComponent - - -Node1 - - -ColliderComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - -Node4 - - -TransformComponent - - - - - -Node2->Node4 - - - - - - - - -Node3 - - -Entity - - - - - -Node3->Node2 - - - - - - entity - - - -Node4->Node1 - - - - - - transform - - - -Node5 - - -Vector2D - - - - - -Node5->Node4 - - - - - - direction -position - - - - - - - - diff --git a/classColliderComponent__coll__graph_org.svg b/classColliderComponent__coll__graph_org.svg deleted file mode 100644 index bc61369..0000000 --- a/classColliderComponent__coll__graph_org.svg +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - -ColliderComponent - - -Node1 - - -ColliderComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - -Node4 - - -TransformComponent - - - - - -Node2->Node4 - - - - - - - - -Node3 - - -Entity - - - - - -Node3->Node2 - - - - - - entity - - - -Node4->Node1 - - - - - - transform - - - -Node5 - - -Vector2D - - - - - -Node5->Node4 - - - - - - direction -position - - - diff --git a/classColliderComponent__inherit__graph.map b/classColliderComponent__inherit__graph.map deleted file mode 100644 index d26aa53..0000000 --- a/classColliderComponent__inherit__graph.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/classColliderComponent__inherit__graph.md5 b/classColliderComponent__inherit__graph.md5 deleted file mode 100644 index 9a90d28..0000000 --- a/classColliderComponent__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -6c7f9d1506558bfb250c7f446bf02fad \ No newline at end of file diff --git a/classColliderComponent__inherit__graph.svg b/classColliderComponent__inherit__graph.svg deleted file mode 100644 index 826d0f5..0000000 --- a/classColliderComponent__inherit__graph.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - -ColliderComponent - - -Node1 - - -ColliderComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - - - - - - diff --git a/classColliderComponent__inherit__graph_org.svg b/classColliderComponent__inherit__graph_org.svg deleted file mode 100644 index c685151..0000000 --- a/classColliderComponent__inherit__graph_org.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -ColliderComponent - - -Node1 - - -ColliderComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - diff --git a/classCollisionHandler-members.html b/classCollisionHandler-members.html index 6bc25a1..2d6e619 100644 --- a/classCollisionHandler-members.html +++ b/classCollisionHandler-members.html @@ -125,16 +125,11 @@ $(function(){initNavTree('classCollisionHandler.html',''); initResizable(true);

This is the complete list of members for CollisionHandler, including all inherited members.

- - - - - - - - - - + + + + +
CollisionHandler(Manager &mManager) (defined in CollisionHandler)CollisionHandlerinline
getAnyIntersection(Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={})CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)CollisionHandler
getColliders(std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities={}) (defined in CollisionHandler)CollisionHandler
getIntersection(Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0)) (defined in CollisionHandler)CollisionHandlerstatic
getIntersectionWithBounds(Entity *entity, Vector2D posMod=Vector2D(0, 0)) (defined in CollisionHandler)CollisionHandlerstatic
update() (defined in CollisionHandler)CollisionHandler
~CollisionHandler() (defined in CollisionHandler)CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={})CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)CollisionHandler
getAnyIntersection(Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)CollisionHandler
getIntersection(Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0))CollisionHandlerstatic
diff --git a/classCollisionHandler.html b/classCollisionHandler.html index b48f080..7f76be6 100644 --- a/classCollisionHandler.html +++ b/classCollisionHandler.html @@ -126,42 +126,37 @@ $(function(){initNavTree('classCollisionHandler.html',''); initResizable(true);
CollisionHandler Class Reference
+ +

Class responsible for collision detection and handling. + More...

+ +

#include <CollisionHandler.h>

- - - - - + - - - + - + - +

Public Member Functions

CollisionHandler (Manager &mManager)
 
-std::vector< ColliderComponent * > getColliders (std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities={})
 
template<typename T>
getAnyIntersection (Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={})
getAnyIntersection (Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={})
 Tests entity against all entities with the specified labels for a collision.
 
-void update ()
 
template<>
IntersectionBitSet getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)
IntersectionBitSet getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)
 
template<>
EntitygetAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)
EntitygetAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)
 
template<>
bool getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)
bool getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities)
 
- + + - -

Static Public Member Functions

-static IntersectionBitSet getIntersection (Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0))
static IntersectionBitSet getIntersection (Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0))
 Checks for intersections relative to entityA.
 
-static IntersectionBitSet getIntersectionWithBounds (Entity *entity, Vector2D posMod=Vector2D(0, 0))
 
-

Member Function Documentation

+

Detailed Description

+

Class responsible for collision detection and handling.

+

Member Function Documentation

◆ getAnyIntersection() [1/4]

@@ -178,7 +173,7 @@ template<>
- Vector2D posMod, + Vector2D posMod, @@ -199,7 +194,7 @@ IntersectionBitSet
using IntersectionBitSet = std::bitset<DIRECTION_C>;
-

Example usage for IntersectionBitSet (TransformComponent::update()):

IntersectionBitSet intersections =
+

Example usage for IntersectionBitSet (TransformComponent::update()):

IntersectionBitSet intersections =
(CollisionHandler::getIntersectionWithBounds(entity, Vector2D(positionChange.x, 0)) |
(this->entity->getManager()
.getGame()->collisionHandler->getAnyIntersection<IntersectionBitSet>(entity, Vector2D(positionChange.x, 0), colliders)) &
@@ -233,7 +228,7 @@ template<>
- Vector2D posMod, + Vector2D posMod, @@ -268,7 +263,7 @@ template<>
- Vector2D posMod, + Vector2D posMod, @@ -302,7 +297,7 @@ template<typename T> - Vector2D posMod = {}, + Vector2D posMod = {}, @@ -318,7 +313,7 @@ template<typename T>

Tests entity against all entities with the specified labels for a collision.

-

Tests the given entity against every other entity with the specified labels for intersections between their collison boxes. If the primary entity has no ColliderComponent, the equivalent of no collision is returned immediately, other entities are skipped if they don't have a ColliderComponent

Parameters
+

Tests the given entity against every other entity with the specified labels for intersections between their collison boxes. If the primary entity has no ColliderComponent, the equivalent of no collision is returned immediately, other entities are skipped if they don't have a ColliderComponent

Parameters
@@ -328,7 +323,56 @@ template<typename T>
entityThe primary entity to check against. Return values will be relative to this entity
posModModifier to apply toposition before checking collisions.
-
See also
ColliderComponent
+
See also
ColliderComponent
+ +
+ + +

◆ getIntersection()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
IntersectionBitSet CollisionHandler::getIntersection (Entity * entityA,
Entity * entityB,
Vector2D posModA = Vector2D(0,0),
Vector2D posModB = Vector2D(0,0) )
+
+static
+
+ +

Checks for intersections relative to entityA.

+
Parameters
+ + + + +
entityAThe first entity to check against
entityBThe second entity to check against
posModAModifier to apply to entityA's position before checking collisions
+
+
diff --git a/classComponent.html b/classComponent.html deleted file mode 100644 index 58554ce..0000000 --- a/classComponent.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - - VEGO-Engine: Component Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
- -
Component Class Reference
-
-
-
-Inheritance diagram for Component:
-
-
-
[legend]
-
-Collaboration diagram for Component:
-
-
-
[legend]
- - - - - - -

-Public Member Functions

-virtual void init ()
 
virtual void update (uint_fast16_t diffTime)
 
- - - -

-Public Attributes

-Entityentity
 
-

Member Function Documentation

- -

◆ update()

- -
-
- - - - - -
- - - - - - - -
virtual void Component::update (uint_fast16_t diffTime)
-
-inlinevirtual
-
- -

Reimplemented in TransformComponent.

- -
-
-
The documentation for this class was generated from the following file: -
-
- - - - diff --git a/classComponent__coll__graph.map b/classComponent__coll__graph.map deleted file mode 100644 index a683aea..0000000 --- a/classComponent__coll__graph.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/classComponent__coll__graph.md5 b/classComponent__coll__graph.md5 deleted file mode 100644 index 1424047..0000000 --- a/classComponent__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -6b482161a75e88cce0bef5ade2decb1a \ No newline at end of file diff --git a/classComponent__coll__graph.svg b/classComponent__coll__graph.svg deleted file mode 100644 index 8dc0e57..0000000 --- a/classComponent__coll__graph.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - -Component - - -Node1 - - -Component - - - - - -Node2 - - -Entity - - - - - -Node2->Node1 - - - - - - entity - - - - - - - - diff --git a/classComponent__coll__graph_org.svg b/classComponent__coll__graph_org.svg deleted file mode 100644 index 524302f..0000000 --- a/classComponent__coll__graph_org.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - -Component - - -Node1 - - -Component - - - - - -Node2 - - -Entity - - - - - -Node2->Node1 - - - - - - entity - - - diff --git a/classComponent__inherit__graph.map b/classComponent__inherit__graph.map deleted file mode 100644 index cf7a31d..0000000 --- a/classComponent__inherit__graph.map +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/classComponent__inherit__graph.md5 b/classComponent__inherit__graph.md5 deleted file mode 100644 index 0466061..0000000 --- a/classComponent__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -1939c342a91c17c881d6dac7dce2b387 \ No newline at end of file diff --git a/classComponent__inherit__graph.svg b/classComponent__inherit__graph.svg deleted file mode 100644 index 73ffdd3..0000000 --- a/classComponent__inherit__graph.svg +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - -Component - - -Node1 - - -Component - - - - - -Node2 - - -ColliderComponent - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -DataComponent - - - - - -Node1->Node3 - - - - - - - - -Node4 - - -HealthComponent - - - - - -Node1->Node4 - - - - - - - - -Node5 - - -InputComponent - - - - - -Node1->Node5 - - - - - - - - -Node6 - - -InteractionComponent - - - - - -Node1->Node6 - - - - - - - - -Node7 - - -PickupComponent - - - - - -Node1->Node7 - - - - - - - - -Node8 - - -PlayerComponent - - - - - -Node1->Node8 - - - - - - - - -Node9 - - -ProjectileComponent - - - - - -Node1->Node9 - - - - - - - - -Node10 - - -SpriteComponent - - - - - -Node1->Node10 - - - - - - - - -Node11 - - -StatEffectsComponent - - - - - -Node1->Node11 - - - - - - - - -Node12 - - -TileComponent - - - - - -Node1->Node12 - - - - - - - - -Node13 - - -TransformComponent - - - - - -Node1->Node13 - - - - - - - - - - - - - diff --git a/classComponent__inherit__graph_org.svg b/classComponent__inherit__graph_org.svg deleted file mode 100644 index bdcbb6e..0000000 --- a/classComponent__inherit__graph_org.svg +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - -Component - - -Node1 - - -Component - - - - - -Node2 - - -ColliderComponent - - - - - -Node1->Node2 - - - - - - - - -Node3 - - -DataComponent - - - - - -Node1->Node3 - - - - - - - - -Node4 - - -HealthComponent - - - - - -Node1->Node4 - - - - - - - - -Node5 - - -InputComponent - - - - - -Node1->Node5 - - - - - - - - -Node6 - - -InteractionComponent - - - - - -Node1->Node6 - - - - - - - - -Node7 - - -PickupComponent - - - - - -Node1->Node7 - - - - - - - - -Node8 - - -PlayerComponent - - - - - -Node1->Node8 - - - - - - - - -Node9 - - -ProjectileComponent - - - - - -Node1->Node9 - - - - - - - - -Node10 - - -SpriteComponent - - - - - -Node1->Node10 - - - - - - - - -Node11 - - -StatEffectsComponent - - - - - -Node1->Node11 - - - - - - - - -Node12 - - -TileComponent - - - - - -Node1->Node12 - - - - - - - - -Node13 - - -TransformComponent - - - - - -Node1->Node13 - - - - - - - - diff --git a/classConfigLoader-members.html b/classConfigLoader-members.html index ed41ee9..7bc369d 100644 --- a/classConfigLoader-members.html +++ b/classConfigLoader-members.html @@ -124,10 +124,7 @@ $(function(){initNavTree('classConfigLoader.html',''); initResizable(true); });

This is the complete list of members for ConfigLoader, including all inherited members.

- - - -
ConfigLoader() (defined in ConfigLoader)ConfigLoader
~ConfigLoader() (defined in ConfigLoader)ConfigLoader
+ @@ -299,42 +284,6 @@ template<typename T, typename... TArgs> - - - -

◆ addGroup()

- -
-
- - - - - - - -
void Entity::addGroup (Group mGroup)
-
-
See also
GroupLabel
- -
-
- -

◆ delGroup()

- -
-
- - - - - - - -
void Entity::delGroup (Group mGroup)
-
-
See also
GroupLabel
-
@@ -359,7 +308,7 @@ template<typename T, typename... TArgs>
-

Mark for destruction for Manager::refresh() and disables collision

See also
ColliderComponent
+

Mark for destruction for Manager::refresh() and disables collision

See also
ColliderComponent
@@ -388,27 +337,51 @@ template<typename T>
-

<

-
Todo
: rewrite to use optionals
+

Access a specific component of an entity.

+
Template Parameters
+ + +
TType of component to access
+
+
+
Returns
Reference to component of type T <
+
Todo
: rewrite to use optionals
- -

◆ getGroupBitSet()

+ +

◆ getComponentAsPointer()

+
+template<typename T>
+ + + + + +
- + - +
std::bitset< MAX_GROUPS > Entity::getGroupBitSet std::shared_ptr< T > Entity::getComponentAsPointer ( ) const
+
+inline
-
Returns
bitset with true on position GroupLabel if the entity belongs to group
-
See also
GroupLabel
+ +

Access a specific component of an entity as a pointer.

+
Template Parameters
+ + +
TType of component to access
+
+
+
Returns
Pointer to component of type T
@@ -462,25 +435,7 @@ template<typename T>
-
See also
Component
- -
- - -

◆ hasGroup()

- -
-
- - - - - - - -
bool Entity::hasGroup (Group mGroup)
-
-
See also
GroupLabel
+
See also
Component
diff --git a/classEntity.js b/classEntity.js index 4271e8b..944ad46 100644 --- a/classEntity.js +++ b/classEntity.js @@ -3,7 +3,6 @@ var classEntity = [ "GroupLabel", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2b", [ [ "MAPTILES", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2ba924bf7180d60940e428a9166b51ce0f4", null ], [ "PLAYERS", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2bae334ea4bb6fd38968f6809b091120ad8", null ], - [ "ENEMIES", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2baf0d62ea6bc0a041d009322e77e1253c0", null ], [ "COLLIDERS", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2badffa23e89f914b343e7811b01a8f756c", null ], [ "PROJECTILE", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2ba46dccab75ce652352e52086601fdc294", null ], [ "HEARTS", "classEntity.html#a9449a7a0ad2c9ae5ee85ef2401382f2bad52d2d4c0b7218c48897d2e69e156ba4", null ], @@ -11,14 +10,11 @@ var classEntity = ] ], [ "Entity", "classEntity.html#aad34087e815ec2da644b86ae2357039b", null ], [ "addComponent", "classEntity.html#ae587a44fd803d7918a45dbfe531c962d", null ], - [ "addGroup", "classEntity.html#a712c05a013e928943c26c3a5b1467f01", null ], - [ "delGroup", "classEntity.html#ae3902aa921b519ed2c25cf4676c9cb5d", null ], [ "destroy", "classEntity.html#a691dbe5f9ec930c27af2af0b97907a9e", null ], [ "getComponent", "classEntity.html#ad5ce9d4246498a5a2ffd163a2d38c98f", null ], - [ "getGroupBitSet", "classEntity.html#adf88082fc18a9ee0294072a0e028453d", null ], + [ "getComponentAsPointer", "classEntity.html#af153779f4ae16c3aa4d67a52f61333b7", null ], [ "getManager", "classEntity.html#acdf7c696ee39da0d8ebddb1976ea0abe", null ], [ "hasComponent", "classEntity.html#aa622a8d79153a90d0e3b9b992ca2d38b", null ], - [ "hasGroup", "classEntity.html#acfb6240560624c026ffc24af4d469b68", null ], [ "isActive", "classEntity.html#aea1c1568b4123d989c5310697030ad77", null ], [ "update", "classEntity.html#af4415c165338eed191ee0cddf550732b", null ] ]; \ No newline at end of file diff --git a/classEventManager.html b/classEventManager.html deleted file mode 100644 index 96aee77..0000000 --- a/classEventManager.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - VEGO-Engine: EventManager Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
- -
EventManager Class Reference
-
-
- - - - - - - - -

-Public Member Functions

 EventManager ()
 
-void registerListener (EventListener listener, std::initializer_list< Uint32 > eventTypes)
 
-SDL_AppResult handleEvent (SDL_Event *const event)
 
-

Constructor & Destructor Documentation

- -

◆ EventManager()

- -
-
- - - - - - - -
EventManager::EventManager ()
-
-

\TODO: from c++26 you (should be able to) can get the amount of name values in an enum

- -
-
-
The documentation for this class was generated from the following files: -
-
- - - - diff --git a/classEventManager.js b/classEventManager.js deleted file mode 100644 index 63b78aa..0000000 --- a/classEventManager.js +++ /dev/null @@ -1,4 +0,0 @@ -var classEventManager = -[ - [ "EventManager", "classEventManager.html#a89099b22114f158b5c530edfea52371d", null ] -]; \ No newline at end of file diff --git a/classGame-members.html b/classGame-members.html deleted file mode 100644 index fb7d3e4..0000000 --- a/classGame-members.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - VEGO-Engine: Member List - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
Game Member List
-
-
- -

This is the complete list of members for Game, including all inherited members.

- - - - - - -
gameInternalGame
init()=0 (defined in Game)Gamepure virtual
setConfigFilePath()Gameinlinevirtual
update(uint_fast16_t diffTime)=0 (defined in Game)Gamepure virtual
~Game() (defined in Game)Gameinlinevirtual
-
- - - - diff --git a/classGame.html b/classGame.html deleted file mode 100644 index a17d653..0000000 --- a/classGame.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - VEGO-Engine: Game Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
- -
Game Class Referenceabstract
-
-
-
-Collaboration diagram for Game:
-
-
-
[legend]
- - - - - - - - - -

-Public Member Functions

-virtual void init ()=0
 
-virtual void update (uint_fast16_t diffTime)=0
 
virtual std::optional< std::string > setConfigFilePath ()
 Sets the path for a custom config file.
 
- - - -

-Public Attributes

GameInternalgameInternal
 
-

Member Function Documentation

- -

◆ setConfigFilePath()

- -
-
- - - - - -
- - - - - - - -
virtual std::optional< std::string > Game::setConfigFilePath ()
-
-inlinevirtual
-
- -

Sets the path for a custom config file.

-

Virtual function to be overwritten in the implementation to return the path of a custom config JSON file.

See also
Layout of the config file is shown in ConfigLoader
-
Returns
std::optional<std::string>
- -
-
-

Member Data Documentation

- -

◆ gameInternal

- -
-
- - - - -
GameInternal* Game::gameInternal
-
-
Deprecated

-
- -
-
-
The documentation for this class was generated from the following file: -
-
- - - - diff --git a/classGame.js b/classGame.js deleted file mode 100644 index b221d53..0000000 --- a/classGame.js +++ /dev/null @@ -1,5 +0,0 @@ -var classGame = -[ - [ "setConfigFilePath", "classGame.html#ab351f4239d9292806a332272d5ee4aea", null ], - [ "gameInternal", "classGame.html#a97bfdecc66a53f55ac7ff8b8ba014418", null ] -]; \ No newline at end of file diff --git a/classGameInternal-members.html b/classGameInternal-members.html deleted file mode 100644 index 3ea056c..0000000 --- a/classGameInternal-members.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - VEGO-Engine: Member List - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
GameInternal Member List
-
-
- -

This is the complete list of members for GameInternal, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean() (defined in GameInternal)GameInternal
collisionHandler (defined in GameInternal)GameInternal
config (defined in GameInternal)GameInternal
event (defined in GameInternal)GameInternal
eventManager (defined in GameInternal)GameInternal
GameInternal() (defined in GameInternal)GameInternal
handleEvent(SDL_Event *event) (defined in GameInternal)GameInternal
hearts (defined in GameInternal)GameInternal
init() (defined in GameInternal)GameInternal
inputManager (defined in GameInternal)GameInternal
interactionManager (defined in GameInternal)GameInternal
isRunning() const (defined in GameInternal)GameInternal
manager (defined in GameInternal)GameInternal
map (defined in GameInternal)GameInternal
pickupManager (defined in GameInternal)GameInternal
players (defined in GameInternal)GameInternal
powerups (defined in GameInternal)GameInternal
projectiles (defined in GameInternal)GameInternal
refreshPlayers() (defined in GameInternal)GameInternal
render() (defined in GameInternal)GameInternal
renderer (defined in GameInternal)GameInternal
renderManager (defined in GameInternal)GameInternal
setRunning(bool running) (defined in GameInternal)GameInternal
soundManager (defined in GameInternal)GameInternal
stopGame() (defined in GameInternal)GameInternal
textureManager (defined in GameInternal)GameInternal
tiles (defined in GameInternal)GameInternal
update(Uint64 frameTime) (defined in GameInternal)GameInternal
~GameInternal() (defined in GameInternal)GameInternal
-
- - - - diff --git a/classGameInternal.html b/classGameInternal.html deleted file mode 100644 index 58a6761..0000000 --- a/classGameInternal.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - VEGO-Engine: GameInternal Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
- -
GameInternal Class Reference
-
-
-
-Collaboration diagram for GameInternal:
-
-
-
[legend]
- - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

-SDL_AppResult init ()
 
-SDL_AppResult handleEvent (SDL_Event *event)
 
-void update (Uint64 frameTime)
 
-void render ()
 
-void clean ()
 
-bool isRunning () const
 
-void setRunning (bool running)
 
-void stopGame ()
 
-void refreshPlayers ()
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Attributes

-SDL_Renderer * renderer = nullptr
 
-SDL_Event event
 
-CollisionHandlercollisionHandler
 
-PickupManagerpickupManager
 
-TextureManagertextureManager
 
-SoundManagersoundManager
 
-InputManagerinputManager
 
-RenderManagerrenderManager
 
-EventManagereventManager
 
-InteractionManagerinteractionManager
 
-Manager manager
 
-Mapmap
 
-ConfigLoaderconfig
 
-std::vector< Entity * > & tiles
 
-std::vector< Entity * > & players
 
-std::vector< Entity * > & projectiles
 
-std::vector< Entity * > & hearts
 
-std::vector< Entity * > & powerups
 
-
The documentation for this class was generated from the following files: -
-
- - - - diff --git a/classGameInternal__coll__graph.map b/classGameInternal__coll__graph.map deleted file mode 100644 index 8b234d4..0000000 --- a/classGameInternal__coll__graph.map +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/classGameInternal__coll__graph.md5 b/classGameInternal__coll__graph.md5 deleted file mode 100644 index 165ad6c..0000000 --- a/classGameInternal__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -73c5b8e2b8caa0bdf78bfc907f74aec1 \ No newline at end of file diff --git a/classGameInternal__coll__graph.svg b/classGameInternal__coll__graph.svg deleted file mode 100644 index df610d9..0000000 --- a/classGameInternal__coll__graph.svg +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -GameInternal - - -Node1 - - -GameInternal - - - - - -Node2 - - -CollisionHandler - - - - - -Node2->Node1 - - - - - - collisionHandler - - - -Node3 - - -PickupManager - - - - - -Node3->Node1 - - - - - - pickupManager - - - -Node4 - - -TextureManager - - - - - -Node4->Node1 - - - - - - textureManager - - - -Node5 - - -SoundManager - - - - - -Node5->Node1 - - - - - - soundManager - - - -Node6 - - -InputManager - - - - - -Node6->Node1 - - - - - - inputManager - - - -Node7 - - -RenderManager - - - - - -Node7->Node1 - - - - - - renderManager - - - -Node8 - - -EventManager - - - - - -Node8->Node1 - - - - - - eventManager - - - -Node9 - - -InteractionManager - - - - - -Node9->Node1 - - - - - - interactionManager - - - -Node10 - - -Manager - - - - - -Node10->Node1 - - - - - - manager - - - -Node11 - - -Map - - - - - -Node11->Node1 - - - - - - map - - - -Node12 - - -ConfigLoader - - - - - -Node12->Node1 - - - - - - config - - - -Node13 - - -std::vector< Entity * > - - - - - -Node13->Node1 - - - - - - hearts -players -powerups -projectiles -tiles - - - -Node14 - - -Entity - - - - - -Node14->Node13 - - - - - - elements - - - -Node15 - - -std::vector< T > - - - - - -Node15->Node13 - - - - - - < Entity * > - - - -Node16 - - -T - - - - - -Node16->Node15 - - - - - - elements - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/classGameInternal__coll__graph_org.svg b/classGameInternal__coll__graph_org.svg deleted file mode 100644 index 26ceb4b..0000000 --- a/classGameInternal__coll__graph_org.svg +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - -GameInternal - - -Node1 - - -GameInternal - - - - - -Node2 - - -CollisionHandler - - - - - -Node2->Node1 - - - - - - collisionHandler - - - -Node3 - - -PickupManager - - - - - -Node3->Node1 - - - - - - pickupManager - - - -Node4 - - -TextureManager - - - - - -Node4->Node1 - - - - - - textureManager - - - -Node5 - - -SoundManager - - - - - -Node5->Node1 - - - - - - soundManager - - - -Node6 - - -InputManager - - - - - -Node6->Node1 - - - - - - inputManager - - - -Node7 - - -RenderManager - - - - - -Node7->Node1 - - - - - - renderManager - - - -Node8 - - -EventManager - - - - - -Node8->Node1 - - - - - - eventManager - - - -Node9 - - -InteractionManager - - - - - -Node9->Node1 - - - - - - interactionManager - - - -Node10 - - -Manager - - - - - -Node10->Node1 - - - - - - manager - - - -Node11 - - -Map - - - - - -Node11->Node1 - - - - - - map - - - -Node12 - - -ConfigLoader - - - - - -Node12->Node1 - - - - - - config - - - -Node13 - - -std::vector< Entity * > - - - - - -Node13->Node1 - - - - - - hearts -players -powerups -projectiles -tiles - - - -Node14 - - -Entity - - - - - -Node14->Node13 - - - - - - elements - - - -Node15 - - -std::vector< T > - - - - - -Node15->Node13 - - - - - - < Entity * > - - - -Node16 - - -T - - - - - -Node16->Node15 - - - - - - elements - - - diff --git a/classGame__coll__graph.map b/classGame__coll__graph.map deleted file mode 100644 index bc275bb..0000000 --- a/classGame__coll__graph.map +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/classGame__coll__graph.md5 b/classGame__coll__graph.md5 deleted file mode 100644 index 52797fd..0000000 --- a/classGame__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -f31a19f603280e51301d45ff271dd466 \ No newline at end of file diff --git a/classGame__coll__graph.svg b/classGame__coll__graph.svg deleted file mode 100644 index 1ee4e27..0000000 --- a/classGame__coll__graph.svg +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Game - - -Node1 - - -Game - - - - - -Node2 - - -GameInternal - - - - - -Node2->Node1 - - - - - - gameInternal - - - -Node3 - - -CollisionHandler - - - - - -Node3->Node2 - - - - - - collisionHandler - - - -Node4 - - -PickupManager - - - - - -Node4->Node2 - - - - - - pickupManager - - - -Node5 - - -TextureManager - - - - - -Node5->Node2 - - - - - - textureManager - - - -Node6 - - -SoundManager - - - - - -Node6->Node2 - - - - - - soundManager - - - -Node7 - - -InputManager - - - - - -Node7->Node2 - - - - - - inputManager - - - -Node8 - - -RenderManager - - - - - -Node8->Node2 - - - - - - renderManager - - - -Node9 - - -EventManager - - - - - -Node9->Node2 - - - - - - eventManager - - - -Node10 - - -InteractionManager - - - - - -Node10->Node2 - - - - - - interactionManager - - - -Node11 - - -Manager - - - - - -Node11->Node2 - - - - - - manager - - - -Node12 - - -Map - - - - - -Node12->Node2 - - - - - - map - - - -Node13 - - -ConfigLoader - - - - - -Node13->Node2 - - - - - - config - - - -Node14 - - -std::vector< Entity * > - - - - - -Node14->Node2 - - - - - - hearts -players -powerups -projectiles -tiles - - - -Node15 - - -Entity - - - - - -Node15->Node14 - - - - - - elements - - - -Node16 - - -std::vector< T > - - - - - -Node16->Node14 - - - - - - < Entity * > - - - -Node17 - - -T - - - - - -Node17->Node16 - - - - - - elements - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/classGame__coll__graph_org.svg b/classGame__coll__graph_org.svg deleted file mode 100644 index e160b2f..0000000 --- a/classGame__coll__graph_org.svg +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - -Game - - -Node1 - - -Game - - - - - -Node2 - - -GameInternal - - - - - -Node2->Node1 - - - - - - gameInternal - - - -Node3 - - -CollisionHandler - - - - - -Node3->Node2 - - - - - - collisionHandler - - - -Node4 - - -PickupManager - - - - - -Node4->Node2 - - - - - - pickupManager - - - -Node5 - - -TextureManager - - - - - -Node5->Node2 - - - - - - textureManager - - - -Node6 - - -SoundManager - - - - - -Node6->Node2 - - - - - - soundManager - - - -Node7 - - -InputManager - - - - - -Node7->Node2 - - - - - - inputManager - - - -Node8 - - -RenderManager - - - - - -Node8->Node2 - - - - - - renderManager - - - -Node9 - - -EventManager - - - - - -Node9->Node2 - - - - - - eventManager - - - -Node10 - - -InteractionManager - - - - - -Node10->Node2 - - - - - - interactionManager - - - -Node11 - - -Manager - - - - - -Node11->Node2 - - - - - - manager - - - -Node12 - - -Map - - - - - -Node12->Node2 - - - - - - map - - - -Node13 - - -ConfigLoader - - - - - -Node13->Node2 - - - - - - config - - - -Node14 - - -std::vector< Entity * > - - - - - -Node14->Node2 - - - - - - hearts -players -powerups -projectiles -tiles - - - -Node15 - - -Entity - - - - - -Node15->Node14 - - - - - - elements - - - -Node16 - - -std::vector< T > - - - - - -Node16->Node14 - - - - - - < Entity * > - - - -Node17 - - -T - - - - - -Node17->Node16 - - - - - - elements - - - diff --git a/classHealthComponent-members.html b/classHealthComponent-members.html deleted file mode 100644 index b6c7798..0000000 --- a/classHealthComponent-members.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - VEGO-Engine: Member List - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
HealthComponent Member List
-
-
- -

This is the complete list of members for HealthComponent, including all inherited members.

- - - - - - - - - - - - -
createHeartComponents(int x) (defined in HealthComponent)HealthComponent
entity (defined in Component)Component
getHealth() (defined in HealthComponent)HealthComponentinline
HealthComponent(int health) (defined in HealthComponent)HealthComponentinline
init() override (defined in HealthComponent)HealthComponentvirtual
modifyHealth(int health=-1) (defined in HealthComponent)HealthComponent
refreshHearts() (defined in HealthComponent)HealthComponent
setHealth(int health) (defined in HealthComponent)HealthComponent
update(uint_fast16_t diffTime) (defined in Component)Componentinlinevirtual
~Component()=default (defined in Component)Componentvirtual
~HealthComponent() (defined in HealthComponent)HealthComponentinline
-
- - - - diff --git a/classHealthComponent.html b/classHealthComponent.html deleted file mode 100644 index ae1be02..0000000 --- a/classHealthComponent.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - VEGO-Engine: HealthComponent Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
- -
HealthComponent Class Reference
-
-
-
-Inheritance diagram for HealthComponent:
-
-
-
[legend]
-
-Collaboration diagram for HealthComponent:
-
-
-
[legend]
- - - - - - - - - - - - - - - - - - - -

-Public Member Functions

HealthComponent (int health)
 
-void modifyHealth (int health=-1)
 
-void setHealth (int health)
 
-int getHealth ()
 
void init () override
 
-void refreshHearts ()
 
-void createHeartComponents (int x)
 
- Public Member Functions inherited from Component
virtual void update (uint_fast16_t diffTime)
 
- - - - -

-Additional Inherited Members

- Public Attributes inherited from Component
-Entityentity
 
-

Member Function Documentation

- -

◆ init()

- -
-
- - - - - -
- - - - - - - -
void HealthComponent::init ()
-
-overridevirtual
-
- -

Reimplemented from Component.

- -
-
-
The documentation for this class was generated from the following files: -
-
- - - - diff --git a/classHealthComponent__coll__graph.map b/classHealthComponent__coll__graph.map deleted file mode 100644 index c478798..0000000 --- a/classHealthComponent__coll__graph.map +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/classHealthComponent__coll__graph.md5 b/classHealthComponent__coll__graph.md5 deleted file mode 100644 index 8106d05..0000000 --- a/classHealthComponent__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -2346e63b87fd3d64f01851b0996195ab \ No newline at end of file diff --git a/classHealthComponent__coll__graph.svg b/classHealthComponent__coll__graph.svg deleted file mode 100644 index acfbd87..0000000 --- a/classHealthComponent__coll__graph.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - -HealthComponent - - -Node1 - - -HealthComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - -Node3 - - -Entity - - - - - -Node3->Node2 - - - - - - entity - - - - - - - - diff --git a/classHealthComponent__coll__graph_org.svg b/classHealthComponent__coll__graph_org.svg deleted file mode 100644 index 0983bab..0000000 --- a/classHealthComponent__coll__graph_org.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - -HealthComponent - - -Node1 - - -HealthComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - -Node3 - - -Entity - - - - - -Node3->Node2 - - - - - - entity - - - diff --git a/classHealthComponent__inherit__graph.map b/classHealthComponent__inherit__graph.map deleted file mode 100644 index b48b76c..0000000 --- a/classHealthComponent__inherit__graph.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/classHealthComponent__inherit__graph.md5 b/classHealthComponent__inherit__graph.md5 deleted file mode 100644 index d5db88f..0000000 --- a/classHealthComponent__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -2a060a3991f91b1cb785f8c8a54a60ea \ No newline at end of file diff --git a/classHealthComponent__inherit__graph.svg b/classHealthComponent__inherit__graph.svg deleted file mode 100644 index 367b73b..0000000 --- a/classHealthComponent__inherit__graph.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - -HealthComponent - - -Node1 - - -HealthComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - - - - - - diff --git a/classHealthComponent__inherit__graph_org.svg b/classHealthComponent__inherit__graph_org.svg deleted file mode 100644 index 67a0382..0000000 --- a/classHealthComponent__inherit__graph_org.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -HealthComponent - - -Node1 - - -HealthComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - diff --git a/classInputComponent-members.html b/classInputComponent-members.html deleted file mode 100644 index 7a30996..0000000 --- a/classInputComponent-members.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - VEGO-Engine: Member List - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
InputComponent Member List
-
-
- -

This is the complete list of members for InputComponent, including all inherited members.

- - - - - - - - -
entity (defined in Component)Component
init() override (defined in InputComponent)InputComponentvirtual
InputComponent() (defined in InputComponent)InputComponent
isKeyDown(Key key) (defined in InputComponent)InputComponent
update(uint_fast16_t diffTime) override (defined in InputComponent)InputComponentvirtual
~Component()=default (defined in Component)Componentvirtual
~InputComponent() (defined in InputComponent)InputComponent
-
- - - - diff --git a/classInputComponent.html b/classInputComponent.html deleted file mode 100644 index b9a8243..0000000 --- a/classInputComponent.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - VEGO-Engine: InputComponent Class Reference - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
-
VEGO-Engine -  0.1 -
-
-
- - - - - - - - -
-
- -
-
-
- -
- -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
- -
InputComponent Class Reference
-
-
-
-Inheritance diagram for InputComponent:
-
-
-
[legend]
-
-Collaboration diagram for InputComponent:
-
-
-
[legend]
- - - - - - - - -

-Public Member Functions

void init () override
 
void update (uint_fast16_t diffTime) override
 
-bool isKeyDown (Key key)
 
- - - - -

-Additional Inherited Members

- Public Attributes inherited from Component
-Entityentity
 
-

Member Function Documentation

- -

◆ init()

- -
-
- - - - - -
- - - - - - - -
void InputComponent::init ()
-
-overridevirtual
-
- -

Reimplemented from Component.

- -
-
- -

◆ update()

- -
-
- - - - - -
- - - - - - - -
void InputComponent::update (uint_fast16_t diffTime)
-
-overridevirtual
-
- -

Reimplemented from Component.

- -
-
-
The documentation for this class was generated from the following files: -
-
- - - - diff --git a/classInputComponent__coll__graph.map b/classInputComponent__coll__graph.map deleted file mode 100644 index d410508..0000000 --- a/classInputComponent__coll__graph.map +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/classInputComponent__coll__graph.md5 b/classInputComponent__coll__graph.md5 deleted file mode 100644 index 16fbb57..0000000 --- a/classInputComponent__coll__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -1e38b370a6075a08b7726407a3d45c52 \ No newline at end of file diff --git a/classInputComponent__coll__graph.svg b/classInputComponent__coll__graph.svg deleted file mode 100644 index 345f1a9..0000000 --- a/classInputComponent__coll__graph.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - -InputComponent - - -Node1 - - -InputComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - -Node3 - - -Entity - - - - - -Node3->Node2 - - - - - - entity - - - - - - - - diff --git a/classInputComponent__coll__graph_org.svg b/classInputComponent__coll__graph_org.svg deleted file mode 100644 index 24e5d56..0000000 --- a/classInputComponent__coll__graph_org.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - -InputComponent - - -Node1 - - -InputComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - -Node3 - - -Entity - - - - - -Node3->Node2 - - - - - - entity - - - diff --git a/classInputComponent__inherit__graph.map b/classInputComponent__inherit__graph.map deleted file mode 100644 index 9aa1177..0000000 --- a/classInputComponent__inherit__graph.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/classInputComponent__inherit__graph.md5 b/classInputComponent__inherit__graph.md5 deleted file mode 100644 index c5e8772..0000000 --- a/classInputComponent__inherit__graph.md5 +++ /dev/null @@ -1 +0,0 @@ -a208adbc9c080d2b8654400e7e35b582 \ No newline at end of file diff --git a/classInputComponent__inherit__graph.svg b/classInputComponent__inherit__graph.svg deleted file mode 100644 index 8a0588f..0000000 --- a/classInputComponent__inherit__graph.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - -InputComponent - - -Node1 - - -InputComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - - - - - - diff --git a/classInputComponent__inherit__graph_org.svg b/classInputComponent__inherit__graph_org.svg deleted file mode 100644 index 665f8b0..0000000 --- a/classInputComponent__inherit__graph_org.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -InputComponent - - -Node1 - - -InputComponent - - - - - -Node2 - - -Component - - - - - -Node2->Node1 - - - - - - - - diff --git a/classInputManager-members.html b/classInputManager-members.html index 2081aa5..718f058 100644 --- a/classInputManager-members.html +++ b/classInputManager-members.html @@ -125,18 +125,10 @@ $(function(){initNavTree('classInputManager.html',''); initResizable(true); });

This is the complete list of members for InputManager, including all inherited members.

- - - - - - - - - - - - + + + +
EventType enum name (defined in InputManager)InputManager
getActionsByKey(const Key key) const (defined in InputManager)InputManager
getActiveContext() const (defined in InputManager)InputManager
handleEvent(SDL_EventType type, SDL_Event *const event) (defined in InputManager)InputManager
init() (defined in InputManager)InputManager
initKeyMap() (defined in InputManager)InputManager
InputManager() (defined in InputManager)InputManager
Key enum name (defined in InputManager)InputManager
processEvents() (defined in InputManager)InputManager
registerAction(const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context) (defined in InputManager)InputManager
setActiveContext(const std::string &context) (defined in InputManager)InputManager
~InputManager() (defined in InputManager)InputManager
getActiveContext() constInputManager
Key enum nameInputManager
registerAction(const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context="Default")InputManager
setActiveContext(const std::string &context)InputManager
diff --git a/classInputManager.html b/classInputManager.html index e6e35cd..c86e3e7 100644 --- a/classInputManager.html +++ b/classInputManager.html @@ -127,148 +127,108 @@ $(function(){initNavTree('classInputManager.html',''); initResizable(true); });
InputManager Class Reference
+ +

InputManager class to handle input events and actions. + More...

+ +

#include <InputManager.h>

+

Classes

struct  InputAction
 InputAction struct to represent an action and its bindings. More...
 
- - - + +

Public Types

enum class  EventType { KeyDown -, KeyUp - }
 
enum class  Key {
-  UP -, DOWN -, LEFT -, RIGHT -,
-  SPACE -, ENTER -, ESCAPE -, TAB -,
-  BACKSPACE -, DELETE -, HOME -, END -,
-  PAGE_UP -, PAGE_DOWN -, INSERT -, CAPS_LOCK -,
-  LEFT_SHIFT -, RIGHT_SHIFT -, LEFT_CTRL -, RIGHT_CTRL -,
-  LEFT_ALT -, RIGHT_ALT -, F1 -, F2 -,
-  F3 -, F4 -, F5 -, F6 -,
-  F7 -, F8 -, F9 -, F10 -,
-  F11 -, F12 -, A -, B -,
-  C -, D -, E -, F -,
-  G -, H -, I -, J -,
-  K -, L -, M -, N -,
-  O -, P -, Q -, R -,
-  S -, T -, U -, V -,
-  W -, X -, Y -, Z -,
-  NUM_0 -, NUM_1 -, NUM_2 -, NUM_3 -,
-  NUM_4 -, NUM_5 -, NUM_6 -, NUM_7 -,
-  NUM_8 -, NUM_9 -, LEFT_BRACKET -, RIGHT_BRACKET -,
-  SEMICOLON -, APOSTROPHE -, COMMA -, PERIOD -,
-  SLASH -, BACKSLASH -, GRAVE -
- }
enum class  Key
 A list of every key that can be bound to an action.
 
- - - - - - - + + + + + + - - - - - -

Public Member Functions

-void init ()
 
-void processEvents ()
 
-void registerAction (const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context)
 
-void setActiveContext (const std::string &context)
void registerAction (const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context="Default")
 Register an action with a name, key bindings, and a callback function.
 
void setActiveContext (const std::string &context)
 set the active context, is "Default" by default
 
std::string getActiveContext () const
 Get the active context.
 
-std::vector< InputAction * > getActionsByKey (const Key key) const
 
-SDL_AppResult handleEvent (SDL_EventType type, SDL_Event *const event)
 
-void initKeyMap ()
 
+

Detailed Description

+

InputManager class to handle input events and actions.

+

This class manages input events, allowing for the registration of actions and their corresponding key bindings.

+

Member Function Documentation

+ +

◆ registerAction()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void InputManager::registerAction (const std::string & actionName,
const std::vector< Key > & keys,
std::function< void(bool)> callback,
const std::string & context = "Default" )
+
+ +

Register an action with a name, key bindings, and a callback function.

+
Parameters
+ + + + + +
actionNameThe name of the action
keysThe keys that are bound to this action
callbackThe function to call when the action is triggered
contextThe context in which the action is valid can be used to switch between e.g. gameplay and menu so the same keys can be used for different actions
+
+
+ +
+
+ +

◆ setActiveContext()

+ +
+
+ + + + + + + +
void InputManager::setActiveContext (const std::string & context)
+
+ +

set the active context, is "Default" by default

+
Parameters
+ + +
contextThe name of the context to set as active
+
+
+ +
+

The documentation for this class was generated from the following files:
diff --git a/classInteractionComponent.html b/classInteractionComponent.html index 28acb85..ec30148 100644 --- a/classInteractionComponent.html +++ b/classInteractionComponent.html @@ -125,43 +125,30 @@ $(function(){initNavTree('classInteractionComponent.html',''); initResizable(tru
InteractionComponent Class Reference
-
-Inheritance diagram for InteractionComponent:
-
-
-
[legend]
-
-Collaboration diagram for InteractionComponent:
-
-
-
[legend]
+ +

InteractionComponent class to handle interaction events. + More...

+ +

#include <InteractionComponent.h>

- + - - + + - - + + - - - - - -

Public Member Functions

 InteractionComponent (std::function< void(void *, void *)> callback)
 Constructor for the InteractionComponent.
 Constructor for the InteractionComponent.
 
void interact (void *actor, void *data) override
 Internal function to be called when an interaction event is triggered.
+void interact (void *actor, void *data) override
 Internal function to be called when an interaction event is triggered.
 
std::shared_ptr< Vector2DgetPosition () override
 Internal function to use as reference for targeting.
+std::shared_ptr< Vector2D > getPosition () override
 Internal function to use as reference for targeting.
 
- Public Member Functions inherited from Component
-virtual void init ()
 
virtual void update (uint_fast16_t diffTime)
 
- - - -

-Additional Inherited Members

- Public Attributes inherited from Component
-Entityentity
 
-

Constructor & Destructor Documentation

+

Detailed Description

+

InteractionComponent class to handle interaction events.

+

This class manages interaction events, allowing for the registration of a callback function to be called when an interaction event is triggered.

+

Constructor & Destructor Documentation

◆ InteractionComponent()

@@ -177,7 +164,7 @@ Additional Inherited Members
-

Constructor for the InteractionComponent.

+

Constructor for the InteractionComponent.

Parameters
@@ -185,69 +172,6 @@ Additional Inherited Members - - -

Member Function Documentation

- -

◆ getPosition()

- -
-
-
callbackA function to be called when an interaction event is triggered. void* actor, void* data are passed to the callback function from InteractionEventdataStruct.
- - - - -
- - - - - - - -
std::shared_ptr< Vector2D > InteractionComponent::getPosition ()
-
-overridevirtual
-
- -

Internal function to use as reference for targeting.

- -

Reimplemented from InteractionListener.

- -
- - -

◆ interact()

- -
-
- - - - - -
- - - - - - - - - - - -
void InteractionComponent::interact (void * actor,
void * data )
-
-overridevirtual
-
- -

Internal function to be called when an interaction event is triggered.

- -

Implements InteractionListener.

-

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

- k -

+ +

- l -