Example #1
0
    void RegisterAction(BaseAction action, BattleQueueType type)
    {
        if (_logRegistrations)
        {
            LogEx.Log <BattleQueue>("Registered action: {0} of type '{1}'", action.GetType().Name, type.ToString());
        }

        switch (type)
        {
        case BattleQueueType.GenericUpdate:
            _genericUpdates.Queue.Enqueue(action);
            break;

        case BattleQueueType.PlayerCommand:
            _playerCommands.Queue.Enqueue(action);
            break;

        case BattleQueueType.StatusUpdate:
            _statusUpdates.Queue.Enqueue(action);
            break;

        case BattleQueueType.Weather:
            _weatherUpdates.Queue.Clear();
            _weatherUpdates.Queue.Enqueue(action);
            break;
        }
    }
Example #2
0
 public BattleQueueWrapper(BattleQueueType type, Action <BattleSystem> onActivation, bool executePostTurn = true)
 {
     Type            = type;
     OnActivation    = onActivation;
     Queue           = new Queue <BaseAction>();
     ExecutePostTurn = executePostTurn;
 }
Example #3
0
    void RegisterAction(BaseAction action, BattleQueueType type)
    {
        if (_logRegistrations)
        {
            LogEx.Log <BattleQueue>("Registered action: {0} of type '{1}'", action.GetType().Name, type.ToString());
        }

        if (ActionRegistered != null)
        {
            ActionRegistered.Invoke(action, type);
        }
    }
Example #4
0
    void OnActionRegistered(BaseAction action, BattleQueueType type)
    {
        switch (type)
        {
        case BattleQueueType.GenericUpdate:
            _genericUpdates.Queue.Enqueue(action);
            break;

        case BattleQueueType.PlayerCommand:
            _playerCommands.Queue.Enqueue(action);
            //LogEx.Log<BattleQueue>("Registered player command '" + action.GetType() + "' targeting '" + (action as TargetedAction).Reciever.name + "'");
            break;

        case BattleQueueType.StatusUpdate:
            _statusUpdates.Queue.Enqueue(action);
            break;

        case BattleQueueType.Weather:
            _weatherUpdates.Queue.Clear();
            _weatherUpdates.Queue.Enqueue(action);
            break;
        }
    }