From 72ba3677c3269cdaf87b5bef2016f5cceb6fa49a Mon Sep 17 00:00:00 2001 From: Darragh Van Tichelen Date: Sat, 10 Aug 2024 19:55:47 +0200 Subject: [PATCH] Implement DiceSystem.clear --- client/src/game/systems/dice/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/game/systems/dice/index.ts b/client/src/game/systems/dice/index.ts index 8aea1373f..8ac79af44 100644 --- a/client/src/game/systems/dice/index.ts +++ b/client/src/game/systems/dice/index.ts @@ -3,6 +3,7 @@ import type { DeepReadonly } from "vue"; import { registerSystem } from ".."; import type { System } from ".."; +import type { SystemClearReason } from "../models"; import { loadDiceEnv } from "./environment"; import { diceState } from "./state"; @@ -10,7 +11,13 @@ import { diceState } from "./state"; const { mutableReactive: $ } = diceState; class DiceSystem implements System { - clear(): void {} + clear(reason: SystemClearReason): void { + $.result = undefined; + if (reason !== "full-loading") { + $.history = []; + $.loaded3d = false; + } + } addToHistory(roll: RollResult, player: string, name?: string): string { let rollString = "";