forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelBoneCollection.cs
More file actions
94 lines (83 loc) · 2.54 KB
/
Copy pathModelBoneCollection.cs
File metadata and controls
94 lines (83 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
namespace Microsoft.Xna.Framework.Graphics
{
// Summary:
// Represents a set of bones associated with a model.
public class ModelBoneCollection : ReadOnlyCollection<ModelBone>
{
public ModelBoneCollection(IList<ModelBone> list)
: base(list)
{
}
// Summary:
// Retrieves a ModelBone from the collection, given the name of the bone.
//
// Parameters:
// boneName:
// The name of the bone to retrieve.
public ModelBone this[string boneName]
{
get {
ModelBone ret;
if (TryGetValue(boneName, out ret)) {
return ret;
}
throw new KeyNotFoundException();
}
}
// // Summary:
// // Returns a ModelBoneCollection.Enumerator that can iterate through a ModelBoneCollection.
// public ModelBoneCollection.Enumerator GetEnumerator() { throw new NotImplementedException(); }
//
// Summary:
// Finds a bone with a given name if it exists in the collection.
//
// Parameters:
// boneName:
// The name of the bone to find.
//
// value:
// [OutAttribute] The bone named boneName, if found.
public bool TryGetValue(string boneName, out ModelBone value)
{
foreach (ModelBone bone in base.Items)
{
if (bone.Name == boneName) {
value = bone;
return true;
}
}
value = null;
return false;
}
// // Summary:
// // Provides the ability to iterate through the bones in an ModelBoneCollection.
// public struct Enumerator : IEnumerator<ModelBone>, IDisposable, IEnumerator
// {
// // Summary:
// // Gets the current element in the ModelBoneCollection.
// public ModelBone Current { get { throw new NotImplementedException(); } }
// // Summary:
// // Immediately releases the unmanaged resources used by this object.
// public void Dispose() { throw new NotImplementedException(); }
// //
// // Summary:
// // Advances the enumerator to the next element of the ModelBoneCollection.
// public bool MoveNext() { throw new NotImplementedException(); }
// #region IEnumerator Members
// object IEnumerator.Current
// {
// get { throw new NotImplementedException(); }
// }
// public void Reset()
// {
// throw new NotImplementedException();
// }
// #endregion
// }
}
}