forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamemode.cpp
43 lines (39 loc) · 1.23 KB
/
gamemode.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
#include "gamemode.h"
#include "gamemode_defense.h"
#include "gamemode_tutorial.h"
#include "debug.h"
#include "translations.h"
std::string special_game_name( special_game_type id )
{
switch( id ) {
case special_game_type::NONE:
case special_game_type::NUM_SPECIAL_GAME_TYPES:
return "Bug (gamemode.cpp:special_game_name)";
case special_game_type::TUTORIAL:
return _( "Tutorial" );
case special_game_type::DEFENSE:
return _( "Defense" );
default:
return "Uncoded (gamemode.cpp:special_game_name)";
}
}
std::unique_ptr<special_game> get_special_game( special_game_type id )
{
std::unique_ptr<special_game> ret;
switch( id ) {
case special_game_type::NONE:
ret = std::make_unique<special_game>();
break;
case special_game_type::TUTORIAL:
ret = std::make_unique<tutorial_game>();
break;
case special_game_type::DEFENSE:
ret = std::make_unique<defense_game>();
break;
default:
debugmsg( "Missing something in gamemode.cpp:get_special_game()?" );
ret = std::make_unique<special_game>();
break;
}
return ret;
}