private void AddEffects(WorldModelAsset wm) { var a1 = EventHelper.ActionEnd("John", "Speak([x],[y],*,*)", "Sarah"); var a2 = EventHelper.ActionEnd("John", "Shoot", "Sarah"); var a3 = (Name)"Event(Action-End , [s], *, John)"; var a4 = (Name)"Event(Action-End , [s], Surf, [t])"; wm.addActionTemplate(a1, 1); wm.addActionTemplate(a2, 1); wm.addActionTemplate(a3, 1); wm.addActionTemplate(a4, 1); wm.AddActionEffect(a1, new EffectDTO() { PropertyName = (Name)"Has(Floor)", NewValue = (Name)"Player" }); wm.AddActionEffect(a2, new EffectDTO() { PropertyName = (Name)"DialogueState(Player)", NewValue = (Name)"Start" }); wm.AddActionEffect(a3, new EffectDTO() { PropertyName = (Name)"Has(Floor)", NewValue = (Name)"False" }); wm.AddActionEffect(a4, new EffectDTO() { PropertyName = (Name)"DialogueState([t])", NewValue = (Name)"[s]" }); }
private void addOrEditButton_Click_1(object sender, EventArgs e) { if (this.Text != "Update") { _eventTemplate = WellFormedNames.Name.BuildName( (Name)AMConsts.EVENT, (Name)"Action-End", textBoxSubject.Value, textBoxObject.Value, textBoxTarget.Value); _asset.addActionTemplate(_eventTemplate, priorityFieldBox.Value); } else { var _pastTemplate = _eventTemplate; _eventTemplate = WellFormedNames.Name.BuildName( (Name)AMConsts.EVENT, (Name)"Action-End", textBoxSubject.Value, textBoxObject.Value, textBoxTarget.Value); _asset.UpdateActionTemplate(_pastTemplate, _eventTemplate, priorityFieldBox.Value); } Close(); }
private void button3_Click(object sender, EventArgs e) // Duplicate Action { var index = dataGridViewEventTemplates.SelectedRows[0].Index; var eventTemp = _wmAsset.GetAllActions().ElementAt(index).Item1; //Cant add events with the same name so I have to rework their variables string newActionName = "Duplicate" + eventTemp.GetNTerm(3).ToString(); var newEventTemp = WellFormedNames.Name.BuildName( (Name)AMConsts.EVENT, (Name)"Action-End", eventTemp.GetNTerm(2), (Name)newActionName, eventTemp.GetNTerm(4)); var priority = _wmAsset.GetAllActions().ElementAt(index).Item2; _wmAsset.addActionTemplate((Name)newEventTemp, priority); _wmAsset.AddActionEffects((Name)newEventTemp, _wmAsset.GetAllEventEffects()[eventTemp].ToList()); RefreshEventList(); }