BlackboardTracker

Namespace: Murder.Save
Assembly: Murder.dll

public class BlackboardTracker

Track variables that contain the state of the world.

⭐ Constructors

public BlackboardTracker()

⭐ Methods

SetValue(BlackboardInfo, string, T, bool)

protected bool SetValue(BlackboardInfo info, string fieldName, T value, bool isRevertingTrigger)

Parameters
info BlackboardInfo
fieldName string
value T
isRevertingTrigger bool

Returns
bool

OnFieldModified(BlackboardInfo, FieldInfo, string, T)

protected virtual void OnFieldModified(BlackboardInfo info, FieldInfo fieldInfo, string fieldName, T value)

Parameters
info BlackboardInfo
fieldInfo FieldInfo
fieldName string
value T

GetBool(string, string, T?)

public bool GetBool(string name, string fieldName, T? character)

Parameters
name string
fieldName string
character T?

Returns
bool

HasPlayed(Guid, int, int)

public bool HasPlayed(Guid guid, int situationId, int dialogId)

Returns whether a particular dialog option has been played.

Parameters
guid Guid
situationId int
dialogId int

Returns
bool

HasVariable(string, string)

public bool HasVariable(string blackboardName, string fieldName)

Return whether a exists on .

Parameters
blackboardName string
fieldName string

Returns
bool

Matches(Criterion, T?, World, T?, out Int32&)

public bool Matches(Criterion criterion, T? character, World world, T? entityId, Int32& weight)

Parameters
criterion Criterion
character T?
world World
entityId T?
weight int&

Returns
bool

SetValueForAllCharacterBlackboards(string, string, T)

public bool SetValueForAllCharacterBlackboards(string blackboardName, string fieldName, T value)

Parameters
blackboardName string
fieldName string
value T

Returns
bool

GetFloat(string, string, T?)

public float GetFloat(string name, string fieldName, T? character)

Parameters
name string
fieldName string
character T?

Returns
float

GetInt(string, string, T?)

public int GetInt(string name, string fieldName, T? character)

Parameters
name string
fieldName string
character T?

Returns
int

PlayCount(Guid, int, int)

public int PlayCount(Guid guid, int situationId, int dialogId)

Returns whether how many times a dialog has been executed.

Parameters
guid Guid
situationId int
dialogId int

Returns
int

GetString(string, string, T?)

public string GetString(string name, string fieldName, T? character)

Parameters
name string
fieldName string
character T?

Returns
string

GetValueAsString(string)

public string GetValueAsString(string fieldName)

Get a blackboard value as a string. This returns the first blackboard that has the field.

Parameters
fieldName string

Returns
string

FetchCharacterFor(Guid)

public T? FetchCharacterFor(Guid guid)

Fetch a cached character out of BlackboardTracker._characterCache

Parameters
guid Guid

Returns
T?

FindBlackboard(string, T?)

public virtual BlackboardInfo FindBlackboard(string name, T? guid)

Parameters
name string
guid T?

Returns
BlackboardInfo

FetchBlackboards()

public virtual ImmutableDictionary<TKey, TValue> FetchBlackboards()

Returns
ImmutableDictionary<TKey, TValue>

Track(Guid, int, int)

public virtual void Track(Guid character, int situationId, int dialogId)

Track that a particular dialog option has been played.

Parameters
character Guid
situationId int
dialogId int

OnModified(BlackboardKind)

public void OnModified(BlackboardKind kind)

Notify that the blackboard has been changed (externally or internally).

Parameters
kind BlackboardKind

ResetPendingTriggers()

public void ResetPendingTriggers()

Reset all fields marked with a [Trigger] attribute, so they are only activated for one frame.

ResetWatcher(BlackboardKind, Action)

public void ResetWatcher(BlackboardKind kind, Action notification)

This will reset all watchers of trackers.

Parameters
kind BlackboardKind
notification Action

SetBool(string, string, BlackboardActionKind, bool, T?)

public void SetBool(string name, string fieldName, BlackboardActionKind kind, bool value, T? character)

Parameters
name string
fieldName string
kind BlackboardActionKind
value bool
character T?

SetFloat(string, string, BlackboardActionKind, float, T?)

public void SetFloat(string name, string fieldName, BlackboardActionKind kind, float value, T? character)

Parameters
name string
fieldName string
kind BlackboardActionKind
value float
character T?

SetInt(string, string, BlackboardActionKind, int, T?)

public void SetInt(string name, string fieldName, BlackboardActionKind kind, int value, T? character)

Parameters
name string
fieldName string
kind BlackboardActionKind
value int
character T?

SetString(string, string, string, T?)

public void SetString(string name, string fieldName, string value, T? character)

Parameters
name string
fieldName string
value string
character T?

SetValue(string, string, T, T?)

public void SetValue(string name, string fieldName, T value, T? character)

Parameters
name string
fieldName string
value T
character T?

Watch(Action, BlackboardKind)

public void Watch(Action notification, BlackboardKind kind)

This will watch any chages to any of the blackboard properties.

Parameters
notification Action
kind BlackboardKind