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(); } }
private void OnReplacedEvent(ITelepadDeliverable deliverable) { if (deliverable == stats) { DeselectDeliverable(); } }
public void RemoveLast() { if (selectedDeliverables != null && selectedDeliverables.Count != 0) { ITelepadDeliverable obj = selectedDeliverables[selectedDeliverables.Count - 1]; if (OnReplacedEvent != null) { OnReplacedEvent(obj); } } }
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(); } }
public bool IsSelected(ITelepadDeliverable deliverable) { return(selectedDeliverables.Contains(deliverable)); }