public override bool TestFor(Values st) => GetBool(st) == compareValue;
public override int IsItClaimable(int dir, Values st) => (dir > 0) == (compareValue) ? 1 : -2;
public override void ForceConditionTrue(Values st) => SetBool(st, compareValue);
public virtual int IsItClaimable(int dir, Values st) => - 2;
public virtual bool TestFor(Values st) => false;
public virtual void ForceConditionTrue(Values st) { }
public override bool TestFor(Values st) { int timeGap; switch (type) { case ConditionType.Above: if (GetInt(st) > compareValue) { return(true); } break; case ConditionType.Below: if (GetInt(st) < compareValue) { return(true); } break; case ConditionType.Equals: if (GetInt(st) == compareValue) { return(true); } break; case ConditionType.NotEquals: if (GetInt(st) != compareValue) { return(true); } break; case ConditionType.VirtualTimePassedAbove: timeGap = (int)Time.time - GetInt(st); if (timeGap > compareValue) { return(true); } LogicMGMT.inst.AddTimeListener(compareValue - timeGap); break; case ConditionType.VirtualTimePassedBelow: timeGap = (int)Time.time - GetInt(st); if (timeGap < compareValue) { LogicMGMT.inst.AddTimeListener(compareValue - timeGap); return(true); } break; case ConditionType.RealTimePassedAbove: timeGap = (LogicMGMT.RealTimeNow() - GetInt(st)); if (timeGap > compareValue) { return(true); } LogicMGMT.inst.AddTimeListener(compareValue - timeGap); break; case ConditionType.RealTimePassedBelow: timeGap = (LogicMGMT.RealTimeNow() - GetInt(st)); if (timeGap < compareValue) { LogicMGMT.inst.AddTimeListener(compareValue - timeGap); return(true); } break; } return(false); }