public void EnqueueForRendering(IRenderable objForRendering) { List<GameFieldCoords> objPosition = objForRendering.GetPosition(); foreach (GameFieldCoords position in objPosition) { this.gameField[position.Row, position.Col] = objForRendering.RenderingSymbol; } }
public void EnqueuForRendering(IRenderable obj) { Vector objectPosition = obj.GetPosition(); char objectImage = obj.GetImage(); if (objectPosition.X >= 0 && objectPosition.X < gameWorld.GetLength(0) - 2 * offset && objectPosition.Y >= 0 && objectPosition.Y < gameWorld.GetLength(1) - 2 * offset) { this.gameWorld[objectPosition.X + offset, objectPosition.Y + offset] = objectImage; } }
public void EnqueueForRendering(IRenderable objForRendering) { List <GameFieldCoords> objPosition = objForRendering.GetPosition(); foreach (GameFieldCoords position in objPosition) { this.gameField[position.Row, position.Col] = objForRendering.RenderingSymbol; } }
public void EnqueueForRendering(IRenderable obj) { char[,] objImage = obj.GetImage(); int imageRows = objImage.GetLength(0); int imageCols = objImage.GetLength(1); MatrixPosition objTopLeft = obj.GetPosition(); int lastRow = Math.Min(objTopLeft.Row + imageRows, this.renderContextMatrixRows); int lastCol = Math.Min(objTopLeft.Col + imageCols, this.renderContextMatrixCols); for (int row = obj.GetPosition().Row; row < lastRow; row++) { for (int col = obj.GetPosition().Col; col < lastCol; col++) { if (row >= 0 && row < renderContextMatrixRows && col >= 0 && col < renderContextMatrixCols) { renderContextMatrix[row, col] = objImage[row - obj.GetPosition().Row, col - obj.GetPosition().Col]; } } } }
public void EnqueueForRender(IRenderable obj) { char objImage = obj.GetImage(); Vector2D position = obj.GetPosition() - this.origin; if (position.X >= 0 && position.X < renderContextMatrixCols && position.Y >= 0 && position.Y < renderContextMatrixRows) { renderContextMatrix[position.Y, position.X] = objImage; } }