diff options
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs')
-rw-r--r-- | Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs deleted file mode 100644 index d0eda4f5..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace BehaviorDesigner.Runtime.Tasks.Basic.Math
-{
- [TaskCategory("Basic/Math")]
- [TaskDescription("Performs comparison between two integers: less than, less than or equal to, equal to, not equal to, greater than or equal to, or greater than.")]
- public class IntComparison : Conditional
- {
- public enum Operation
- {
- LessThan,
- LessThanOrEqualTo,
- EqualTo,
- NotEqualTo,
- GreaterThanOrEqualTo,
- GreaterThan
- }
-
- [Tooltip("The operation to perform")]
- public Operation operation;
- [Tooltip("The first integer")]
- public SharedInt integer1;
- [Tooltip("The second integer")]
- public SharedInt integer2;
-
- public override TaskStatus OnUpdate()
- {
- switch (operation) {
- case Operation.LessThan:
- return integer1.Value < integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
- case Operation.LessThanOrEqualTo:
- return integer1.Value <= integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
- case Operation.EqualTo:
- return integer1.Value == integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
- case Operation.NotEqualTo:
- return integer1.Value != integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
- case Operation.GreaterThanOrEqualTo:
- return integer1.Value >= integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
- case Operation.GreaterThan:
- return integer1.Value > integer2.Value ? TaskStatus.Success : TaskStatus.Failure;
- }
- return TaskStatus.Failure;
- }
-
- public override void OnReset()
- {
- operation = Operation.LessThan;
- integer1.Value = 0;
- integer2.Value = 0;
- }
- }
-}
\ No newline at end of file |