Ejemplo n.º 1
0
        public RendererParameters(SpriteBatch spriteBatch, Rectangle viewportRectangle, TextureContent textureContent)
        {
            spriteBatch.ThrowIfNull("spriteBatch");
            textureContent.ThrowIfNull("textureContent");

            _spriteBatch = spriteBatch;
            _viewportRectangle = viewportRectangle;
            _textureContent = textureContent;
        }
Ejemplo n.º 2
0
        public RendererParameters(IXnaGameTime gameTime, SpriteBatch spriteBatch, FontContent fontContent, TextureContent textureContent)
        {
            gameTime.ThrowIfNull("gameTime");
            spriteBatch.ThrowIfNull("spriteBatch");
            fontContent.ThrowIfNull("fontContent");
            textureContent.ThrowIfNull("textureContent");

            _gameTime = gameTime;
            _spriteBatch = spriteBatch;
            _fontContent = fontContent;
            _textureContent = textureContent;
        }
Ejemplo n.º 3
0
        public void Render(SpriteBatch spriteBatch, Rectangle viewRectangle, TextureContent textureContent)
        {
            spriteBatch.ThrowIfNull("spriteBatch");
            textureContent.ThrowIfNull("textureContent");

            // Must call ToArray() because collection could be modified during iteration
            foreach (IRenderer renderer in _renderers.ToArray())
            {
                var parameters = new RendererParameters(spriteBatch, viewRectangle, textureContent);

                renderer.Render(parameters);
            }
        }
        public void Render(SpriteBatch spriteBatch, IXnaGameTime gameTime, FontContent fontContent, TextureContent textureContent)
        {
            spriteBatch.ThrowIfNull("spriteBatch");
            gameTime.ThrowIfNull("gameTime");
            fontContent.ThrowIfNull("fontContent");
            textureContent.ThrowIfNull("textureContent");

            var parameters = new RendererParameters(gameTime, spriteBatch, fontContent, textureContent);

            // Must call ToArray() because collection could be modified during iteration
            foreach (IRenderer renderer in _renderers.ToArray())
            {
                renderer.Render(parameters);
            }
        }