// MW:TODO refactor bleh
 private static IMyDecoratorLogic GetDecoratorLogic(MyObjectBuilder_BehaviorTreeDecoratorNode.Logic logicData)
 {
     if (logicData is MyObjectBuilder_BehaviorTreeDecoratorNode.TimerLogic)
     {
         return(new MyBehaviorTreeDecoratorTimerLogic());
     }
     else if (logicData is MyObjectBuilder_BehaviorTreeDecoratorNode.CounterLogic)
     {
         return(new MyBehaviorTreeDecoratorCounterLogic());
     }
     else
     {
         Debug.Fail("Unsupported type");
     }
     return(null);
 }
Пример #2
0
 public void Construct(MyObjectBuilder_BehaviorTreeDecoratorNode.Logic logicData)
 {
     MyObjectBuilder_BehaviorTreeDecoratorNode.CounterLogic logic = logicData as MyObjectBuilder_BehaviorTreeDecoratorNode.CounterLogic;
     this.CounterLimit = logic.Count;
 }
        public void Construct(MyObjectBuilder_BehaviorTreeDecoratorNode.Logic logicData)
        {
            var timerLogic = logicData as MyObjectBuilder_BehaviorTreeDecoratorNode.TimerLogic;

            TimeInMs = timerLogic.TimeInMs;
        }
Пример #4
0
 private static IMyDecoratorLogic GetDecoratorLogic(MyObjectBuilder_BehaviorTreeDecoratorNode.Logic logicData) =>
 (!(logicData is MyObjectBuilder_BehaviorTreeDecoratorNode.TimerLogic) ? (!(logicData is MyObjectBuilder_BehaviorTreeDecoratorNode.CounterLogic) ? null : ((IMyDecoratorLogic) new MyBehaviorTreeDecoratorCounterLogic())) : ((IMyDecoratorLogic) new MyBehaviorTreeDecoratorTimerLogic()));