示例#1
0
 /// <summary>
 /// This is called when the game should draw itself.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Draw(GameTime gameTime)
 {
     spriteBatch.Begin();
     for (int i = 0; i < SpritesForDrawList.Count; i++)
     {
         SpritesForDrawList.GetElement(i).DrawSpriteOnScreen(spriteBatch);
     }
     spriteBatch.End();
     base.Draw(gameTime);
 }
        public bool MoveNext()
        {
            if (++_index >= _genericList.Count)
            {
                return(false);
            }

            Current = _genericList.GetElement(_index);
            return(true);
        }
示例#3
0
        public GenericListEnumerator(IGenericList <T> list)
        {
            _internalStorage = new T[list.Count];
            for (var index = 0; index < list.Count; ++index)
            {
                _internalStorage[index] = list.GetElement(index);
            }

            _index    = -1;
            _disposed = false;
        }
示例#4
0
 /// <summary>
 /// This is called when the game should draw itself.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Draw(GameTime gameTime)
 {
     // Start drawing .
     spriteBatch.Begin();
     for (int i = 0; i < SpritesForDrawList.Count; i++)
     {
         SpritesForDrawList.GetElement(i).DrawSpriteOnScreen(spriteBatch);
     }
     // End drawing .
     // Send all gathered details to the graphic card in one batch .
     spriteBatch.End();
     base.Draw(gameTime);
 }
示例#5
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            for (int i = 0; i < SpritesForDrawList.Count; i++)
            {
                SpritesForDrawList.GetElement(i).DrawSpriteOnScreen(spriteBatch);
            }

            spriteBatch.End();
            base.Draw(gameTime);
        }
        public TodoItem Update(TodoItem todoItem)
        {
            int      index = _inMemoryTodoDatabase.IndexOf(todoItem);
            TodoItem a     = _inMemoryTodoDatabase.GetElement(index);

            if (_inMemoryTodoDatabase.Contains(todoItem))
            {
                a = todoItem;
                _inMemoryTodoDatabase.RemoveAt(index);
            }
            _inMemoryTodoDatabase.Add(a);
            return(todoItem);
        }
示例#7
0
        public TodoItem Get(Guid todoId)
        {
            var temp = _inMemoryTodoDatabase.FirstOrDefault(s => s.Id == todoId);
            int pom  = _inMemoryTodoDatabase.IndexOf(temp);

            if (pom >= 0)
            {
                return(_inMemoryTodoDatabase.GetElement(pom));
            }
            else
            {
                return(null);
            }
        }
示例#8
0
 /// <summary>
 /// This is called when the game should draw itself.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Draw(GameTime gameTime)
 {
     GraphicsDevice.Clear(Color.CornflowerBlue);
     // Start drawing .
     spriteBatch.Begin();
     for (int i = 0; i < SpritesForDrawList.Count; i++)
     {
         SpritesForDrawList.GetElement(i).DrawSpriteOnScreen(spriteBatch);
     }
     // TODO: Add your drawing code here
     // End drawing .
     // Send all gathered details to the graphic card in one batch .
     spriteBatch.End();
     base.Draw(gameTime);
 }
示例#9
0
 public static void ListExample(IGenericList <string> list)
 {
     list.Add("1a");
     list.Add("2b");
     list.Add("3c");
     list.Add("4d");
     list.Add("5e");
     list.RemoveAt(0);
     list.Remove("5e");
     WriteLine(list.GetElement(2));
     WriteLine(list.Count);
     WriteLine(list.Remove("100"));
     WriteLine(list.RemoveAt(5));
     list.Clear();
     WriteLine(list.Count);
 }
示例#10
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            var bounds = GraphicsDevice.Viewport.Bounds;

            //Start drawing
            spriteBatch.Begin();
            for (int i = 0; i < SpritesForDrawList.Count; i++)
            {
                SpritesForDrawList.GetElement(i).DrawSpriteOnScreen(spriteBatch);
            }

            //End drawing.
            //Send all gathered details to the graphic card in one batch.
            spriteBatch.DrawString(TopScore, scoreTop.ToString(), new Vector2(bounds.Left, bounds.Center.Y - 25f), Color.White);
            spriteBatch.DrawString(BottomScore, scoreBottom.ToString(), new Vector2(bounds.Left, bounds.Center.Y + 25f), Color.White);

            spriteBatch.End();
            base.Draw(gameTime);
        }