Struct TraitBasedObjectId
The trait denoting that an entity represents a trait-based object
Namespace: Unity.AI.Planner.Traits
Syntax
public struct TraitBasedObjectId : ITrait, IBufferElementData, IEquatable<TraitBasedObjectId>
Fields
Id
A unique ObjectId assigned to the trait-based object
Declaration
public ObjectId Id
Field Value
Type | Description |
---|---|
ObjectId |
None
Default TraitBasedObjectId representing no Object
Declaration
public static readonly TraitBasedObjectId None
Field Value
Type | Description |
---|---|
TraitBasedObjectId |
Methods
Equals(Object)
Test for equality
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Other TraitBasedObjectId |
Returns
Type | Description |
---|---|
Boolean | Result of equality test |
Overrides
Equals(TraitBasedObjectId)
Test for equality
Declaration
public bool Equals(TraitBasedObjectId other)
Parameters
Type | Name | Description |
---|---|---|
TraitBasedObjectId | other | Other TraitBasedObjectId |
Returns
Type | Description |
---|---|
Boolean | Result of equality test |
GetField(String)
Get the value of a field
Declaration
public object GetField(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
String | fieldName | Name of field |
Returns
Type | Description |
---|---|
Object | Value |
Implements
GetHashCode()
Get the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Hash code |
Overrides
GetNext()
Provides a new TraitBasedObjectId with a unique ObjectId
Declaration
public static TraitBasedObjectId GetNext()
Returns
Type | Description |
---|---|
TraitBasedObjectId | Returns a new TraitBasedObjectId with a new unique ObjectId |
SetField(String, Object)
Set the value of a field
Declaration
public void SetField(string fieldName, object value)
Parameters
Type | Name | Description |
---|---|---|
String | fieldName | Name of field |
Object | value | Value |
Implements
ToString()
Returns a string that represents the TraitBasedObjectId
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents the TraitBasedObjectId |
Overrides
Operators
Equality(TraitBasedObjectId, TraitBasedObjectId)
Compares two given TraitBasedObjectIds
Declaration
public static bool operator ==(TraitBasedObjectId x, TraitBasedObjectId y)
Parameters
Type | Name | Description |
---|---|---|
TraitBasedObjectId | x | A TraitBasedObjectId |
TraitBasedObjectId | y | A TraitBasedObjectId |
Returns
Type | Description |
---|---|
Boolean | Returns if two TraitBasedObjectIds are equal |
Inequality(TraitBasedObjectId, TraitBasedObjectId)
Compares two given TraitBasedObjectIds
Declaration
public static bool operator !=(TraitBasedObjectId x, TraitBasedObjectId y)
Parameters
Type | Name | Description |
---|---|---|
TraitBasedObjectId | x | A TraitBasedObjectId |
TraitBasedObjectId | y | A TraitBasedObjectId |
Returns
Type | Description |
---|---|
Boolean | Returns if two TraitBasedObjectIds are not equal |