Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
feat(SteelPath): add evergreens and incursions
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein committed Jun 26, 2022
1 parent 23620c3 commit 9780fef
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/entities/worldstate/steel_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ class SteelPath extends WorldstateObject {
required DateTime expiry,
required this.currentReward,
required this.rotation,
required this.evergreens,
required this.incursions,
}) : super(activation: activation, expiry: expiry);

final SteelPathReward currentReward;
final List<SteelPathReward> rotation;
final List<SteelPathReward> evergreens;
final Incursions incursions;

@override
List<Object?> get props => super.props..addAll([currentReward, rotation]);
Expand All @@ -26,3 +30,11 @@ class SteelPathReward extends Equatable {
@override
List<Object?> get props => [name, cost];
}

class Incursions extends WorldstateObject {
const Incursions({
required super.id,
required super.activation,
required super.expiry,
});
}
25 changes: 25 additions & 0 deletions lib/src/models/worldstate/steel_path_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ class SteelPathModel extends SteelPath {
required super.expiry,
required this.currentReward,
required this.rotation,
required this.evergreens,
required this.incursions,
}) : super(
currentReward: currentReward,
rotation: rotation,
evergreens: evergreens,
incursions: incursions,
);

factory SteelPathModel.fromJson(Map<String, dynamic> json) {
Expand All @@ -26,6 +30,12 @@ class SteelPathModel extends SteelPath {
@override
final List<SteelPathRewardModel> rotation;

@override
final List<SteelPathRewardModel> evergreens;

@override
final IncursionsModel incursions;

Map<String, dynamic> toJson() => _$SteelPathModelToJson(this);
}

Expand All @@ -39,3 +49,18 @@ class SteelPathRewardModel extends SteelPathReward {

Map<String, dynamic> toJson() => _$SteelPathRewardModelToJson(this);
}

@JsonSerializable()
class IncursionsModel extends Incursions {
const IncursionsModel({
required super.id,
required super.activation,
required super.expiry,
});

factory IncursionsModel.fromJson(Map<dynamic, dynamic> json) {
return _$IncursionsModelFromJson(json);
}

Map<String, dynamic> toJson() => _$IncursionsModelToJson(this);
}
32 changes: 32 additions & 0 deletions lib/src/models/worldstate/steel_path_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9780fef

Please sign in to comment.