public Coefficient copy(Coefficient coef) { Coefficient copyCoefficient = (Coefficient)base.copy(coef); copyCoefficient.is_constant = this.is_constant; copyCoefficient.Denominator = this.Denominator; copyCoefficient.ItsConstantNum = this.ItsConstantNum; copyCoefficient.NumberOfDice = this.NumberOfDice; copyCoefficient.DiceType = this.DiceType; return copyCoefficient; }
public bool changeCoefficient(string name, Coefficient newCoef) { if (isGoverningAttribute(name)) { changeCoefficient(getAttribute(name), newCoef); return true; } else return false; }
public new void fromXml(XmlNode node) { base.fromXml(node); XmlNodeList attributeList = ((XmlElement)((XmlElement)node). GetElementsByTagName("Governing_Attributes").Item(0)).GetElementsByTagName("Attribute"); Attribute currentAtt; foreach (XmlNode attributeNode in attributeList) { currentAtt = new Attribute(); currentAtt.fromXml(attributeNode); itsGoverningAttributes.addOrSet(currentAtt); } XmlNodeList statList = ((XmlElement)((XmlElement)node). GetElementsByTagName("Governing_Stats").Item(0)).GetElementsByTagName("Stat"); Stat currentStat; foreach (XmlNode Node in statList) { currentStat = new Stat(); currentStat.fromXml(Node); itsGoverningStats.addOrSet(currentStat); } XmlNodeList coefficientList = ((XmlElement)((XmlElement)node). GetElementsByTagName("Coefficients").Item(0)).GetElementsByTagName("Coefficient"); Coefficient currentCoefficient; foreach (XmlNode Node in coefficientList) { currentCoefficient = new Coefficient(); currentCoefficient.fromXml(Node); this.itsAtt_Coefficients.add(currentCoefficient); } }
public bool changeCoefficient(Attribute modAttribute, Coefficient newCoef) { Coefficient current=itsAtt_Coefficients.find(modAttribute.Name); current=newCoef;//if its found, then its set, if not then current is null and nothing happens return (current==null); }