private void CleanValues()
 {
     ActionAdd.CleanValues();
     ObservationAdd.CleanValues();
     ActionList.CleanValues();
     LabelValidationScenario.Content = String.Empty;
 }
        //
        public virtual ResourceCreator.Action CreateAddAction(DrawElement obj, IDrawElementList parent)
        {
            ActionAdd action = new ActionAdd(this);

            action.m_Parent = parent;
            action.Model    = obj;
            return(action);
        }
        public void HasDescription()
        {
            // arrange
            ActionAdd action = new ActionAdd(this.Writer);

            // act

            // assert
            Assert.IsFalse(String.IsNullOrEmpty(action.Description));
        }
        public void HasCorrectName()
        {
            // arrange
            ActionAdd action = new ActionAdd(this.Writer);

            // act

            // assert
            Assert.AreEqual("Add", action.Name);
        }
        public void Initialize(List <Fluent> fluents, List <WorldAction> actions, List <WorldDescriptionRecord> statements, int maxTime)
        {
            ActionAdd.SetActions(actions);
            _scenarioDescription = new ScenarioDescription();
            _fluents             = fluents;

            InitializeStatements(statements);
            this.ObservationAdd.Fluents = new ObservableCollection <Fluent>(fluents);
            this.ActionAdd.MaxTime      = maxTime;
            this.ObservationAdd.MaxTime = maxTime;
        }
 private void ButtonAddAction_Click(object sender, RoutedEventArgs e)
 {
     if (ActionAdd.SelectedWARecordType == null)
     {
         ActionAdd.LabelValidation.Content = "It is necessary to choose an action.";
     }
     else if (ActionList.AddAction(ActionAdd.Time, ActionAdd.SelectedWARecordType.Id, ActionAdd.SelectedWARecordType.Duration))
     {
         _scenarioDescription.addACS(ActionAdd.SelectedWARecordType, ActionAdd.Time);
         ActionAdd.CleanValues();
     }
     else
     {
         ActionAdd.LabelValidation.Content = "Two actions at the some time are forbidden.";
     }
 }
        public void Compute()
        {
            // arrange
            ActionAdd action = new ActionAdd(this.Writer);

            // act
            action.Action(3, 5);
            action.Action(0, 0);
            action.Action(1, 5);
            action.Action(-3, 5);

            // assert
            Assert.AreEqual("8", this.Lines[0]);
            Assert.AreEqual("0", this.Lines[1]);
            Assert.AreEqual("6", this.Lines[2]);
            Assert.AreEqual("2", this.Lines[3]);
        }
Exemple #8
0
 ActionBase IActionVisitor <XElement, ActionBase> .Visit(ActionAdd action, XElement xAction)
 {
     return(action);
 }
Exemple #9
0
 XElement IActionVisitor <XElement, XElement> .Visit(ActionAdd action, XElement arg)
 {
     return(arg);
 }