UnitCard constructor
UnitCard({})
Creates a unit card with the given properties.
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
UnitCard({
required super.cardSet,
required super.orderInSet,
required super.name,
required super.aspects,
required super.cost,
required super.traits,
required this.power,
required this.hp,
this.arena = Arena.ground,
this.title,
}) : isLeader = false,
super(unique: title != null) {
if (title != null) {
checkNotEmpty(value: title!, name: 'title');
}
RangeError.checkNotNegative(power, 'power');
checkPositive(hp, 'hp');
}