示例#1
0
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     foreach (Description d in  descriptions)
     {
         ConditionsController.updateVarFlagSummary(varFlagSummary, d.getConditions());
     }
 }
示例#2
0
    /**
     * Contructor.
     *
     * @param timer
     *            Timer structure
     */

    public TimerDataControl(Timer timer)
    {
        this.timer = timer;

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

        ConditionsController.ConditionOwner owner = new ConditionsController.ConditionOwner(Controller.TIMER,
                                                                                            timer.getDisplayName());
        context1.Add(ConditionsController.CONDITION_OWNER, owner);
        ConditionsController.ConditionCustomMessage cMessage1 =
            new ConditionsController.ConditionCustomMessage(TC.get("Conditions.Context.1A.44"),
                                                            TC.get("Conditions.Context.2A.44"));
        context1.Add(ConditionsController.CONDITION_CUSTOM_MESSAGE, cMessage1);

        Dictionary <string, ConditionsController.ConditionContextProperty> context2 =
            new Dictionary <string, ConditionsController.ConditionContextProperty>();

        context2.Add(ConditionsController.CONDITION_OWNER, owner);
        ConditionsController.ConditionCustomMessage cMessage2 =
            new ConditionsController.ConditionCustomMessage(TC.get("Conditions.Context.1B.44"),
                                                            TC.get("Conditions.Context.2B.44"));
        context2.Add(ConditionsController.CONDITION_CUSTOM_MESSAGE, cMessage2);

        initConditionsController = new ConditionsController(timer.getInitCond(), context1);
        endConditionsController  = new ConditionsController(timer.getEndCond(), context2);
        effectsController        = new EffectsController(timer.getEffects());
        postEffectsController    = new EffectsController(timer.getPostEffects());
    }
示例#3
0
 public GeoActionDataControl(GeoAction geoAction)
 {
     this.geoAction            = geoAction;
     this.Type                 = geoAction.Name;
     this.conditionsController = new ConditionsController(geoAction.Conditions);
     this.effectsController    = new EffectsController(geoAction.Effects);
 }
示例#4
0
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     // Update the summary with conditions and both blocks of effects
     ConditionsController.updateVarFlagSummary(varFlagSummary, timer.getInitCond());
     ConditionsController.updateVarFlagSummary(varFlagSummary, timer.getEndCond());
     EffectsController.updateVarFlagSummary(varFlagSummary, timer.getEffects());
     EffectsController.updateVarFlagSummary(varFlagSummary, timer.getPostEffects());
 }
示例#5
0
 public override bool doTool()
 {
     lineDeleted = parent.getLine(lineIndex);
     parent.removeLine(lineIndex);
     conditionDeleted = node[lineIndex];
     node.RemoveAt(lineIndex);
     return(true);
 }
示例#6
0
    public void Init(ConditionsController con)
    {
        editor   = EditorWindow.GetWindow <ConditionEditorWindow>();
        editor.s = Color.black;

        editor.Conditions = con.Conditions;

        ConditionEditorFactory.Intance.ResetInstance();
    }
 public override bool doTool()
 {
     effectDeleted = effects.getEffects()[index];
     effects.getEffects().RemoveAt(index);
     condition = conditions[index];
     conditions.RemoveAt(index);
     updateVarFlagSummary((Effect)effectDeleted);
     return(true);
 }
示例#8
0
    /**
     * 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);
    }
    public override bool doTool()
    {
        effects.add(effectToAdd);
        if (conditions != null)
        {
            condition = new ConditionsController(effectToAdd.getConditions(), Controller.EFFECT, EffectsController.getEffectInfo(effectToAdd));
            conditions.Add(condition);
        }

        return(true);
    }
示例#10
0
        public ConditionsControllerTests()
        {
            _mockConditionService = new Mock <IConditionService>();
            _mockConditionService.Setup(c => c.Save()).ReturnsAsync(true);

            _controller = new ConditionsController(_mockConditionService.Object, _mapper);
            SetupTestController(_controller);

            _builder                  = new ConditionTestBuilder();
            resourceParameters        = new ConditionsResourceParameters();
            resourceParameters.Fields = "Id, Grade";
        }
    public DescriptionController(Description description)
    {
        this.description = description;

        if (description.getConditions() == null)
        {
            description.setConditions(new Conditions());
        }


        conditionsController = new ConditionsController(description.getConditions());
    }
示例#12
0
    /**
     * Returns the conditions of the element reference.
     *
     * @return Conditions of the element reference
     */
    public ConditionsController getConditions()
    {
        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.ACTIVE_AREA, activeArea.getId(), parent);

        context1.Add(ConditionsController.CONDITION_OWNER, owner);
        conditionsController = new ConditionsController(activeArea.getConditions(), context1);

        return(conditionsController);
    }
    /**
     * Returns the conditions of the element reference.
     *
     * @return Conditions of the element reference
     */
    public ConditionsController getConditions()
    {
        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.EXIT, exit.getNextSceneId(), parent);
        context1.Add(ConditionsController.CONDITION_OWNER, owner);

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

        return(conditionsController);
    }
    /**
     * Constructor.
     *
     * @param sceneDataControl
     *            Parent scene controller
     * @param exit
     *            Exit of the data control structure
     */
    public ExitDataControl(SceneDataControl sceneDataControl, Exit exit)
    {
        this.sceneDataControl = sceneDataControl;
        this.exit             = exit;

        this.influenceAreaDataControl = new InfluenceAreaDataControl(sceneDataControl, exit.getInfluenceArea(), this);
        effectsController             = new EffectsController(exit.getEffects());
        postEffectsController         = new EffectsController(exit.getPostEffects());
        notEffectsController          = new EffectsController(exit.getNotEffects());
        conditionsController          = new ConditionsController(new Conditions());
        exitLookDataControl           = new ExitLookDataControl(exit);
    }
    /**
     * Contructor.
     *
     * @param action
     *            Next scenes of the data control structure
     *
     *
     */
    public ActionDataControl(Action action, string name)
    {
        this.action = action;

        this.resourcesList            = new List <ResourcesUni>();
        this.resourcesDataControlList = new List <ResourcesDataControl>();

        actionType = Controller.ACTION_TALK_TO;

        // Create subcontrollers
        conditionsController = new ConditionsController(action.getConditions(), actionType, name);
        effectsController    = new EffectsController(action.getEffects());
        notEffectsController = new EffectsController(action.getNotEffects());
    }
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     ConditionsController.updateVarFlagSummary(varFlagSummary, exit.getConditions());
     if (exit.getEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, exit.getEffects());
     }
     if (exit.getPostEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, exit.getPostEffects());
     }
     if (exit.getNotEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, exit.getNotEffects());
     }
 }
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     // Update the flag summary with the effects of the action
     EffectsController.updateVarFlagSummary(varFlagSummary, action.getEffects());
     if (action.getNotEffects() != null)
     {
         EffectsController.updateVarFlagSummary(varFlagSummary, action.getNotEffects());
     }
     ConditionsController.updateVarFlagSummary(varFlagSummary, action.getConditions());
     if (action.getType() == Action.CUSTOM_INTERACT || action.getType() == Action.CUSTOM)
     {
         foreach (ResourcesDataControl resourcesDataControl in resourcesDataControlList)
         {
             resourcesDataControl.updateVarFlagSummary(varFlagSummary);
         }
     }
 }
示例#18
0
        //TODO AH need to refactor for loops to surround this once then test the whole?
        public void NextGeneration()
        {
            var conditionCommands = new ConditionsController(GameState).CreateCommands();

            for (int x = 0; x < GameState.State.GetLength(1) - 1; x++)
            {
                for (int y = 0; y < GameState.State.GetLength(0) - 1; y++)
                {
                    foreach (var condition in conditionCommands)
                    {
                        condition.CheckCondition(x, y);
                    }
                }
            }

            GameState.UpdateCurrentState();
        }
示例#19
0
    /**
     * 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);
    }
示例#20
0
    /**
     * Contructor.
     *
     * @param sceneDataControl
     *            Parent scene controller
     * @param elementReference
     *            Element reference of the data control structure
     */
    public ElementReferenceDataControl(SceneDataControl sceneDataControl, ElementReference elementReference, int type, int referenceNumber)
    {
        this.sceneDataControl = sceneDataControl;
        this.elementReference = elementReference;
        this.type             = type;
        this.visible          = true;
        if (type == Controller.ITEM_REFERENCE || type == Controller.NPC_REFERENCE)
        {
            this.influenceAreaDataControl = new InfluenceAreaDataControl(sceneDataControl, elementReference.getInfluenceArea(), this);
        }

        // 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(type, elementReference.getTargetId(), parent);
        context1.Add(ConditionsController.CONDITION_OWNER, owner);

        conditionsController = new ConditionsController(elementReference.getConditions(), context1);
    }
    public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
    {
        // Check every node on the conversation
        List <ConversationNode> conversationNodes = graphConversation.getAllNodes();

        foreach (ConversationNode conversationNode in conversationNodes)
        {
            // Update the summary with the effects, if avalaible
            if (conversationNode.hasEffects())
            {
                EffectsController.updateVarFlagSummary(varFlagSummary, conversationNode.getEffects());
            }

            // Update the summary with the conditions of the lines
            for (int i = 0; i < conversationNode.getLineCount(); i++)
            {
                ConditionsController.updateVarFlagSummary(varFlagSummary, conversationNode.getLineConditions(i));
            }
        }
    }
示例#22
0
 protected void check(ConditionsController conditions, string desc)
 {
     for (int i = 0; i < conditions.getBlocksCount(); i++)
     {
         for (int j = 0; j < conditions.getConditionCount(i); j++)
         {
             Dictionary <string, string> properties = conditions.getCondition(i, j);
             if (properties.ContainsKey(ConditionsController.CONDITION_ID))
             {
                 check(properties[ConditionsController.CONDITION_ID], desc + " (ID)");
             }
             if (properties.ContainsKey(ConditionsController.CONDITION_STATE))
             {
                 // CHECK!!!
                 check(properties[ConditionsController.CONDITION_STATE], desc + " ()");
             }
             if (properties.ContainsKey(ConditionsController.CONDITION_VALUE))
             {
                 // CHECK!!!
                 check(properties[ConditionsController.CONDITION_VALUE], desc + " ()");
             }
         }
     }
 }
示例#23
0
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     ConditionsController.updateVarFlagSummary(varFlagSummary, conditionsController.Conditions);
 }
 public void setConditions(ConditionsController conditions)
 {
     milestone.setConditions(conditions.Conditions);
     this.conditionsController = conditions;
 }
示例#25
0
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     actionsListDataControl.updateVarFlagSummary(varFlagSummary);
     ConditionsController.updateVarFlagSummary(varFlagSummary, activeArea.getConditions());
     descriptionsController.updateVarFlagSummary(varFlagSummary);
 }
示例#26
0
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     // Update the flag summary with the conditions
     ConditionsController.updateVarFlagSummary(varFlagSummary, elementReference.getConditions());
 }
    public override bool doTool()
    {
        Condition newCondition = null;
        int       type         = ConditionsController.getTypeFromstring(conditionType);

        if (type == ConditionsController.FLAG_CONDITION)
        {
            newCondition = new FlagCondition(conditionId, ConditionsController.getStateFromstring(conditionState));
        }
        else if (type == ConditionsController.VAR_CONDITION)
        {
            newCondition = new VarCondition(conditionId, ConditionsController.getStateFromstring(conditionState), int.Parse(value));
        }
        else if (type == ConditionsController.GLOBAL_STATE_CONDITION)
        {
            newCondition = new GlobalStateCondition(conditionId, ConditionsController.getStateFromstring(conditionState));
        }

        if (newCondition != null)
        {
            if (index1 < conditions.size())
            {
                if (index2 == ConditionsController.INDEX_NOT_USED)
                {
                    // Add new block
                    List <Condition> newBlock = new List <Condition>();
                    newBlock.Add(newCondition);
                    conditions.add(index1, newBlock);
                    indexAdded = index1;
                    blockAdded = newBlock;
                }
                else
                {
                    List <Condition> block = conditions.get(index1);
                    if (index2 < 0 || index2 > block.Count)
                    {
                        return(false);
                    }

                    if (index2 == conditions.size())
                    {
                        block.Add(newCondition);
                        indexAdded     = block.IndexOf(newCondition);
                        conditionAdded = newCondition;
                    }
                    else
                    {
                        indexAdded     = index2;
                        conditionAdded = newCondition;
                        block.Insert(index2, newCondition);
                    }
                }
            }
            else
            {
                // Add new block
                List <Condition> newBlock = new List <Condition>();
                newBlock.Add(newCondition);
                conditions.add(newBlock);
                indexAdded = conditions.size() - 1;
                blockAdded = newBlock;
            }
            Controller.getInstance().updateVarFlagSummary();
            Controller.getInstance().updatePanel();
            return(true);
        }
        return(false);
    }
 void Awake()
 {
     active = this;
     initialConditionsPresets = GetInitialConditionsPresets();
 }
示例#29
0
 public override void updateVarFlagSummary(VarFlagSummary varFlagSummary)
 {
     ConditionsController.updateVarFlagSummary(varFlagSummary, barrier.getConditions());
 }
示例#30
0
 public GMLGeometryDataControl(GMLGeometry gmlGeometry)
 {
     this.gmlGeometry          = gmlGeometry;
     this.conditionsController = new ConditionsController(gmlGeometry.Conditions);
 }