Class Character
Inheritance
Inherited Members
Namespace: StoryVerse.Models
Assembly: Assembly-CSharp.dll.dll
Syntax
[Serializable]
public class Character
Constructors
Character(String, String, List<String>, Inventory)
Declaration
public Character(string id, string seasonId, List<string> inventoryItems = null, Inventory sharedInventory = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | Id of the character |
| System.String | seasonId | Id of the season which character is bound to |
| System.Collections.Generic.List<System.String> | inventoryItems | Optional list of inventory items which Character posses. Those will be overwritten once .RefreshInventory is called |
| Inventory | sharedInventory | Optional shared inventory to use. For example, inventory of the player |
Fields
Nodes
Last nodes that were loaded
Declaration
public Dictionary<string, string> Nodes
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.String> |
OnGetNodes
This event fires when Nodes recieved for current character
Declaration
public UnityEvent OnGetNodes
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnGetNodesError
This event fires when error while getting Nodes
Declaration
public PlayFabErrorEvent OnGetNodesError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnGetState
This event fires when failed to get State
Declaration
public SeasonStateEvent OnGetState
Field Value
| Type | Description |
|---|---|
| SeasonStateEvent |
OnGetStateError
This event fires when failed to get State
Declaration
public PlayFabErrorEvent OnGetStateError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnInventoryRefresh
This event fires when inventory is updated for this character
Declaration
public UnityEvent OnInventoryRefresh
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnInventoryRefreshError
This event fires when error while refreshing inventory
Declaration
public PlayFabErrorEvent OnInventoryRefreshError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnReset
This event fires when character is reset
Declaration
public UnityEvent OnReset
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnResetEpisode
This event is fired when an episode is reset
Declaration
public UnityEvent OnResetEpisode
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnResetEpisodeError
This event fires when failed to reset episode
Declaration
public PlayFabErrorEvent OnResetEpisodeError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnResetError
This event fires when failed to Reset error
Declaration
public PlayFabErrorEvent OnResetError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnSaveNode
This event fires when Node is saved on backend
Declaration
public UnityEvent OnSaveNode
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnSaveNodeError
This event fires when node save failed
Declaration
public PlayFabErrorEvent OnSaveNodeError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnSaveState
This event is fired when season state is saved
Declaration
public UnityEvent OnSaveState
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnSaveStateError
This event fires when failed to save Season State
Declaration
public PlayFabErrorEvent OnSaveStateError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
OnStashHistory
This event is fired when the state/history has been stashed
Declaration
public UnityEvent OnStashHistory
Field Value
| Type | Description |
|---|---|
| UnityEngine.Events.UnityEvent |
OnStashHistoryError
This event fires when failed to stash state/history
Declaration
public PlayFabErrorEvent OnStashHistoryError
Field Value
| Type | Description |
|---|---|
| PlayFabErrorEvent |
Properties
Id
ID of the this character
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Inventory
Personal, character inventory
Declaration
public Inventory Inventory { get; }
Property Value
| Type | Description |
|---|---|
| Inventory |
Player
Player object which this character is bound to
Declaration
public Player Player { get; set; }
Property Value
| Type | Description |
|---|---|
| Player |
SeasonId
Identifies show which this character is bound to
Declaration
public string SeasonId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
SharedInventory
A shared inventory, for example, from a current Player
Declaration
public Inventory SharedInventory { get; }
Property Value
| Type | Description |
|---|---|
| Inventory |
Methods
GetNodes()
Get all nodes saved for current character
Declaration
public void GetNodes()
GetState()
Retrieve state for this character
Declaration
public void GetState()
RefreshInventory()
Refreshes character inventory
Declaration
public void RefreshInventory()
Reset()
Reset Character
Declaration
public void Reset()
ResetEpisode()
Reset Episode Resets an episode to the state/history it was at the start of the current episode
Declaration
public void ResetEpisode()
SaveNode(String, String)
Save node
Declaration
public void SaveNode(string nodeId, string body)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | nodeId | |
| System.String | body |
SaveState(SeasonState)
Persists the state of inside this character
Declaration
public void SaveState(SeasonState state)
Parameters
| Type | Name | Description |
|---|---|---|
| SeasonState | state | State to save |
StashHistory()
Stash History Stashes the character state/history to be restored at a later time
Declaration
public void StashHistory()