Computing stats after game
continuous-integration/drone/push Build is passing Details

pull/25/head
Arthur VALIN 2 years ago
parent 8a8e51b700
commit 62a785f489

@ -5,7 +5,6 @@ import 'User.dart';
class Stat { class Stat {
int _nbVictory; int _nbVictory;
int _nbDefeat;
int _nbGames; int _nbGames;
int _highscore; int _highscore;
int _nbStrikes; int _nbStrikes;
@ -17,7 +16,6 @@ class Stat {
// Constructor // Constructor
Stat( Stat(
this._nbVictory, this._nbVictory,
this._nbDefeat,
this._nbGames, this._nbGames,
this._highscore, this._highscore,
this._nbStrikes, this._nbStrikes,
@ -34,12 +32,6 @@ class Stat {
_nbVictory = value; _nbVictory = value;
} }
int get nbDefeat => _nbDefeat;
set nbDefeat(int value) {
_nbDefeat = value;
}
int get nbGames => _nbGames; int get nbGames => _nbGames;
set nbGames(int value) { set nbGames(int value) {
@ -87,6 +79,11 @@ class Stat {
if(gd.winner == p){ if(gd.winner == p){
nbVictory +=1; nbVictory +=1;
} }
if((gd.points[p] ?? 0) > highscore){
highscore = gd.points[p] ?? 0;
}
double totalpins = 0; double totalpins = 0;
for(var r in gd.rounds){ for(var r in gd.rounds){

@ -59,7 +59,6 @@ class StubData extends IManager {
0, 0,
0, 0,
0, 0,
0,
0)), 0)),
User( User(
9, 9,
@ -91,7 +90,6 @@ class StubData extends IManager {
0, 0,
0, 0,
0, 0,
0,
0)), 0)),
User( User(
22, 22,
@ -106,7 +104,6 @@ class StubData extends IManager {
[], [],
Stat( Stat(
10, 10,
2,
12, 12,
150, 150,
7, 7,
@ -127,7 +124,6 @@ class StubData extends IManager {
[], [],
Stat( Stat(
10, 10,
2,
12, 12,
10, 10,
7, 7,
@ -148,7 +144,6 @@ class StubData extends IManager {
[], [],
Stat( Stat(
10, 10,
2,
12, 12,
40, 40,
7, 7,
@ -169,7 +164,6 @@ class StubData extends IManager {
[], [],
Stat( Stat(
10, 10,
2,
12, 12,
76, 76,
7, 7,
@ -186,7 +180,6 @@ class StubData extends IManager {
0, 0,
0, 0,
0, 0,
0,
0)) 0))
]; ];

Loading…
Cancel
Save