perf(core): reduce inter-service HTTP calls from 11 to 4 per move
- Add `postMoveStatus` batch method to `RuleSet` trait (default impl composes individual calls; `RuleSetRestAdapter` overrides with single HTTP round-trip) - Collapse 5 sequential rule checks in `GameEngine.executeMove` into one `postMoveStatus` call - Add `POST /api/rules/post-move-status` endpoint to rule-service - Add `exportCombined` to `IoServiceClient` and `POST /io/export/combined` endpoint to io-service, replacing two separate FEN/PGN HTTP calls - Fix `statusOf` to pattern-match on `WinReason` from `ctx.result` instead of making a redundant `isCheckmate` HTTP call - Remove duplicate `legalMoves` pre-validation in `GameResource.makeMove`; engine already validates and fires `InvalidMoveEvent` - Add `scalafix:off` guards for pre-existing `var`/`return` usage in `DefaultRules` hot-path code - Apply spotless formatting to previously unformatted files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ class GameResultDeserializer extends JsonDeserializer[GameResult]:
|
||||
override def deserialize(p: JsonParser, ctx: DeserializationContext): GameResult =
|
||||
val node = p.getCodec.readTree[ObjectNode](p)
|
||||
node.get("type").asText() match
|
||||
case "win" =>
|
||||
case "win" =>
|
||||
GameResult.Win(
|
||||
Color.valueOf(node.get("color").asText()),
|
||||
WinReason.valueOf(node.get("winReason").asText()),
|
||||
|
||||
Reference in New Issue
Block a user