-
Notifications
You must be signed in to change notification settings - Fork 0
/
Command.h
38 lines (29 loc) · 875 Bytes
/
Command.h
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
#include <string>
#include <SFML/Graphics.hpp>
#include <functional>
class SceneNode;
#ifndef _COMMAND_H_
#define _COMMAND_H_
class Command
{
public:
using categoryType = unsigned int;
using actionType = std::function<void(SceneNode&, const sf::Time&)>;
Command(actionType action,const categoryType& category);
Command(actionType action, const std::string& name);
Command(actionType action, const std::string&& name);
void operator=(const actionType& action);
void setAction(actionType& action);
actionType getAction() const;
void setCategory(const categoryType& category);
categoryType getCategory() const;
void setName(const std::string& name);
void setName(std::string&& name);
std::string getName() const;
void operator()(SceneNode& node, const sf::Time& dt) const;
private:
actionType action;
categoryType category;
std::string name;
};
#endif