Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Sabatini committed Jun 28, 2024
1 parent d609a5a commit b0b6c8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/domain/mars_rover.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MarsRoverStatus(enum.Enum):
STARTED = "STARTED"
MOVING = "MOVING"
OBSTACLE_FOUND = "OBSTACLE_FOUND"
TURNED_OFF_FOR_AN_OBSTACLE = "TURNED_OFF"
TURNED_OFF = "TURNED_OFF"


@dataclasses.dataclass
Expand All @@ -29,7 +29,7 @@ def start(self) -> MarsRoverStarted:
return MarsRoverStarted.create(self.id)

def turn_off(self) -> MarsRoverTurnedOff:
self.status = MarsRoverStatus.TURNED_OFF_FOR_AN_OBSTACLE
self.status = MarsRoverStatus.TURNED_OFF
return MarsRoverTurnedOff.create(self.id)

def turn_right(self) -> MarsRoverMoved | None:
Expand Down Expand Up @@ -101,7 +101,7 @@ def coordinate(self):
return f"{hit_obstacles}{self.actual_point.x}:{self.actual_point.y}:{self.direction.value}"

def _is_stopped(self):
return (self.status == MarsRoverStatus.TURNED_OFF_FOR_AN_OBSTACLE or
return (self.status == MarsRoverStatus.TURNED_OFF or
self.status == MarsRoverStatus.OBSTACLE_FOUND)

@staticmethod
Expand Down

0 comments on commit b0b6c8a

Please sign in to comment.