Presnyakova V.V Lab_2 #2

Merged
eegov merged 3 commits from Lab_2 into Lab_1 2022-10-28 09:07:57 +04:00
Showing only changes of commit a9f3a7a521 - Show all commits

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)