private static Feature loadFeature(XmlNode featureNode, Charakter charakter, int number, DSA_FEATURES type) { Feature feature = new Feature(type); foreach (XmlNode node in featureNode) { switch (node.Name) { case ManagmentXMLStrings.Name: feature.setName(node.InnerText); break; case ManagmentXMLStrings.Description: feature.setDescription(node.InnerText); break; case ManagmentXMLStrings.Value: feature.setValue(node.InnerText); break; case ManagmentXMLStrings.GP: feature.setGP(node.InnerText); break; case ManagmentXMLStrings.AttributeElement: LoadAttribute(node, feature); break; case ManagmentXMLStrings.EnergienElement: LoadEnergien(node, feature); break; case ManagmentXMLStrings.AdvancedElement: LoadFeatureAdvanced(node, feature); break; case ManagmentXMLStrings.Talente: LoadFeatureTalente(node, charakter, feature); break; } } return(feature); }
public Feature editFeature(Feature feature) { /*Clone Feature* -> Nötig wegen Elementaren Fehler im Manager*/ Feature cloneFeature = new Feature(feature.getFeatureType()); cloneFeature.setName(feature.getName()); cloneFeature.setDescription(feature.getSimpleDescription()); cloneFeature.setGP(feature.getGP()); cloneFeature.setValue(feature.getValue()); for (int i = 0; i < Enum.GetNames(typeof(DSA_ATTRIBUTE)).Length; i++) { DSA_ATTRIBUTE type = (DSA_ATTRIBUTE)i; cloneFeature.setAttributeBonus(type, feature.getAttributeBonus(type)); } for (int i = 0; i < Enum.GetNames(typeof(DSA_ENERGIEN)).Length; i++) { DSA_ENERGIEN type = (DSA_ENERGIEN)i; cloneFeature.setEnergieBonus(type, feature.getEnergieBonus(type)); } for (int i = 0; i < Enum.GetNames(typeof(DSA_ADVANCEDVALUES)).Length; i++) { DSA_ADVANCEDVALUES type = (DSA_ADVANCEDVALUES)i; cloneFeature.setAdvancedValues(type, feature.getAdvancedValues(type)); } List <InterfaceTalent> list = feature.getTalentListwithBonus(); for (int i = 0; i < list.Count; i++) { cloneFeature.addTalent(list[i], feature.getTaWBonus(list[i])); } this.feature = cloneFeature; View_CreateFeature Form = new View_CreateFeature(this); Form.ShowDialog(); return(this.feature); }
public String FeatureDescription(String description) { feature.setDescription(description); return(FeatureDescription()); }