From 506a41d6926405b2753894f0b40130b4077828b3 Mon Sep 17 00:00:00 2001 From: wushin Date: Tue, 9 Jun 2015 01:06:22 -0500 Subject: Remove old Magic --- src/map/magic-expr.hpp | 107 ------------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 src/map/magic-expr.hpp (limited to 'src/map/magic-expr.hpp') diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp deleted file mode 100644 index 055f37b..0000000 --- a/src/map/magic-expr.hpp +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once -// magic-expr.hpp - Pure functions for the old magic backend. -// -// Copyright © 2004-2011 The Mana World Development Team -// Copyright © 2011-2014 Ben Longbons -// -// This file is part of The Mana World (Athena server) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#include "fwd.hpp" - -#include "../strings/zstring.hpp" -#include "../strings/literal.hpp" - -#include "magic-interpreter.t.hpp" - - -namespace tmwa -{ -namespace map -{ -namespace magic -{ -/* - * Argument types: - * i : int - * d : dir - * s : string - * e : entity - * l : location - * a : area - * S : spell - * I : invocation - * . : any, except for fail/undef - * _ : any, including fail, but not undef - */ -struct fun_t -{ - LString name; - LString signature; - char ret_ty; - int (*fun)(dumb_ptr env, val_t *result, Slice arga); -}; - -/** - * Retrieves a function by name - * @param name The name to look up - * @return A function of that name, or nullptr. - */ -fun_t *magic_get_fun(ZString name); - -/** - * Evaluates an expression and stores the result in `dest' - */ -void magic_eval(dumb_ptr env, val_t *dest, dumb_ptr expr); - -/** - * Evaluates an expression and coerces the result into an integer - */ -int magic_eval_int(dumb_ptr env, dumb_ptr expr); - -/** - * Evaluates an expression and coerces the result into a string - */ -AString magic_eval_str(dumb_ptr env, dumb_ptr expr); - -void magic_clear_var(val_t *v); - -void magic_copy_var(val_t *dest, const val_t *src); - -void magic_random_location(location_t *dest, dumb_ptr area); - -// ret -1: not a string, ret 1: no such item, ret 0: OK -int magic_find_item(Slice args, int index, Item *item, int *stackable); - -#define GET_ARG_ITEM(index, dest, stackable) \ - switch (magic_find_item(args, index, &dest, &stackable)) \ - { \ - case -1: return 1; \ - case 1: return 0; \ - default: break; \ - } - -int magic_location_in_area(Borrowed m, int x, int y, dumb_ptr area); - -/* Helper definitions for dealing with functions and operations */ - -int magic_signature_check(ZString opname, ZString funname, ZString signature, - Slice args, int line, int column); - -Borrowed magic_area_rect(int *x, int *y, int *width, int *height, - area_t& area); -} // namespace magic -} // namespace map -} // namespace tmwa -- cgit v1.2.3-70-g09d2