blob: 9b5503bf9b2be9908cf84ae35aaf3ed0c5e832e1 (
plain)
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
85
86
87
88
89
|
/*
This file is part of Minitrem.
Minitrem is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Minitrem is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Minitrem. If not, see <http://www.gnu.org/licenses/>.
*/
#include "game.hpp"
namespace game::text {
language_t language = LANG_ENGLISH;
static const char *soldier_names[] = {
"Kowalski", "Jackson", "Carter", "O'Neill", "Hammond", "Mitchell"
};
static std::string get_english(index_t index)
{
switch (index) {
case PAUSED:
return "PAUSED";
case UNPAUSED:
return "UNPAUSED";
case FOLLOWING_ON:
return "Following: on.";
case FOLLOWING_OFF:
return "Following: off.";
case SAY_NO_PATH:
return "I can't get there.";
case SAY_READY:
return "Ready for orders.";
case SAY_MOVING:
return "On my way.";
case SAY_STOPPING:
return "Stopping.";
case SAY_FIRING:
return "Firing!";
case UNIT_NAME_SPIDER:
return "Spider";
case UNIT_NAME_SOLDIER:
return soldier_names[rand() % COUNT(soldier_names)];
case UNIT_NAME_NEST:
return "Nest";
case UNIT_NAME_REPL:
return "Replicator";
case UNIT_DEATH:
return "died";
default:
abort();
}
}
std::string get(index_t index)
{
switch (language) {
case LANG_ENGLISH:
return get_english(index);
default:
abort();
}
}
} // namespace text
|