Datenbankstruktur für Spiele #16
@@ -24,7 +24,7 @@ class GameDao extends DatabaseAccessor<AppDatabase> with _$GameDaoMixin {
|
|||||||
final result = await query.getSingle();
|
final result = await query.getSingle();
|
||||||
|
|
||||||
List<Player>? players;
|
List<Player>? players;
|
||||||
|
sneeex marked this conversation as resolved
|
|||||||
if (await db.playerGameDao.hasGamePlayers(gameId: gameId)) {
|
if (await db.playerGameDao.gameHasPlayers(gameId: gameId)) {
|
||||||
players = await db.playerGameDao.getPlayersByGameId(gameId: gameId);
|
players = await db.playerGameDao.getPlayersByGameId(gameId: gameId);
|
||||||
}
|
}
|
||||||
Group? group;
|
Group? group;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class PlayerGameDao extends DatabaseAccessor<AppDatabase>
|
|||||||
|
|
||||||
/// Checks if there are any players associated with the given [gameId].
|
/// Checks if there are any players associated with the given [gameId].
|
||||||
/// Returns `true` if there are players, otherwise `false`.
|
/// Returns `true` if there are players, otherwise `false`.
|
||||||
Future<bool> hasGamePlayers({required String gameId}) async {
|
Future<bool> gameHasPlayers({required String gameId}) async {
|
||||||
final count =
|
final count =
|
||||||
|
flixcoo marked this conversation as resolved
sneeex
commented
Finde den namen hasGamePlayers schlecht, besser Finde den namen hasGamePlayers schlecht, besser `gameHasPlayers`
|
|||||||
await (selectOnly(playerGameTable)
|
await (selectOnly(playerGameTable)
|
||||||
..where(playerGameTable.gameId.equals(gameId))
|
..where(playerGameTable.gameId.equals(gameId))
|
||||||
|
|||||||
Reference in New Issue
Block a user
Wieso gehst du überall davon aus, dass players null sein kann? Man kann doch kein Game ohne Player erstellen oder in welchem case ist das der Fall?
Weil ein
Gameja auch nur eineGroupbekommern kann