/// <summary> /// Сдвигает фигурку по оям на указанную величину. /// </summary> /// <param name="dX">Смещение по горизонтальной оси.</param> /// <param name="dY">Смещение по вертикальной оси.</param> /// <returns></returns> public bool Offset(int dX, int dY) { XY[] testPos = new XY[form[0].Length]; for (int i = 0; i < testPos.Length; i++) { testPos[i] = new XY(location.X + dX + form[0][i].X, location.Y + dY + form[0][i].Y); } Hide(); if (!glass.ThereBrick(testPos)) { location = new XY(location.X + dX, location.Y + dY); Show(); return(true); } Show(); return(false); }
public bool PlaceToGlass(Glass glass, XY location) { if (this.glass != null) { Hide(); } this.glass = glass; this.location = location; if (glass.ThereBrick(GetPosition())) { return(false); } Show(); return(true); }