Area constructor
Area({
- required DeployedBase base,
- required UnitCard leader,
- List<
PlayableCard> resources = const [], - int? availableResources,
- List<
PlayableCard> hand = const [], - List<
PlayableCard> deck = const [], - List<
PlayableCard> discard = const [], - List<
DeployedCard< inPlay = const [],TargetCard> >
Creates an area with the given properties.
If availableResources
is not provided, it defaults to the length of
resources
(i.e. that no resources have been exhausted).
Errors
This class is not intended to be used with user-provided input, and as such does not provide any error handling. If any of the fields are invalid, an error will be thrown.
Implementation
factory Area({
required DeployedBase base,
required UnitCard leader,
List<PlayableCard> resources = const [],
int? availableResources,
List<PlayableCard> hand = const [],
List<PlayableCard> deck = const [],
List<PlayableCard> discard = const [],
List<DeployedCard> inPlay = const [],
}) {
return Area._(
totalResources: resources,
availableResources: availableResources ?? resources.length,
base: base,
leader: leader,
hand: hand,
deck: deck,
discard: discard,
arena: inPlay,
);
}