RepositoryItem<T> class
A repository containing game data separated by locale. This class represents a single item in the repository. All the localizations are stored in here, and you may use the various methods to access them, change the locale, or manipulate localized versions of data.
- Implementers
Constructors
- RepositoryItem([String? initialLocale])
Properties
- currentLocale → String
-
The current locale.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
changeLocale(
String locale) → void - Change the current locale to a new locale. Getting data will now be for this locale.
-
create(
) → T - Create a new item.
-
get(
) → T - Get the item data for the current locale.
-
getForLocale(
String locale) → T - Get the item data for the given locale.
-
initLocale(
String locale) → void - Initialize the repository for a new locale. If one already exists, it will not be overwritten.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
T item) → void - Get the item data for the current locale.
-
setForLocale(
String locale, T item) → void - Set the item data for the given locale.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited