public GameGrid() { InitializeComponent(); gl = GameLogic.GetInstance(); GameGridCells = new GameCell[gl.SIZE, gl.SIZE]; NewGame(); }
public void AddNewGameCell(int x, int y) { RemoveOldGameCell(x, y); GameGridCells[x, y] = new GameCell(); GameGridCells[x, y].Value.Text = gl.GetValueAt(x, y).ToString(); GameGridCells[x, y].Cell.Background = new SolidColorBrush(Colors.Gold); GameGridCells[x, y].RenderTransformOrigin = new Point(0.5, 0.5); GameGridCells[x, y].RenderTransform = new TranslateTransform(x * 125, y * 125); GameCanvas.Children.Add(GameGridCells[x, y]); }