public override bool Equals(object o) { if (o is AHFloat) { AHFloat b = (AHFloat)o; return(this.v == b.v); } else { return(false); } }
public virtual void SetBaseProperty() { //从配置表中获得人物基础属性 for (int i = 1; i < propertys.propertyValues.Length; i++) { if (!ConfigManager.propertyConfManager.dataMap.ContainsKey(i)) { continue; } PropertyConf pconf = ConfigManager.propertyConfManager.dataMap[i]; AHFloat val = conf.propertyValues[i]; if (this.isElite) { val *= 2f; } if (pconf.formula != 2) { if (pconf.formula == 1) { propertys.propertyValues[i] = (1f - val / 100f); } else { propertys.propertyValues[i] = val; } } else { propertys.propertyValues[i] = 0; } } float baselife = propertys.propertyValues[(int)enCharacterProperty.life]; propertys.propertyValues[(int)enCharacterProperty.life] = this.level * this.level * baselife / 2 + baselife; float baseforce = propertys.propertyValues[(int)enCharacterProperty.atkForce]; propertys.propertyValues[(int)enCharacterProperty.atkForce] = this.level * this.level * baseforce / 10 + baseforce; //附加属性 if (data == null) { return; } foreach (KeyValuePair <int, float> kv in data.additionPropertyList) { AddPropertyVal(kv.Key, kv.Value, 1); } }
public void Deserialize(DataStream stream) { short type = stream.ReadSInt16(); while (type != -1) { switch (type) { case 1: id = stream.ReadSInt32(); break; case 2: val = (float)stream.ReadSInt32() / 1000f; break; } type = stream.ReadSInt16(); } //Debug.Log("EquipProperty : " + id + " val1,val2,val3 : " + val1 + "/" + val2 + "/" + val3); }
public bool Equals(AHFloat b) { return((object)b != null && v == b.v); }