grail (C  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Blackboard Class Reference

Grail's universal data container More...

Inheritance diagram for Grail.Blackboard:
Collaboration diagram for Grail.Blackboard:

Public Member Functions

delegate object MergeStrategy (object ours, object theirs)
 
 Blackboard (Blackboard other)
 
void RemoveEntry (string key)
 Deletes value keyed with given key from this blackboard. More...
 
bool ContainsKey (string key)
 Checks whether this blackboard contains given key. More...
 
void Merge (Blackboard other)
 Merges data from other blackboard into this one, uses OursStrategy to resolve conflicts. More...
 
void Merge (Blackboard other, MergeStrategy mergeStrategy)
 Merges data from other blackboard into this one. More...
 
void SetValue< T > (string key, T value)
 Inserts key and value into this blackboard. If key already exists new value is assigned. More...
 
void SetDefaultValue< T > (string key)
 Inserts key and default value of given type into this blackboard. If key already exists new value is assigned. More...
 
GetValue< T > (string key)
 Returns value paired with given key. If blackboard does not contain key, new entry is created. More...
 
bool TryGetValue< T > (string key, out T value)
 Checks whether blackboard contains given key. If it does, assigns keyed value to out parameter value. More...
 
IEnumerator< KeyValuePair< string, object > > GetEnumerator ()
 

Static Public Member Functions

static void TwoWayMerge (Blackboard first, Blackboard second)
 TwoWayMerge - merges second blackboard into first and first into second, uses OursStrategy in both cases More...
 
static void TwoWayMerge (Blackboard first, Blackboard second, MergeStrategy firstStrategy, MergeStrategy secondStrategy)
 TwoWayMerge - merges second blackboard into first and first into second, uses provided merge strategies More...
 
static object OursStrategy (object ours, object theirs)
 OursStrategy More...
 
static object TheirsStrategy (object ours, object theirs)
 TheirsStrategy More...
 

Properties

int Size [get]
 Blackboard's data count. More...
 

Detailed Description

Grail's universal data container

Member Function Documentation

◆ ContainsKey()

bool Grail.Blackboard.ContainsKey ( string  key)
inline

Checks whether this blackboard contains given key.

Parameters
key
Returns
true if key exists, false if not

◆ GetValue< T >()

T Grail.Blackboard.GetValue< T > ( string  key)
inline

Returns value paired with given key. If blackboard does not contain key, new entry is created.

Parameters
key
Template Parameters
T
Returns
value paired with given key

◆ Merge() [1/2]

void Grail.Blackboard.Merge ( Blackboard  other)
inline

Merges data from other blackboard into this one, uses OursStrategy to resolve conflicts.

Parameters
other

◆ Merge() [2/2]

void Grail.Blackboard.Merge ( Blackboard  other,
MergeStrategy  mergeStrategy 
)
inline

Merges data from other blackboard into this one.

Parameters
other
mergeStrategydetermines how conflicts will be resolved

◆ OursStrategy()

static object Grail.Blackboard.OursStrategy ( object  ours,
object  theirs 
)
inlinestatic

OursStrategy

Parameters
ours
theirs
Returns
ours

◆ RemoveEntry()

void Grail.Blackboard.RemoveEntry ( string  key)
inline

Deletes value keyed with given key from this blackboard.

Parameters
key

◆ SetDefaultValue< T >()

void Grail.Blackboard.SetDefaultValue< T > ( string  key)
inline

Inserts key and default value of given type into this blackboard. If key already exists new value is assigned.

Parameters
key
Template Parameters
T

◆ SetValue< T >()

void Grail.Blackboard.SetValue< T > ( string  key,
value 
)
inline

Inserts key and value into this blackboard. If key already exists new value is assigned.

Parameters
key
value
Template Parameters
T

◆ TheirsStrategy()

static object Grail.Blackboard.TheirsStrategy ( object  ours,
object  theirs 
)
inlinestatic

TheirsStrategy

Parameters
ours
theirs
Returns
theirs

◆ TryGetValue< T >()

bool Grail.Blackboard.TryGetValue< T > ( string  key,
out T  value 
)
inline

Checks whether blackboard contains given key. If it does, assigns keyed value to out parameter value.

Parameters
key
value
Template Parameters
T
Returns
true if key exists, false if it does not.

◆ TwoWayMerge() [1/2]

static void Grail.Blackboard.TwoWayMerge ( Blackboard  first,
Blackboard  second 
)
inlinestatic

TwoWayMerge - merges second blackboard into first and first into second, uses OursStrategy in both cases

Parameters
first
second

◆ TwoWayMerge() [2/2]

static void Grail.Blackboard.TwoWayMerge ( Blackboard  first,
Blackboard  second,
MergeStrategy  firstStrategy,
MergeStrategy  secondStrategy 
)
inlinestatic

TwoWayMerge - merges second blackboard into first and first into second, uses provided merge strategies

Parameters
first
second
firstStrategy
secondStrategy

Property Documentation

◆ Size

int Grail.Blackboard.Size
get

Blackboard's data count.


The documentation for this class was generated from the following file: