-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49f6d1d
commit f5b01ad
Showing
9 changed files
with
243 additions
and
119 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
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
frosthaven_assistant/lib/Resource/commands/shuffle_amd_card_command.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 '../../services/service_locator.dart'; | ||
import '../state/game_state.dart'; | ||
|
||
class ShuffleAMDCardCommand extends Command { | ||
final bool allyDeck; | ||
ShuffleAMDCardCommand(this.allyDeck); | ||
|
||
@override | ||
void execute() { | ||
ModifierDeck deck = allyDeck | ||
? getIt<GameState>().modifierDeckAllies | ||
: getIt<GameState>().modifierDeck; | ||
|
||
deck.shuffleUnDrawn(stateAccess); | ||
} | ||
|
||
@override | ||
void undo() {} | ||
|
||
@override | ||
String describe() { | ||
return "Extra AMD deck shuffle"; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
frosthaven_assistant/lib/Resource/commands/shuffle_drawn_ability_card_command.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:collection/collection.dart'; | ||
|
||
import '../state/game_state.dart'; | ||
|
||
class ShuffleDrawnAbilityCardCommand extends Command { | ||
final String deck; | ||
ShuffleDrawnAbilityCardCommand(this.deck); | ||
|
||
@override | ||
void execute() { | ||
Monster? monster = GameMethods.getCurrentMonsters() | ||
.firstWhereOrNull((element) => element.type.deck == deck); | ||
if (monster != null) { | ||
MonsterAbilityState? deck = GameMethods.getDeck(monster.type.deck); | ||
deck?.shuffleUnDrawn(stateAccess); | ||
} | ||
} | ||
|
||
@override | ||
void undo() {} | ||
|
||
@override | ||
String describe() { | ||
return "Drawn ability deck shuffle"; | ||
} | ||
} |
Oops, something went wrong.