public RuntimeState <S, T> addState(int stateId, int turns = 0) { RuntimeState <S, T> state; _isStateChanged = true; if (states.ContainsKey(stateId)) { state = states[stateId]; state.add(turns); } else { state = new RuntimeState <S, T>(stateId, turns); states.Add(stateId, state); on(BaseBattlerCallback.StateAdded, state); } return(state); }
/// <summary> /// 状态解除回调 /// </summary> protected virtual void _onStateRemoved(RuntimeState <S, T> state, bool force = false) { }
/// <summary> /// 状态添加回调 /// </summary> protected virtual void _onStateAdded(RuntimeState <S, T> state) { }
/// <param name="buff">Buff对象</param> public RuntimeState <S, T> removeState(RuntimeState <S, T> state, int turns = 0, bool force = false) { return(removeState(state.stateId, turns, force)); }