-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActors.hpp
50 lines (35 loc) · 1021 Bytes
/
Actors.hpp
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
#ifndef ACTORS_HPP
#define ACTORS_HPP
#include <glm/glm.hpp>
#include "Util.hpp"
#include "Force.hpp"
#include "Actor.hpp"
#include <vector>
#include <iterator>
#include <map>
class Actors {
private:
//std::map<Id, Actor*> actors;
std::vector<Actor> actors;
int selected_index;
void check();
public:
// because I'm too lazy to implement an iterator wrapper
//const std::map<Id, Actor*>& underlying() const;
std::vector<Actor>& underlying();
Actors();
~Actors();
void apply_force(const Force& force);
bool insert(const Id& id, Actor a);
void select(const Id& id);
Id selected();
Actor& selectedActor();
template <typename Iter, typename Cont>
bool is_last(Iter iter, const Cont& cont) {
return (iter != cont.end()) && (std::next(iter) == cont.end());
}
void next();
Actor& operator[](const Id& id);
int size() const;
};
#endif