コード例 #1
0
ファイル: Hero.cs プロジェクト: GitMaiter/Snake
 public Point GetNextPoint()
 {
     Point headPoint = pointList.Last();
     Point nextPoint = new Point(headPoint);
     nextPoint.ChangeDirection(1, direction);
     return nextPoint;
 }
コード例 #2
0
ファイル: Hero.cs プロジェクト: GitMaiter/Snake
        public Point GetNextPoint()
        {
            Point headPoint = pointList.Last();
            Point nextPoint = new Point(headPoint);

            nextPoint.ChangeDirection(1, direction);
            return(nextPoint);
        }
コード例 #3
0
ファイル: Hero.cs プロジェクト: GitMaiter/Snake
        public Hero(Point tail, int lenght, Direction direction)
        {
            this.direction = direction;
            pointList = new List<Point>();

            for (int i = 0; i < lenght; i++)
            {
                Point point = new Point(tail);
                point.ChangeDirection(i, direction);
                pointList.Add(point);
            }
        }
コード例 #4
0
ファイル: Hero.cs プロジェクト: GitMaiter/Snake
        public Hero(Point tail, int lenght, Direction direction)
        {
            this.direction = direction;
            pointList      = new List <Point>();

            for (int i = 0; i < lenght; i++)
            {
                Point point = new Point(tail);
                point.ChangeDirection(i, direction);
                pointList.Add(point);
            }
        }