/**
         * Constructor
         *
         * @param npc
         *            Contained NPC data
         */
        public NPCDataControl(NPC npc)
        {
            this.npc           = npc;
            this.resourcesList = npc.getResources();

            selectedResources = 0;

            // Add a new resource if the list is empty
            if (resourcesList.Count == 0)
            {
                resourcesList.Add(new ResourcesUni());
            }

            // Create the subcontrollers
            resourcesDataControlList = new List <ResourcesDataControl>();
            foreach (ResourcesUni resources in resourcesList)
            {
                resourcesDataControlList.Add(new ResourcesDataControl(resources, Controller.NPC));
            }

            actionsListDataControl = new ActionsListDataControl(npc.getActions(), this);

            descriptionController = new DescriptionsController(npc.getDescriptions());

            previewAnimations = new Dictionary <Orientation, Animation>();
            ReloadPreviewAnimations();
        }
        /**
         * Constructor.
         *
         * @param sceneDataControl
         *            Parent scene controller
         * @param activeArea
         *            Exit of the data control structure
         */
        public ActiveAreaDataControl(SceneDataControl sceneDataControl, ActiveArea activeArea)
        {
            this.sceneDataControl         = sceneDataControl;
            this.activeArea               = activeArea;
            conditionsController          = new ConditionsController(new Conditions());
            this.influenceAreaDataControl = new InfluenceAreaDataControl(sceneDataControl, activeArea.getInfluenceArea(), this);
            descriptionsController        = new DescriptionsController(activeArea.getDescriptions());

            // Create subcontrollers
            actionsListDataControl = new ActionsListDataControl(activeArea.getActions(), this);
        }
        /**
         * Constructor.
         *
         * @param sceneDataControl
         *            Parent scene controller
         * @param activeArea
         *            Exit of the data control structure
         */
        public BarrierDataControl(SceneDataControl sceneDataControl, Barrier barrier)
        {
            this.sceneDataControl = sceneDataControl;
            this.barrier          = barrier;

            // Create subcontrollers
            Dictionary <string, ConditionsController.ConditionContextProperty> context1 = new Dictionary <string, ConditionsController.ConditionContextProperty>();

            ConditionsController.ConditionOwner parent = new ConditionsController.ConditionOwner(Controller.SCENE, sceneDataControl.getId());
            ConditionsController.ConditionOwner owner  = new ConditionsController.ConditionOwner(Controller.BARRIER, barrier.getId(), parent);

            context1.Add(ConditionsController.CONDITION_OWNER, owner);

            conditionsController = new ConditionsController(barrier.getConditions(), context1);

            descriptionController = new DescriptionsController(barrier.getDescriptions());

            //Barriers can only have name, and only one description, so we set selectedDEscription to 0
            descriptionController.setSelectedDescription(0);
        }
        /**
         * Constructor.
         *
         * @param item
         *            Contained item
         */
        public ItemDataControl(Item item)
        {
            this.item          = item;
            this.resourcesList = item.getResources();

            selectedResources = 0;

            // Add a new resource if the list is empty
            if (resourcesList.Count == 0)
            {
                resourcesList.Add(new ResourcesUni());
            }

            // Create the subcontrollers
            resourcesDataControlList = new List <ResourcesDataControl>();
            foreach (ResourcesUni resources in resourcesList)
            {
                resourcesDataControlList.Add(new ResourcesDataControl(resources, Controller.ITEM));
            }

            actionsListDataControl = new ActionsListDataControl(item.getActions(), this);

            descriptionController = new DescriptionsController(item.getDescriptions());
        }
Ejemplo n.º 5
0
 public RemoveDescriptionTool(DescriptionsController descriptionsController)
 {
     this.descriptionsController = descriptionsController;
 }
Ejemplo n.º 6
0
 public AddDescriptionTool(DescriptionsController descriptionsController)
 {
     this.descriptionsController = descriptionsController;
 }
Ejemplo n.º 7
0
 public DuplicateDescriptionTool(DescriptionsController descriptionsController)
 {
     this.descriptionsController = descriptionsController;
 }