Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ModelBoneCollection.cs
Go to the documentation of this file.
1
using
System
;
2
using
System.Collections
;
3
using
System.Collections.Generic
;
4
using
System.Collections.ObjectModel
;
5
6
namespace
Microsoft.Xna.Framework.Graphics
;
7
8
public
sealed
class
ModelBoneCollection
:
ReadOnlyCollection
<ModelBone>
9
{
10
public
struct
Enumerator
:
IEnumerator
<ModelBone>,
IDisposable
,
IEnumerator
11
{
12
private
ModelBone
[]
wrappedArray
;
13
14
private
int
position
;
15
16
public
ModelBone
Current
=>
wrappedArray
[
position
];
17
18
object
IEnumerator.Current =>
Current
;
19
20
internal
Enumerator
(
ModelBone
[]
wrappedArray
)
21
{
22
this.wrappedArray =
wrappedArray
;
23
position
= -1;
24
}
25
26
public
bool
MoveNext
()
27
{
28
position
++;
29
if
(
position
>=
wrappedArray
.Length)
30
{
31
position
=
wrappedArray
.Length;
32
return
false
;
33
}
34
return
true
;
35
}
36
37
void
IEnumerator
.
Reset
()
38
{
39
position
= -1;
40
}
41
42
public
void
Dispose
()
43
{
44
}
45
}
46
47
private
ModelBone
[]
wrappedArray
;
48
49
public
ModelBone
this
[
string
boneName
]
50
{
51
get
52
{
53
if
(!
TryGetValue
(
boneName
,
out
var
value
))
54
{
55
throw
new
KeyNotFoundException
();
56
}
57
return
value
;
58
}
59
}
60
61
internal
ModelBoneCollection
(
ModelBone
[] bones)
62
:
base
((
IList
<
ModelBone
>)bones)
63
{
64
wrappedArray
= bones;
65
}
66
67
public
bool
TryGetValue
(
string
boneName
,
out
ModelBone
value
)
68
{
69
if
(
string
.IsNullOrEmpty(
boneName
))
70
{
71
throw
new
ArgumentNullException
(
"boneName"
);
72
}
73
int
count
=
base
.Items.
Count
;
74
for
(
int
i = 0; i <
count
; i++)
75
{
76
ModelBone
modelBone
=
base
.Items[i];
77
if
(
string
.Compare(
modelBone
.Name,
boneName
,
StringComparison
.Ordinal) == 0)
78
{
79
value
=
modelBone
;
80
return
true
;
81
}
82
}
83
value
=
null
;
84
return
false
;
85
}
86
87
public
new
Enumerator
GetEnumerator
()
88
{
89
return
new
Enumerator
(
wrappedArray
);
90
}
91
}
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.wrappedArray
ModelBone[] wrappedArray
Definition
ModelBoneCollection.cs:47
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.TryGetValue
bool TryGetValue(string boneName, out ModelBone value)
Definition
ModelBoneCollection.cs:67
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.ModelBoneCollection
ModelBoneCollection(ModelBone[] bones)
Definition
ModelBoneCollection.cs:61
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.GetEnumerator
new Enumerator GetEnumerator()
Definition
ModelBoneCollection.cs:87
Microsoft.Xna.Framework.Graphics.ModelBoneCollection
Definition
ModelBoneCollection.cs:9
Microsoft.Xna.Framework.Graphics.ModelBone
Definition
ModelBone.cs:4
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.Collections.Generic.Dictionary.Count
int Count
Definition
Dictionary.cs:682
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.Generic.KeyNotFoundException
Definition
KeyNotFoundException.cs:9
System.Collections.ObjectModel.ReadOnlyCollection
Definition
ReadOnlyCollection.cs:12
System.Collections.Generic.IEnumerator
Definition
IEnumerator.cs:4
System.Collections.Generic.IList
Definition
IList.cs:4
System.Collections.IEnumerator.Reset
void Reset()
System.IDisposable
Definition
IDisposable.cs:4
Microsoft.Xna.Framework.Graphics
Definition
AlphaTestEffect.cs:1
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Collections.ObjectModel
Definition
EventArgsCache.cs:4
System.Collections
Definition
BlockingCollection.cs:8
System.ExceptionArgument.value
@ value
System.ExceptionArgument.count
@ count
System.StringComparison
StringComparison
Definition
StringComparison.cs:4
System
Definition
BlockingCollection.cs:8
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.position
int position
Definition
ModelBoneCollection.cs:14
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.Current
object IEnumerator. Current
Definition
ModelBoneCollection.cs:18
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.Enumerator
Enumerator(ModelBone[] wrappedArray)
Definition
ModelBoneCollection.cs:20
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.MoveNext
bool MoveNext()
Definition
ModelBoneCollection.cs:26
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.Dispose
void Dispose()
Definition
ModelBoneCollection.cs:42
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.Current
ModelBone Current
Definition
ModelBoneCollection.cs:16
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator.wrappedArray
ModelBone[] wrappedArray
Definition
ModelBoneCollection.cs:12
Microsoft.Xna.Framework.Graphics.ModelBoneCollection.Enumerator
Definition
ModelBoneCollection.cs:11
source
Microsoft.Xna.Framework.Graphics
ModelBoneCollection.cs
Generated by
1.10.0