Esempio n. 1
0
 public override Task Start(SMHandoff smh)
 {
     //The GCX may be disposed by the parent before the child has run (due to early return), so we copy it
     smh.ch = smh.ch.CopyGCX();
     //ContinueWithSync prints errors
     states[0].Start(smh).ContinueWithSync(smh.GCX.Dispose);
     return(Task.CompletedTask);
 }
Esempio n. 2
0
 public override async Task Start(SMHandoff smh)
 {
     for (int ii = 0; ii < states.Count; ++ii)
     {
         await states[ii].Start(smh);
         smh.ThrowIfCancelled();
     }
 }
Esempio n. 3
0
        public void SetupBossPhase(SMHandoff smh)
        {
            if (smh.Exec != Exec || tracking == null)
            {
                return;
            }
            var cs = tracking.Challenges;

            for (int ii = 0; ii < cs.Length; ++ii)
            {
                cs[ii].SetupPhase(smh);
            }
        }
Esempio n. 4
0
        public override Task Start(SMHandoff smh)
        {
            var behs = BehaviorEntity.GetExecsForIDs(targets);

            if (behs.Length == 0)
            {
                Log.Unity($"Retarget operation with targets {string.Join(", ", targets)} found no BEH", level: Log.Level.WARNING);
                return(Task.CompletedTask);
            }
            else if (behs.Length == 1)
            {
                return(behs[0].RunExternalSM(SMRunner.Run(states[0], smh.cT, smh.GCX), false));
            }
            else
            {
                return(Task.WhenAll(behs.Select(x => x.RunExternalSM(SMRunner.Run(states[0], smh.cT, smh.GCX), false))));
            }
        }
Esempio n. 5
0
 public override Task Start(SMHandoff smh)
 {
     return(pred(smh.GCX) ? states[0].Start(smh) : states[1].Start(smh));
 }
Esempio n. 6
0
 public override Task Start(SMHandoff smh) =>
 //Minor garbage optimization
 states.Count == 1 ?
 states[0].Start(smh) :
 //WARNING: Due to how WhenAll works, any child exceptions will only be thrown at the end of execution.
 Task.WhenAll(states.Select(s => s.Start(smh)));
Esempio n. 7
0
 public override Task Start(SMHandoff smh)
 {
     return(Task.CompletedTask);
 }
Esempio n. 8
0
 public static Task WaitFor(SMHandoff smh, float time, bool zeroToInfinity) =>
 WaitFor(smh.Exec, smh.cT, time, zeroToInfinity);