diff options
| author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-15 06:35:03 +0000 |
|---|---|---|
| committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-15 06:35:03 +0000 |
| commit | 99548fb47fee447b5f22d5338501ac574086c4fd (patch) | |
| tree | fcef60aed6d7d0f04437249815af36c25461c5dd /src/scripting/script.hpp | |
| parent | 2fa455ff7870dc09d75bb89a897c7c1d26eb9020 (diff) | |
| download | manaserv-99548fb47fee447b5f22d5338501ac574086c4fd.tar.gz manaserv-99548fb47fee447b5f22d5338501ac574086c4fd.tar.xz manaserv-99548fb47fee447b5f22d5338501ac574086c4fd.zip | |
Added helper functions for loading files and NPCs as scripts. Put Lua helpers into a separate library automatically loaded into new contexts.
Diffstat (limited to 'src/scripting/script.hpp')
| -rw-r--r-- | src/scripting/script.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/scripting/script.hpp b/src/scripting/script.hpp index 136ae9f..65fc004 100644 --- a/src/scripting/script.hpp +++ b/src/scripting/script.hpp @@ -53,12 +53,24 @@ class Script virtual ~Script() {} /** - * Loads a chunk of text into the script context and executes - * its global statements. + * Loads a chunk of text into script context and executes its global + * statements. */ virtual void load(char const *) = 0; /** + * Loads a text file into script context and executes its global + * statements. + */ + virtual void loadFile(std::string const &); + + /** + * Loads a chunk of text and considers it as an NPC handler. This + * handler will later be used to create the given NPC. + */ + virtual void loadNPC(int id, int x, int y, char const *); + + /** * Called every tick for the script to manage its data. * Calls the "update" function of the script by default. */ |
