Tramway SDK
script.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_FRAMEWORK_SCRIPT_H
5#define TRAM_SDK_FRAMEWORK_SCRIPT_H
6
7#include <framework/value.h>
8#include <vector>
9
10namespace tram::Script {
11
12void SetGlobal(name_t name, value_t value);
14void SetFunction(name_t name, std::vector<Type> parameters, value_t (*function)(valuearray_t));
15value_t CallFunction(name_t name, std::vector<Value> parameters);
16
17
18struct Language {
20
22 void (*set_global)(name_t name, value_t value);
23 void (*set_function)(name_t name, std::vector<Type> parameters, value_t (*function)(valuearray_t));
24 value_t (*call_function)(name_t name, std::vector<Value> parameters);
25
26 void (*load_script)(const char* path);
27};
28
29void SetLanguage(Language language);
30void LoadScript(const char* path);
31
32void Init();
33
34}
35
36#endif // TRAM_SDK_FRAMEWORK_SCRIPT_H
Generic, type-safe union.
Definition: value.h:18
std::vector< Type > parameters
Definition: lua.cpp:156
Definition: script.cpp:23
void SetGlobal(name_t name, value_t value)
Definition: script.cpp:34
void Init()
Definition: script.cpp:58
void SetFunction(name_t name, std::vector< Type > parameters, value_t(*function)(valuearray_t))
Definition: script.cpp:42
void SetLanguage(Language lang)
Definition: script.cpp:50
value_t GetGlobal(name_t name)
Definition: script.cpp:38
void LoadScript(const char *path)
Definition: script.cpp:54
value_t CallFunction(name_t name, std::vector< Value > parameters)
Definition: script.cpp:46
Value value_t
Definition: value.h:346
ValueArray valuearray_t
Definition: value.h:347
UID name_t
Definition: uid.h:40
Definition: script.h:18
name_t name
Definition: script.h:19
void(* load_script)(const char *path)
Definition: script.h:26
void(* set_global)(name_t name, value_t value)
Definition: script.h:22
void(* set_function)(name_t name, std::vector< Type > parameters, value_t(*function)(valuearray_t))
Definition: script.h:23
value_t(* call_function)(name_t name, std::vector< Value > parameters)
Definition: script.h:24
value_t(* get_global)(name_t name)
Definition: script.h:21
Definition: uid.h:11