Вторая лабораторная

This commit is contained in:
VictoriaPresnyakova 2022-10-03 09:12:52 +04:00
parent 9594bcedae
commit a9f3a7a521

View File

@ -102,25 +102,10 @@ namespace Catamaran
{
_drawingObject.MoveObject(direction);
}
else _drawingObject.MoveObject(OppositDirection(direction));
return DrawMapWithObject();
}
private static Direction OppositDirection(Direction direction)
{
switch (direction)
{
case Direction.Up:
return Direction.Down;
case Direction.Down:
return Direction.Up;
case Direction.Left:
return Direction.Right;
case Direction.Right:
return Direction.Left;
}
return Direction.None;
}
private bool SetObjectOnMap()
{
if (_drawingObject == null || _map == null)