diff --git a/Sources/bowlin_project/lib/model/Stat.dart b/Sources/bowlin_project/lib/model/Stat.dart index 2c874c4..d68fa57 100644 --- a/Sources/bowlin_project/lib/model/Stat.dart +++ b/Sources/bowlin_project/lib/model/Stat.dart @@ -5,7 +5,6 @@ import 'User.dart'; class Stat { int _nbVictory; - int _nbDefeat; int _nbGames; int _highscore; int _nbStrikes; @@ -17,7 +16,6 @@ class Stat { // Constructor Stat( this._nbVictory, - this._nbDefeat, this._nbGames, this._highscore, this._nbStrikes, @@ -34,12 +32,6 @@ class Stat { _nbVictory = value; } - int get nbDefeat => _nbDefeat; - - set nbDefeat(int value) { - _nbDefeat = value; - } - int get nbGames => _nbGames; set nbGames(int value) { @@ -87,6 +79,11 @@ class Stat { if(gd.winner == p){ nbVictory +=1; } + + if((gd.points[p] ?? 0) > highscore){ + highscore = gd.points[p] ?? 0; + } + double totalpins = 0; for(var r in gd.rounds){ diff --git a/Sources/bowlin_project/lib/model/StubManager/StubData.dart b/Sources/bowlin_project/lib/model/StubManager/StubData.dart index a4a2ef5..001b928 100644 --- a/Sources/bowlin_project/lib/model/StubManager/StubData.dart +++ b/Sources/bowlin_project/lib/model/StubManager/StubData.dart @@ -59,7 +59,6 @@ class StubData extends IManager { 0, 0, 0, - 0, 0)), User( 9, @@ -91,7 +90,6 @@ class StubData extends IManager { 0, 0, 0, - 0, 0)), User( 22, @@ -106,7 +104,6 @@ class StubData extends IManager { [], Stat( 10, - 2, 12, 150, 7, @@ -127,7 +124,6 @@ class StubData extends IManager { [], Stat( 10, - 2, 12, 10, 7, @@ -148,7 +144,6 @@ class StubData extends IManager { [], Stat( 10, - 2, 12, 40, 7, @@ -169,7 +164,6 @@ class StubData extends IManager { [], Stat( 10, - 2, 12, 76, 7, @@ -186,7 +180,6 @@ class StubData extends IManager { 0, 0, 0, - 0, 0)) ];