Assets are composed primarily of data elements called fields. More...
Public Member Functions | |
Field () | |
Initializes a new Field. More... | |
Field (ChatMapper.Field chatMapperField) | |
Initializes a new Field copied from a Chat Mapper field. More... | |
Field (string title, string value, FieldType type) | |
Initializes a new Field. More... | |
Field (string title, string value, FieldType type, string typeString) | |
Initializes a new Field. More... | |
Field (Field sourceField) | |
Copy constructor. More... | |
void | Assign (ChatMapper.Field chatMapperField) |
Copies the contents of a Chat Mapper field. More... | |
Static Public Member Functions | |
static FieldType | StringToFieldType (string chatMapperType) |
A static utility method that converts a Chat Mapper type string into a FieldType. More... | |
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. More... | |
static List< Field > | CopyFields (List< Field > sourceFields) |
Copies a field list. More... | |
static bool | FieldExists (List< Field > fields, string title) |
A static utility method that checks whether a field exists in a list of fields. More... | |
static Field | Lookup (List< Field > fields, string title) |
A static utility method that looks up a field by title in a list of fields. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static void | SetValue (List< Field > fields, string title, string value, FieldType type) |
A static utility method that sets the string value of a field. More... | |
static void | SetValue (List< Field > fields, string title, string value) |
A static utility method that sets the string value of a field. More... | |
static void | SetValue (List< Field > fields, string title, float value) |
A static utility method that sets the float value of a field. More... | |
static void | SetValue (List< Field > fields, string title, int value) |
A static utility method that sets the int value of a field. More... | |
static void | SetValue (List< Field > fields, string title, bool value) |
A static utility method that sets the string bool of a field, if the field exists. More... | |
static bool | IsFieldAssigned (List< Field > fields, string title) |
A static utility method that checks whether a field exists and has non-empty text. More... | |
static Field | AssignedField (List< Field > fields, string title) |
A static utility method that returns a field if it exists and has non-empty text. More... | |
static string | FieldValue (Field field) |
Returns the value of a field. More... | |
static string | LocalizedTitle (string title) |
Returns the localized field title. More... | |
static string | GetTypeString (FieldType type) |
Public Attributes | |
string | title = null |
The title of the field, such as Name or Age. More... | |
string | value = null |
The value of the field, such as Fred or 42. More... | |
FieldType | type = FieldType.Text |
The data type of the field, such as Text or Number. More... | |
string | typeString = string.Empty |
The name of a field drawer class. More... | |
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.
PixelCrushers.DialogueSystem.Field.Field | ( | ) |
Initializes a new Field.
PixelCrushers.DialogueSystem.Field.Field | ( | ChatMapper.Field | chatMapperField | ) |
Initializes a new Field copied from a Chat Mapper field.
chatMapperField | The Chat Mapper field to copy. |
PixelCrushers.DialogueSystem.Field.Field | ( | string | title, |
string | value, | ||
FieldType | type | ||
) |
PixelCrushers.DialogueSystem.Field.Field | ( | string | title, |
string | value, | ||
FieldType | type, | ||
string | typeString | ||
) |
PixelCrushers.DialogueSystem.Field.Field | ( | Field | sourceField | ) |
Copy constructor.
sourceField | Source field. |
void PixelCrushers.DialogueSystem.Field.Assign | ( | ChatMapper.Field | chatMapperField | ) |
Copies the contents of a Chat Mapper field.
chatMapperField | The Chat Mapper field to copy. |
|
static |
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. |
|
static |
Copies a field list.
sourceFields | Source fields. |
|
static |
A static utility method that creates a list of fields from a list of Chat Mapper fields.
chatMapperFields | The Chat Mapper fields. |
|
static |
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. |
|
static |
Returns the value of a field.
null
if field is null
. field | The field. |
|
static |
|
static |
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. |
|
static |
Returns the localized field title.
title | The default title. |
|
static |
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.
|
static |
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.
|
static |
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.
|
static |
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.
|
static |
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. |
|
static |
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.
|
static |
A static utility method that sets the string bool of a field, if the field exists.
fields | A list of fields. |
title | The title of the field to set. |
value | The new value of the field. |
|
static |
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. |
|
static |
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. |
|
static |
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. |
|
static |
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. |
|
static |
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.