"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupChallenge = setupChallenge;
const LabelDrop_1 = require("../../LabelDrop");
const ObjectPick_1 = require("../../ObjectPick");
const Question_1 = require("../../Question");
const Entities_1 = require("../Entities");
const PMs_1 = require("../PMs");
const UCs_1 = require("../UCs");
function setupChallenge(appObjects) {
    const ao = appObjects.getOrCreate("Challenge");
    // Entity
    const challenge = (0, Entities_1.makeChallengeEntity)(ao);
    // UCs
    new UCs_1.SerializeChallengeUC(ao);
    (0, UCs_1.makeSetChallengeUC)(ao);
    (0, UCs_1.makeShowChallengeHelpUC)(ao);
    (0, UCs_1.makeTryChallengeAgainUC)(ao);
    // PM
    (0, PMs_1.makeChallengeAuthorHelpPM)(ao);
    (0, PMs_1.makeChallengeConsumerHelpPM)(ao);
    (0, PMs_1.makeSelectedChallengePM)(ao);
    // Register challenges
    const question = Question_1.QuestionEntity.get(appObjects);
    if (!question) {
        appObjects.submitError("setupChallenge", "No QuestionEntity");
    }
    else {
        challenge.registerChallenge(question);
    }
    const labelDrop = LabelDrop_1.LabelDropRepo.get(appObjects);
    if (!labelDrop) {
        appObjects.submitError("setupChallenge", "No LabelDropEntity");
    }
    else {
        challenge.registerChallenge(labelDrop);
    }
    const objectPick = ObjectPick_1.ObjectPickEntity.get(appObjects);
    if (!objectPick) {
        appObjects.submitError("setupChallenge", "No ObjectPickEntity");
    }
    else {
        challenge.registerChallenge(objectPick);
    }
}
//# sourceMappingURL=setupChallenge.js.map