forked from aburch/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 1
/
simmesg.h
69 lines (50 loc) · 1.46 KB
/
simmesg.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef simmesg_h
#define simmesg_h
#include "simtypes.h"
#include "simcolor.h"
#include "display/simimg.h"
#include "dataobj/koord.h"
#include "tpl/slist_tpl.h"
class karte_t;
/* class for a simple message
* this way they are stored in a list
* @author prissi
*/
class message_t
{
public:
class node {
public:
char msg[256];
sint32 type;
koord pos;
PLAYER_COLOR_VAL color;
image_id bild;
sint32 time;
void rdwr(loadsave_t *file);
uint32 get_type_shifted() const { return 1<<(type & ~local_flag); }
PLAYER_COLOR_VAL get_player_color(karte_t*) const;
};
enum msg_typ { general=0, ai=1, city=2, problems=3, industry=4, chat=5, new_vehicle=6, full=7, warnings=8, traffic_jams=9, scenario=10, MAX_MESSAGE_TYPE, local_flag = 0x8000u };
void add_message( const char *text, koord pos, uint16 what, PLAYER_COLOR_VAL color=COL_BLACK, image_id bild=IMG_LEER );
static message_t * get_instance();
/* determines, which message is displayed where */
void get_message_flags( sint32 *t, sint32 *w, sint32 *a, sint32 *i);
void set_message_flags( sint32, sint32, sint32, sint32 );
message_t(karte_t *welt);
~message_t();
private:
karte_t *welt;
// bitfields that contains the messages
sint32 ticker_flags;
sint32 win_flags;
sint32 auto_win_flags;
sint32 ignore_flags;
slist_tpl<node *> list;
public:
const slist_tpl<node *> &get_list() const { return list; }
void clear();
void rotate90( sint16 size_w );
void rdwr( loadsave_t *file );
};
#endif