public UpdaterParameters(IXnaGameTime gameTime, Focus focus) { gameTime.ThrowIfNull("gameTime"); _gameTime = gameTime; _focus = focus; }
public void DequeueOldLogEntries(IXnaGameTime gameTime) { gameTime.ThrowIfNull("gameTime"); while (_logEntries.Any() && gameTime.TotalGameTime - _logEntries.Peek().LoggedTotalWorldTime > LogEntryLifetime) { _logEntries.Dequeue(); } }
protected override void Draw(IXnaGameTime gameTime) { gameTime.ThrowIfNull("gameTime"); var spriteBatch = new SpriteBatch(GraphicsDevice); _rendererCollection.Render(spriteBatch, gameTime, _fontContent, _textureContent); spriteBatch.Dispose(); }
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; }
public void Update(IXnaGameTime gameTime, Focus focus) { gameTime.ThrowIfNull("gameTime"); var updaterParameters = new UpdaterParameters(gameTime, focus); // Must call ToArray() because collection could be modified during iteration foreach (IUpdater updater in _updaters.ToArray()) { updater.Update(updaterParameters); } }
protected override void Update(IXnaGameTime gameTime) { gameTime.ThrowIfNull("gameTime"); ProcessWorldInstanceCommandQueue(); UpdateFpsRendererState(gameTime.ElapsedGameTime); UpdateWorldTimeRendererState(gameTime); UpdateLogRendererState(gameTime); UpdateBoardRendererState(); ProcessMessage(gameTime.TotalGameTime); _updaterCollection.Update(gameTime, _inputManager.Focus); }
public void UpdateWorldTimes(IXnaGameTime gameTime) { gameTime.ThrowIfNull("gameTime"); if (Paused) { return; } TimeSpan elapsed = TimeSpan.FromTicks((long)(gameTime.ElapsedGameTime.Ticks * _speed)); ElapsedWorldTime = elapsed; TotalWorldTime += elapsed; }
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); } }