Skip to content

Question8_4: If failed, clear filled spots #175

@solimant

Description

@solimant

private boolean parkStartingAtSpot(int spotNumber, Vehicle vehicle) {

If one or more spots fail, it seems to still decrease the number of available spots, and also doesn't free the spots that succeeded. This should be an "all-or-nothing" kind of transaction. Potentially, if a level fails to park the vehicle, the following level should try, which then starts by clearing the spots on the given vehicle. To make sure we are clearing the correct number of vehicles vs. decreasing the correct number of available spots, a workaround would be to decrease the available spots by the actual number of spots that were filled rather than the vehicle's number of spots needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions