TrinityCore
enuminfo_UnitAICommon.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 "UnitAICommon.h"
19#include "Define.h"
20#include "SmartEnum.h"
21#include <stdexcept>
22
24{
25
26/******************************************************************\
27|* data for enum 'EvadeReason' in 'UnitAICommon.h' auto-generated *|
28\******************************************************************/
29template <>
31{
32 switch (value)
33 {
34 case EvadeReason::NoHostiles: return { "NoHostiles", "NoHostiles", "the creature's threat list is empty" };
35 case EvadeReason::Boundary: return { "Boundary", "Boundary", "the creature has moved outside its evade boundary" };
36 case EvadeReason::NoPath: return { "NoPath", "NoPath", "the creature was unable to reach its target for over 5 seconds" };
37 case EvadeReason::SequenceBreak: return { "SequenceBreak", "SequenceBreak", "this is a boss and the pre-requisite encounters for engaging it are not defeated yet" };
38 case EvadeReason::Other: return { "Other", "Other", "anything else" };
39 default: throw std::out_of_range("value");
40 }
41}
42
43template <>
45
46template <>
48{
49 switch (index)
50 {
51 case 0: return EvadeReason::NoHostiles;
52 case 1: return EvadeReason::Boundary;
53 case 2: return EvadeReason::NoPath;
54 case 3: return EvadeReason::SequenceBreak;
55 case 4: return EvadeReason::Other;
56 default: throw std::out_of_range("index");
57 }
58}
59
60template <>
62{
63 switch (value)
64 {
65 case EvadeReason::NoHostiles: return 0;
66 case EvadeReason::Boundary: return 1;
67 case EvadeReason::NoPath: return 2;
68 case EvadeReason::SequenceBreak: return 3;
69 case EvadeReason::Other: return 4;
70 default: throw std::out_of_range("value");
71 }
72}
73}
#define TC_API_EXPORT
Definition: Define.h:92
EvadeReason
Definition: UnitAICommon.h:30
static size_t ToIndex(Enum index)
static EnumText ToString(Enum value)
static Enum FromIndex(size_t index)