import { WORLDMAP_TYPES } from "../types";
import { assert } from "../utils";
import type { VillageState } from "../village";


export default function toggleMissionRepeat(V: VillageState, regionIndex: number) {
    const region = V.worldmap[regionIndex];

    assert(region.type === WORLDMAP_TYPES.OASIS);

    if (!region.state.mission) {
        return false;
    }

    region.state.mission.repeat = !region.state.mission.repeat;

    return true;
}
