Assets are composed primarily of data elements called fields. More...
Public Member Functions | |
Field () | |
Initializes a new Field. | |
Field (ChatMapper.Field chatMapperField) | |
Initializes a new Field copied from a Chat Mapper field. | |
Field (string title, string value, FieldType type) | |
Initializes a new Field. | |
Field (string title, string value, FieldType type, string typeString) | |
Initializes a new Field. | |
Field (Field sourceField) | |
Copy constructor. | |
void | Assign (ChatMapper.Field chatMapperField) |
Copies the contents of a Chat Mapper field. | |
Static Public Member Functions | |
static FieldType | StringToFieldType (string chatMapperType) |
A static utility method that converts a Chat Mapper type string into a FieldType. | |
static List< Field > | CreateListFromChatMapperFields (List< ChatMapper.Field > chatMapperFields) |
A static utility method that creates a list of fields from a list of Chat Mapper fields. | |
static List< Field > | CopyFields (List< Field > sourceFields) |
Copies a field list. | |
static bool | FieldExists (List< Field > fields, string title) |
A static utility method that checks whether a field exists in a list of fields. | |
static Field | Lookup (List< Field > fields, string title) |
A static utility method that looks up a field by title in a list of fields. | |
static string | LookupValue (List< Field > fields, string title) |
A static utility method that looks up a field in a list and returns its string value. | |
static string | LookupLocalizedValue (List< Field > fields, string title) |
A static utility method that looks up a localized version of a field and returns its string value. | |
static int | LookupInt (List< Field > fields, string title) |
A static utility method that looks up a field in a list and returns its int value. | |
static float | LookupFloat (List< Field > fields, string title) |
A static utility method that looks up a field in a list and returns its float value. | |
static bool | LookupBool (List< Field > fields, string title) |
A static utility method that looks up a field in a list and returns its bool value. | |
static void | SetValue (List< Field > fields, string title, string value, FieldType type) |
A static utility method that sets the string value of a field. | |
static void | SetValue (List< Field > fields, string title, string value) |
A static utility method that sets the string value of a field. | |
static void | SetValue (List< Field > fields, string title, float value) |
A static utility method that sets the float value of a field. | |
static void | SetValue (List< Field > fields, string title, int value) |
A static utility method that sets the int value of a field. | |
static void | SetValue (List< Field > fields, string title, bool value) |
A static utility method that sets the string bool of a field. | |
static bool | IsFieldAssigned (List< Field > fields, string title) |
A static utility method that checks whether a field exists and has non-empty text. | |
static Field | AssignedField (List< Field > fields, string title) |
A static utility method that returns a field if it exists and has non-empty text. | |
static string | FieldValue (Field field) |
Returns the value of a field. | |
static string | LocalizedTitle (string title) |
Returns the localized field title. | |
static string | GetTypeString (FieldType type) |
Public Attributes | |
string | title = null |
The title of the field, such as Name or Age. | |
string | value = null |
The value of the field, such as Fred or 42. | |
FieldType | type = FieldType.Text |
The data type of the field, such as Text or Number. | |
string | typeString = string.Empty |
The name of a field drawer class. | |
Assets are composed primarily of data elements called fields.
This class represents a field, which is a <title, value, type> tuple such as <Name, Fred, Text>. This class also contains several static utility functions to work with fields.
|
inline |
Initializes a new Field.
|
inline |
Initializes a new Field copied from a Chat Mapper field.
chatMapperField | The Chat Mapper field to copy. |
|
inline |
Initializes a new Field.
title | Title of the field. |
value | Value of the field. |
type | Field type. |
|
inline |
Initializes a new Field.
title | Title of the field. |
value | Value of the field. |
type | Field type. |
typeString | Custom type string. |
|
inline |
Copy constructor.
sourceField | Source field. |
|
inline |
Copies the contents of a Chat Mapper field.
chatMapperField | The Chat Mapper field to copy. |
|
inlinestatic |
A static utility method that returns a field if it exists and has non-empty text.
null
if it doesn't exist or has empty text. fields | A list of fields. |
title | Title of the field. |
|
inlinestatic |
Copies a field list.
sourceFields | Source fields. |
|
inlinestatic |
A static utility method that creates a list of fields from a list of Chat Mapper fields.
chatMapperFields | The Chat Mapper fields. |
|
inlinestatic |
A static utility method that checks whether a field exists in a list of fields.
true
if the field exists; otherwise false
. fields | A list of fields. |
title | Title of the field. |
|
inlinestatic |
Returns the value of a field.
null
if field is null
. field | The field. |
|
inlinestatic |
|
inlinestatic |
A static utility method that checks whether a field exists and has non-empty text.
true
if the field is assigned; otherwise, false
. fields | A list of fields. |
title | Title of the field. |
|
inlinestatic |
Returns the localized field title.
title | The default title. |
|
inlinestatic |
A static utility method that looks up a field by title in a list of fields.
fields | A list of fields. |
title | Title of the field. |
null
if no field matches.
|
inlinestatic |
A static utility method that looks up a field in a list and returns its bool value.
fields | A list of fields. |
title | Title of the field. |
false
if the field doesn't exist or isn't a bool.
|
inlinestatic |
A static utility method that looks up a field in a list and returns its float value.
fields | A list of fields. |
title | Title of the field. |
0
if the field doesn't exist or isn't a float.
|
inlinestatic |
A static utility method that looks up a field in a list and returns its int value.
fields | A list of fields. |
title | Title of the field. |
0
if the field doesn't exist or isn't an int.
|
inlinestatic |
A static utility method that looks up a localized version of a field and returns its string value.
Given a title, this method looks for a field appended with a blank space character or underscore and then the current language code.
fields | A list of fields. |
title | The title of the field. |
|
inlinestatic |
A static utility method that looks up a field in a list and returns its string value.
fields | A list of fields. |
title | Title of the field. |
null
if the field doesn't exist in the list.
|
inlinestatic |
A static utility method that sets the string bool of a field.
fields | A list of fields. |
title | The title of the field to set. |
value | The new value of the field. |
|
inlinestatic |
A static utility method that sets the float value of a field.
fields | A list of fields. |
title | The title of the field to set. |
value | The new value of the field. |
|
inlinestatic |
A static utility method that sets the int value of a field.
fields | A list of fields. |
title | The title of the field to set. |
value | The new value of the field. |
|
inlinestatic |
A static utility method that sets the string value of a field.
fields | A list of fields. |
title | The title of the field to set. |
value | The new value of the field. |
|
inlinestatic |
A static utility method that sets the string value of a field.
fields | A list of fields. |
title | The title of the field to set. |
value | The new value of the field. |
type | The type of the field. |
|
inlinestatic |
A static utility method that converts a Chat Mapper type string into a FieldType.
chatMapperType | The Chat Mapper type string. |
string PixelCrushers.DialogueSystem.Field.title = null |
The title of the field, such as Name or Age.
FieldType PixelCrushers.DialogueSystem.Field.type = FieldType.Text |
The data type of the field, such as Text or Number.
string PixelCrushers.DialogueSystem.Field.typeString = string.Empty |
The name of a field drawer class.
string PixelCrushers.DialogueSystem.Field.value = null |
The value of the field, such as Fred or 42.