12 using bl::script::Function;
13 using bl::script::SymbolTable;
14 using bl::script::Value;
16 typedef void (*Builtin)(
const std::string&,
const std::string&, std::uint16_t, Value&);
18 void mapName(
const std::string& prevMap,
const std::string& newMap, std::uint16_t spawn,
20 void previousMap(
const std::string& prevMap,
const std::string& newMap, std::uint16_t spawn,
22 void spawnId(
const std::string& prevMap,
const std::string& newMap, std::uint16_t spawn,
25 Value bind(
const std::string& prevMap,
const std::string& newMap, std::uint16_t spawn,
27 return Value(Function(std::bind(func, prevMap, newMap, spawn, std::placeholders::_3)));
33 const std::string& newMap, std::uint16_t spawn)
42 table.set(
"mapName", bind(prevMap, newMap, spawn, &mapName));
43 table.set(
"previousMap", bind(prevMap, newMap, spawn, &previousMap));
44 table.set(
"spawnId", bind(prevMap, newMap, spawn, &spawnId));
49 void mapName(
const std::string&,
const std::string& newMap, std::uint16_t, Value& result) {
53 void previousMap(
const std::string& prevMap,
const std::string&, std::uint16_t, Value& result) {
57 void spawnId(
const std::string&,
const std::string&, std::uint16_t spawn, Value& result) {
58 result =
static_cast<float>(spawn);
Core classes and functionality for both the editor and game.
static void addDefaults(bl::script::SymbolTable &table, system::Systems &systems)
Adds the universal built-in functions to the given symbol table.
MapChangeContext(system::Systems &systems, const std::string &prevMap, const std::string &newMap, std::uint16_t spawn)
Construct a new Map ChangeContext.
virtual void addCustomSymbols(bl::script::SymbolTable &table) const override
Owns all primary systems and a reference to the engine.