示例#1
0
 /// <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);
 }
示例#2
0
 /// <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);
 }
示例#3
0
 // 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);
 }
示例#4
0
 /// <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);
 }
示例#5
0
 // If snake game provided
 public SnakeGameGUI(SnakeSettings snakeSettings, SnakeGame snakeGame)
 {
     IsAlive = snakeGame.Snake.IsAlive;
     Score   = snakeGame.Score;
     GridGUI = new GridGUI(snakeGame.Grid, snakeSettings, IsAlive);
 }