Implementierung der Games #203

Merged
flixcoo merged 34 commits from feature/119-implementierung-der-games-2 into development 2026-05-09 17:13:46 +00:00
2 changed files with 5 additions and 18 deletions
Showing only changes of commit eadf05e116 - Show all commits

View File

@@ -469,38 +469,32 @@ class _CreateGameViewState extends State<CreateGameView> {
final oldGame = widget.gameToEdit!; final oldGame = widget.gameToEdit!;
if (oldGame.name != newGame.name) { if (oldGame.name != newGame.name) {
await db.gameDao.updateGameName( await db.gameDao.updateGameName(gameId: oldGame.id, name: newGame.name);
gameId: oldGame.id,
newName: newGame.name,
);
} }
if (oldGame.description != newGame.description) { if (oldGame.description != newGame.description) {
await db.gameDao.updateGameDescription( await db.gameDao.updateGameDescription(
gameId: oldGame.id, gameId: oldGame.id,
newDescription: newGame.description, description: newGame.description,
); );
} }
if (oldGame.ruleset != newGame.ruleset) { if (oldGame.ruleset != newGame.ruleset) {
await db.gameDao.updateGameRuleset( await db.gameDao.updateGameRuleset(
gameId: oldGame.id, gameId: oldGame.id,
newRuleset: newGame.ruleset, ruleset: newGame.ruleset,
); );
} }
if (oldGame.color != newGame.color) { if (oldGame.color != newGame.color) {
await db.gameDao.updateGameColor( await db.gameDao.updateGameColor(
gameId: oldGame.id, gameId: oldGame.id,
newColor: newGame.color, color: newGame.color,
); );
} }
if (oldGame.icon != newGame.icon) { if (oldGame.icon != newGame.icon) {
await db.gameDao.updateGameIcon( await db.gameDao.updateGameIcon(gameId: oldGame.id, icon: newGame.icon);
gameId: oldGame.id,
newIcon: newGame.icon,
);
} }
} }

View File

@@ -295,13 +295,6 @@ class _CreateMatchViewState extends State<CreateMatchView> {
); );
} }
if (widget.matchToEdit!.game.id != updatedMatch.game.id) {
await db.matchDao.updateMatchGame(
matchId: widget.matchToEdit!.id,
gameId: updatedMatch.game.id,
);
}
// Add players who are in updatedMatch but not in the original match // Add players who are in updatedMatch but not in the original match
for (var player in updatedMatch.players) { for (var player in updatedMatch.players) {
if (!widget.matchToEdit!.players.any((p) => p.id == player.id)) { if (!widget.matchToEdit!.players.any((p) => p.id == player.id)) {