Neuer Regelsatz: Platzierung #213

Merged
sneeex merged 22 commits from feature/206-Neuer-Regelsatz-Platzierung into development 2026-05-09 21:37:30 +00:00
3 changed files with 23 additions and 14 deletions
Showing only changes of commit 79ce3efd0a - Show all commits

View File

@@ -353,4 +353,19 @@ class ScoreEntryDao extends DatabaseAccessor<AppDatabase>
return await deleteAllScoresForMatch(matchId: matchId);
}
}
/// Sets the placement for each player in a match.
/// The highest score is assigned to the first player, the second highest to the second player, and so on.
Future<void> setPlacements({
required String matchId,
required List<Player> players,
}) async {
for (int i = 0; i < players.length; i++) {
await db.scoreEntryDao.addScore(
matchId: matchId,
playerId: players[i].id,
entry: ScoreEntry(roundNumber: 0, score: players.length - i, change: 0),
);
}
}
}

View File

@@ -199,7 +199,7 @@ class _MatchResultViewState extends State<MatchResultView> {
height: 60,
child: Container(
decoration: BoxDecoration(
flixcoo marked this conversation as resolved Outdated

Vielleicht andere box decoration, maybe keine border und kompletter container in der border color

Vielleicht andere box decoration, maybe keine border und kompletter container in der border color

tote nummer
grafik.png

tote nummer ![grafik.png](/attachments/a399a850-1b2f-4afe-8f74-e4c28f80941a)

ja fair, aber irgendwie würd ich die gern anders darstellen. Nicht genau so wie die list tiles. Und macht die mal quadratisch

ja fair, aber irgendwie würd ich die gern anders darstellen. Nicht genau so wie die list tiles. Und macht die mal quadratisch

so?
grafik.png

so? ![grafik.png](/attachments/41e1acb6-75c3-4487-86a6-fa77c0b1ff90)

Mach mal color: orange, fontcolor: weiß

Mach mal color: orange, fontcolor: weiß

meinst du so?
sonst probier selber mal rum, du weißt ja besser was du willst

grafik.png

meinst du so? sonst probier selber mal rum, du weißt ja besser was du willst ![grafik.png](/attachments/f4030533-907c-4c68-b5ff-f90cc676859e)
color: CustomTheme.boxColor,
color: CustomTheme.primaryColor,
border: Border.all(
color: CustomTheme.primaryColor,
),
@@ -212,7 +212,7 @@ class _MatchResultViewState extends State<MatchResultView> {
child: Text(
' #${i + 1} ',
style: const TextStyle(
color: CustomTheme.primaryColor,
color: CustomTheme.textColor,
fontWeight: FontWeight.bold,
fontSize: 16,
),
@@ -383,18 +383,11 @@ class _MatchResultViewState extends State<MatchResultView> {
/// Handles saving the placement for each player in the database.
Future<void> _handlePlacement() async {
for (int i = 0; i < allPlayers.length; i++) {
await db.scoreEntryDao.addScore(
await db.scoreEntryDao.setPlacements(
matchId: widget.match.id,
playerId: allPlayers[i].id,
entry: ScoreEntry(
roundNumber: 0,
score: allPlayers.length - i,
change: 0,
),
players: allPlayers,
);
}
}
String getTitleForRuleset(AppLocalizations loc) {
switch (ruleset) {

View File

@@ -303,8 +303,9 @@ class _MatchTileState extends State<MatchTile> {
final mvp = widget.match.mvp;
final mvpScore = widget.match.scores[mvp.first.id]?.score ?? 0;
final mvpNames = mvp.map((player) => player.name).join(', ');
return '${loc.winner}: $mvpNames (${getPointLabel(loc, mvpScore)})';
} else if (ruleset == Ruleset.placement) {
return '${loc.winner}: ${widget.match.mvp.first.name}';
}
return '${loc.winner}: n.A.';
}