Ejemplo n.º 1
0
        private void Increase(CharacterPropertyEnum id, long delta)
        {
            long val = Get(id);

            val += delta;
            Set(id, val);
        }
Ejemplo n.º 2
0
 private void InitProperty(CharacterPropertyEnum id, int val)
 {
     if (val != 0)
     {
         BaseProperty.SetInt(id, val);
     }
 }
Ejemplo n.º 3
0
        internal bool HaveState(CharacterPropertyEnum id)
        {
            long val     = GetState(id);
            bool disable = IsStateDisable(val);
            long ct      = GetStateCount(val);

            return(ct > 0 && !disable);
        }
Ejemplo n.º 4
0
 private void SetState(CharacterPropertyEnum id, long val)
 {
     if (IsState(id))
     {
         int idVal = (int)id;
         m_Values[idVal] = val;
     }
 }
Ejemplo n.º 5
0
        private long Get(CharacterPropertyEnum id)
        {
            long val   = 0;
            int  idVal = (int)id;

            m_Values.TryGetValue(idVal, out val);
            return(val);
        }
Ejemplo n.º 6
0
        internal void RemoveState(CharacterPropertyEnum id)
        {
            long val     = GetState(id);
            long disable = GetStateDisable(val);
            long ct      = GetStateCount(val);

            val = (ct > 0 ? ct - 1 : 0) | disable;
            SetState(id, val);
        }
Ejemplo n.º 7
0
        internal void AddState(CharacterPropertyEnum id)
        {
            long val     = GetState(id);
            long disable = GetStateDisable(val);
            long ct      = GetStateCount(val);

            val = (ct + 1) | disable;
            SetState(id, val);
        }
Ejemplo n.º 8
0
        internal void DisableState(CharacterPropertyEnum id)
        {
            long val = GetState(id);
            long ct  = GetStateCount(val);

            if (ct <= 0)
            {
                return;
            }
            val = ct | c_StateDisableFlag;
            SetState(id, val);
        }
Ejemplo n.º 9
0
 public float GetFloat(CharacterPropertyEnum id)
 {
     return(Get(id) / 1000.0f);
 }
Ejemplo n.º 10
0
 public void IncreaseLong(CharacterPropertyEnum id, long delta)
 {
     Increase(id, delta);
 }
Ejemplo n.º 11
0
 public void SetLong(CharacterPropertyEnum id, long val)
 {
     Set(id, val);
 }
Ejemplo n.º 12
0
 public long GetLong(CharacterPropertyEnum id)
 {
     return(Get(id));
 }
Ejemplo n.º 13
0
 public void IncreaseInt(CharacterPropertyEnum id, int delta)
 {
     Increase(id, delta);
 }
Ejemplo n.º 14
0
 public void SetInt(CharacterPropertyEnum id, int val)
 {
     Set(id, val);
 }
Ejemplo n.º 15
0
 public void DisableState(CharacterPropertyEnum id)
 {
     BaseProperty.DisableState(id);
     ActualProperty.DisableState(id);
 }
Ejemplo n.º 16
0
 public void AddState(CharacterPropertyEnum id)
 {
     BaseProperty.AddState(id);
     ActualProperty.AddState(id);
 }
Ejemplo n.º 17
0
 private static bool IsState(CharacterPropertyEnum id)
 {
     return(id >= CharacterPropertyEnum.x3001_眩晕 && id < CharacterPropertyEnum.x4001_职业);
 }
Ejemplo n.º 18
0
        private void Set(CharacterPropertyEnum id, long val)
        {
            int idVal = (int)id;

            m_Values[idVal] = val;
        }
Ejemplo n.º 19
0
 internal void ClearState(CharacterPropertyEnum id)
 {
     SetState(id, 0);
 }
Ejemplo n.º 20
0
 public bool HaveState(CharacterPropertyEnum id)
 {
     return(ActualProperty.HaveState(id));
 }
Ejemplo n.º 21
0
 public void SetFloat(CharacterPropertyEnum id, float val)
 {
     Set(id, (long)(val * 1000.0f));
 }
Ejemplo n.º 22
0
 public void RemoveState(CharacterPropertyEnum id)
 {
     BaseProperty.RemoveState(id);
     ActualProperty.RemoveState(id);
 }
Ejemplo n.º 23
0
 public void IncreaseFloat(CharacterPropertyEnum id, float delta)
 {
     Increase(id, (long)(delta * 1000.0f));
 }
Ejemplo n.º 24
0
 public void ClearState(CharacterPropertyEnum id)
 {
     BaseProperty.ClearState(id);
     ActualProperty.ClearState(id);
 }
Ejemplo n.º 25
0
 public int GetInt(CharacterPropertyEnum id)
 {
     return((int)Get(id));
 }