Exemple #1
0
 /// <summary>
 /// A convienience shortcut to do a Cpu.AddTrigger for this UserDelegate.  See
 /// Cpu.AddTrigger to see what this is for.  This is useful for cases where you
 /// want to do an AddTrigger() but don't have access to the Shared.Cpu with which to
 /// do so (the UserDelegate knows which Cpu it was created with so it can get to
 /// it directly from that).
 /// </summary>
 public TriggerInfo TriggerNextUpdate(params Structure[] args)
 {
     if (CheckForDead(false))
     {
         return(null);
     }
     return(Cpu.AddTrigger(this, args));
 }
Exemple #2
0
 /// <summary>
 /// Similar to TriggerOnNextOpcode(), except this won't trigger until the
 /// next KOSFixedUpdate in which the callstack is free of other similar
 /// future-update triggers like this one.  This is to be 'nice' to
 /// other kerboscript code and prevent these types of triggers from
 /// using 100% of the CPU time.  This should be used in
 /// cases where you intend to make a repeating callback by scheduling
 /// a new call as soon as you detect the previous one is done.  (like
 /// VectorRenderer's UPDATEVEC does for example).  It can also be used for
 /// one-shots as well, if you think it's okay for the one-shot to wait until
 /// at least the next update boundary to execute.
 /// </summary>
 public TriggerInfo TriggerOnFutureUpdate(InterruptPriority priority, params Structure[] args)
 {
     if (CheckForDead(false))
     {
         return(null);
     }
     return(Cpu.AddTrigger(this, priority, Cpu.NextTriggerInstanceId, false, args));
 }