added /tick command

This commit is contained in:
2021-11-26 15:45:36 -05:00
parent 1e93533246
commit 742209988b
9 changed files with 61 additions and 21 deletions

View File

@@ -66,8 +66,9 @@ public:
// Print Buffer
//
// In non-actors, this is a null pointer. Stores the console
// output for this actor until it can be probed by the client.
// Stores the console output for this actor until it can be
// probed by the client. Most tangibles have empty printbuffers,
// which are stored as just a null pointer internally.
//
PrintBuffer print_buffer_;
@@ -124,9 +125,9 @@ public:
// Make a tangible.
//
// If the ID is zero, allocates an ID using the thread's ID allocator. If
// pushdb is true, pushes the tangible's database onto the lua stack.
// Otherwise, leaves the lua stack untouched.
// You must provide a valid previously-unused ID. If pushdb is true, pushes
// the tangible's database onto the lua stack. Otherwise, leaves the lua
// stack untouched.
//
Tangible *tangible_make(lua_State *L, int64_t id, const std::string &plane, bool pushdb);
@@ -220,7 +221,7 @@ public:
// Run any threads which according to the scheduler queue are ready.
//
void run_scheduled_threads(int64_t clk);
void run_scheduled_threads();
// Check that the main thread has nothing on the stack
//
@@ -271,6 +272,10 @@ private:
// Invoke the flush-prints operation.
//
void invoke_flush_prints(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
// Invoke the tick operation.
//
void invoke_tick(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
public:
////////////////////////////////////////////////////////////////////////////
@@ -453,6 +458,9 @@ private:
//
std::unordered_map<int64_t, UniqueTangible> tangibles_;
// Current time.
int64_t clock_;
// Thread schedule: must include every thread, except
// for the one currently-executing thread.
//