DungeonWorldRepository class
The main repository of Dungeon World data. This class contains all the data for the game, and is the main entry point for accessing it. You can switch locale using changeLocale and get the data for the current locale using the various getters.
- Inheritance
-
- Object
- RepositoryItem<
Map< String, dynamic> > - RepositoryMap<
String, dynamic> - DungeonWorldRepository
Constructors
- DungeonWorldRepository([String? initialLocale])
Properties
-
characterClasses
→ Map<
String, CharacterClass> -
A mapping of all the character classes.
The key in each entry is a unique key to the class, and the value is the class itself.
no setter
- currentLocale → String
-
The current locale.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ Map<
String, Item> -
A mapping of all the items.
The key in each entry is a unique key to the item, and the value is the item itself.
no setter
-
keys
→ Iterable<
String> -
no setterinherited
-
monsters
→ Map<
String, Monster> -
A mapping of all the monsters.
The key in each entry is a unique key to the monster, and the value is the monster itself.
no setter
-
moves
→ Map<
String, Move> -
A mapping of all the moves.
The key in each entry is a unique key to the move, and the value is the move itself.
no setter
-
races
→ Map<
String, Race> -
A mapping of all the races.
The key in each entry is a unique key to the race, and the value is the race itself.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
spells
→ Map<
String, Spell> -
A mapping of all the spells.
The key in each entry is a unique key to the spell, and the value is the spell itself.
no setter
-
A mapping of all the tags.
The key in each entry is a unique key to the tag, and the value is the tag itself.
no setter
- values → Iterable
-
no setterinherited
- version → String
-
The current version of the data.
final
Methods
-
add(
String key, dynamic item) → void -
inherited
-
addAll(
Map< String, dynamic> items) → void -
inherited
-
addAllForLocale(
String locale, Map< String, dynamic> items) → void -
inherited
-
addForLocale(
String locale, String key, dynamic item) → void -
inherited
-
changeLocale(
String locale) → void -
Change the current locale to a new locale. Getting data will now be for this locale.
inherited
-
create(
) → Map< String, dynamic> -
Create the initial data structure.
override
-
get(
) → Map< String, dynamic> -
Get the item data for the current locale.
inherited
-
getForLocale(
String locale) → Map< String, dynamic> -
Get the item data for the given locale.
inherited
-
getItem(
String key) → dynamic -
inherited
-
getItemFor(
String locale, String key) → dynamic -
inherited
-
initLocale(
String locale) → void -
Initialize the repository for a new locale.
If one already exists, it will not be overwritten.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
Map< String, dynamic> item) → void -
Get the item data for the current locale.
inherited
-
setForLocale(
String locale, Map< String, dynamic> item) → void -
Set the item data for the given locale.
inherited
-
toJson(
) → Map< String, dynamic> -
Dump all the data as a JSON map. Same as
toJsonAsMaps()
See toJsonAsMaps See toJsonAsLists -
toJsonAsLists(
) → Map< String, dynamic> - Dump all the data as a JSON lists, instead of key => value maps. See toJson See toJsonAsMaps
-
toJsonAsMaps(
) → Map< String, dynamic> -
Dump all the data as a JSON map. Same as
toJson()
See toJson See toJsonAsLists -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited