File: gamemode.cpp

package info (click to toggle)
cataclysm-dda 0.C%2Bgit20190228.faafa3a-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 181,636 kB
  • sloc: cpp: 256,609; python: 2,621; makefile: 862; sh: 495; perl: 37; xml: 33
file content (42 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download
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
#include "gamemode.h"

#include "debug.h"
#include "output.h"
#include "translations.h"

std::string special_game_name( special_game_id id )
{
    switch( id ) {
        case SGAME_NULL:
        case NUM_SPECIAL_GAMES:
            return "Bug (gamemode.cpp:special_game_name)";
        case SGAME_TUTORIAL:
            return _( "Tutorial" );
        case SGAME_DEFENSE:
            return _( "Defense" );
        default:
            return "Uncoded (gamemode.cpp:special_game_name)";
    }
}

std::unique_ptr<special_game> get_special_game( special_game_id id )
{
    std::unique_ptr<special_game> ret;
    switch( id ) {
        case SGAME_NULL:
            ret.reset( new special_game );
            break;
        case SGAME_TUTORIAL:
            ret.reset( new tutorial_game );
            break;
        case SGAME_DEFENSE:
            ret.reset( new defense_game );
            break;
        default:
            debugmsg( "Missing something in gamemode.cpp:get_special_game()?" );
            ret.reset( new special_game );
            break;
    }

    return ret;
}