40 #ifndef _lua51script_cpp
41 #define _lua51script_cpp
81 : SourceCode(InitialSourceCode),
83 FunctionCall(JustAFunctionCall)
85 if(Compiler && !FunctionCall)
90 : SourceCode(InitialSourceCode),
92 FunctionCall(JustAFunctionCall)
104 { Args.push_back(Arg); }
146 { Args.erase( std::remove(Args.begin(),Args.end(),Arg) ); }
149 { Args.erase(Args.begin()+ArgNumber); }
152 {
return Args.size(); }
158 {
return Args.at(ArgNumber); }
172 Returns.push_back(Return1);
176 {
return SourceCode; }
179 { CompiledByteCode = Code; }
182 {
return CompiledByteCode; }
185 {
return CompiledByteCode; }
188 {
return CompiledByteCode.
Binary != 0; }
207 {
return Returns.size(); }
210 { Returns.push_back(ReturnArg); }
216 {
return Returns.at(ReturnNumber); }
virtual CountedPtr< iScriptCompilable > Compile(const String &SourceToCompile)
Calls Compile(CountedPtr) and returns a CountedPtr to the script created...
void SetName(const String &NewName)
change the name of the Script
virtual void SetSourceCode(const String &Code)
Sets the string version of the script.
bool Boole
Generally acts a single bit, true or false.
std::vector< CountedPtr< iScriptArgument > > ArgumentGroup
A group of arguments that can be returned from some scripts.
void Compile(Lua51ScriptingEngine *Compiler)
This will compile the Lua script.
virtual Whole GetArgumentCount() const
How many arguments have been attached to this script?
virtual void ClearArguments()
Remove all the ARGs!!! http://imgur.com/DJhw7.
All the definitions for datatypes as well as some basic conversion functions are defined here...
virtual CountedPtr< iScriptArgument > GetArgument(Whole ArgNumber) const
Retrieve a argument previously passed in.
int Integer
A datatype used to represent any integer close to.
virtual String GetSourceCode() const
If present this returns the code of script.
virtual void SetByteCode(BinaryTools::BinaryBuffer Code)
Set the bytecode used when this script is executed.
No special care is required for Whole number Lua Arguments, so a simple typedef is used...
This implements the exception hiearchy for Mezzanine.
virtual bool IsCompiled() const
Has this script already been compiled into a bytecode.
virtual FlaggedBuffer & GetByteCodeReference()
Get a reference to bytecode instead of a copy.
float Real
A Datatype used to represent a real floating point number.
char Char8
A datatype to represent one character.
Lua51Script()
Simple constructor, creates a script that executes a no-op.
No special care is required for String Lua Arguments, so a simple typedef is used.
This file has the interface for the Lua scripts.
An expanded version of the BinaryTools::BinaryBuffer to carry one tiny piece of metadata around with ...
This file has the definition of the Script Arguments for Lua 51.
virtual void RemoveArgument(CountedPtr< iScriptArgument > Arg)
Remove an argument based on a CountedPtr to the script.
The implementations in the ScriptArgumentGeneric will cover most of what this needs...
int luaopen_Mezzanine(lua_State *L)
Entry point into Swig bindings, required to initialize Lua.
virtual ~Lua51Script()
Virtual destructor.
virtual BinaryTools::BinaryBuffer GetByteCode() const
Get the compiled version of the code if it is available.
The workhorse of the Lua scripting system. All scripts come here to be executed.
virtual Whole GetReturnCount() const
How many values are being returned.
virtual void AddReturn(CountedPtr< iScriptArgument > ReturnArg)
Add another value to be returned.
String GetName() const
Get the name of the current Script.
No special care is required for Bool Lua Arguments, so a simple typedef is used.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
This file has the interface for the Lua based implementation of the Scripting system.
virtual CountedPtr< iScriptArgument > GetReturn(Whole ReturnNumber) const
Retrieve a value returned from a script.
std::string String
A datatype used to a series of characters.
A Real that can readily be passed into lua scripts.
virtual void AddArgument()
When called with no arguments this inserts a Lua51nil.
Represents not much of anything but will insert and retrieves Nils from Lua51.
virtual ArgumentGroup GetAllReturns() const
Get the returns from the last exection of the script.