Example #1
0
            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
                };
            }
Example #2
0
 public override float GetAttribute(Pathea.AttribType type, bool isBase = false)
 {
     if (type == Pathea.AttribType.Atk)
     {
         return(GetBaseAtk());
     }
     return(base.GetAttribute(type, isBase));
 }
Example #3
0
 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;
     }
 }
Example #4
0
 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);
 }
Example #5
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);
            }
Example #6
0
            public bool HasProperty(Pathea.AttribType property)
            {
                if (null == mPropertys)
                {
                    return(false);
                }

                foreach (PropertyValue value in mPropertys)
                {
                    if (value.type == property)
                    {
                        return(true);
                    }
                }

                return(false);
            }
Example #7
0
            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);
            }
Example #8
0
            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;
                    }
                }
            }