File Scripting.h
FileList > engine > include > Scripting.h
Go to the source code of this file
#include <stddef.h>#include <stdbool.h>#include "IntTypes.h"
Classes
| Type | Name |
|---|---|
| struct | LuaListenedEventArgs |
| struct | ScriptCallArgument |
Public Types
| Type | Name |
|---|---|
| enum | ScriptCallArgumentDataType |
| typedef struct lua_State | lua_State only intended for unit testing, and in games linking to the engine |
Public Functions
| Type | Name |
|---|---|
| void | Sc_AddLightUserDataValueToTable (int regIndex, const char * userDataKey, void * userDataValue) |
| bool | Sc_Bool () |
| void | Sc_CallFuncInRegTableEntry (int regIndex, struct ScriptCallArgument * pArgs, int numArgs, int numReturnVals, int selfRegIndex) |
| void | Sc_CallFuncInRegTableEntryTable (int regIndex, const char * funcName, struct ScriptCallArgument * pArgs, int numArgs, int numReturnVals) |
| int | Sc_CallGlobalFuncReturningTableAndStoreResultInReg (const char * funcName, struct ScriptCallArgument * pArgs, int numArgs) call a global lua function that returns a table, and store the table in the lua registry (lua_LGetRef) |
| void | Sc_DeInitScripting () |
| void | Sc_DeleteTableInReg (int index) delete a table stored in the lua registry |
| void | Sc_DumpStack () |
| float | Sc_Float () |
| bool | Sc_FunctionPresentInTable (int regIndex, const char * funcName) |
| void | Sc_InitScripting () |
| int | Sc_Int () |
| bool | Sc_IsBool () |
| bool | Sc_IsInteger () |
| bool | Sc_IsNil () |
| bool | Sc_IsNumber () |
| bool | Sc_IsString () |
| bool | Sc_IsTable () |
| void | Sc_NewTableOnStack (int arrayElementHint, int nonArrayElementHint) |
| bool | Sc_OpenFile (const char * path) |
| void | Sc_Pop () |
| void | Sc_PushInt (int i) |
| int | Sc_RefTable () |
| void | Sc_RegisterCFunction (const char * name, int(*)(lua_State *) fn) |
| void | Sc_ResetStack () |
| void | Sc_SetFloatAtTableKey (const char * key, float val) |
| void | Sc_SetIntAtTableIndex (int index, int value) |
| void | Sc_SetIntAtTableKey (const char * key, int val) |
| void | Sc_SetPointerAtTableKey (const char * key, void * ptr) |
| void | Sc_SetTable () (stack on table) push index onto stack push something to set at the index call this to set the value at the index |
| void | Sc_StackTopStrCopy (char * pOutString) |
| size_t | Sc_StackTopStringLen () |
| bool | Sc_StringCmp (const char * cmpTo) |
| void | Sc_TableGet (const char * key) |
| void | Sc_TableGetIndex (int index) |
| int | Sc_TableLen () |
| int | Sc_Type () |
| void | Sc_UnRefTable (int ref) |
Macros
| Type | Name |
|---|---|
| define | MAX_SCRIPT_FUNCTION_NAME_SIZE 32 |
Public Types Documentation
enum ScriptCallArgumentDataType
enum ScriptCallArgumentDataType {
SCA_nil,
SCA_boolean,
SCA_number,
SCA_string,
SCA_userdata,
SCA_table,
SCA_int
};
typedef lua_State
only intended for unit testing, and in games linking to the engine
typedef struct lua_State lua_State;
Public Functions Documentation
function Sc_AddLightUserDataValueToTable
void Sc_AddLightUserDataValueToTable (
int regIndex,
const char * userDataKey,
void * userDataValue
)
function Sc_Bool
bool Sc_Bool ()
function Sc_CallFuncInRegTableEntry
void Sc_CallFuncInRegTableEntry (
int regIndex,
struct ScriptCallArgument * pArgs,
int numArgs,
int numReturnVals,
int selfRegIndex
)
function Sc_CallFuncInRegTableEntryTable
void Sc_CallFuncInRegTableEntryTable (
int regIndex,
const char * funcName,
struct ScriptCallArgument * pArgs,
int numArgs,
int numReturnVals
)
function Sc_CallGlobalFuncReturningTableAndStoreResultInReg
call a global lua function that returns a table, and store the table in the lua registry (lua_LGetRef)
int Sc_CallGlobalFuncReturningTableAndStoreResultInReg (
const char * funcName,
struct ScriptCallArgument * pArgs,
int numArgs
)
Parameters:
funcNamepArgsnumArgs
Returns:
key to the table returned, stored in the registry table. 0 if failed
function Sc_DeInitScripting
void Sc_DeInitScripting ()
function Sc_DeleteTableInReg
delete a table stored in the lua registry
void Sc_DeleteTableInReg (
int index
)
Parameters:
index
function Sc_DumpStack
void Sc_DumpStack ()
function Sc_Float
float Sc_Float ()
function Sc_FunctionPresentInTable
bool Sc_FunctionPresentInTable (
int regIndex,
const char * funcName
)
function Sc_InitScripting
void Sc_InitScripting ()
function Sc_Int
int Sc_Int ()
function Sc_IsBool
bool Sc_IsBool ()
function Sc_IsInteger
bool Sc_IsInteger ()
function Sc_IsNil
bool Sc_IsNil ()
function Sc_IsNumber
bool Sc_IsNumber ()
function Sc_IsString
bool Sc_IsString ()
function Sc_IsTable
bool Sc_IsTable ()
function Sc_NewTableOnStack
void Sc_NewTableOnStack (
int arrayElementHint,
int nonArrayElementHint
)
function Sc_OpenFile
bool Sc_OpenFile (
const char * path
)
function Sc_Pop
void Sc_Pop ()
function Sc_PushInt
void Sc_PushInt (
int i
)
function Sc_RefTable
int Sc_RefTable ()
function Sc_RegisterCFunction
void Sc_RegisterCFunction (
const char * name,
int(*)(lua_State *) fn
)
function Sc_ResetStack
void Sc_ResetStack ()
function Sc_SetFloatAtTableKey
void Sc_SetFloatAtTableKey (
const char * key,
float val
)
function Sc_SetIntAtTableIndex
void Sc_SetIntAtTableIndex (
int index,
int value
)
function Sc_SetIntAtTableKey
void Sc_SetIntAtTableKey (
const char * key,
int val
)
function Sc_SetPointerAtTableKey
void Sc_SetPointerAtTableKey (
const char * key,
void * ptr
)
function Sc_SetTable
(stack on table) push index onto stack push something to set at the index call this to set the value at the index
void Sc_SetTable ()
function Sc_StackTopStrCopy
void Sc_StackTopStrCopy (
char * pOutString
)
function Sc_StackTopStringLen
size_t Sc_StackTopStringLen ()
function Sc_StringCmp
bool Sc_StringCmp (
const char * cmpTo
)
function Sc_TableGet
void Sc_TableGet (
const char * key
)
function Sc_TableGetIndex
void Sc_TableGetIndex (
int index
)
function Sc_TableLen
int Sc_TableLen ()
function Sc_Type
int Sc_Type ()
function Sc_UnRefTable
void Sc_UnRefTable (
int ref
)
Macro Definition Documentation
define MAX_SCRIPT_FUNCTION_NAME_SIZE
#define MAX_SCRIPT_FUNCTION_NAME_SIZE `32`
The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/include/Scripting.h