Ejemplo n.º 1
0
 public void AddCommand(EXECommand Command)
 {
     this.Commands.Add(Command);
     if (Command.IsComposite())
     {
         ((EXEScope)Command).SetSuperScope(this);
     }
 }
Ejemplo n.º 2
0
        public void RequestStep(EXECommand Command, EXEScope SuperScope, AnimationCommandStorage ACS)
        {
            lock (this.Syncer)
            {
                Debug.Log("Got into Thread Syncer");
                //If the room has been entered previously and has not been emptied yet, we must wait until it's emptied
                while (this.Blocked)
                {
                    Monitor.Wait(this.Syncer);
                }

                //If someone changed number of threads, let's do it
                PerformThreadCountChange();

                //Let us let know everyone of our presence
                this.InLockCount++;
                this.UntilLockResetCount--;
                if (this.InLockCount == 1)
                {
                    //AnimationCommandStorage.GetInstance();//.NewAnimationSequence();
                    ACS.NewAnimationSequence();
                }
                /*Animation.Instance.AddAnimationStep(new AnimationCommand(SuperScope, Command));*/
                ACS.AddAnimationStep(new AnimationCommand(SuperScope, Command));

                //If we have to wait for more threads, let's sleep until they come
                while (this.UntilLockResetCount > 0)
                {
                    //If someone changed number of threads, let's do it
                    PerformThreadCountChange();
                    Monitor.Wait(this.Syncer);
                }
                //If we are the last thread to come, let's block the room until everyone leaves and wake everyone up
                if (this.UntilLockResetCount == 0)
                {
                    this.Blocked = true;
                    OALProgram.RequestNextStep();
                    Monitor.PulseAll(this.Syncer);
                }

                //Let know that we are leaving
                this.InLockCount--;
                //If we are the last one leaving, unblock the room and reset counters. And wake up possible sleepers
                if (this.InLockCount == 0)
                {
                    this.Blocked             = false;
                    this.UntilLockResetCount = this.ThreadCount;
                    //Animation.Instance.NewAnimationSequence();
                    ACS.NewAnimationSequence();
                    Monitor.PulseAll(this.Syncer);
                }
            }
        }
 public EXECommandCallTestDecorator(EXECommand DecoratedCommand, StringBuffer CallTextBuffer)
 {
     this.DecoratedCommand = DecoratedCommand;
     this.CallTextBuffer   = CallTextBuffer;
 }
Ejemplo n.º 4
0
 public AnimationCommand(EXEScope SuperScope, EXECommand DecoratedCommand)
 {
     this.SuperScope       = SuperScope;
     this.DecoratedCommand = DecoratedCommand;
     this.IsCall           = DecoratedCommand is EXECommandCall;
 }