using System.Collections.Generic;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.XR.Interaction.Toolkit.Interactors
{
///
/// An interface that represents an Interaction Group component that is capable of overriding the interaction of the
/// when another interactor tries to select any of the interactables
/// being hovered or selected. An interactor can only override interaction when it is or is contained within a Group
/// member that is configured as a possible override for the active Group member.
///
///
///
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public interface IXRInteractionOverrideGroup : IXRInteractionGroup
{
///
/// Adds as a possible interaction override for .
///
/// The Group member whose interaction can be potentially overridden by .
/// The Group member to add as a possible interaction override.
///
/// Both members must be registered with the Group. Additionally, must
/// implement either or .
/// This method must not create a loop in the chain of overrides for . Use the
/// implementation of to ensure there is no loop before adding override.
///
void AddInteractionOverrideForGroupMember(IXRGroupMember sourceGroupMember,
IXRGroupMember overrideGroupMember);
///
/// Checks whether is either the same as
/// or part of a chain of its override Group members and their overrides.
///
/// The source Group member for the potential chain of override members.
/// The Group member to check for as part of a chain of overrides.
///
/// Returns if is either the same as
/// or part of a chain of its override Group members and their overrides.
/// Otherwise, returns .
///
bool GroupMemberIsPartOfOverrideChain(IXRGroupMember sourceGroupMember,
IXRGroupMember potentialOverrideGroupMember);
///
/// Removes as a possible interaction override for .
///
/// The Group member whose interaction can no longer be overridden by .
/// The Group member to remove as a possible interaction override.
///
/// Returns if was removed from the set of
/// potential overrides for . Otherwise, returns
/// if was not part of the set.
///
///
/// must be registered with the Group.
///
bool RemoveInteractionOverrideForGroupMember(IXRGroupMember sourceGroupMember,
IXRGroupMember overrideGroupMember);
///
/// Clears the set of possible interaction overrides for .
///
/// The Group member whose interaction can no longer be overridden.
///
/// Returns if there is a set of overrides for .
/// Otherwise, returns .
///
///
/// must be registered with the Group.
///
bool ClearInteractionOverridesForGroupMember(IXRGroupMember sourceGroupMember);
///
/// Returns all members in the set of possible interaction overrides for
/// into set .
///
/// The Group member whose overrides to get.
/// Set to receive override Group members.
///
/// must be registered with the Group.
/// This method populates the set with the Group members at the time the method is called. It is not a live view,
/// meaning override Group members added or removed afterward will not be reflected in the results of this method.
/// Clears before adding to it.
///
void GetInteractionOverridesForGroupMember(IXRGroupMember sourceGroupMember, HashSet results);
///
/// Checks whether the Group should end the interactions of the
/// and instead prioritize an override interactor for interaction. An interactor should only override if it exists
/// in the set of override Group members for the active member and is capable of selecting any interactable that
/// is interacting with. If multiple Group members are capable
/// of overriding, only the highest priority one should override.
///
/// The interactor that should override interaction.
///
/// Returns if the Group should end the interactions of the
/// and instead prioritize an override interactor for
/// interaction. Otherwise, returns .
///
///
/// The implementation of
/// should call this method at the start to determine whether should
/// override the pre-prioritized interactor.
/// The implementation of this method should call on each
/// override Group member that is an .
///
bool ShouldOverrideActiveInteraction(out IXRSelectInteractor overridingInteractor);
///
/// Checks whether any member of the Group should override the interactions of .
/// An interactor should only override if it is capable of selecting any interactable that
/// is interacting with. If multiple Group members are capable of overriding, only the highest priority one should override.
///
/// The interactor that is interacting with an interactable.
/// The interactor that should override interaction.
///
/// Returns if any member of the Group should override the interactions of
/// . Otherwise, returns .
///
///
/// The implementation of this method should call this method on each Group member that is an
/// .
///
bool ShouldAnyMemberOverrideInteraction(IXRInteractor interactingInteractor,
out IXRSelectInteractor overridingInteractor);
}
}