diff options
Diffstat (limited to 'src/map/magic-interpreter.t.hpp')
-rw-r--r-- | src/map/magic-interpreter.t.hpp | 118 |
1 files changed, 10 insertions, 108 deletions
diff --git a/src/map/magic-interpreter.t.hpp b/src/map/magic-interpreter.t.hpp index 9310a7b..ab151fc 100644 --- a/src/map/magic-interpreter.t.hpp +++ b/src/map/magic-interpreter.t.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_MAP_MAGIC_INTERPRETER_T_HPP -#define TMWA_MAP_MAGIC_INTERPRETER_T_HPP +#pragma once // magic-interpreter.t.hpp - Old magic. // // Copyright © 2004-2011 The Mana World Development Team @@ -20,10 +19,15 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -# include "../sanity.hpp" +#include "fwd.hpp" -# include "../generic/enum.hpp" +#include "../generic/enum.hpp" + +namespace tmwa +{ +namespace magic +{ enum class SPELLARG : uint8_t { NONE, @@ -31,90 +35,6 @@ enum class SPELLARG : uint8_t STRING, }; -enum class TYPE : uint8_t -{ - UNDEF, - INT, - DIR, - STRING, - ENTITY, - LOCATION, - AREA, - SPELL, - INVOCATION, - FAIL = 127, - - NEGATIVE_1 = 255, -}; - -// Note: there is also a typedef by this name in <dirent.h> -// but we should be fine since we never include it. -// (in the long term we should still rename this though) -enum class DIR : uint8_t -{ - S = 0, - SW = 1, - W = 2, - NW = 3, - N = 4, - NE = 5, - E = 6, - SE = 7, - - COUNT, -}; - -constexpr -earray<int, DIR, DIR::COUNT> dirx //= -{{ - 0, -1, -1, -1, 0, 1, 1, 1, -}}, diry //= -{{ - 1, 1, 0, -1, -1, -1, 0, 1, -}}; - -constexpr -bool dir_is_diagonal(DIR d) -{ - return static_cast<uint8_t>(d) & 1; -} - -enum class AREA : uint8_t -{ - LOCATION, - UNION, - RECT, - BAR, -}; - -enum class EXPR : uint8_t -{ - VAL, - LOCATION, - AREA, - FUNAPP, - ID, - SPELLFIELD, -}; - -// temporary rename to avoid collision with enum value -// in magic-interpreter-parser -enum class EFFECT : uint8_t -{ - SKIP, - ABORT, - ASSIGN, - FOREACH, - FOR, - IF, - SLEEP, - SCRIPT, - BREAK, - OP, - END, - CALL, -}; - enum class FOREACH_FILTER : uint8_t { MOB, @@ -125,17 +45,6 @@ enum class FOREACH_FILTER : uint8_t NPC, }; -enum class SPELLGUARD : uint8_t -{ - CONDITION, - COMPONENTS, - CATALYSTS, - CHOICE, - MANA, - CASTTIME, - EFFECT, -}; - namespace e { enum class SPELL_FLAG : uint8_t @@ -153,13 +62,6 @@ ENUM_BITWISE_OPERATORS(SPELL_FLAG) } using e::SPELL_FLAG; -enum class CONT_STACK : uint8_t -{ - FOREACH, - FOR, - PROC, -}; - namespace e { enum class INVOCATION_FLAG : uint8_t @@ -176,5 +78,5 @@ enum class INVOCATION_FLAG : uint8_t ENUM_BITWISE_OPERATORS(INVOCATION_FLAG) } using e::INVOCATION_FLAG; - -#endif // TMWA_MAP_MAGIC_INTERPRETER_T_HPP +} // namespace magic +} // namespace tmwa |