Exemple #1
0
 private void AttachPack(Object sender, EventArgs args)
 {
     while (toAttach.Count > 0)
     {
         ParentHolder.Attach(toAttach.Dequeue());
     }
 }
Exemple #2
0
 public BehaviorPack(float lifetime = -1)
     : base(lifetime)
 {
     AliveChanged += (behavior) =>
     {
         while (toAttach.Count > 0)
         {
             ParentHolder.Attach(toAttach.Dequeue());
         }
     };
 }
Exemple #3
0
        public SampleAction2()
            : base(1)
        {
            // the public delegates and events can either
            // have functions hooked into them:
            //this.AliveChanged += AttachPack;

            // or lambdas
            this.AliveChanged += (Action a) =>
            {
                while (toAttach.Count > 0)
                {
                    ParentHolder.Attach(toAttach.Dequeue());
                }
            };
        }