TouchBase FindIndexByIdOrGetFreeIndex Method Delta Engine Documentation

Namespace: DeltaEngine.Input
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public int FindIndexByIdOrGetFreeIndex(
	int id
)

Return Value

Type: Int32
Remarks

Tests: DeltaEngine.Input.Windows.Tests.TouchCollectionTests
Examples

4 unit tests call DeltaEngine.Input.TouchBase.FindIndexByIdOrGetFreeIndex(System.Int32)
[Test, CloseAfterFirstFrame]
public void FindIndexByIdOrGetFreeIndex()
{
    Assert.AreEqual(0, touchCollection.FindIndexByIdOrGetFreeIndex(478));
}
[Test, CloseAfterFirstFrame]
public void FindIndexByIdWithExistingId()
{
    emptyTouchCollection.ids[5] = 5893;
    Assert.AreEqual(5, emptyTouchCollection.FindIndexByIdOrGetFreeIndex(5893));
}
[Test, CloseAfterFirstFrame]
public void FindFreeIndex()
{
    Assert.AreEqual(0, touchCollection.FindIndexByIdOrGetFreeIndex(456));
}
See Also