mancala/apps/backend/src/main/java/app/playmancala/model/ClientGame.java
Halit Aksoy ee9e5261eb feat(backend): keep the series a live game belongs to
Every game starts a series; a game created in a series gets its seat to
move first. Clients get the series and the first seat with the game, the
end message the series with the ended game; snapshots keep the series.
2026-10-17 02:00:44 +03:00

23 lines
736 B
Java

package app.playmancala.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import app.playmancala.engine.MancalaGame;
// A live game as players and spectators receive it; leaves out spectator ids and other server-side state.
// It refers to the live MancalaGame, so serialise it on the game loop. `series` holds the games before this one.
public record ClientGame(
String id,
MancalaGame mancalaGame,
GameUsersConnectionInfo gameUsersConnectionInfo,
long startedAt,
List<Long> moveTimes,
int spectatorCount,
GameClock clock,
long serverTime,
@JsonInclude(JsonInclude.Include.NON_NULL) Series series,
Seat firstSeat) {
}