Mountain  1.0.0
Simple C++ 2D Game Framework
component.hpp
1 #pragma once
2 
3 #include "Mountain/core.hpp"
4 
5 namespace Mountain
6 {
7  class Entity;
8 
10  class MOUNTAIN_API Component
11  {
12  friend class Entity;
13 
14  public:
15  Component() = default;
16  virtual ~Component() = default;
17 
18  DEFAULT_VIRTUAL_COPY_MOVE_OPERATIONS(Component)
19 
20 
21  virtual void Added() {}
22 
24  virtual void Removed() {}
25 
27  virtual void Update() {}
28 
30  virtual void Render() {}
31 
32  virtual void DebugRender() {}
33 
35  [[nodiscard]]
36  const Entity* GetEntity() const;
37 
39  Entity* GetEntity();
40 
41  protected:
43  Entity* m_Entity = nullptr;
44  };
45 }
virtual void Update()
Updates the component.
Definition: component.hpp:27
Represents a behavior that can be attached to an Entity.
Definition: component.hpp:10
virtual void Removed()
Called when the component is removed from an Entity.
Definition: component.hpp:24
virtual void Render()
Renders the component.
Definition: component.hpp:30
Contains all declarations of the Mountain Framework.
Definition: audio.hpp:22