From aeb973067c96f701d3104692e80e59201fb65cde Mon Sep 17 00:00:00 2001 From: rich Date: Mon, 19 Aug 2024 15:48:41 +0100 Subject: [PATCH] Add roundEnd state to roundMachine This is just useful for logging to see if the interactions in the model are working as expected. Depending on the guard we will either play another turn or end the round. --- 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", }, }, });