private void DrawBlocks(RenderTarget target, RenderStates states) { if (_shape != null) { foreach (var shapeBlock in _shape.Blocks) { var block = new UIBlock(shapeBlock, _shape.X * UIBlock.Size + _transpositionX, _shape.Y * UIBlock.Size + _transpositionY); block.Draw(target, states); } } }
private void DrawBlocks(RenderTarget target, RenderStates states) { if (_gameController.Game != null) { for (var i = 0; i < _gameController.Game.Width; i++) { for (var j = 0; j < _gameController.Game.Height; j++) { if (_gameController.Game.Blocks[i, j] != null) { var block = new UIBlock(_gameController.Game.Blocks[i, j], PositionX, PositionY); block.Draw(target, states); } } } if (_gameController.Game?.Shape != null) { var shape = new UIShape(_gameController.Game.Shape, PositionX, PositionY); shape.Draw(target, states); } } }