C# Class UnityAI.Core.Planning.Predicate

Inheritance: IComparable
ファイルを表示 Open project: unityai/unityai-core Class Usage Examples

Public Methods

Method Description
CalculateHashCode ( string name, bool isNegative, IEnumerable parameters ) : int

Calculates a hashcode for a predicate's parameters

Written separately so that it can be used for calculating hashes on predicat caching

CompareTo ( object obj ) : int
Create ( string name ) : Predicate

Create a Predicate

Create ( string name, bool isNegative ) : Predicate

Create a Predicate

Equals ( object obj ) : bool

Is this predicate Equal to another Predicate?

FindPredicate ( string name, bool isNegative ) : Predicate

Find the Predicate in the Cache

GetHashCode ( ) : int

Calculates the predicate's hashcode

IsComplimentOf ( Predicate predicate ) : bool

Are the Predicates Negatives of Eachother

ToString ( ) : string

String Representation of the Predicate

Validate ( ) : void

Marks the predicate as current

Protected Methods

Method Description
AddPredicate ( Predicate predicate ) : void

Adds a Predicate to the current cache

CalculateHashCode ( Predicate predicate ) : int

Calculates a hashcode for a predicate

Written separately so that it can be used for calculating hashes on predicat caching

Predicate ( string name ) : System

Construct a Predicate ie At(Monster,Location)

Predicate ( string name, bool isNegative ) : System

Construct a Predicate ie At(Monster,Location)

Private Methods

Method Description
InitializeCache ( ) : void

Initialize the Predicate Cache

Predicate ( ) : System

Static Constructor

Method Details

AddPredicate() protected static method

Adds a Predicate to the current cache
protected static AddPredicate ( Predicate predicate ) : void
predicate Predicate Predicate to add
return void

CalculateHashCode() protected static method

Calculates a hashcode for a predicate
Written separately so that it can be used for calculating hashes on predicat caching
protected static CalculateHashCode ( Predicate predicate ) : int
predicate Predicate Predicate to evaluate
return int

CalculateHashCode() public static method

Calculates a hashcode for a predicate's parameters
Written separately so that it can be used for calculating hashes on predicat caching
public static CalculateHashCode ( string name, bool isNegative, IEnumerable parameters ) : int
name string Predicate name
isNegative bool Is the predicate negative?
parameters IEnumerable Predicate parameters
return int

CompareTo() public method

public CompareTo ( object obj ) : int
obj object
return int

Create() public static method

Create a Predicate
public static Create ( string name ) : Predicate
name string Name of Predicate
return Predicate

Create() public static method

Create a Predicate
public static Create ( string name, bool isNegative ) : Predicate
name string Name of Predicate
isNegative bool Is Negative?
return Predicate

Equals() public method

Is this predicate Equal to another Predicate?
public Equals ( object obj ) : bool
obj object
return bool

FindPredicate() public static method

Find the Predicate in the Cache
public static FindPredicate ( string name, bool isNegative ) : Predicate
name string Name of the Predicate
isNegative bool Is Negated
return Predicate

GetHashCode() public method

Calculates the predicate's hashcode
public GetHashCode ( ) : int
return int

IsComplimentOf() public method

Are the Predicates Negatives of Eachother
public IsComplimentOf ( Predicate predicate ) : bool
predicate Predicate Predicate to Compare
return bool

Predicate() protected method

Construct a Predicate ie At(Monster,Location)
protected Predicate ( string name ) : System
name string Name of the Predicate
return System

Predicate() protected method

Construct a Predicate ie At(Monster,Location)
protected Predicate ( string name, bool isNegative ) : System
name string Name of the Predicate
isNegative bool Is Negated?
return System

ToString() public method

String Representation of the Predicate
public ToString ( ) : string
return string

Validate() public method

Marks the predicate as current
public Validate ( ) : void
return void