WIP: Score implementation ergänzen #196
@@ -49,7 +49,6 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
||||
|
||||
return Score(
|
||||
playerId: result.playerId,
|
||||
matchId: result.matchId,
|
||||
roundNumber: result.roundNumber,
|
||||
score: result.score,
|
||||
change: result.change,
|
||||
@@ -64,7 +63,6 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
||||
.map(
|
||||
(row) => Score(
|
||||
playerId: row.playerId,
|
||||
matchId: row.matchId,
|
||||
roundNumber: row.roundNumber,
|
||||
score: row.score,
|
||||
change: row.change,
|
||||
@@ -86,7 +84,6 @@ class ScoreDao extends DatabaseAccessor<AppDatabase> with _$ScoreDaoMixin {
|
||||
.map(
|
||||
(row) => Score(
|
||||
playerId: row.playerId,
|
||||
matchId: row.matchId,
|
||||
roundNumber: row.roundNumber,
|
||||
score: row.score,
|
||||
change: row.change,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
class Score {
|
||||
final String playerId;
|
||||
final String matchId;
|
||||
final int roundNumber;
|
||||
int score = 0;
|
||||
int change = 0;
|
||||
|
||||
Score({
|
||||
required this.playerId,
|
||||
required this.matchId,
|
||||
required this.roundNumber,
|
||||
required this.score,
|
||||
required this.change,
|
||||
@@ -15,14 +13,12 @@ class Score {
|
||||
|
||||
Score.fromJson(Map<String, dynamic> json)
|
||||
: playerId = json['playerId'],
|
||||
matchId = json['matchId'],
|
||||
roundNumber = json['roundNumber'],
|
||||
score = json['score'],
|
||||
change = json['change'];
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'playerId': playerId,
|
||||
'matchId': matchId,
|
||||
'roundNumber': roundNumber,
|
||||
'score': score,
|
||||
'change': change,
|
||||
|
||||
@@ -84,7 +84,6 @@ void main() {
|
||||
|
||||
expect(score, isNotNull);
|
||||
expect(score!.playerId, testPlayer1.id);
|
||||
expect(score.matchId, testMatch1.id);
|
||||
expect(score.roundNumber, 1);
|
||||
expect(score.score, 10);
|
||||
expect(score.change, 10);
|
||||
|
||||
Reference in New Issue
Block a user