Exemple #1
0
        public void TestBoundedQueueNoAbsorb()
        {
            BoundedQueue <int> queue = new BoundedQueue <int>(10);

            for (int i = 0; i < 10; i++)
            {
                Assert.False(queue.IsFull);
                queue.Enqueue(i);
            }
            Assert.Equal(queue.Count, 10);
            Assert.True(queue.Contains(5));
            Assert.True(queue.IsFull);
            Assert.Equal(queue.Peek(), 0);
            Assert.Equal(queue.Dequeue(), 0);
            Assert.Equal(queue.Count, 9);
            Assert.False(queue.IsFull);
        }
Exemple #2
0
        /// <summary>
        ///     Call this method whenever entering a new room.
        /// </summary>
        private void ProcessPlayerMove()
        {
            CollectItemsFromRoom();

            if (!PlayerPath.Contains(PlayerRoom))
            {
                Trivia.Trivia.UnlockNewHint();
            }

            PlayerPath.Enqueue(PlayerRoom);

            Player.Turns = ++MoveCount;

            Room currentRoom = Cave[PlayerRoom];

            if (currentRoom.HasBats)
            {
                ReactToBatCollision(currentRoom);
            }
            OnPlayerMoved(this, new EventArgs());
        }