Allow startup without explicit limit/report parameters
This commit is contained in:
parent
ade26bd283
commit
01fb3a471a
|
@ -1,12 +1,15 @@
|
|||
import { BoxState, SetBox } from "./box-protocol.js";
|
||||
import { Handle, Ref, Turn } from "./actor.js";
|
||||
import { Assertion, Handle, Ref, Turn } from "./actor.js";
|
||||
import { Observe } from "./dataspace.js";
|
||||
|
||||
let startTime = Date.now();
|
||||
let prevValue = 0;
|
||||
|
||||
export default function (t: Turn, [ds, LIMIT, REPORT_EVERY]: [Ref, number, number]) {
|
||||
console.log('Spawning Box');
|
||||
export default function (t: Turn, arg: Assertion) {
|
||||
const [ds, LIMIT, REPORT_EVERY]: [Ref, number, number] = Array.isArray(arg) && arg.length === 3
|
||||
? arg as any
|
||||
: [arg, 50000, 2500];
|
||||
console.log('Spawning Box', LIMIT, REPORT_EVERY);
|
||||
let valueHandle: Handle | undefined;
|
||||
function setValue(t: Turn, value: number) {
|
||||
valueHandle = t.replace(ds, valueHandle, BoxState(value));
|
||||
|
|
Loading…
Reference in New Issue