Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- setTimer, killTimer function added. - New arguments reader added. - Fixed various issues with using function reader.
- Loading branch information
Showing
15 changed files
with
329 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "CLuaArgument.h" | ||
#include "CUtility.h" | ||
|
||
CLuaArgument::CLuaArgument(lua_State *L, int argIndex) | ||
{ | ||
argType = lua_type(L, argIndex); | ||
switch (argType) | ||
{ | ||
case LUA_TBOOLEAN: | ||
{ | ||
argBoolean = !!lua_toboolean(L, argIndex); | ||
break; | ||
} | ||
case LUA_TNUMBER: | ||
{ | ||
argNumber = lua_tonumber(L, argIndex); | ||
CUtility::printf("N: %d - %f", argIndex, argNumber); | ||
break; | ||
} | ||
case LUA_TSTRING: | ||
{ | ||
argString = lua_tostring(L, argIndex); | ||
break; | ||
} | ||
|
||
default: | ||
{ | ||
argType = 0; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
CLuaArgument::~CLuaArgument() | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef _LUA_ARGUMENT_HEADER_ | ||
#define _LUA_ARGUMENT_HEADER_ | ||
|
||
#include <string> | ||
extern "C" | ||
{ | ||
#include "Lua_351/lua.h" | ||
} | ||
|
||
class CLuaArgument | ||
{ | ||
public: | ||
CLuaArgument(lua_State *L, int argIndex); | ||
~CLuaArgument(); | ||
inline int GetType() { return argType; } | ||
inline bool GetBoolean() { return argBoolean; } | ||
inline lua_Number GetNumber() { return argNumber; } | ||
inline std::string GetString() { return argString; } | ||
private: | ||
int argType; | ||
bool argBoolean; | ||
lua_Number argNumber; | ||
std::string argString; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "CLuaArguments.h" | ||
|
||
void CLuaArguments::Add(CLuaArgument *arg) | ||
{ | ||
argumentsContainer.push_back(arg); | ||
} | ||
|
||
CLuaArguments::CLuaArguments() | ||
{ | ||
|
||
} | ||
|
||
CLuaArguments::~CLuaArguments() | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef _LUA_ARGUMENTS_HEADER_ | ||
#define _LUA_ARGUMENTS_HEADER_ | ||
|
||
#include "CLuaArgument.h" | ||
#include <vector> | ||
|
||
class CLuaArguments | ||
{ | ||
public: | ||
CLuaArguments(); | ||
~CLuaArguments(); | ||
void Add(CLuaArgument *); | ||
std::vector<CLuaArgument *> Get(void) { return argumentsContainer; } | ||
private: | ||
std::vector<CLuaArgument *> argumentsContainer; | ||
int teszt; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.