Esempio n. 1
0
        /// <summary>
        /// Retrieves a state entry from the stack and removes it.
        /// </summary>
        /// <returns>The entry which used to be on top of the stack.</returns>
        public GameStateChangeInfo Pop()
        {
            GameStateChangeInfo entry = null;

            if (this.DeltaChanges.Count != 0)
            {
                entry = this.DeltaChanges[this.DeltaChanges.Count - 1];
                this.DeltaChanges.RemoveAt(this.DeltaChanges.Count - 1);
            }

            return(entry);
        }
Esempio n. 2
0
 /// <summary>
 /// Pushes a state entry to the stack.
 /// </summary>
 /// <param name="entry">The most recent entry.</param>
 public void Push(GameStateChangeInfo entry)
 {
     this.DeltaChanges.Add(entry);
 }