R-Type
R-Type project
IComponent.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** gameEngine2
4 ** File description:
5 ** IComponent
6 */
7 
8 #ifndef ICOMPONENT_HPP_
9 #define ICOMPONENT_HPP_
10 
11 #include <memory>
12 
13 namespace KapEngine {
14  class GameObject;
15 }
16 
17 namespace KapEngine {
18 
19  class IComponent {
20  public:
21  ~IComponent() {}
22 
23  //function to update object
30  virtual void onInit() = 0;
36  virtual void onAwake() = 0;
42  virtual void onStart() = 0;
48  virtual void onUpdate() = 0;
55  virtual void onFixedUpdate() = 0;
56 
61  virtual void onDisplay() = 0;
62 
67  virtual void onTriggerEnter(std::shared_ptr<GameObject> go) = 0;
68 
73  virtual void onTriggerStay(std::shared_ptr<GameObject> go) = 0;
74 
79  virtual void onTriggerExit(std::shared_ptr<GameObject> go) = 0;
80 
85  virtual void onMouseEnter() = 0;
86 
91  virtual void onMouseStay() = 0;
92 
97  virtual void onMouseExit() = 0;
98 
105  virtual bool checkComponentValidity() = 0;
106 
111  virtual void onDestroy() = 0;
112 
117  virtual void onGameQuit() = 0;
118 
123  virtual void onDisable() = 0;
124 
129  virtual void onEnable() = 0;
130 
135  virtual void onSceneUpdated() = 0;
136 
141  virtual void onSceneGonnaUpdated() = 0;
142 
147  virtual void onSceneChanged() = 0;
148 
149  protected:
150  private:
151  };
152 
153 }
154 
155 #endif /* !ICOMPONENT_HPP_ */
KapEngine::IComponent::onUpdate
virtual void onUpdate()=0
call each frame
KapEngine::IComponent::onDestroy
virtual void onDestroy()=0
call when component destroyed
KapEngine::IComponent::onAwake
virtual void onAwake()=0
call component awake
KapEngine::IComponent::onInit
virtual void onInit()=0
call on component init
KapEngine::IComponent::onTriggerEnter
virtual void onTriggerEnter(std::shared_ptr< GameObject > go)=0
something enter in object
KapEngine::IComponent::onSceneChanged
virtual void onSceneChanged()=0
call when scene is changed
KapEngine::IComponent
Definition: IComponent.hpp:19
KapEngine::IComponent::onTriggerExit
virtual void onTriggerExit(std::shared_ptr< GameObject > go)=0
something out of object
KapEngine::IComponent::onSceneGonnaUpdated
virtual void onSceneGonnaUpdated()=0
call when scene will update (not threaded)
KapEngine::IComponent::onFixedUpdate
virtual void onFixedUpdate()=0
call eachv x ms
KapEngine::IComponent::onSceneUpdated
virtual void onSceneUpdated()=0
call when scene is updated (not threaded)
KapEngine::IComponent::onTriggerStay
virtual void onTriggerStay(std::shared_ptr< GameObject > go)=0
something stay in object
KapEngine::IComponent::checkComponentValidity
virtual bool checkComponentValidity()=0
Check you component is runnable With this function you can add some conditions to make your component...
KapEngine::IComponent::onMouseEnter
virtual void onMouseEnter()=0
called when mouse enter object
KapEngine::IComponent::onDisplay
virtual void onDisplay()=0
use to display some things this function is call after all updates fucntion
KapEngine::IComponent::onEnable
virtual void onEnable()=0
call when GameObject is enable after being disable
KapEngine::IComponent::onMouseExit
virtual void onMouseExit()=0
called when mouse leave object
KapEngine::IComponent::onStart
virtual void onStart()=0
call component start
KapEngine
main namespace
Definition: Component.hpp:17
KapEngine::IComponent::onGameQuit
virtual void onGameQuit()=0
call when game is turn off
KapEngine::IComponent::onDisable
virtual void onDisable()=0
call when GameObject is disable after being enable
KapEngine::IComponent::onMouseStay
virtual void onMouseStay()=0
called when mouse stay on object