forked from Dzejrou/tdt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAISystem.hpp
More file actions
65 lines (55 loc) · 1.47 KB
/
Copy pathAISystem.hpp
File metadata and controls
65 lines (55 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <Ogre.h>
#include <cstdlib>
#include "System.hpp"
#include "EntitySystem.hpp"
#include "Components.hpp"
#include "lppscript\LppScript.hpp"
/**
* System handling the AI of entities by calling their update method every frame.
*/
class AISystem : public System
{
public:
/**
* Constructor.
* Param: Reference to the game's entity system.
*/
AISystem(EntitySystem&);
/**
* Destructor.
*/
~AISystem() {}
/**
* Brief: Updates all valid entities by calling their update function stored in the
* AIComponent::blueprint table.
* Param: Time since the last frame.
*/
void update(Ogre::Real);
/**
* Brief: Sets the amount of seconds it takes before the next AI
* update will be performed.
* Param: Update period time (in seconds).
*/
void set_update_period(Ogre::Real);
/**
* Brief: Returns the amount of seconds it takes before the next AI
* update will be performed.
*/
Ogre::Real get_update_period() const;
/**
* Brief: Sets the update timer equal to the period and thus forcing
* all entities' AI to be updated on next AISystem::update call.
*/
void force_update();
private:
/**
* Reference to the game's entity system.
*/
EntitySystem& entities_;
/**
* Used to track the time and check if the entities should be updated.
* TODO: Add as a setting to a config (along with regen timer etc).
*/
Ogre::Real update_timer_, update_period_;
};