-
Notifications
You must be signed in to change notification settings - Fork 30
/
player_activity.h
49 lines (41 loc) · 1.12 KB
/
player_activity.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
39
40
41
42
43
44
45
46
47
48
49
#ifndef _PLAYER_activity_H_
#define _PLAYER_activity_H_
#include <string>
#include <vector>
enum Player_activity_type
{
PLAYER_ACTIVITY_NULL,
PLAYER_ACTIVITY_WAIT,
PLAYER_ACTIVITY_RELOAD,
PLAYER_ACTIVITY_READ,
PLAYER_ACTIVITY_MAX
};
std::string get_activity_name (Player_activity_type type);
std::string get_activity_participle (Player_activity_type type);
struct Player_activity
{
Player_activity()
{
type = PLAYER_ACTIVITY_NULL;
duration = 0;
primary_item_uid = -1;
secondary_item_uid = -1;
active = false;
}
Player_activity(Player_activity_type _type, int _duration,
int _primary_uid = -1, int _secondary_uid = -1) :
type (_type),
duration (_duration),
primary_item_uid (_primary_uid),
secondary_item_uid (_secondary_uid)
{ active = true; }
Player_activity_type type;
int duration;
int primary_item_uid;
int secondary_item_uid;
bool active;
std::string get_name(); // Proper name e.g. "wait"
std::string get_participle(); // "You stop ______" e.g. waiting
bool is_active() { return active && (type != PLAYER_ACTIVITY_NULL); }
};
#endif