public void AddProperty(Pathea.AttribType property, float v) { if (HasProperty(property)) { SetProperty(property, v); } PropertyValue[] newPropertys; if (mPropertys == null) { newPropertys = new PropertyValue[1]; } else { newPropertys = new PropertyValue[mPropertys.Length + 1]; Array.Copy(mPropertys, newPropertys, mPropertys.Length); } mPropertys = newPropertys; mPropertys[mPropertys.Length - 1] = new PropertyValue() { type = property, value = v }; }
public override float GetAttribute(Pathea.AttribType type, bool isBase = false) { if (type == Pathea.AttribType.Atk) { return(GetBaseAtk()); } return(base.GetAttribute(type, isBase)); }
public virtual void SetAttribute(Pathea.AttribType type, float value, bool isBase = true) { if (null != _SkEntity) { if (isBase) { _SkEntity.attribs.raws[(int)type] = value; } _SkEntity.attribs.sums[(int)type] = value; } }
public virtual float GetAttribute(Pathea.AttribType type, bool isBase = false) { if (null != _SkEntity) { if (isBase) { return(_SkEntity.attribs.raws[(int)type]); } return(_SkEntity.attribs.sums[(int)type]); } return(0); }
static float[] ReadFromDb(Mono.Data.SqliteClient.SqliteDataReader reader) { float[] attributeArray = new float[(int)Pathea.AttribType.Max]; for (int i = (int)Pathea.AttribType.HpMax; i < (int)Pathea.AttribType.Max; i++) { Pathea.AttribType a = (Pathea.AttribType)i; string attributeName = a.ToString(); attributeArray[i] = System.Convert.ToSingle(reader.GetString(reader.GetOrdinal(attributeName))); } return(attributeArray); }
public bool HasProperty(Pathea.AttribType property) { if (null == mPropertys) { return(false); } foreach (PropertyValue value in mPropertys) { if (value.type == property) { return(true); } } return(false); }
public float GetProperty(Pathea.AttribType property) { if (null == mPropertys) { return(0f); } foreach (PropertyValue value in mPropertys) { if (value.type == property) { return(value.value); } } return(0f); }
public void SetProperty(Pathea.AttribType property, float value) { if (!HasProperty(property)) { AddProperty(property, value); } if (null == mPropertys) { mPropertys = new PropertyValue[1]; } foreach (PropertyValue v in mPropertys) { if (v.type == property) { v.value = value; } } }