forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_messages.cpp
84 lines (77 loc) · 1.92 KB
/
fake_messages.cpp
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <cstddef>
#include <iosfwd>
#include <utility>
#include <vector>
#include "calendar.h"
#include "enums.h"
#include "messages.h"
class Creature;
class JsonObject;
class JsonOut;
struct tripoint;
namespace catacurses
{
class window;
} // namespace catacurses
/**
* For unit testing we just store all messages so they can be dumped in the
* event of a test failure.
*/
static std::vector<std::pair<std::string, std::string>> messages;
std::vector<std::pair<std::string, std::string>> Messages::recent_messages( size_t )
{
return messages;
}
bool Messages::has_debug_filter( debugmode::debug_filter )
{
return true;
}
void Messages::add_msg( std::string m )
{
messages.emplace_back( to_string_time_of_day( calendar::turn ), std::move( m ) );
}
void Messages::add_msg( const game_message_params &, std::string m )
{
add_msg( std::move( m ) );
}
void Messages::clear_messages()
{
messages.clear();
}
void Messages::deactivate() {}
size_t Messages::size()
{
return messages.size();
}
bool Messages::has_undisplayed_messages()
{
return false;
}
void Messages::display_messages() {}
void Messages::display_messages( const catacurses::window &, int, int, int, int ) {}
void Messages::serialize( JsonOut & ) {}
void Messages::deserialize( const JsonObject & ) {}
void add_msg( std::string m )
{
Messages::add_msg( std::move( m ) );
}
void add_msg( const game_message_params &, std::string m )
{
Messages::add_msg( std::move( m ) );
}
void add_msg_if_player_sees( const tripoint &, std::string m )
{
Messages::add_msg( std::move( m ) );
}
void add_msg_if_player_sees( const Creature &, std::string m )
{
Messages::add_msg( std::move( m ) );
}
void add_msg_if_player_sees( const tripoint &, const game_message_params &, std::string m )
{
Messages::add_msg( std::move( m ) );
}
void add_msg_if_player_sees( const Creature &, const game_message_params &, std::string m )
{
Messages::add_msg( std::move( m ) );
}