cards library
Inlines a copy of the cards database.
While some applications will want to store/update the database in a database or storage format (i.e. JSON), this library is provided as a convenience for applications that want to use the cards database without having to manage external resources.
All known card sets are available as top-level variables:
For a future proof collection of every card set, use allCardSets.
Example
// It's recommended to import the library with a prefix.
import 'package:unlimited/cards.dart' as cards;
import 'package:unlimited/schema.dart';
void main() {
final vader = cards.sparkOfRebellion.find(10);
// Pattern match to get the card's type.
switch (vader) {
case final BaseCard card:
print('Base: ${card.name}: ${card.location}');
case final UnitCard card:
print('Unit: ${card.name}: ${card.title ?? '<No title>'}');
case final EventCard card:
print('Event: ${card.name}');
case final UpgradeCard card:
print('Upgrade: ${card.name}');
}
}
Properties
- allCardSets → Collection
-
A collection of every card set in the game.
final
- sparkOfRebellion → CardSetInventory
-
The Spark of Rebellion card set, as previewed so far by September 1, 2023.
final