コード例 #1
0
        private void GeneratePoint()
        {
            var snPoint = SnakePointGenerator.Generate();

            SnPoints.Add(snPoint);
            Board.Board.Children.Add(snPoint.BasicRectangle);
            SetPosition(snPoint.BasicRectangle, snPoint.Location);
        }
コード例 #2
0
        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();
            }
        }