Небольшие правки
This commit is contained in:
parent
755c0d2dd2
commit
b8af73b6a6
@ -35,7 +35,7 @@ namespace Hydroplane
|
||||
/// <summary>
|
||||
/// Высота прорисовки гидроплана
|
||||
/// </summary>
|
||||
private readonly int _planeHeight = 100;
|
||||
private readonly int _planeHeight = 80;
|
||||
/// <summary>
|
||||
/// Инициализация свойств
|
||||
/// </summary>
|
||||
@ -51,9 +51,12 @@ namespace Hydroplane
|
||||
public bool Init(int speed, double weight, Color bodyColor, Color
|
||||
additionalColor, bool boat, bool bobber, int width, int height)
|
||||
{
|
||||
// TODO: Продумать проверки
|
||||
_pictureWidth = width;
|
||||
_pictureHeight = height;
|
||||
if (_pictureWidth < _planeWidth || _pictureHeight < _planeHeight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
EntityHydroplane = new EntityHydroplane();
|
||||
EntityHydroplane.Init(speed, weight, bodyColor, additionalColor,
|
||||
boat, bobber);
|
||||
@ -67,9 +70,8 @@ namespace Hydroplane
|
||||
/// <param name="y">Координата Y</param>
|
||||
public void SetPosition(int x, int y)
|
||||
{
|
||||
// TODO: Изменение x, y
|
||||
_startPosX = x;
|
||||
_startPosY = y;
|
||||
_startPosX = Math.Min(x, _pictureWidth - _planeWidth);
|
||||
_startPosY = Math.Min(y, _pictureHeight - _planeHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user