Struct DomainObjectTrait
The trait denoting that an entity represents a domain object
Namespace: Unity.AI.Planner.DomainLanguage.TraitBased
Syntax
public struct DomainObjectTrait : ITrait<DomainObjectTrait>, ITrait, IComponentData, IEquatable<DomainObjectTrait>
Fields
ID
A unique ID assigned to the domain object
Declaration
public DomainObjectID ID
Field Value
Type | Description |
---|---|
DomainObjectID |
Methods
Equals(DomainObjectTrait)
Declaration
public bool Equals(DomainObjectTrait other)
Parameters
Type | Name | Description |
---|---|---|
DomainObjectTrait | other |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetNext()
Provides a new DomainObjectTrait with a unique DomainObjectID
Declaration
public static DomainObjectTrait GetNext()
Returns
Type | Description |
---|---|
DomainObjectTrait | Returns a new DomainObjectTrait with an new unique DomainObjectID |
SetComponentData(EntityManager, Entity)
Sets the component on a given domain object
Declaration
public void SetComponentData(EntityManager entityManager, Entity domainObjectEntity)
Parameters
Type | Name | Description |
---|---|---|
EntityManager | entityManager | The entity manager for the world containing the domain object entity |
Entity | domainObjectEntity | The domain object for which the trait is set |
Implements
SetField(String, Object)
Set a field on the trait (alternative to using reflection)
Declaration
public void SetField(string fieldName, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field |
System.Object | value | Value to set |
Implements
SetTraitMask(EntityManager, Entity)
Sets the flag corresponding to the trait in an object's trait mask
Declaration
public void SetTraitMask(EntityManager entityManager, Entity domainObjectEntity)
Parameters
Type | Name | Description |
---|---|---|
EntityManager | entityManager | The entity manager for the world in which the domain object entity exists |
Entity | domainObjectEntity | The domain object entity for which the trait is set |