Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Domain] Created new game code entities / model
- Loading branch information
Showing
7 changed files
with
55 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export 'entities/calculator/calculator_character_skill.dart'; | ||
export 'entities/calculator/calculator_item.dart'; | ||
export 'entities/calculator/calculator_session.dart'; | ||
export 'entities/game_code/used_game_code.dart'; | ||
export 'entities/game_code/game_code.dart'; | ||
export 'entities/game_code/game_code_reward.dart'; | ||
export 'entities/inventory/inventory_item.dart'; | ||
export 'entities/inventory/inventory_used_item.dart'; | ||
export 'entities/tierlist/tierlist_item.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'game_code.g.dart'; | ||
|
||
@HiveType(typeId: 6) | ||
class GameCode extends HiveObject { | ||
@HiveField(0) | ||
final String code; | ||
|
||
@HiveField(1) | ||
DateTime usedOn; | ||
|
||
@HiveField(2) | ||
DateTime discoveredOn; | ||
|
||
@HiveField(3) | ||
DateTime expiredOn; | ||
|
||
@HiveField(4) | ||
bool isExpired; | ||
|
||
@HiveField(5) | ||
int region; | ||
|
||
GameCode(this.code, this.usedOn, this.discoveredOn, this.expiredOn, this.isExpired, this.region); | ||
} |
17 changes: 17 additions & 0 deletions
17
lib/domain/models/entities/game_code/game_code_reward.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'game_code_reward.g.dart'; | ||
|
||
@HiveType(typeId: 8) | ||
class GameCodeReward extends HiveObject { | ||
@HiveField(0) | ||
final int gameCodeKey; | ||
|
||
@HiveField(1) | ||
final String itemKey; | ||
|
||
@HiveField(2) | ||
final int quantity; | ||
|
||
GameCodeReward(this.gameCodeKey, this.itemKey, this.quantity); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:genshindb/domain/enums/enums.dart'; | ||
import 'package:genshindb/domain/models/models.dart'; | ||
|
||
class GameCodeModel { | ||
final String code; | ||
final AppServerResetTimeType region; | ||
|
||
final DateTime discoveredOn; | ||
final DateTime expiredOn; | ||
final bool isExpired; | ||
|
||
final bool isUsed; | ||
final List<ItemAscensionMaterialModel> rewards; | ||
|
||
GameCodeModel({ | ||
@required this.code, | ||
@required this.isExpired, | ||
@required this.isUsed, | ||
@required this.rewards, | ||
@required this.isExpired, | ||
@required this.discoveredOn, | ||
this.expiredOn, | ||
this.region, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters