/// <summary>Начало координат снизу слева, т.к. графические элементы выравниваются к нижней части.</summary> /// <param name="circleZoneStart_x">Начало координат снизу слева.</param> /// <param name="circleZoneStart_y">Начало координат снизу слева.</param> static List <WallpaperPart> CreateUserCircles(int circleZoneStart_x, int circleZoneStart_y, int circleNumber, int completedCirclesNumber) { List <WallpaperPart> circles = new List <WallpaperPart>(); int circleWidth = Properties.Resources.circle.Width; int circleHeight = Properties.Resources.circle.Height; for (int i = 0; i < circleNumber; i++) { int circle_x = circleZoneStart_x; int circle_y = circleZoneStart_y - (circleHeight * i) - (GAP_BETWEEN_ELEMENTS * i); WallpaperPart circle = new WallpaperPart(Properties.Resources.circle, circle_x, circle_y, circleWidth, circleHeight); circles.Add(circle); // Если все круги были добавленны, то добавляем последний текущий круг. if (i + 1 == circleNumber) { int currentСircle_x = circleZoneStart_x; int currentСircle_y = circleZoneStart_y - (circleHeight * (i + 1)) - (GAP_BETWEEN_ELEMENTS * (i + 1)); WallpaperPart currentСircle = new WallpaperPart(Properties.Resources.circle_orange, currentСircle_x, currentСircle_y, circleWidth, circleHeight); circles.Add(currentСircle); } } return(circles); }
/// <summary>Начало координат снизу слева, т.к. графические элементы выравниваются к нижней части.</summary> /// <param name="squareZoneStart_x">Начало координат снизу слева.</param> /// <param name="squareZoneStart_y">Начало координат снизу слева.</param> static List <WallpaperPart> CreateUserSquares(int squareZoneStart_x, int squareZoneStart_y, int futureSquaresNumber, int completedSquaresNumber) { List <WallpaperPart> squares = new List <WallpaperPart>(); int squareWidth = Properties.Resources.square.Width; int squareHeight = Properties.Resources.square.Height; for (int i = 0; i < futureSquaresNumber; i++) { int square_x = squareZoneStart_x; int square_y = squareZoneStart_y - (squareHeight * i) - (GAP_BETWEEN_ELEMENTS * i); WallpaperPart square = new WallpaperPart(Properties.Resources.square, square_x, square_y, squareWidth, squareHeight); squares.Add(square); // Если все квадраты были добавленны, то добавляем последний текущий квадрат. if (i + 1 == futureSquaresNumber) { int currentSquare_x = squareZoneStart_x; int currentSquare_y = squareZoneStart_y - (squareHeight * (i + 1)) - (GAP_BETWEEN_ELEMENTS * (i + 1)); WallpaperPart currentSquare = new WallpaperPart(Properties.Resources.square_orange, currentSquare_x, currentSquare_y, squareWidth, squareHeight); squares.Add(currentSquare); } } return(squares); }
/// <summary>Начало координат снизу слева, т.к. графические элементы выравниваются к нижней части.</summary> /// <param name="stickZoneStart_x">Начало координат снизу слева.</param> /// <param name="stickZoneStart_y">Начало координат снизу слева.</param> static List <WallpaperPart> CreateUserSticks(int stickZoneStart_x, int stickZoneStart_y, int futureShiftsNumber, int completedShiftsNumber) { List <WallpaperPart> sticks = new List <WallpaperPart>(); int stickWidth = Properties.Resources.stick.Width; int stickHeight = Properties.Resources.stick.Height; int stick_x; int stick_y; // Добавляем палочки будущих смен. for (int i = 0; i < futureShiftsNumber; i++) { stick_x = stickZoneStart_x; stick_y = stickZoneStart_y - (stickHeight * i) - (GAP_BETWEEN_ELEMENTS * i); WallpaperPart futureShiftStick = new WallpaperPart(Properties.Resources.stick, stick_x, stick_y, stickWidth, stickHeight); sticks.Add(futureShiftStick); } // Добавляем палочку текущей смены. stick_x = stickZoneStart_x; stick_y = stickZoneStart_y - (stickHeight * futureShiftsNumber) - (GAP_BETWEEN_ELEMENTS * futureShiftsNumber); WallpaperPart currentShiftStick = new WallpaperPart(Properties.Resources.stick_orange, stick_x, stick_y, stickWidth, stickHeight); sticks.Add(currentShiftStick); //// Добавялем палочки завершённых смен. //for (int i = futureShiftsNumber + CURRENT_STICK, j = 0; j < completedShiftsNumber; i++, j++) //{ // stick_x = stickZoneStart_x; // stick_y = stickZoneStart_y - (stickHeight * i) - (GAP_BETWEEN_ELEMENTS * i); // WallpaperPart completedShiftStick = new WallpaperPart(Properties.Resources.stick_gray, stick_x, stick_y, stickWidth, stickHeight); // sticks.Add(completedShiftStick); //} return(sticks); }