示例#1
0
        public HUDSequenceElementOperation(IHUDElementOperation op1, params IHUDElementOperation[] ops)
        {
            opQueue.Enqueue(op1);
            foreach (var op in ops)
            {
                opQueue.Enqueue(op);
            }

            actionStart = null;
            actionEnd   = null;
        }
示例#2
0
        protected override void OnStart(TElement element)
        {
            actionStart?.Invoke(element);

            if (current == null)
            {
                if (opQueue.Count == 0)
                {
                    return;
                }

                current = opQueue.Dequeue();
                current.OnStart(element);
            }
        }
示例#3
0
        public override bool Update(TElement entity, SAMTime gameTime, InputState istate)
        {
            if (current == null)
            {
                if (opQueue.Count == 0)
                {
                    return(false);
                }

                current = opQueue.Dequeue();
                current.OnStart(entity);
            }

            bool r = current.Update(entity, gameTime, istate);

            if (!r)
            {
                current.OnEnd(entity);
                current = null;
            }

            return(true);
        }
示例#4
0
 public HUDDelayedElementOperation(IHUDElementOperation op, float delay)
 {
     _offset    = delay;
     _operation = op;
 }
示例#5
0
		public void AddHUDOperation(IHUDElementOperation op)
		{
			ActiveOperations.Add(op);
			op.OnStart(this);
		}
示例#6
0
        public HUDSequenceElementOperation(Action <TElement> aInit, Action <TElement> aFinal, IHUDElementOperation op1, params IHUDElementOperation[] ops)
        {
            opQueue.Enqueue(op1);
            foreach (var op in ops)
            {
                opQueue.Enqueue(op);
            }

            actionStart = aInit;
            actionEnd   = aFinal;
        }