Simplify
This commit is contained in:
parent
eb24199c8b
commit
109441785f
6
actor.ts
6
actor.ts
|
@ -44,10 +44,6 @@ export class Actor {
|
||||||
return this.exitReason === null;
|
return this.exitReason === null;
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(t: Turn) {
|
|
||||||
this.terminateWith(t, { ok: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
terminateWith(t: Turn, reason: Exclude<ExitReason, null>) {
|
terminateWith(t: Turn, reason: Exclude<ExitReason, null>) {
|
||||||
if (this.alive) {
|
if (this.alive) {
|
||||||
this.exitReason = reason;
|
this.exitReason = reason;
|
||||||
|
@ -115,7 +111,7 @@ export class Turn {
|
||||||
|
|
||||||
quit(): void {
|
quit(): void {
|
||||||
const actor = this._ensureActor("quit");
|
const actor = this._ensureActor("quit");
|
||||||
this.localActions.push(t => actor.stop(t));
|
this.localActions.push(t => actor.terminateWith(t, { ok: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(location: Ref<Entity>, assertion: Assertion): Handle {
|
assert(location: Ref<Entity>, assertion: Assertion): Handle {
|
||||||
|
|
Loading…
Reference in New Issue