From a68c629c8609746db147fb1d693571b43cc54bc0 Mon Sep 17 00:00:00 2001 From: Simon Lemieux <1105380+simlmx@users.noreply.github.com> Date: Thu, 18 Jul 2024 23:07:58 +0000 Subject: [PATCH] Use constants for builtin board moves --- packages/game/src/testing.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/game/src/testing.ts b/packages/game/src/testing.ts index 60a1f89..9c2f11d 100644 --- a/packages/game/src/testing.ts +++ b/packages/game/src/testing.ts @@ -14,6 +14,7 @@ import { } from "@lefun/core"; import { + ADD_PLAYER, Agent, AgentGetMoveRet, AutoMoveInfo, @@ -23,6 +24,7 @@ import { GameStateBase, GetPayloadOfPlayerMove, INIT_MOVE, + KICK_PLAYER, MATCH_WAS_ABORTED, parseGame, RewardPayload, @@ -269,7 +271,7 @@ export class MatchTester< this._sameBotCount = 0; // Make the special initial move. - this._makeBoardMove("initMove"); + this._makeBoardMove(INIT_MOVE); this._botTrainingLog = []; this._stats = []; @@ -316,7 +318,7 @@ export class MatchTester< } // Trigger the game's logic. - this._makeBoardMove("addPlayer", { userId }); + this._makeBoardMove(ADD_PLAYER, { userId }); this.users.byId[userId] = { username, @@ -334,7 +336,7 @@ export class MatchTester< const { meta, playerboards } = this; // Trigger the game's logic. - this._makeBoardMove("kickPlayer", { userId }); + this._makeBoardMove(KICK_PLAYER, { userId }); metaRemoveUserFromMatch(meta, userId); @@ -347,7 +349,7 @@ export class MatchTester< */ abortMatch(): void { this._endMatch({}); - this._makeBoardMove("matchWasAborted"); + this._makeBoardMove(MATCH_WAS_ABORTED); } /*