Esempio n. 1
0
        private void ConditionSetView_OnDataChanged()
        {
            var selectedRule = EditorTools.GetSelectedDtoFromTable <SocialExchangeDTO>(gridSocialExchanges);

            if (selectedRule == null)
            {
                return;
            }
            selectedRule.StartingConditions = conditions.GetData();
            _loadedAsset.AddOrUpdateExchange(selectedRule);
            this._socialExchangeList.DataSource = _loadedAsset.GetAllSocialExchanges().ToList();
            this._socialExchangeList.Refresh();
        }
Esempio n. 2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            var steps = stepsTextBox.Text.ToString().Split(',');

            List <WellFormedNames.Name> _steps = new List <WellFormedNames.Name>();

            foreach (var s in steps)
            {
                var text = s.ToString().Trim();
                if (text != "" && text != null && text != " ")
                {
                    _steps.Add((WellFormedNames.Name)text);
                }
            }

            try
            {
                dto.Name        = nameTextBox.Value;
                dto.Description = textBoxDescription.Text;
                dto.Steps       = _steps;
                dto.Target      = wfNameTarget.Value;
                UpdatedGuid     = asset.AddOrUpdateExchange(dto);
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Resources.ErrorDialogTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     try
     {
         dto.Name        = nameTextBox.Value;
         dto.Description = textBoxDescription.Text;
         dto.Steps       = stepsTextBox.Text;
         dto.Target      = wfNameTarget.Value;
         dto.Id          = asset.AddOrUpdateExchange(dto);
         UpdatedGuid     = dto.Id;
         Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Resources.ErrorDialogTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 4
0
        private static CommeillFautAsset BuildCIFAsset()
        {
            var seDTO = new SocialExchangeDTO()
            {
                Name        = Name.BuildName("Flirt"),
                Description = "When I'm atracted to...",


                Target             = Name.BuildName("[t]"),
                StartingConditions = new Conditions.DTOs.ConditionSetDTO()
                {
                    ConditionSet = new string[] { "Has(Floor) = SELF" }
                },
                Steps = new List <Name>()
                {
                    (Name)"Start", (Name)"Answer", (Name)"Finish"
                },
                InfluenceRules = new List <InfluenceRuleDTO>()
                {
                    new InfluenceRuleDTO()
                    {
                        Value = 5,
                        Mode  = (Name)"General",
                        Rule  = new Conditions.DTOs.ConditionSetDTO()

                        {
                            ConditionSet = new string[] { "Likes([t]) = True" }
                        }
                    },

                    new InfluenceRuleDTO()
                    {
                        Value = 10,
                        Mode  = (Name)"Love",
                        Rule  = new Conditions.DTOs.ConditionSetDTO()

                        {
                            ConditionSet = new string[] { "Likes([t]) = True", "EventId(Action-End, [i], Speak(*, *, *, *), [t])>0" }
                        }
                    }
                }
            };

            var cif1 = new CommeillFautAsset();

            cif1.AddOrUpdateExchange(seDTO);



            var seDTO2 = new SocialExchangeDTO()
            {
                Name        = Name.BuildName("Insult"),
                Description = "I hate you ",


                Target             = Name.BuildName("[t]"),
                StartingConditions = new Conditions.DTOs.ConditionSetDTO()
                {
                    ConditionSet = new string[] { "IsAgent(SELF) = True" }
                },
                Steps = new List <Name>()
                {
                    (Name)"Start"
                },
                InfluenceRules = new List <InfluenceRuleDTO>()
                {
                    new InfluenceRuleDTO()
                    {
                        Value = 4,
                        Rule  = new Conditions.DTOs.ConditionSetDTO()

                        {
                            ConditionSet = new string[] { "Likes([t]) = False" }
                        }
                    }
                }
            };

            cif1.AddOrUpdateExchange(seDTO2);

            return(cif1);
        }