Example #1
0
    /////////////////////////////////////////////////////////////////////////////////////////////////
    // Notifications from base class
    /////////////////////////////////////////////////////////////////////////////////////////////////
    protected override void OnTriggerEnter_TargetStorage(S_Storage_Base _targetStorage)
    {
        switch (currentTask.subTasks.Peek().subTaskType)
        {
        case SubTaskType.TAKE_PRODUCT:
            int amountTaken = _targetStorage.RemoveStock(currentTask.subTasks.Peek().scheduledExchangeAmount);
            AddItemToInventory(_targetStorage.ProductName, amountTaken);
            break;

        case SubTaskType.GIVE_PRODUCT:
            int amountAdded = _targetStorage.AddStock(currentTask.subTasks.Peek().scheduledExchangeAmount);
            RmoveItemFromInventory(_targetStorage.ProductName, amountAdded);
            break;
        }
        FinishSubTask();
    }
Example #2
0
 /////////////////////////////////////////////////////////////////////////////////////////////////
 // Overrideable Notifications
 /////////////////////////////////////////////////////////////////////////////////////////////////
 protected virtual void OnTriggerEnter_TargetStorage(S_Storage_Base _targetStorage)
 {
 }
Example #3
0
 // Constructors
 public S_AI_SubTask(SubTaskType newSubTaskType, S_Storage_Base newTargetStorage)
 {
     subTaskType   = newSubTaskType;
     targetStorage = newTargetStorage;
 }