Exemple #1
0
    public DataControl getReferencedElementDataControl()
    {
        switch (type)
        {
        case Controller.ATREZZO_REFERENCE:
            AtrezzoListDataControl aldc = Controller.getInstance().getSelectedChapterDataControl().getAtrezzoList();
            foreach (AtrezzoDataControl adc in aldc.getAtrezzoList())
            {
                if (adc.getId().Equals(this.getElementId()))
                {
                    return(adc);
                }
            }
            break;

        case Controller.NPC_REFERENCE:
            NPCsListDataControl nldc = Controller.getInstance().getSelectedChapterDataControl().getNPCsList();
            foreach (NPCDataControl ndc in nldc.getNPCs())
            {
                if (ndc.getId().Equals(this.getElementId()))
                {
                    return(ndc);
                }
            }
            break;

        case Controller.ITEM_REFERENCE:
            ItemsListDataControl ildc = Controller.getInstance().getSelectedChapterDataControl().getItemsList();
            foreach (ItemDataControl idc in ildc.getItems())
            {
                if (idc.getId().Equals(this.getElementId()))
                {
                    return(idc);
                }
            }
            break;
        }
        return(null);
    }
Exemple #2
0
    /**
     * Updates the data contained in the data control with a new chapter. This
     * method is essential for some undo/redo tools
     *
     * @param chaper
     */
    public void update(Chapter chapter)
    {
        this.chapter = chapter;

        // Create the subcontrollers
        playerDataControl            = new PlayerDataControl(chapter.getPlayer());
        scenesListDataControl        = new ScenesListDataControl(chapter.getScenes(), this.getPlayer().getPreviewImage());
        cutscenesListDataControl     = new CutscenesListDataControl(chapter.getCutscenes());
        booksListDataControl         = new BooksListDataControl(chapter.getBooks());
        itemsListDataControl         = new ItemsListDataControl(chapter.getItems());
        atrezzoListDataControl       = new AtrezzoListDataControl(chapter.getAtrezzo());
        npcsListDataControl          = new NPCsListDataControl(chapter.getCharacters());
        conversationsListDataControl = new ConversationsListDataControl(chapter.getConversations());
        TimersListDataControl      timersListDataControl       = new TimersListDataControl(chapter.getTimers());
        GlobalStateListDataControl globalStatesListDataControl = new GlobalStateListDataControl(chapter.getGlobalStates());
        MacroListDataControl       macrosListDataControl       = new MacroListDataControl(chapter.getMacros());

        advancedFeaturesDataControl = new AdvancedFeaturesDataControl();
        advancedFeaturesDataControl.setTimerListDataControl(timersListDataControl);
        advancedFeaturesDataControl.setGlobalStatesListDataContorl(globalStatesListDataControl);
        advancedFeaturesDataControl.setMacrosListDataControl(macrosListDataControl);
        // assessmentProfilesDataControl = new AssessmentProfilesDataControl(chapter.getAssessmentProfiles());
        //adaptationProfilesDataControl = new AdaptationProfilesDataControl(chapter.getAdaptationProfiles());
    }