Tanoda
ReadonlyList.cs
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) Ultraleap, Inc. 2011-2020. *
3
* *
4
* Use subject to the terms of the Apache License 2.0 available at *
5
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6
* between Ultraleap and you, your company or other organization. *
7
******************************************************************************/
8
9
using
UnityEngine
;
10
using
System.Collections.Generic;
11
using
System.Collections;
12
13
namespace
Leap.Unity
{
14
20
public
struct
ReadonlyList
<T> {
21
private
readonly List<T> _list;
22
23
public
ReadonlyList
(List<T> list) {
24
_list = list;
25
}
26
27
public
bool
isValid
{
28
get
{
29
return
_list !=
null
;
30
}
31
}
32
33
public
int
Count
{
34
get
{
35
return
_list.Count;
36
}
37
}
38
39
public
T
this
[
int
index] {
40
get
{
41
return
_list[index];
42
}
43
}
44
45
public
List<T>.Enumerator
GetEnumerator
() {
46
return
_list.GetEnumerator();
47
}
48
49
public
static
implicit
operator
ReadonlyList<T>
(List<T> list) {
50
return
new
ReadonlyList<T>
(list);
51
}
52
53
public
int
IndexOf
(T item) {
54
return
_list.IndexOf(item);
55
}
56
}
57
}
Leap.Unity
Definition:
AssetFolderPropertyDrawer.cs:15
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Leap.Unity.ReadonlyList
A simple wrapper around List to provide readonly access. Useful when you want to return a list to som...
Definition:
ReadonlyList.cs:20
Leap.Unity.ReadonlyList.GetEnumerator
List< T >.Enumerator GetEnumerator()
Definition:
ReadonlyList.cs:45
Leap.Unity.ReadonlyList.ReadonlyList
ReadonlyList(List< T > list)
Definition:
ReadonlyList.cs:23
Leap.Unity.ReadonlyList.isValid
bool isValid
Definition:
ReadonlyList.cs:27
Leap.Unity.ReadonlyList.Count
int Count
Definition:
ReadonlyList.cs:33
Leap.Unity.ReadonlyList.IndexOf
int IndexOf(T item)
Definition:
ReadonlyList.cs:53
Source
Assets
Plugins
LeapMotion
Core
Scripts
DataStructures
ReadonlyList.cs
Generated by
1.9.3