Added new Class (Player, Guest and Stat)
continuous-integration/drone/push Build is passing Details

pull/15/head
Emre KARTAL 2 years ago
parent 1660bb0673
commit cac321d92a

3
.idea/.gitignore vendored

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/Sources/bowlin_project/build" />
<excludeFolder url="file://$MODULE_DIR$/Sources/bowlin_project/.pub" />
<excludeFolder url="file://$MODULE_DIR$/Sources/bowlin_project/.dart_tool" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Bowl_in.iml" filepath="$PROJECT_DIR$/.idea/Bowl_in.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -1,5 +1,8 @@
class Achievement {
String _name;
Achievement(this._name);
String get name => _name;
@ -7,5 +10,4 @@ class Achievement {
_name = value;
}
Achievement(this._name);
}

@ -4,7 +4,15 @@ import 'package:uuid/uuid.dart';
import 'package:uuid/uuid_util.dart';
class Game {
var _id;
Uuid _id;
DateTime _time;
int _pointsCurrentUser;
bool _isFinished;
List<String> _playerImages = <String>[];
Game(this._id, this._time, this._players, this._winner);
get id => _id;
@ -12,21 +20,28 @@ class Game {
_id = value;
}
DateTime _time;
DateTime get time => _time;
set time(DateTime value) {
_time = value;
}
final Map<Uuid, Int> _players;
int get pointsCurrentUser => _pointsCurrentUser;
Map<Uuid, Int> get players => _players;
set pointsCurrentUser(int value) {
_pointsCurrentUser = value;
}
final Uuid _winner;
bool get isFinished => _isFinished;
Uuid get winner => _winner;
set isFinished(bool value) {
_isFinished = value;
}
List<String> get playerImages => _playerImages;
set playerImages(List<String> value) {
_playerImages = value;
}
Game(this._id, this._time, this._players, this._winner);
}

@ -0,0 +1,9 @@
import 'package:uuid/uuid.dart';
import 'package:uuid/uuid_util.dart';
import 'Achievement.dart';
class User {
User(Uuid id, String image, String name): super(id, image, name);
}

@ -0,0 +1,27 @@
import 'package:uuid/uuid.dart';
import 'package:uuid/uuid_util.dart';
import 'Achievement.dart';
class Player {
final Uuid _id;
String _image;
String _name;
User(this._id, this._image, this._name);
get id => _id;
String get name => _name;
set name(String value) {
_name = value;
}
String get image => _image;
set image(String value) {
_image = value;
}
}

@ -0,0 +1,70 @@
class Stat {
int _nbVictory;
int _nbDefeat;
int _nbGames;
int _highscore;
int _nbStrikes;
int _nbSpares;
int _nbScore;
int _avgScore;
double _avgPinsPerRound;
Round(this._nbVictory,this._nbDefeat,this._nbGames,this._highscore,this._nbStrikes,this._nbSpares,this._avgScore,this._avgPinsPerRound);
int get nbVictory => _nbVictory;
set nbVictory(int value) {
_nbVictory = value;
}
int get nbDefeat => _nbDefeat;
set nbDefeat(int value) {
_nbDefeat = value;
}
int get nbGames => _nbGames;
set nbGames(int value) {
_nbGames = value;
}
int get highscore => _highscore;
set highscore(int value) {
_highscore = value;
}
int get nbStrikes => _nbStrikes;
set nbStrikes(int value) {
_nbStrikes = value;
}
int get nbSpares => _nbSpares;
set nbSpares(int value) {
_nbSpares = value;
}
int get nbScore => _nbScore;
set nbScore(int value) {
_nbScore = value;
}
int get avgScore => _avgScore;
set avgScore(int value) {
_avgScore = value;
}
double get avgPinsPerRound => _avgPinsPerRound;
set avgPinsPerRound(double value) {
_avgPinsPerRound = value;
}
}

@ -3,31 +3,29 @@ import 'package:uuid/uuid_util.dart';
import 'Achievement.dart';
class User {
//attributes from BowlIn
Uuid _id;
get id => _id;
String _mail;
List<Stat> _stats = <Stat>[];
List<Achievement> _achievements = <Achievement>[];
set id(value) {
_id = value;
}
User(Uuid id, String image, String name, this._achievements, this._stats ): super(id, image, name);
String get name => _name;
String get mail => _mail;
set name(String value) {
_name = value;
set mail(String value) {
_mail = value;
}
String _name;
List<Achievement> _achievements = <Achievement>[];
List<Achievement> get achievements => _achievements;
set achievements(List<Achievement> value) {
_achievements = value;
}
//constructors
User(this._id, this._name, this._achievements);
List<Stat> get stats => _stats;
set stats(List<Stat> value) {
_stats = value;
}
}

Loading…
Cancel
Save