/// <summary> /// Draws each of the fields in the grid. /// </summary> /// <param name="graphics">Graphical drawing surface.</param> public void Draw(Graphics graphics) { GridGUI.Draw(graphics); }
/// <summary> /// Updates the view if only grid is provided. /// </summary> public void UpdateView(Grid grid, int score, bool isAlive, Point snakeHeadPoint) { IsAlive = isAlive; Score = score; GridGUI.Update(grid, snakeHeadPoint, isAlive); }
// If grid provided but no snake game public SnakeGameGUI(SnakeSettings snakeSettings, Grid grid, int score, bool isAlive) { IsAlive = isAlive; Score = score; GridGUI = new GridGUI(grid, snakeSettings, IsAlive); }
/// <summary> /// Updates the view if snake game is provided. /// </summary> public void UpdateView(SnakeGame snakeGame) { IsAlive = snakeGame.Snake.IsAlive; Score = snakeGame.Score; GridGUI.Update(snakeGame.Grid, snakeGame.Snake.Head.Point, snakeGame.Snake.IsAlive); }
// If snake game provided public SnakeGameGUI(SnakeSettings snakeSettings, SnakeGame snakeGame) { IsAlive = snakeGame.Snake.IsAlive; Score = snakeGame.Score; GridGUI = new GridGUI(snakeGame.Grid, snakeSettings, IsAlive); }