Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Domain] Added an entity to store the characters and the weapons
- Loading branch information
Showing
11 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
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
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
16 changes: 16 additions & 0 deletions
16
lib/domain/models/custom_builds/custom_build_team_character_model.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,16 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
|
||
part 'custom_build_team_character_model.freezed.dart'; | ||
|
||
@freezed | ||
class CustomBuildTeamCharacterModel with _$CustomBuildTeamCharacterModel { | ||
const factory CustomBuildTeamCharacterModel({ | ||
required String key, | ||
required int index, | ||
required String name, | ||
required String image, | ||
required CharacterRoleType roleType, | ||
required CharacterRoleSubType subType, | ||
}) = _CustomBuildTeamCharacterModel; | ||
} |
19 changes: 19 additions & 0 deletions
19
lib/domain/models/custom_builds/custom_build_weapon_model.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,19 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
|
||
part 'custom_build_weapon_model.freezed.dart'; | ||
|
||
@freezed | ||
class CustomBuildWeaponModel with _$CustomBuildWeaponModel { | ||
const factory CustomBuildWeaponModel({ | ||
required String key, | ||
required int index, | ||
required int rarity, | ||
required int refinement, | ||
required double baseAtk, | ||
required StatType subStatType, | ||
required double subStatValue, | ||
required String name, | ||
required String image, | ||
}) = _CustomBuildWeaponModel; | ||
} |
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
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
24 changes: 24 additions & 0 deletions
24
lib/domain/models/entities/custom_builds/custom_build_team_character.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,24 @@ | ||
import 'package:hive/hive.dart'; | ||
import 'package:shiori/domain/enums/enums.dart'; | ||
|
||
part 'custom_build_team_character.g.dart'; | ||
|
||
@HiveType(typeId: 21) | ||
class CustomBuildTeamCharacter extends HiveObject { | ||
@HiveField(0) | ||
final int buildItemKey; | ||
|
||
@HiveField(1) | ||
int index; | ||
|
||
@HiveField(2) | ||
String characterKey; | ||
|
||
@HiveField(3) | ||
CharacterRoleType roleType; | ||
|
||
@HiveField(4) | ||
CharacterRoleSubType subType; | ||
|
||
CustomBuildTeamCharacter(this.buildItemKey, this.index, this.characterKey, this.roleType, this.subType); | ||
} |
20 changes: 20 additions & 0 deletions
20
lib/domain/models/entities/custom_builds/custom_build_weapon.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,20 @@ | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'custom_build_weapon.g.dart'; | ||
|
||
@HiveType(typeId: 22) | ||
class CustomBuildWeapon extends HiveObject { | ||
@HiveField(0) | ||
final int buildItemKey; | ||
|
||
@HiveField(1) | ||
String weaponKey; | ||
|
||
@HiveField(2) | ||
int index; | ||
|
||
@HiveField(3) | ||
int refinement; | ||
|
||
CustomBuildWeapon(this.buildItemKey, this.weaponKey, this.index, this.refinement); | ||
} |
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
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,8 @@ | ||
import 'package:shiori/domain/models/sorting/sortable_item.dart'; | ||
|
||
class SortResult { | ||
final bool somethingChanged; | ||
final List<SortableItem> items; | ||
|
||
SortResult(this.somethingChanged, this.items); | ||
} |
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,6 @@ | ||
class SortableItem { | ||
final String key; | ||
final String text; | ||
|
||
SortableItem(this.key, this.text); | ||
} |