Class GoapAction
Inheritance
System.Object
GoapAction
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Mars.Components.dll
Syntax
public abstract class GoapAction : IGoapAction
Constructors
|
Improve this Doc
View Source
GoapAction(IGoapAgentStates, Single)
Declaration
protected GoapAction(IGoapAgentStates agentStates, float cost = 0F)
Parameters
Properties
|
Improve this Doc
View Source
Cost
Declaration
public float Cost { get; protected set; }
Property Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Effects
Declaration
public IDictionary<IGoapStateKey, GoapStateProperty> Effects { get; }
Property Value
|
Improve this Doc
View Source
Preconditions
Declaration
public IDictionary<IGoapStateKey, GoapStateProperty> Preconditions { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddOrUpdateEffect(GoapStateProperty)
Declaration
public void AddOrUpdateEffect(GoapStateProperty effect)
Parameters
|
Improve this Doc
View Source
AddOrUpdateEffect<T>(GoapStateKey<T>, T)
Adds an effect to this action or updates an existing effect with the same key.
Declaration
public void AddOrUpdateEffect<T>(GoapStateKey<T> key, T value)
Parameters
Type |
Name |
Description |
GoapStateKey<T> |
key |
Identifies the state property. |
T |
value |
The specific manifestation of this state. |
Type Parameters
Name |
Description |
T |
The type of value. |
|
Improve this Doc
View Source
AddOrUpdateEffect<T>(KeyValuePair<GoapStateKey<T>, T>)
Adds an effect to this action or updates an existing effect with the same key.
Declaration
public void AddOrUpdateEffect<T>(KeyValuePair<GoapStateKey<T>, T> kvp)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<GoapStateKey<T>, T> |
kvp |
Identifies the state property. |
Type Parameters
Name |
Description |
T |
The type of value. |
|
Improve this Doc
View Source
AddOrUpdatePrecondition(GoapStateProperty)
Declaration
public void AddOrUpdatePrecondition(GoapStateProperty precondition)
Parameters
|
Improve this Doc
View Source
AddOrUpdatePrecondition<T>(GoapStateKey<T>, T)
Adds a precondition to this action or updates an existing precondition with the same key.
Declaration
public void AddOrUpdatePrecondition<T>(GoapStateKey<T> key, T value)
Parameters
Type |
Name |
Description |
GoapStateKey<T> |
key |
Identifies the state property. |
T |
value |
The specific manifestation of this state. |
Type Parameters
Name |
Description |
T |
The type of value. |
|
Improve this Doc
View Source
AddOrUpdatePrecondition<T>(KeyValuePair<GoapStateKey<T>, T>)
Adds a precondition to this action or updates an existing precondition with the same key.
Declaration
public void AddOrUpdatePrecondition<T>(KeyValuePair<GoapStateKey<T>, T> kvp)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<GoapStateKey<T>, T> |
kvp |
Identifies the state property. |
Type Parameters
Name |
Description |
T |
The type of value. |
|
Improve this Doc
View Source
Execute()
Declaration
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ExecuteAction()
Simply executes the specific action code, without GOAP overhead organization.
Declaration
protected abstract bool ExecuteAction()
Returns
Type |
Description |
System.Boolean |
True, if the action instructions were successful, false otherwise |
|
Improve this Doc
View Source
RemoveEffect(GoapStateProperty)
Declaration
public void RemoveEffect(GoapStateProperty effect)
Parameters
|
Improve this Doc
View Source
RemoveEffect(IGoapStateKey)
Removes an effect with given key.
Declaration
public void RemoveEffect(IGoapStateKey effectKey)
Parameters
Type |
Name |
Description |
IGoapStateKey |
effectKey |
Identifies the effect that should be removed. |
|
Improve this Doc
View Source
RemovePrecondition(GoapStateProperty)
Declaration
public void RemovePrecondition(GoapStateProperty precondition)
Parameters
|
Improve this Doc
View Source
RemovePrecondition(IGoapStateKey)
Removes a precondition with given key.
Declaration
public void RemovePrecondition(IGoapStateKey preconditionKey)
Parameters
Type |
Name |
Description |
IGoapStateKey |
preconditionKey |
Identifies the precondition that should be removed. |
|
Improve this Doc
View Source
UpdateCost()
Declaration
public virtual void UpdateCost()
Implements
Extension Methods