public void GoUp() { ThrowIfCanNotMove(); var direction = Direction.Up; if (IsDownMoving(Head.CurPosition, BodyFirst.CurPosition)) { direction = TurnBack(); } DirectionQueue.Enqueue(direction); }
public void GoLeft() { ThrowIfCanNotMove(); var direction = Direction.Left; if (IsRightMoving(Head.CurPosition, BodyFirst.CurPosition)) { direction = TurnBack(); } DirectionQueue.Enqueue(direction); }