Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 状态解除回调
 /// </summary>
 protected virtual void _onStateRemoved(RuntimeState <S, T> state, bool force = false)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// 状态添加回调
 /// </summary>
 protected virtual void _onStateAdded(RuntimeState <S, T> state)
 {
 }
Exemplo n.º 4
0
 /// <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));
 }