public void Notify(Model m) { if (m is SnakeGameModel) { SnakeGameModel sbm = m as SnakeGameModel; SetScore((sbm.SnakeLength() - SnakeGameModel.SNAKE_INIT_SIZE).ToString()); } }
public void Notify(Model m) { // if it's a SnakeBoardModel, then we know how to handle it if (m is SnakeGameModel) { sbm = (SnakeGameModel)m; if (sbm.isHit) { controller.Stop(); MessageBox.Show("Game over!!, your score is " + (sbm.SnakeLength() - SnakeGameModel.SNAKE_INIT_SIZE)); } if (sbm.isEating) { Snake.Debug("Eating"); } } }