コード例 #1
0
 public override bool TestFor(Values st) => GetBool(st) == compareValue;
コード例 #2
0
 public override int IsItClaimable(int dir, Values st) => (dir > 0) == (compareValue) ?  1 : -2;
コード例 #3
0
 public override void ForceConditionTrue(Values st) => SetBool(st, compareValue);
コード例 #4
0
 public virtual int IsItClaimable(int dir, Values st) => - 2;
コード例 #5
0
 public virtual bool TestFor(Values st) => false;
コード例 #6
0
 public virtual void ForceConditionTrue(Values st)
 {
 }
コード例 #7
0
        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);
        }