import { LabelDropRepo } from "../../LabelDrop";
import { ObjectPickEntity } from "../../ObjectPick";
import { QuestionEntity } from "../../Question";
import { makeChallengeEntity } from "../Entities";
import { makeChallengeAuthorHelpPM, makeChallengeConsumerHelpPM, makeSelectedChallengePM, } from "../PMs";
import { makeSetChallengeUC, makeShowChallengeHelpUC, makeTryChallengeAgainUC, SerializeChallengeUC, } from "../UCs";
export function setupChallenge(appObjects) {
    const ao = appObjects.getOrCreate("Challenge");
    // Entity
    const challenge = makeChallengeEntity(ao);
    // UCs
    new SerializeChallengeUC(ao);
    makeSetChallengeUC(ao);
    makeShowChallengeHelpUC(ao);
    makeTryChallengeAgainUC(ao);
    // PM
    makeChallengeAuthorHelpPM(ao);
    makeChallengeConsumerHelpPM(ao);
    makeSelectedChallengePM(ao);
    // Register challenges
    const question = QuestionEntity.get(appObjects);
    if (!question) {
        appObjects.submitError("setupChallenge", "No QuestionEntity");
    }
    else {
        challenge.registerChallenge(question);
    }
    const labelDrop = LabelDropRepo.get(appObjects);
    if (!labelDrop) {
        appObjects.submitError("setupChallenge", "No LabelDropEntity");
    }
    else {
        challenge.registerChallenge(labelDrop);
    }
    const objectPick = ObjectPickEntity.get(appObjects);
    if (!objectPick) {
        appObjects.submitError("setupChallenge", "No ObjectPickEntity");
    }
    else {
        challenge.registerChallenge(objectPick);
    }
}
//# sourceMappingURL=setupChallenge.js.map