SocialsFactory<T> class

The main factory for storing suffixes and filters, as well as converting social strings to perspective aware strings which can be sent to objects of type T.

Constructors

SocialsFactory({String defaultSuffix = 'n', String defaultIndex = '1', RegExp? suffixRegExp, RegExp? objectRegExp, RegExp? wordRegExp, RegExp? upperCaseRegExp})
Default constructor.
SocialsFactory.sensible({String defaultSuffix = 'n', String defaultIndex = '1'})
Create a factory with a couple of useful suffixes.
factory

Properties

defaultIndex String
The default index.
final
defaultSuffix String
The default suffix.
final
filters Map<String, FilterType>
All filters which have been loaded with addFilter.
final
hashCode int
The hash code for this object.
no setterinherited
objectRegExp RegExp
The regular expression for matching object names in emote strings.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suffixes Map<String, SuffixResult Function(T)>
All suffixes which have been loaded with addSuffix.
final
suffixRegExp RegExp
The regular expression for matching suffixes.
final
upperCaseRegExp RegExp
The regular expression for upper case characters.
final
wordRegExp RegExp
The regexp to split strings into words.
final

Methods

addFilter(List<String> names, String func(String)) → void
Add a filter.
addSuffix(List<String> names, SuffixResult func(T)) → void
Add a suffix.
convertEmoteString(String emoteString, T actor, T matchFunc(String)) EmoteContext<T>
Used to convert emote strings entered by players to social strings.
getStrings(String socialString, List<T> perspectives) SocialContext<T>
Converts a string such as
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startsAsUpperCase(String value) bool
Returns true if value starts with an upper case letter.
toString() String
A string representation of this object.
inherited
toTitleCase(String s) String
Returns a string with the first letter of each word capitalised.

Operators

operator ==(Object other) bool
The equality operator.
inherited