12 using bl::script::Function;
13 using bl::script::SymbolTable;
14 using bl::script::Value;
19 void talkingEntity(SymbolTable& table, bl::ecs::Entity entity,
21 void conversationOver(SymbolTable& table, bl::ecs::Entity entity,
23 void waitConversationOver(SymbolTable& table, bl::ecs::Entity entity,
28 Function(std::bind(func, std::placeholders::_1, entity, cb, std::placeholders::_3)));
41 table.set(
"talkingEntity", bind(owner, cb, &talkingEntity));
42 table.set(
"conversationOver", bind(owner, cb, &conversationOver));
43 table.set(
"waitConversationOver", bind(owner, cb, &waitConversationOver));
50 res =
static_cast<float>(entity);
58 void waitConversationOver(SymbolTable& table, bl::ecs::Entity entity,
60 while (!cb(entity)) { table.waitFor(100); }
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.
virtual void addCustomSymbols(bl::script::SymbolTable &table) const override
std::function< bool(bl::ecs::Entity)> StatusCb
Special callback type for reporting conversation state.
ConversationContext(system::Systems &systems, bl::ecs::Entity entity, const StatusCb &cb)
Construct a new ConversationContext.
Owns all primary systems and a reference to the engine.