Exemplo n.º 1
0
        public cShip(int _coordinataX, int _coordinataY, int _heigh, cDirection _direction)
        {
            int crdX  = _coordinataX;
            int crdY  = _coordinataY;
            int heigh = _heigh;

            direction = _direction;

            allShipLine = new List <cHorizontalLine>();

            List <cPoint> lineShip = new List <cPoint>();

            do
            {
                for (int i = 0; i < 3; i++)
                {
                    cPoint p = new cPoint(crdX, crdY, '*');
                    lineShip.Add(p);
                    crdX++;
                }
                cFigure line = new cFigure();
            }while (heigh < 2);

            //cHorizontalLine line = new cHorizontalLine(crdX, crdX+2, crdY, '*');
            //lineShip.Add(line);
            //crdY++;
            //heigh--;
        }
Exemplo n.º 2
0
        public cHorizontalLine(int xLeft, int xRight, int y, char sym)
        {
            pointList = new List <cPoint>();

            for (int x = xLeft; x <= xRight; x++)
            {
                cPoint p = new cPoint(x, y, sym);
                pointList.Add(p);
            }
        }
Exemplo n.º 3
0
        public cVerticalLine(int x, int yUp, int yDown, char sym)
        {
            pointList = new List <cPoint>();

            for (int y = yUp; y <= yDown; y++)
            {
                cPoint p = new cPoint(x, y, sym);
                pointList.Add(p);
            }
        }
Exemplo n.º 4
0
 public cPoint(cPoint p)
 {
     x   = p.x;
     y   = p.y;
     sym = p.sym;
 }