private GENpc.GEItemAction ProcessActions(ItemActionsType action, string parentId) { GEAction actionBase = ProcessActions((ActionsType)action, parentId); List <GENpc.GEItemAction.GEEquipItem> equipItems = new List <GENpc.GEItemAction.GEEquipItem>(); foreach (ItemActionsTypeEquipItem equipItem in action.equipItem) { equipItems.Add(new GENpc.GEItemAction.GEEquipItem(equipItem.refId, equipItem.value)); } GENpc.GEItemAction newAction = new GENpc.GEItemAction(elementManager, null, actionBase.Activations, actionBase.PropertySetters, actionBase.SaveAction, equipItems, actionBase.UseInterval); OnReferenceProcessing += delegate(object o, EventArgs e) { newAction.ResponseText = elementManager.GetTextElement(action.responseTextId); }; return(newAction); }
private GEAction ProcessActions(ActionsType actions, string parentId) { List <GEAction.GEActivation> activations = new List <GEAction.GEActivation>(); foreach (ActionsTypeSetActive activation in actions.setActive) { ActivationSetEnum vEnum = activation.value; bool?value = null; if (vEnum != ActivationSetEnum.@switch) { value = vEnum == ActivationSetEnum.@true ? true : false; } activations.Add(new GEAction.GEActivation(activation.refId, value)); } List <GEAction.GEPropertySetter> propSetter = new List <GEAction.GEPropertySetter>(); foreach (ActionsTypeSetPropertyValue prop in actions.setPropertyValue) { GEAction.PropertyChangeType propEnum = GEAction.PropertyChangeType.SET; PropertyChangeEnum change = prop.change; if (!change.Equals(PropertyChangeEnum.set)) { propEnum = change.Equals(PropertyChangeEnum.inc) ? GEAction.PropertyChangeType.SET : GEAction.PropertyChangeType.DEC; } propSetter.Add(new GEAction.GEPropertySetter(prop.refId, propEnum, prop.value)); } GEAction.GESaveAction saveAction = null; if (actions.SaveGame != null) { saveAction = new GEAction.GESaveAction(actions.SaveGame.isAutoSave, parentId); } GEAction processedAction = new GEAction(elementManager, null, activations, propSetter, saveAction, actions.onUseIntervalTo); OnReferenceProcessing += delegate(object o, EventArgs e) { processedAction.ResponseText = elementManager.GetTextElement(actions.responseTextId); }; return(processedAction); }