Beispiel #1
0
 public void AddDeliverable(ITelepadDeliverable deliverable)
 {
     if (selectedDeliverables.Contains(deliverable))
     {
         Debug.Log("Tried to add the same minion twice.");
     }
     else if (selectedDeliverables.Count >= selectableCount)
     {
         Debug.LogError("Tried to add minions beyond the allowed limit");
     }
     else
     {
         selectedDeliverables.Add(deliverable);
         OnDeliverableAdded();
         if (selectedDeliverables.Count == selectableCount)
         {
             EnableProceedButton();
             if (OnLimitReachedEvent != null)
             {
                 OnLimitReachedEvent();
             }
             OnLimitReached();
         }
     }
 }
 private void OnReplacedEvent(ITelepadDeliverable stats)
 {
     if (stats == info)
     {
         DeselectDeliverable();
     }
 }
Beispiel #3
0
 private void OnReplacedEvent(ITelepadDeliverable deliverable)
 {
     if (deliverable == stats)
     {
         DeselectDeliverable();
     }
 }
Beispiel #4
0
 public void RemoveLast()
 {
     if (selectedDeliverables != null && selectedDeliverables.Count != 0)
     {
         ITelepadDeliverable obj = selectedDeliverables[selectedDeliverables.Count - 1];
         if (OnReplacedEvent != null)
         {
             OnReplacedEvent(obj);
         }
     }
 }
Beispiel #5
0
    public void RemoveDeliverable(ITelepadDeliverable deliverable)
    {
        bool flag = selectedDeliverables.Count >= selectableCount;

        selectedDeliverables.Remove(deliverable);
        OnDeliverableRemoved();
        if (flag && selectedDeliverables.Count < selectableCount)
        {
            DisableProceedButton();
            if (OnLimitUnreachedEvent != null)
            {
                OnLimitUnreachedEvent();
            }
            OnLimitUnreached();
        }
    }
Beispiel #6
0
 public bool IsSelected(ITelepadDeliverable deliverable)
 {
     return(selectedDeliverables.Contains(deliverable));
 }