TrinityCore
Loading...
Searching...
No Matches
enuminfo_CreatureAI.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 "CreatureAI.h"
19#include "Define.h"
20#include "SmartEnum.h"
21#include <stdexcept>
22
24{
25
26/****************************************************************************\
27|* data for enum 'CreatureAI::EvadeReason' in 'CreatureAI.h' auto-generated *|
28\****************************************************************************/
29template <>
31{
32 switch (value)
33 {
34 case CreatureAI::EVADE_REASON_NO_HOSTILES: return { "EVADE_REASON_NO_HOSTILES", "EVADE_REASON_NO_HOSTILES", "the creature's threat list is empty" };
35 case CreatureAI::EVADE_REASON_BOUNDARY: return { "EVADE_REASON_BOUNDARY", "EVADE_REASON_BOUNDARY", "the creature has moved outside its evade boundary" };
36 case CreatureAI::EVADE_REASON_NO_PATH: return { "EVADE_REASON_NO_PATH", "EVADE_REASON_NO_PATH", "the creature was unable to reach its target for over 5 seconds" };
37 case CreatureAI::EVADE_REASON_SEQUENCE_BREAK: return { "EVADE_REASON_SEQUENCE_BREAK", "EVADE_REASON_SEQUENCE_BREAK", "this is a boss and the pre-requisite encounters for engaging it are not defeated yet" };
38 case CreatureAI::EVADE_REASON_OTHER: return { "EVADE_REASON_OTHER", "EVADE_REASON_OTHER", "anything else" };
39 default: throw std::out_of_range("value");
40 }
41}
42
43template <>
45
46template <>
48{
49 switch (index)
50 {
55 case 4: return CreatureAI::EVADE_REASON_OTHER;
56 default: throw std::out_of_range("index");
57 }
58}
59
60template <>
62{
63 switch (value)
64 {
69 case CreatureAI::EVADE_REASON_OTHER: return 4;
70 default: throw std::out_of_range("value");
71 }
72}
73}
#define TC_API_EXPORT
Definition Define.h:89
@ EVADE_REASON_OTHER
Definition CreatureAI.h:98
@ EVADE_REASON_BOUNDARY
Definition CreatureAI.h:95
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:94
@ EVADE_REASON_SEQUENCE_BREAK
Definition CreatureAI.h:97
@ EVADE_REASON_NO_PATH
Definition CreatureAI.h:96
static size_t ToIndex(Enum index)
static EnumText ToString(Enum value)
static Enum FromIndex(size_t index)