Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Last active December 13, 2020 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinZikmund/488d6ee30bb117f742f53de7f0001c56 to your computer and use it in GitHub Desktop.
Save MartinZikmund/488d6ee30bb117f742f53de7f0001c56 to your computer and use it in GitHub Desktop.
private BitmapImage _aliveBitmap = new BitmapImage(new Uri($"ms-appx:///Assets/Classic_alive.png"));
private BitmapImage _deadBitmap = new BitmapImage(new Uri($"ms-appx:///Assets/Classic_dead.png"));
private void RedrawBoard()
{
for (var row = 0; row < _gameState.Size; row++)
{
for (var column = 0; column < _gameState.Size; column++)
{
var cell = GetCell(row, column);
cell.Source = _gameState.Cells[row, column] == CellState.Alive ?
_aliveBitmap : _deadBitmap;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment