private void Increase(CharacterPropertyEnum id, long delta) { long val = Get(id); val += delta; Set(id, val); }
private void InitProperty(CharacterPropertyEnum id, int val) { if (val != 0) { BaseProperty.SetInt(id, val); } }
internal bool HaveState(CharacterPropertyEnum id) { long val = GetState(id); bool disable = IsStateDisable(val); long ct = GetStateCount(val); return(ct > 0 && !disable); }
private void SetState(CharacterPropertyEnum id, long val) { if (IsState(id)) { int idVal = (int)id; m_Values[idVal] = val; } }
private long Get(CharacterPropertyEnum id) { long val = 0; int idVal = (int)id; m_Values.TryGetValue(idVal, out val); return(val); }
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); }
internal void AddState(CharacterPropertyEnum id) { long val = GetState(id); long disable = GetStateDisable(val); long ct = GetStateCount(val); val = (ct + 1) | disable; SetState(id, val); }
internal void DisableState(CharacterPropertyEnum id) { long val = GetState(id); long ct = GetStateCount(val); if (ct <= 0) { return; } val = ct | c_StateDisableFlag; SetState(id, val); }
public float GetFloat(CharacterPropertyEnum id) { return(Get(id) / 1000.0f); }
public void IncreaseLong(CharacterPropertyEnum id, long delta) { Increase(id, delta); }
public void SetLong(CharacterPropertyEnum id, long val) { Set(id, val); }
public long GetLong(CharacterPropertyEnum id) { return(Get(id)); }
public void IncreaseInt(CharacterPropertyEnum id, int delta) { Increase(id, delta); }
public void SetInt(CharacterPropertyEnum id, int val) { Set(id, val); }
public void DisableState(CharacterPropertyEnum id) { BaseProperty.DisableState(id); ActualProperty.DisableState(id); }
public void AddState(CharacterPropertyEnum id) { BaseProperty.AddState(id); ActualProperty.AddState(id); }
private static bool IsState(CharacterPropertyEnum id) { return(id >= CharacterPropertyEnum.x3001_眩晕 && id < CharacterPropertyEnum.x4001_职业); }
private void Set(CharacterPropertyEnum id, long val) { int idVal = (int)id; m_Values[idVal] = val; }
internal void ClearState(CharacterPropertyEnum id) { SetState(id, 0); }
public bool HaveState(CharacterPropertyEnum id) { return(ActualProperty.HaveState(id)); }
public void SetFloat(CharacterPropertyEnum id, float val) { Set(id, (long)(val * 1000.0f)); }
public void RemoveState(CharacterPropertyEnum id) { BaseProperty.RemoveState(id); ActualProperty.RemoveState(id); }
public void IncreaseFloat(CharacterPropertyEnum id, float delta) { Increase(id, (long)(delta * 1000.0f)); }
public void ClearState(CharacterPropertyEnum id) { BaseProperty.ClearState(id); ActualProperty.ClearState(id); }
public int GetInt(CharacterPropertyEnum id) { return((int)Get(id)); }