Grail (C#)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Planners.WorldObject Class Reference

WorldObject is the main building block of the state-action representation used in the Planner model.
It represents some entity in the planning space. It has a unique type (e.g. a 'monster') [with multiple inheritance supported] and any number of parameters (e.g. 'position', 'health'). Hence WorldObject is a specialization of ParametrizedObject
WorldObjects can be subjects to various actions. More...

Inheritance diagram for Grail.Planners.WorldObject:
Collaboration diagram for Grail.Planners.WorldObject:

Public Member Functions

 WorldObject (WorldObjectType type)
 Constructs a new WorldObject instance of the provided type. See also:

See also
WorldObjectType

. More...

 
 WorldObject (WorldObject other)
 Constructs a new WorldObject that is a copy of the provided object. More...
 
bool IsOfType (int typeID)
 Checks if the type of the WorldObject matches the provided one by ID. More...
 
bool IsOfType (string name)
 Checks if the type of the WorldObject matches the provided one by name. More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 
- Public Member Functions inherited from Grail.Planners.ParametrizedObject
void MergeParameters (ParametrizedObject other)
 Adds parameters from the other object to the own one, replacing parameters with those of other in case of conflict. More...
 
int GetParametersSize ()
 
Returns
The number of parameters assigned to this object

 
bool Contains (string name)
 
Returns
true if the object contains a parameter with the given name, false otherwise

 
void SetParameter< ParameterType > (string name, ParameterType value)
 Sets a value of a parameter identified by the given name. More...
 
ParameterType GetParameterValue< ParameterType > (string name)
 Fetches the value of a parameter identified with the given name as a given ParameterType. Make sure to provide the correct ParameterType. More...
 
bool CollectionContains (string collectionName, int objectIndex)
 
void AddCollection (string collectionName)
 Creates a named collection object, which can be used to group many IDs of objects together.
The name should be unique or you will otherwise override an existing collection. More...
 
SortedSet< int > GetCollection (string collectionName)
 
bool HasEqualParams (ParametrizedObject other)
 
Returns
true if the other object contains identical set of parameters (including the contents of collections)

 

Public Attributes

string TypeName => type.Name
 

Properties

int ObjectId [get, set]
 Returns an integer that uniquely identifies a specific WorldObject instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Grail.Planners.ParametrizedObject
 ParametrizedObject (ParametrizedObject other)
 

Detailed Description

WorldObject is the main building block of the state-action representation used in the Planner model.
It represents some entity in the planning space. It has a unique type (e.g. a 'monster') [with multiple inheritance supported] and any number of parameters (e.g. 'position', 'health'). Hence WorldObject is a specialization of ParametrizedObject
WorldObjects can be subjects to various actions.

Constructor & Destructor Documentation

◆ WorldObject() [1/2]

Grail.Planners.WorldObject.WorldObject ( WorldObjectType  type)
inline

Constructs a new WorldObject instance of the provided type. See also:

See also
WorldObjectType

.

◆ WorldObject() [2/2]

Grail.Planners.WorldObject.WorldObject ( WorldObject  other)
inline

Constructs a new WorldObject that is a copy of the provided object.

Member Function Documentation

◆ IsOfType() [1/2]

bool Grail.Planners.WorldObject.IsOfType ( int  typeID)
inline

Checks if the type of the WorldObject matches the provided one by ID.

Parameters
typeIDA unique ID of the type to check. See also:
See also
WorldObjectType
Returns
true if the object has the same type as the provided one.

◆ IsOfType() [2/2]

bool Grail.Planners.WorldObject.IsOfType ( string  name)
inline

Checks if the type of the WorldObject matches the provided one by name.

Parameters
nameThe name of the type to check. See also:
See also
WorldObjectType
Returns
true if the object has the type matching the given name.

Property Documentation

◆ ObjectId

int Grail.Planners.WorldObject.ObjectId
getset

Returns an integer that uniquely identifies a specific WorldObject instance.


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