TugOfBaby.RenderManager.Draw C# (CSharp) Method

Draw() public method

public Draw ( SpriteBatch spriteBatch, List all ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
all List
return void
        public void Draw(SpriteBatch spriteBatch, List<GameObject> all)
        {
            foreach (GameObject gameObject in all)
            {
                if (gameObject.Sprite != null && gameObject.Enabled)
                {
                    Vector2 pos = gameObject.Position + gameObject.Sprite.Origin;

                    if (gameObject.Baby != null)
                    {
                        gameObject.Baby.Torso.Animation.Draw(spriteBatch, pos + gameObject.Baby.Torso.Origin, 0f, false);
                    }

                    if (gameObject.Sprite.BackgroundAnimation != null)
                    {
                       gameObject.Sprite.BackgroundAnimation.Draw(spriteBatch, gameObject.Position, 0f, gameObject.Sprite.Flipped);
                    }

                    if (gameObject.Sprite.Animation == null)
                    {

                        spriteBatch.Draw(gameObject.Sprite.Texture, pos, Color.White);
                    }
                    else
                    {
                        gameObject.Sprite.Animation.Draw(spriteBatch, pos, 0f,gameObject.Sprite.Flipped);
                    }

                }
            }
        }