TrinityCore
enuminfo_InstanceScript.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "InstanceScript.h"
19#include "Define.h"
20#include "SmartEnum.h"
21#include <stdexcept>
22
24{
25
26/***********************************************************************\
27|* data for enum 'EncounterState' in 'InstanceScript.h' auto-generated *|
28\***********************************************************************/
29template <>
31{
32 switch (value)
33 {
34 case NOT_STARTED: return { "NOT_STARTED", "NOT_STARTED", "" };
35 case IN_PROGRESS: return { "IN_PROGRESS", "IN_PROGRESS", "" };
36 case FAIL: return { "FAIL", "FAIL", "" };
37 case DONE: return { "DONE", "DONE", "" };
38 case SPECIAL: return { "SPECIAL", "SPECIAL", "" };
39 case TO_BE_DECIDED: return { "TO_BE_DECIDED", "TO_BE_DECIDED", "" };
40 default: throw std::out_of_range("value");
41 }
42}
43
44template <>
46
47template <>
49{
50 switch (index)
51 {
52 case 0: return NOT_STARTED;
53 case 1: return IN_PROGRESS;
54 case 2: return FAIL;
55 case 3: return DONE;
56 case 4: return SPECIAL;
57 case 5: return TO_BE_DECIDED;
58 default: throw std::out_of_range("index");
59 }
60}
61
62template <>
64{
65 switch (value)
66 {
67 case NOT_STARTED: return 0;
68 case IN_PROGRESS: return 1;
69 case FAIL: return 2;
70 case DONE: return 3;
71 case SPECIAL: return 4;
72 case TO_BE_DECIDED: return 5;
73 default: throw std::out_of_range("value");
74 }
75}
76}
#define TC_API_EXPORT
Definition: Define.h:92
EncounterState
@ IN_PROGRESS
@ FAIL
@ DONE
@ SPECIAL
@ NOT_STARTED
@ TO_BE_DECIDED
static size_t ToIndex(Enum index)
static EnumText ToString(Enum value)
static Enum FromIndex(size_t index)