Creating class (User, Achievement, IManager, Game, Round...)
continuous-integration/drone/push Build is passing Details

pull/15/head
Emre KARTAL 2 years ago
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);
}

@ -413,6 +413,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
uuid:
dependency: "direct main"
description:
name: uuid
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
url: "https://pub.dev"
source: hosted
version: "3.0.7"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:

@ -39,6 +39,7 @@ dependencies:
simple_gradient_text: ^1.2.4 simple_gradient_text: ^1.2.4
google_fonts: ^3.0.1 google_fonts: ^3.0.1
go_router: ^6.0.1 go_router: ^6.0.1
uuid: ^3.0.7
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save