Interface IBrainSerializer
An interface used to save and load bot brains.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Composition
Assembly: BotBrain.Abstractions.dll
Syntax
public interface IBrainSerializer : IMetadataAccess, ITitleResourceHelper, IResourceHelper
Properties
View SourceBotBrainFileExtension
Gets the file extension for bot brain files.
Declaration
string BotBrainFileExtension { get; }
Property Value
Type | Description |
---|---|
string |
BrainsFolder
Gets or sets the path to the folder containing bot brain files.
Declaration
string BrainsFolder { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceDeserializeBrain(string)
Deserializes a brain from a string.
Declaration
IBotBrain DeserializeBrain(string contents)
Parameters
Type | Name | Description |
---|---|---|
string | contents | A string representation of a brain. |
Returns
Type | Description |
---|---|
IBotBrain | The brain. |
Initialize()
Initializes the brain serializer.
Declaration
void Initialize()
IsReservedBrainFilename(string)
Determines if the given filename is reserved for brain metadata like defaults or parameters.
Declaration
bool IsReservedBrainFilename(string filename)
Parameters
Type | Name | Description |
---|---|---|
string | filename | The filename. |
Returns
Type | Description |
---|---|
bool | True if it is reserved. |
LoadBrain(string)
Loads a brain instance.
Declaration
IBotBrain? LoadBrain(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The brain name. |
Returns
Type | Description |
---|---|
IBotBrain | The brain. |
LoadDefaultBrainParameters()
Loads the default brain parameters.
Declaration
IParameterManager? LoadDefaultBrainParameters()
Returns
Type | Description |
---|---|
IParameterManager | The default parameters, or null if they don't exist. |
SerializeBrain(IBotBrain, bool)
Serializes a brain to a string.
Declaration
string SerializeBrain(IBotBrain brain, bool indented = true)
Parameters
Type | Name | Description |
---|---|---|
IBotBrain | brain | The brain. |
bool | indented | If true, the output is indented. |
Returns
Type | Description |
---|---|
string | A string representation of a brain. |