/// <summary> /// Returns true if the first value and the compared value are equal. /// </summary> /// <param name="other">The fact to compare to</param> public override bool Equals(Fact other) { if (other is FactObject) { return(value == ((FactObject)other).value); } else { Debug.LogWarning("You try comparing FactObject and " + other.GetType() + ". This will always return false."); return(false); } }
/// <summary> /// Returns true if the value is greater than the compared value. /// </summary> /// <param name="other">The fact to compare to</param> public override bool Greater(Fact other) { if (other is FactInt myOther) { return((int)getValueAsObject() > (int)myOther.getValueAsObject()); } else { Debug.LogWarning("You try comparing FactInt and " + other.GetType() + ". This will always return false."); return(false); } }
/// <summary> /// Returns true if the value is less than the compared value. /// </summary> /// <param name="other">The fact to compare to</param> public override bool Less(Fact other) { if (other is FactFloat) { return((float)getValueAsObject() < (float)((FactFloat)other).getValueAsObject()); } else { Debug.LogWarning("You try comparing FactFloat and " + other.GetType() + ". This will always return false."); return(false); } }
/// <summary> /// Returns true if the value is true and the compared value is false. /// </summary> /// <param name="other">The fact to compare to</param> public override bool Less(Fact other) { if (other is FactBool) { return((value) && !((FactBool)other).value); } else { Debug.LogWarning("You try comparing FactBool and " + other.GetType() + ". This will always return false."); return(false); } }