Add invocation queue to DrivenEngine, use it for lua source
This commit is contained in:
@@ -31,7 +31,7 @@ public:
|
||||
Gui gui_;
|
||||
|
||||
public:
|
||||
virtual void event_init(std::string_view srcpk, int argc, char *argv[]) {
|
||||
virtual void event_init(std::string_view srcpk, int argc, char *argv[]) override {
|
||||
// Create the master world model.
|
||||
master_.reset(new World(WORLD_TYPE_MASTER));
|
||||
|
||||
@@ -166,9 +166,13 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void event_update() {
|
||||
// If the driver has reloaded the source, put it into master model.
|
||||
master_->update_source(get_lua_source_pack());
|
||||
virtual void event_update() override {
|
||||
// Execute any queued invocations.
|
||||
// We just feed these directly into the master model.
|
||||
eng::vector<UniqueInvocation> invocations = get_queued_invocations();
|
||||
for (const UniqueInvocation &inv : invocations) {
|
||||
master_->invoke(*inv);
|
||||
}
|
||||
|
||||
// Check for keyboard input on stdin.
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user