PIbd22_NikiforovaMV_Contain.../ContainerShip/ObjectParameters.cs

31 lines
830 B
C#
Raw Permalink Normal View History

2023-11-25 12:44:21 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ContainerShip.MovementStrategy
{
2023-12-16 11:10:10 +04:00
2023-11-25 12:44:21 +04:00
public class ObjectParameters
{
private readonly int _x;
private readonly int _y;
private readonly int _width;
private readonly int _height;
public int LeftBorder => _x;
public int TopBorder => _y;
public int RightBorder => _x + _width;
public int DownBorder => _y + _height;
public int ObjectMiddleHorizontal => _x + _width / 2;
public int ObjectMiddleVertical => _y + _height / 2;
public ObjectParameters(int x, int y, int width, int height)
{
_x = x;
_y = y;
_width = width;
_height = height;
}
}
}