Verschiedene Regelsätze implementieren #194

Merged
flixcoo merged 46 commits from feature/132-verschiedene-regelsaetze-implementieren into development 2026-04-24 10:31:36 +00:00
Showing only changes of commit a7e234cf10 - Show all commits

View File

@@ -45,25 +45,6 @@ class GameDao extends DatabaseAccessor<AppDatabase> with _$GameDaoMixin {
);
}
Future<Game> getGameByMatchId({required String matchId}) async {
final query = select(gameTable).join([
innerJoin(matchTable, matchTable.gameId.equalsExp(gameTable.id)),
])..where(matchTable.id.equals(matchId));
final result = await query.getSingle();
final gameRow = result.readTable(gameTable);
return Game(
id: gameRow.id,
name: gameRow.name,
ruleset: Ruleset.values.firstWhere((e) => e.name == gameRow.ruleset),
description: gameRow.description,
color: GameColor.values.firstWhere((e) => e.name == gameRow.color),
icon: gameRow.icon,
createdAt: gameRow.createdAt,
);
}
/// Adds a new [game] to the database.
/// If a game with the same ID already exists, no action is taken.
/// Returns `true` if the game was added, `false` otherwise.