From 3b98f3439e33b15bba2036c402f9925340fdb2b9 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 29 Jun 2013 23:23:43 -0700 Subject: Poison std::string and use the various string classes --- src/map/magic-interpreter.hpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/map/magic-interpreter.hpp') diff --git a/src/map/magic-interpreter.hpp b/src/map/magic-interpreter.hpp index 9b60d998..13c91e9 100644 --- a/src/map/magic-interpreter.hpp +++ b/src/map/magic-interpreter.hpp @@ -10,6 +10,8 @@ #include "script.hpp" #include "skill.t.hpp" +struct fun_t; +struct op_t; struct expr_t; struct val_t; struct location_t; @@ -118,7 +120,8 @@ struct expr_t e_area_t e_area; struct { - int id, line_nr, column; + fun_t *funp; + int line_nr, column; int args_nr; dumb_ptr args[MAX_ARGS]; } e_funapp; @@ -169,7 +172,7 @@ struct effect_t dumb_ptr e_script; struct { - int id; + op_t *opp; int args_nr; int line_nr, column; dumb_ptr args[MAX_ARGS]; @@ -238,9 +241,8 @@ struct letdef_t struct spell_t { - std::string name; - std::string invocation; - int index_; // Relative location in the definitions file + FString name; + FString invocation; SPELL_FLAG flags; int arg; SPELLARG spellarg_ty; @@ -256,8 +258,8 @@ struct spell_t struct teleport_anchor_t { - std::string name; - std::string invocation; + FString name; + FString invocation; dumb_ptr location; }; @@ -269,15 +271,15 @@ struct magic_conf_t { struct mcvar { - std::string name; + FString name; val_t val; }; // This should probably be done by a dedicated "intern pool" class std::vector varv; - std::map> spells_by_name, spells_by_invocation; + std::map> spells_by_name, spells_by_invocation; - std::map> anchors_by_name, anchors_by_invocation; + std::map> anchors_by_name, anchors_by_invocation; }; /* Execution environment */ @@ -390,10 +392,10 @@ extern env_t magic_default_env; /* Fake default environment */ */ void magic_add_component(dumb_ptr *component_holder, int id, int count); -dumb_ptr magic_find_anchor(const std::string& name); +dumb_ptr magic_find_anchor(XString name); dumb_ptr spell_create_env(magic_conf_t *conf, dumb_ptr spell, - dumb_ptr caster, int spellpower, const_string param); + dumb_ptr caster, int spellpower, XString param); void magic_free_env(dumb_ptr env); @@ -419,7 +421,7 @@ int spell_unbind(dumb_ptr subject, dumb_ptr invoca */ dumb_ptr spell_clone_effect(dumb_ptr source); -dumb_ptr magic_find_spell(const std::string& invocation); +dumb_ptr magic_find_spell(XString invocation); /* The following is used only by the parser: */ struct args_rec_t @@ -429,7 +431,7 @@ struct args_rec_t struct proc_t { - std::string name; + FString name; std::vector argv; dumb_ptr body; -- cgit v1.2.3-60-g2f50