Class HeightAboveFloorCondition
Represents a situation where a given plane must be within a certain height off the floor
Inherited Members
Namespace: Unity.MARS.Conditions
Syntax
public class HeightAboveFloorCondition : Condition<float>, ISimulatable, ICondition<float>, ICondition, IConditionBase, IRequiresTraits<float>, IRequiresTraits, ICreateFromData
Properties
IdealHeight
Gets/Sets the "ideal" height from the floor.
Declaration
public float IdealHeight { get; set; }
Property Value
Type | Description |
---|---|
Single |
RangeFromIdealHeight
Gets/Sets the +/- range from the ideal height.
Declaration
public float RangeFromIdealHeight { get; set; }
Property Value
Type | Description |
---|---|
Single |
RequireInRange
Gets/Sets the requirement that the height must be within Height +/- RangeFromIdealHeight.
Declaration
public bool RequireInRange { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
FormatDataString(TraitDataSnapshot)
Formats data into a string that is human-readable and appropriate for the condition
Declaration
public string FormatDataString(TraitDataSnapshot data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | data | The data |
Returns
Type | Description |
---|---|
String | The formatted string |
Implements
GetConditionRatingForData(TraitDataSnapshot)
Return the rating this condition has for the given data snapshot
Declaration
public float GetConditionRatingForData(TraitDataSnapshot data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | data | The data |
Returns
Type | Description |
---|---|
Single | The result of the condition's data rate matching method |
Implements
GetRequiredTraits()
Get the TraitRequirements that are required by this object
Declaration
public override TraitRequirement[] GetRequiredTraits()
Returns
Type | Description |
---|---|
TraitRequirement[] | The required traits |
Overrides
IncludeData(TraitDataSnapshot)
Modifies the properties so that the data is acceptable for this condition
Declaration
public void IncludeData(TraitDataSnapshot data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | data | The data that should pass this condition after this method is called |
Implements
OptimizeForData(TraitDataSnapshot)
Modifies the properties so that the data is the optimal data for this condition
Declaration
public void OptimizeForData(TraitDataSnapshot data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | data | The data that should be optimal for the condition after this method is called |
Implements
RateDataMatch(ref Single)
Describe how well a given piece of data matches a condition. 0 means the match is unacceptable, 1 means a perfect match
Declaration
public override float RateDataMatch(ref float height)
Parameters
Type | Name | Description |
---|---|---|
Single | height |
Returns
Type | Description |
---|---|
Single | A number from 0 to 1 indicating how well a piece of data watches this condition |