лаб 1
This commit is contained in:
parent
f37d2ac2d1
commit
283b167e75
@ -107,19 +107,22 @@ public class DrawCont
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case DirectionType.Right:
|
case DirectionType.Right:
|
||||||
if (_StartPosX.Value + EntityContainer.Step < _PictureWidth)
|
if (_StartPosX.Value + EntityContainer.Step < _PictureWidth - _drawingContWidth)
|
||||||
{
|
{
|
||||||
_StartPosX += (int)EntityContainer.Step;
|
_StartPosX += (int)EntityContainer.Step;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case DirectionType.Up:
|
case DirectionType.Up:
|
||||||
|
|
||||||
if (_StartPosY.Value - EntityContainer.Step > 0)
|
if (_StartPosY.Value - EntityContainer.Step > 0)
|
||||||
{
|
{
|
||||||
_StartPosY -= (int)EntityContainer.Step;
|
_StartPosY -= (int)EntityContainer.Step;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case DirectionType.Down:
|
case DirectionType.Down:
|
||||||
if (_StartPosY.Value + EntityContainer.Step < _PictureHeight)
|
if (_StartPosY.Value + EntityContainer.Step < _PictureHeight - _drawingContHeight)
|
||||||
{
|
{
|
||||||
_StartPosY += (int)EntityContainer.Step;
|
_StartPosY += (int)EntityContainer.Step;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public class EntityContainer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Crane { get; private set; }
|
public bool Crane { get; private set; }
|
||||||
|
|
||||||
public double Step => Speed * 100 / Weight;
|
public double Step => Speed * 10 / Weight;
|
||||||
|
|
||||||
public void Init(int speed, double weight, Color shipColor, Color containerColor, bool container, bool crane)
|
public void Init(int speed, double weight, Color shipColor, Color containerColor, bool container, bool crane)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user