Struct ActionKey
A concrete action key for trait-based state representation
Namespace: Unity.AI.Planner.Traits
Syntax
public struct ActionKey : IEquatable<ActionKey>, IActionKeyWithGuid, IActionKey
Constructors
ActionKey(Int32)
Create a new action key with a specified number of arguments
Declaration
public ActionKey(int length)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length |
Properties
ActionGuid
A GUID (Globally Unique Identifier) for an action type
Declaration
public Guid ActionGuid { get; set; }
Property Value
Type | Description |
---|---|
Guid |
Item[Int32]
Access an action argument by index
Declaration
public int this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of action argument |
Property Value
Type | Description |
---|---|
Int32 |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Throws an exception if the index is >= Length |
Length
The number of arguments for this action
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
Int32 |
MaxLength
The maximum number of arguments that an action can have
Declaration
public static int MaxLength { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Equals(Object)
Test for equality
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Other action |
Returns
Type | Description |
---|---|
Boolean | Result of equality test |
Overrides
Equals(ActionKey)
Test for equality
Declaration
public bool Equals(ActionKey other)
Parameters
Type | Name | Description |
---|---|---|
ActionKey | other | Other action |
Returns
Type | Description |
---|---|
Boolean | Result of equality test |
GetHashCode()
Get the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Hash code |
Overrides
ToString()
Returns a string that represents the ActionKey
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents the ActionKey |