private void Advanced_Changed(object sender, EventArgs e) { TextBox box = (TextBox)sender; DSA_ADVANCEDVALUES advanced = (DSA_ADVANCEDVALUES)box.Tag; box.Text = controller.Advanced(advanced, box.Text); }
public void ControllClass_SimpleTest_AdvancedValue() { for (int i = 0; i < Enum.GetNames(typeof(DSA_ADVANCEDVALUES)).Length; i++) { DSA_ADVANCEDVALUES x = (DSA_ADVANCEDVALUES)i; int y = random.Next(attrMax); int z = controll.AdvancedValueAKT(x, y.ToString()); int w = controll.AdvancedValueMOD(x); int v = controll.AdvancedValueMAX(x); if (x == DSA_ADVANCEDVALUES.BEHERSCHUNGSWERT || x == DSA_ADVANCEDVALUES.ENTRÜCKUNG || x == DSA_ADVANCEDVALUES.GESCHWINDIGKEIT) { Assert.AreEqual(y, z, 0, x.ToString()); Assert.AreEqual(0, w, 0, x.ToString()); Assert.AreEqual(y, v, 0, x.ToString()); } else { Assert.AreEqual(0, z, 0, x.ToString()); Assert.AreEqual(0, w, 0, x.ToString()); Assert.AreEqual(0, v, 0, x.ToString()); } } }
public String Advanced(DSA_ADVANCEDVALUES advanced, String value) { int x = convertToInt(value); feature.setAdvancedValues(advanced, x); return(Advanced(advanced)); }
public int getAdvancedValues(DSA_ADVANCEDVALUES value) { int x; advancedBonus.TryGetValue(value, out x); return(x); }
private void testFeatureAdvanced(Feature feature1, Feature feature2) { for (int i = 0; i < Enum.GetNames(typeof(DSA_ADVANCEDVALUES)).Length; i++) { DSA_ADVANCEDVALUES value = (DSA_ADVANCEDVALUES)i; Assert.AreEqual(feature1.getAdvancedValues(value), feature1.getAdvancedValues(value)); } }
public int AdvancedValueAKT(DSA_ADVANCEDVALUES advancedValue, string value) { var isNumeric = int.TryParse(value, out var value_out); if (isNumeric == true) { Charakter.setAdvancedValueAKT(advancedValue, value_out); } return(AdvancedValueAKT(advancedValue)); }
public void setAdvancedValueAKT(DSA_ADVANCEDVALUES type, int value) { switch (type) { case DSA_ADVANCEDVALUES.BEHERSCHUNGSWERT: this.Beherschungswert = value; break; case DSA_ADVANCEDVALUES.ENTRÜCKUNG: this.Entrückung = value; break; case DSA_ADVANCEDVALUES.GESCHWINDIGKEIT: this.Geschwindigkeit = value; break; } }
public int getAdvancedValueAKT(DSA_ADVANCEDVALUES value) { int ret = 0; switch (value) { case DSA_ADVANCEDVALUES.ATTACKE_BASIS: Double attacBasis = Convert.ToDouble(getAttribute_Max(DSA_ATTRIBUTE.MU) + getAttribute_Max(DSA_ATTRIBUTE.GE) + getAttribute_Max(DSA_ATTRIBUTE.KK)) / 5; ret = (int)Math.Ceiling(attacBasis); break; case DSA_ADVANCEDVALUES.PARADE_BASIS: Double paradeBasis = Convert.ToDouble(getAttribute_Max(DSA_ATTRIBUTE.IN) + getAttribute_Max(DSA_ATTRIBUTE.GE) + getAttribute_Max(DSA_ATTRIBUTE.KK)) / 5; ret = (int)Math.Ceiling(paradeBasis); break; case DSA_ADVANCEDVALUES.FERNKAMPF_BASIS: Double fernkampfBasis = Convert.ToDouble(getAttribute_Max(DSA_ATTRIBUTE.IN) + getAttribute_Max(DSA_ATTRIBUTE.FF) + getAttribute_Max(DSA_ATTRIBUTE.KK)) / 5; ret = (int)Math.Ceiling(fernkampfBasis); break; case DSA_ADVANCEDVALUES.INITATIVE_BASIS: Double initativeBasis = Convert.ToDouble(getAttribute_Max(DSA_ATTRIBUTE.MU) + getAttribute_Max(DSA_ATTRIBUTE.MU) + getAttribute_Max(DSA_ATTRIBUTE.IN) + getAttribute_Max(DSA_ATTRIBUTE.GE)) / 5; ret = (int)Math.Ceiling(initativeBasis); break; case DSA_ADVANCEDVALUES.BEHERSCHUNGSWERT: ret = (Beherschungswert); break; case DSA_ADVANCEDVALUES.ARTEFAKTKONTROLLE: Double artefaktkontrolle = Convert.ToDouble(getAttribute_Max(DSA_ATTRIBUTE.IN) + getEnergieMAX(DSA_ENERGIEN.MAGIERESISTENZ)); ret = (int)Math.Ceiling(artefaktkontrolle); break; case DSA_ADVANCEDVALUES.WUNDSCHWELLE: Double wundschwelle = Convert.ToDouble(getAttribute_Max(DSA_ATTRIBUTE.KO)) / 2; ret = (int)Math.Ceiling(wundschwelle); break; case DSA_ADVANCEDVALUES.ENTRÜCKUNG: ret = (Entrückung); break; case DSA_ADVANCEDVALUES.GESCHWINDIGKEIT: ret = (Geschwindigkeit); break; } return(ret); }
public void ControllView_CreateFeatureTests_setAdvanced() { Random rand = new Random(); ControllView_CreateFeature controll = new ControllView_CreateFeature(getTalentList()); Feature feature = new Feature(DSA_FEATURES.VORTEIL); controll.setFeature(feature); Assert.AreEqual(feature, controll.getFeature()); for (int i = 0; i < Enum.GetNames(typeof(DSA_ADVANCEDVALUES)).Length; i++) { int value = rand.Next(100); DSA_ADVANCEDVALUES type = (DSA_ADVANCEDVALUES)i; controll.Advanced(type, value.ToString()); Assert.AreEqual(value, feature.getAdvancedValues(type)); Assert.AreEqual(value.ToString(), controll.Advanced(type)); } }
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); }
private void loadFightingTalent(XmlNode FightingNode) { foreach (XmlNode node in FightingNode) { String[] NamesOFAdvantageElements = Enum.GetNames(typeof(DSA_ADVANCEDVALUES)); switch (node.Name) { case ManagmentXMLStrings.attack: for (int i = 0; i < NamesOFAdvantageElements.Length; i++) { if (0 == String.Compare(NamesOFAdvantageElements[i], node.InnerText)) { attace = (DSA_ADVANCEDVALUES)i; } } break; case ManagmentXMLStrings.Parade: parade = Convert.ToBoolean(node.InnerText); break; } } }
//Advanced############################################################################################################################################## public String Advanced(DSA_ADVANCEDVALUES advanced) { return(feature.getAdvancedValues(advanced).ToString()); }
public void setAdvancedValues(DSA_ADVANCEDVALUES values, int value) { value = checkValue(value); advancedBonus.Remove(values); advancedBonus.Add(values, value); }
public int AdvancedValueMAX(DSA_ADVANCEDVALUES advancedValue) { return(Charakter.getAdvancedValueMAX(advancedValue)); }
public int getAdvancedValueMAX(DSA_ADVANCEDVALUES value) { return(getAdvancedValueAKT(value) + getAdvancedValueMOD(value)); }
public int getAdvancedValueMOD(DSA_ADVANCEDVALUES value) { return(featureManagment.getAdvancedBonus(value)); }
public View_CreateFeature(ControllView_CreateFeature controller) { InitializeComponent(); this.controller = controller; List <InterfaceTalent> talentList = controller.getTalentList(); cbTalente.DataSource = talentList; ListTalente.Clear(); ListTalente.Columns.Add(new ColumnHeader().Text = "Name"); ListTalente.Columns.Add(new ColumnHeader().Text = "TaW"); txtName.Text = controller.FeatureName(); txtDescription.Text = controller.FeatureDescription(); txtGP.Text = controller.FeatureGP(); txtValue.Text = controller.FeatureValue(); txtName.KeyUp += txtName_TextChanged; txtDescription.KeyUp += txtDescription_TextChanged; txtGP.KeyUp += txtGP_TextChanged; txtValue.KeyUp += txtValue_TextChanged; attributeTextBoxes = new List <TextBox> { txtCharisma, txtFingerfertigkeit, txtGewandheit, txtIntuition, txtKonstitution, txtKörperkraft, txtKlugheit, txtMut, txtSozialstatus }; txtCharisma.Tag = DSA_ATTRIBUTE.CH; txtFingerfertigkeit.Tag = DSA_ATTRIBUTE.FF; txtGewandheit.Tag = DSA_ATTRIBUTE.GE; txtIntuition.Tag = DSA_ATTRIBUTE.IN; txtKörperkraft.Tag = DSA_ATTRIBUTE.KK; txtKlugheit.Tag = DSA_ATTRIBUTE.KL; txtKonstitution.Tag = DSA_ATTRIBUTE.KO; txtMut.Tag = DSA_ATTRIBUTE.MU; txtSozialstatus.Tag = DSA_ATTRIBUTE.SO; for (int i = 0; i < attributeTextBoxes.Count; i++) { DSA_ATTRIBUTE attr = (DSA_ATTRIBUTE)attributeTextBoxes[i].Tag; attributeTextBoxes[i].Text = controller.Attribute(attr); attributeTextBoxes[i].KeyUp += Attribute_Changed; } energieTextBoxes = new List <TextBox> { txtAstralenergie, txtAusdauer, txtKarmaenergie, txtLebensenergie, txtMagieresistenz }; txtAstralenergie.Tag = DSA_ENERGIEN.ASTRALENERGIE; txtAusdauer.Tag = DSA_ENERGIEN.AUSDAUER; txtKarmaenergie.Tag = DSA_ENERGIEN.KARMAENERGIE; txtLebensenergie.Tag = DSA_ENERGIEN.LEBENSENERGIE; txtMagieresistenz.Tag = DSA_ENERGIEN.MAGIERESISTENZ; for (int i = 0; i < energieTextBoxes.Count; i++) { DSA_ENERGIEN energ = (DSA_ENERGIEN)energieTextBoxes[i].Tag; energieTextBoxes[i].Text = controller.Energie(energ); energieTextBoxes[i].KeyUp += Energie_Changed; } advancedTextBoxes = new List <TextBox> { txtAttacke, txtParade, txtFernkampf, txtInitiative, txtBeherschungswert, txtArtefaktKontrolle, txtWundschwelle, txtEntrückung, txtGeschwindigkeit }; txtAttacke.Tag = DSA_ADVANCEDVALUES.ATTACKE_BASIS; txtParade.Tag = DSA_ADVANCEDVALUES.PARADE_BASIS; txtFernkampf.Tag = DSA_ADVANCEDVALUES.FERNKAMPF_BASIS; txtInitiative.Tag = DSA_ADVANCEDVALUES.INITATIVE_BASIS; txtBeherschungswert.Tag = DSA_ADVANCEDVALUES.BEHERSCHUNGSWERT; txtArtefaktKontrolle.Tag = DSA_ADVANCEDVALUES.ARTEFAKTKONTROLLE; txtWundschwelle.Tag = DSA_ADVANCEDVALUES.WUNDSCHWELLE; txtEntrückung.Tag = DSA_ADVANCEDVALUES.ENTRÜCKUNG; txtGeschwindigkeit.Tag = DSA_ADVANCEDVALUES.GESCHWINDIGKEIT; for (int i = 0; i < advancedTextBoxes.Count; i++) { DSA_ADVANCEDVALUES advanced = (DSA_ADVANCEDVALUES)advancedTextBoxes[i].Tag; advancedTextBoxes[i].Text = controller.Advanced(advanced); advancedTextBoxes[i].KeyUp += Advanced_Changed; } List <String> talenteWithBonus = controller.TalentewithBonus(); foreach (String talent in talenteWithBonus) { ListViewItem lvi = new ListViewItem(); lvi.Text = talent; lvi.SubItems.Add(controller.getTawBonus(talent).ToString()); ListTalente.Items.Add(lvi); } }
public TalentRange(String name, String be, List <TalentDeviate> diverates, DSA_ADVANCEDVALUES at, bool parade) : base(name, be, diverates, at, parade) { }