def _to_position(self) -> Position:
    if (self.direction == DirectionType.Up):
        return Position(x=0, y=1)
    elif (self.direction == DirectionType.Down):
        return Position(x=0, y=(- 1))
    elif (self.direction == DirectionType.Left):
        return Position(x=(- 1), y=0)
    elif (self.direction == DirectionType.Right):
        return Position(x=1, y=0)
def _to_position(self) -> Position:
    if (self.direction == DirectionType.Up):
        return Position(x=0, y=1)
    elif (self.direction == DirectionType.Down):
        return Position(x=0, y=(- 1))
    elif (self.direction == DirectionType.Left):
        return Position(x=(- 1), y=0)
    elif (self.direction == DirectionType.Right):
        return Position(x=1, y=0)