private void GeneratePoint() { var snPoint = SnakePointGenerator.Generate(); SnPoints.Add(snPoint); Board.Board.Children.Add(snPoint.BasicRectangle); SetPosition(snPoint.BasicRectangle, snPoint.Location); }
private void UpdatePointsOnBoard() { foreach (var snakePoints in SnPoints) { snakePoints.RemoveLive(); if (snakePoints.ToRemove) { Board.Board.Children.Remove(snakePoints.BasicRectangle); } } SnPoints.RemoveAll(x => x.ToRemove); if (PointToGenerate) { GeneratePoint(); } }