Пример #1
0
 public Earth(Point2D topLeftPlayGround, Point2D bottomRightPlayGround)
 {
     this.body = new HashSet<Pixel>();
     this.topLeftPlayGround = topLeftPlayGround;
     this.bottomRightPlayGround = bottomRightPlayGround;
     this.levelElementsCount = new int[this.bottomRightPlayGround.Y];
 }
Пример #2
0
        public FallingL(Point2D center, Rotation rotation, char symbol, ConsoleColor color)
        {
            this.Center = center;
            this.Rotation = rotation;
            this.relativeBody = new List<Pixel>();

            //Here should come the body definitions in relative to center coordinates for creating new shape!
            relativeBody.Add(new Pixel(0, -1, symbol, color));
            relativeBody.Add(new Pixel(0, 0, symbol, color));
            relativeBody.Add(new Pixel(0, 1, symbol, color));
            relativeBody.Add(new Pixel(1, 1, symbol, color));

            this.Body = new List<Pixel>();
            for(int i = 0; i < relativeBody.Count; i++) Body.Add(new Pixel(0,0,'@', ConsoleColor.Gray));
            this.ReCalculateBody();
        }
Пример #3
0
        public FallingLine(Point2D center, Rotation rotation, char symbol, ConsoleColor color, int length)
        {
            this.Center = center;
            this.Rotation = rotation;
            this.relativeBody = new List<Pixel>();

            //Here should come the body definitions in relative to center coordinates for creating new shape!
            relativeBody.Add(new Pixel(0, 0, symbol, color));
            for (int i = 1; i < length; i++)
            {
                if (i % 2 == 0) relativeBody.Add(new Pixel((i+1)/2, 0, symbol, color));
                else relativeBody.Add(new Pixel(-(i + 1) / 2, 0, symbol, color));
            }

            this.Body = new List<Pixel>();
            for(int i = 0; i < relativeBody.Count; i++) Body.Add(new Pixel(0,0,'@', ConsoleColor.Gray));
            this.ReCalculateBody();
        }
Пример #4
0
 public Pixel(int x, int y, char symbol, ConsoleColor color)
 {
     Coordinate = new Point2D(x, y);
     Symbol = symbol;
     Color = color;
 }