Word Game Builder 2.0.1f2
Reference Manual
Public Member Functions | Properties | List of all members
WordGameAgent Class Reference

Represents a word game AI agent. The agent is multithreaded and supports automatic selection/submission. More...

+ Inheritance diagram for WordGameAgent:
+ Collaboration diagram for WordGameAgent:

Public Member Functions

AsyncTask FindWords ()
 Finds a set of words, based on the player's current held tiles. More...
 
AsyncTask FindWords (IList< ILetterTile > tiles)
 Finds a set of words, based on a list of letter tiles. More...
 
AsyncTask FindWords (IList< ILetterTile > tiles, bool selectWord, float selectionTime, bool submitWord, float submissionTime)
 Finds a set of words, based on a list of letter tiles. More...
 
void Stop ()
 Stops all actions currently in progress by the agent. More...
 
- Public Member Functions inherited from WGBBase
GetComponentFromInterface< T > ()
 Gets a component from its interface type. More...
 
GetComponentInChildrenFromInterface< T > ()
 Gets a component from its interface type, searching through this GameObject and all children. More...
 
T[] GetComponentsFromInterface< T > ()
 Gets all components from its interface type. More...
 
T[] GetComponentsInChildrenFromInterface< T > ()
 Gets all components from its interface type, searching through this GameObject and all children. More...
 
- Public Member Functions inherited from IMonoBehaviour
void CancelInvoke ()
 Cancels all Invoke calls on this MonoBehaviour. More...
 
void CancelInvoke (string methodName)
 Cancels all Invoke calls with name methodName on this behaviour. More...
 
int GetInstanceID ()
 Returns the instance id of the object. More...
 
void Invoke (string methodName, float time)
 Invokes the method methodName in time seconds. More...
 
void InvokeRepeating (string methodName, float time, float repeatRate)
 Invokes the method methodName in time seconds. More...
 
bool IsInvoking ()
 Is any invoke pending on this MonoBehaviour? More...
 
bool IsInvoking (string methodName)
 Is any invoke on methodName pending? More...
 
Coroutine StartCoroutine (IEnumerator routine)
 Starts a coroutine. More...
 
Coroutine StartCoroutine (string methodName)
 Starts a coroutine named methodName. More...
 
Coroutine StartCoroutine (string methodName, object value)
 Starts a coroutine named methodName. More...
 
void StopAllCoroutines ()
 Stops all coroutines running on this behaviour. More...
 
void StopCoroutine (string methodName)
 Stops all coroutines named methodName running on this behaviour. More...
 
string ToString ()
 Returns the name of the game object. More...
 

Properties

float autoSelectTime [get, set]
 If autoSelectWord is enabled, the amount of time to wait between selecting tiles. More...
 
bool autoSelectWord [get, set]
 If enabled, automatically select the best found word. More...
 
float autoSubmitTime [get, set]
 If autoSubmitWord is enabled, the amount of time to wait before submitting tiles. This has no effect if autoSelectWord is disabled. More...
 
bool autoSubmitWord [get, set]
 If enabled, automatically submit the best found word. This has no effect if autoSelectWord is disabled. More...
 
float bias [get, set]
 A value between 0 and 1 that controls how aggressive or "intelligent" the agent is at getting words. More...
 
int customWildcardScore [get, set]
 If customWildcardScoring = true, the custom point value to assign to wildcard tiles. More...
 
Dictionary< Letter, int > customWildcardScores [get]
 A dictionary that can be modified to have more fine grained control over the scoring for wildcard tiles. More...
 
bool customWildcardScoring [get, set]
 If true, selecting wildcard tiles will be calculated using a custom point value. More...
 
bool ignorePlayerInputState [get, set]
 If true, ignore the player's inputEnabled property. More...
 
AgentSearchInfo lastSearchInfo [get]
 Gets information about the last agent search. This is set right before event callbacks. More...
 
int maxPrefixIterations [get, set]
 For long words (over a word set's max prefix length), a prefix check is performed to speed up the algorithm. This value controls the maximum number of iterations to perform with the prefix check. More...
 
float maxTime [get, set]
 The maximum amount of time (in seconds) to look for words before selecting a candidate or retrying/giving up. More...
 
int maxWordLength [get, set]
 The maximum amount of letters for a candidate word. More...
 
int maxWords [get, set]
 The maximum amount of words to find before selecting a candidate. More...
 
int minWordLength [get, set]
 The minimum amount of letters for a candidate word. More...
 
WGBEvent onFindWords [get, set]
 This event fires whenever the agent has found a set of words. More...
 
bool processWildcards [get, set]
 If true, blank tiles will be processed as wildcard tiles. More...
 
int retryCount [get, set]
 The maximum amount of times to retry a search, if a root has not yet been searched. More...
 
int threshold [get, set]
 Controls how many candidate words are kept when sorted by score. More...
 
- Properties inherited from WGBBase
object userData [get, set]
 Additional user data associated with this object. This is unused by default. More...
 
- Properties inherited from IWordGameAgent
AgentSearchInfo lastSearchInfo [get]
 Gets the most recent search information found from the agent. More...
 
WGBEvent onFindWords [get, set]
 This event should fire whenever the agent has found a set of words. More...
 
- Properties inherited from IMonoBehaviour
bool enabled [get, set]
 Enabled Behaviours are Updated, disabled Behaviours are not. More...
 
GameObject gameObject [get]
 The game object this component is attached to. A component is always attached to a game object. More...
 
HideFlags hideFlags [get, set]
 Should the object be hidden, saved with the scene or modifiable by the user? More...
 
string name [get, set]
 The name of the object. More...
 
string tag [get, set]
 The tag of this game object. More...
 
Transform transform [get]
 The Transform attached to this GameObject. A component is always attached to a transform. More...
 
object userData [get, set]
 Additional user data associated with this object. This is unused by default. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from WGBBase
static T FindObjectOfTypeFromInterface< T > ()
 Finds the first object of interface type T. More...
 
static T[] FindObjectsOfTypeFromInterface< T > ()
 Finds all objects of interface type T. More...
 
static T InstantiateFromInterface< T > (T original)
 Instantiate a GameObject from interface type T. More...
 
static T InstantiateFromInterface< T > (T original, Vector3 position, Quaternion rotation)
 Instantiate a GameObject from interface type T at the specified position and rotation. More...
 
static void Log (object message, string prefix, string type)
 Logs a prefixed message. More...
 
static void Log (object message, string prefix, string type, Object context)
 Logs a prefixed message, with context. More...
 
static void LogError (object message, string prefix, string type)
 Logs a prefixed erorr. More...
 
static void LogError (object message, string prefix, string type, Object context)
 Logs a prefixed exception, with context. More...
 
static void LogException (System.Exception ex)
 Logs an exception. More...
 
static void LogException (System.Exception ex, Object context)
 Logs an exception, with context. More...
 
static void LogWarning (object message, string prefix, string type)
 Logs a prefixed warning. More...
 
static void LogWarning (object message, string prefix, string type, Object context)
 Logs a prefixed warning, with context. More...
 

Detailed Description

Represents a word game AI agent. The agent is multithreaded and supports automatic selection/submission.

This component requires a WordGamePlayer to be present. Letter tile implementations that use ISelectableLetterTile will obey selection rules.

Member Function Documentation

AsyncTask FindWords ( )
inline

Finds a set of words, based on the player's current held tiles.

Returns
An object representing an asynchronous task.

Implements IWordGameAgent.

AsyncTask FindWords ( IList< ILetterTile tiles)
inline

Finds a set of words, based on a list of letter tiles.

Parameters
tilesA list of letter tiles to use when searching for words.
Returns
An object representing an asynchronous task.

Implements IWordGameAgent.

AsyncTask FindWords ( IList< ILetterTile tiles,
bool  selectWord,
float  selectionTime,
bool  submitWord,
float  submissionTime 
)
inline

Finds a set of words, based on a list of letter tiles.

Parameters
tilesA list of letter tiles to use when searching for words.
selectWordIf true, automatically select a word after finding it.
selectionTimeThe amount of time to spend between selecting each letter if selectWord is true.
submitWordIf true, automatically submit a word after finding it. This has no effect if selectWord is false.
submissionTimeThe amount of time to wait before submitting a word if submitWord is true.
Returns
A task object representing the asynchronous task. If a task is already running, the previous task will be aborted. If a player has not been selected, an empty task is returned and no callbacks are run.

+ Here is the call graph for this function:

void Stop ( )
inline

Stops all actions currently in progress by the agent.

Implements IWordGameAgent.

+ Here is the call graph for this function:

Property Documentation

float autoSelectTime
getset

If autoSelectWord is enabled, the amount of time to wait between selecting tiles.

bool autoSelectWord
getset

If enabled, automatically select the best found word.

float autoSubmitTime
getset

If autoSubmitWord is enabled, the amount of time to wait before submitting tiles. This has no effect if autoSelectWord is disabled.

bool autoSubmitWord
getset

If enabled, automatically submit the best found word. This has no effect if autoSelectWord is disabled.

float bias
getset

A value between 0 and 1 that controls how aggressive or "intelligent" the agent is at getting words.

A value of 0 will pick a random word from the top candidates. A value of 1 will always find the highest-scoring word from the top candidates.

int customWildcardScore
getset

If customWildcardScoring = true, the custom point value to assign to wildcard tiles.

Dictionary<Letter, int> customWildcardScores
get

A dictionary that can be modified to have more fine grained control over the scoring for wildcard tiles.

bool customWildcardScoring
getset

If true, selecting wildcard tiles will be calculated using a custom point value.

bool ignorePlayerInputState
getset

If true, ignore the player's inputEnabled property.

AgentSearchInfo lastSearchInfo
get

Gets information about the last agent search. This is set right before event callbacks.

Implements IWordGameAgent.

int maxPrefixIterations
getset

For long words (over a word set's max prefix length), a prefix check is performed to speed up the algorithm. This value controls the maximum number of iterations to perform with the prefix check.

Higher iteration counts take more processing and memory power, but produce more accurate results.

float maxTime
getset

The maximum amount of time (in seconds) to look for words before selecting a candidate or retrying/giving up.

int maxWordLength
getset

The maximum amount of letters for a candidate word.

int maxWords
getset

The maximum amount of words to find before selecting a candidate.

int minWordLength
getset

The minimum amount of letters for a candidate word.

WGBEvent onFindWords
getset

This event fires whenever the agent has found a set of words.

Note that this will fire immediately after a set of words has been found, even if words are being automatically selected.

Variables set:

  • WGBEvent.currentLanguage
  • WGBEvent.currentPlayer
  • WGBEvent.currentAgent

Implements IWordGameAgent.

bool processWildcards
getset

If true, blank tiles will be processed as wildcard tiles.

int retryCount
getset

The maximum amount of times to retry a search, if a root has not yet been searched.

Retries will only happen if a root hasn't been searched (All words starting with a specific tile).

int threshold
getset

Controls how many candidate words are kept when sorted by score.