Creating class (User, Achievement, IManager, Game, Round...)
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
9d437dd9c1
commit
3f95f2fcee
@ -0,0 +1,11 @@
|
||||
class Achievement {
|
||||
String _name;
|
||||
|
||||
String get name => _name;
|
||||
|
||||
set name(String value) {
|
||||
_name = value;
|
||||
}
|
||||
|
||||
Achievement(this._name);
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:uuid/uuid_util.dart';
|
||||
|
||||
class Game {
|
||||
var _id;
|
||||
|
||||
get id => _id;
|
||||
|
||||
set id(value) {
|
||||
_id = value;
|
||||
}
|
||||
|
||||
DateTime _time;
|
||||
|
||||
DateTime get time => _time;
|
||||
|
||||
set time(DateTime value) {
|
||||
_time = value;
|
||||
}
|
||||
|
||||
final Map<Uuid, Int> _players;
|
||||
|
||||
Map<Uuid, Int> get players => _players;
|
||||
|
||||
final Uuid _winner;
|
||||
|
||||
Uuid get winner => _winner;
|
||||
|
||||
Game(this._id, this._time, this._players, this._winner);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
import 'package:bowl_in/model/Game.dart';
|
||||
|
||||
import 'User.dart';
|
||||
|
||||
abstract class IManager {
|
||||
User _userCurrent;
|
||||
|
||||
User get userCurrent => _userCurrent;
|
||||
|
||||
set userCurrent(User value) {
|
||||
_userCurrent = value;
|
||||
}
|
||||
|
||||
late Game _gameCurrent;
|
||||
List<Game> _games;
|
||||
|
||||
Game get gameCurrent => _gameCurrent;
|
||||
|
||||
set gameCurrent(Game value) {
|
||||
_gameCurrent = value;
|
||||
}
|
||||
|
||||
List<Game> get games => _games;
|
||||
|
||||
set games(List<Game> value) {
|
||||
_games = value;
|
||||
}
|
||||
|
||||
IManager(this._userCurrent, this._gameCurrent, this._games);
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
class Round {
|
||||
int _nbPoints;
|
||||
|
||||
int get nbPoints => _nbPoints;
|
||||
|
||||
set nbPoints(int value) {
|
||||
_nbPoints = value;
|
||||
}
|
||||
|
||||
Round(this._nbPoints);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:uuid/uuid_util.dart';
|
||||
import 'Achievement.dart';
|
||||
|
||||
class User {
|
||||
//attributes from BowlIn
|
||||
Uuid _id;
|
||||
|
||||
get id => _id;
|
||||
|
||||
set id(value) {
|
||||
_id = value;
|
||||
}
|
||||
|
||||
String get name => _name;
|
||||
|
||||
set name(String value) {
|
||||
_name = 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);
|
||||
}
|
Loading…
Reference in new issue