public override void Intercept(IInteraction a_interaction, InteractableCollection a_interactableCollection, InteractionEventType a_interactionType, int a_identifier = int.MinValue) { TInteractable interactable = a_interactableCollection.LocateInteractable <TInteractable>(a_eventType: a_interactionType, a_identifier: a_identifier); OnIntercept((TInteraction)a_interaction, (TInteractable)interactable); }
//public abstract void Invoke(InteractableCollection a_unit, int a_identifier = 0); protected TInteractable LocateInteractable(InteractableCollection a_interactableCollection, int a_identifier, InteractionEventType a_interactionType = null) { if (a_interactableCollection == null) { throw new System.NullReferenceException("can't locate interactable from null collection"); } return(a_interactableCollection.LocateInteractable <TInteractable>(a_eventType: a_interactionType, a_identifier: a_identifier)); }