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--; }
public void KeyControl(ConsoleKey Key) { if (Key == ConsoleKey.LeftArrow) { direction = cDirection.LEFT; } else if (Key == ConsoleKey.RightArrow) { direction = cDirection.RIGHT; } }
public void MovePoint(int offset, cDirection direction) { if (direction == cDirection.RIGHT) { x = x + offset; } else if (direction == cDirection.LEFT) { x = x - offset; } //if (direction == Direction.UP) //{ y = y - offset; } //else if (direction == Direction.DOWN) //{ y = y + offset; } }