/*
* @author Valentin Simonov / http://va.lent.in/
*/
using System;
using System.Collections.Generic;
using TouchScript.Hit;
using TouchScript.Layers;
using TouchScript.Pointers;
using UnityEngine;
namespace TouchScript
{
///
/// Core manager which controls TouchLayers.
///
public interface ILayerManager
{
///
/// Gets the list of .
///
/// A sorted list of currently active layers.
IList Layers { get; }
///
/// Gets the number of active layers.
///
/// The number of active layers.
int LayerCount { get; }
///
/// Indicates whether there are currently any exclusive transforms.
///
///
/// true if any exclusive transforms are registered; otherwise, false.
///
///
///
bool HasExclusive { get; }
///
/// Adds a layer in a specific position.
///
/// The layer to add.
/// Layer index to add the layer to or -1 to add to the end of the list.
/// if set to true move the layer to another index if it is already added; don't move otherwise.
///
/// True if the layer was added.
///
bool AddLayer(TouchLayer layer, int index = -1, bool addIfExists = true);
///
/// Removes a layer.
///
/// The layer to remove.
/// True if the layer was removed.
bool RemoveLayer(TouchLayer layer);
///
/// Swaps layers.
///
/// Layer index 1.
/// Layer index 2.
void ChangeLayerIndex(int at, int to);
///
/// Executes an action over all layers in order.
///
/// The action to execute. If it returns true, execution stops.
void ForEach(Func action);
///
/// Detects if the pointer hits any object in the scene.
///
/// The pointer.
/// Hit structure to fill on success.
/// True if any object is hit.
bool GetHitTarget(IPointer pointer, out HitData hit);
///
/// Sets the exclusive transform. Only exclusive transforms will be able to receive pointers.
///
/// The exclusive transform.
/// if set to true target's children will also be added.
void SetExclusive(Transform target, bool includeChildren = false);
///
/// Sets the exclusive transforms. Only exclusive transforms will be able to receive pointers.
///
/// The exclusive transforms to set.
void SetExclusive(IEnumerable targets);
///
/// Determines whether the specified target is exclusive.
///
/// The target.
///
/// true if the specified target is exclusive; otherwise, false.
///
bool IsExclusive(Transform target);
///
/// Clears the exclusive transforms list.
///
void ClearExclusive();
}
}