From 80c4a2b21d08daa073a3250526255d6dd38e8d5a Mon Sep 17 00:00:00 2001 From: rich Date: Mon, 19 Aug 2024 15:48:41 +0100 Subject: [PATCH] Add turnEnd state to roundMachine This is just useful for logging to see if the interactions in the model are working as expected --- server/machines/round.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/machines/round.ts b/server/machines/round.ts index 45e52140..32bad9c0 100644 --- a/server/machines/round.ts +++ b/server/machines/round.ts @@ -42,6 +42,17 @@ const roundMachine = setup({ states: { turn: { entry: [{ type: "setQuestion", params: dynamicParamFuncs.setQuestion }], + on: { + turnEnd: { + target: "roundEnd", + // guard: (_, __) => { + // check to see if round end conditions are met + // }, + }, + }, + }, + roundEnd: { + type: "final", }, }, });