rules/win_rules library

Functions

hasPlayerWon(List<LudoPiece> pieces, int playerIndex) bool
Returns true if playerIndex's own 4 pieces have all finished.
hasTeamWon(List<LudoPiece> pieces, LudoTeam team) bool
In teams mode: returns true if both players on team have all 4 pieces finished (8 pieces total).
isGameFinished(int winnersCount, int totalPlayers, {List<LudoTeam>? teams, List<LudoPiece>? pieces}) bool
Returns true if the overall game is finished.