BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.Wii.Animations.KeyframeCollection Class Reference
Inheritance diagram for BrawlLib.Wii.Animations.KeyframeCollection:

Public Member Functions

 KeyframeCollection (int arrayCount, int numFrames, params float[] defaultValues)
 
KeyframeEntry SetFrameValue (int arrayIndex, int frameIndex, float value, bool parsing=false)
 
KeyframeEntry GetKeyframe (int arrayIndex, int index)
 
float GetFrameValue (int arrayIndex, float index, bool returnOutValue=false)
 
void Insert (int index, params int[] arrays)
 
void Delete (int index, params int[] arrays)
 
int Clean ()
 
bool Equals (KeyframeCollection obj)
 
IEnumerator< KeyframeArrayGetEnumerator ()
 

Public Attributes

KeyframeArray[] _keyArrays
 

Properties

KeyframeArray this[int index] [get]
 
bool Loop [get, set]
 
int FrameLimit [get, set]
 
float this[int index, params int[] arrays [get, set]
 
int ArrayCount [get]
 

Constructor & Destructor Documentation

◆ KeyframeCollection()

BrawlLib.Wii.Animations.KeyframeCollection.KeyframeCollection ( int  arrayCount,
int  numFrames,
params float[]  defaultValues 
)
inline
53 {
54 _frameLimit = numFrames;
55 _keyArrays = new KeyframeArray[arrayCount];
56 for (int i = 0; i < arrayCount; i++)
57 {
58 _keyArrays[i] = new KeyframeArray(numFrames, i < defaultValues.Length ? defaultValues[i] : 0);
59 }
60 }
KeyframeArray[] _keyArrays
Definition: KeyframeCollection.cs:18

Member Function Documentation

◆ Clean()

int BrawlLib.Wii.Animations.KeyframeCollection.Clean ( )
inline
148 {
149 int removed = 0;
150 foreach (KeyframeArray arr in _keyArrays)
151 {
152 removed += arr.Clean();
153 }
154
155 return removed;
156 }

◆ Delete()

void BrawlLib.Wii.Animations.KeyframeCollection.Delete ( int  index,
params int[]  arrays 
)
inline
130 {
131 KeyframeEntry entry = null, root;
132 foreach (int x in arrays)
133 {
134 root = _keyArrays[x]._keyRoot;
135 for (entry = root._prev; entry != root && entry._index >= index; entry = entry._prev)
136 {
137 if (entry._index == index || --entry._index < 0)
138 {
139 entry = entry._next;
140 entry._prev.Remove();
141 _keyArrays[x]._keyCount--;
142 }
143 }
144 }
145 }
float this[int index, params int[] arrays
Definition: KeyframeCollection.cs:63
void Remove()
Definition: KeyframeCollection.cs:253
KeyframeEntry _prev
Definition: KeyframeCollection.cs:195
KeyframeEntry _next
Definition: KeyframeCollection.cs:195

◆ Equals()

bool BrawlLib.Wii.Animations.KeyframeCollection.Equals ( KeyframeCollection  obj)
inline
159 {
160 if (!(obj is KeyframeCollection k))
161 {
162 return false;
163 }
164
165 if (k.ArrayCount != ArrayCount)
166 return false;
167
168 for (int i = 0; i < ArrayCount; i++)
169 {
170 if (!_keyArrays[i].Equals(k._keyArrays[i]))
171 {
172 return false;
173 }
174 }
175
176 return true;
177 }
bool Equals(KeyframeCollection obj)
Definition: KeyframeCollection.cs:158
int ArrayCount
Definition: KeyframeCollection.cs:179

◆ GetEnumerator()

IEnumerator< KeyframeArray > BrawlLib.Wii.Animations.KeyframeCollection.GetEnumerator ( )
inline
182 {
183 return GetEnumerator();
184 }
IEnumerator< KeyframeArray > GetEnumerator()
Definition: KeyframeCollection.cs:181

◆ GetFrameValue()

float BrawlLib.Wii.Animations.KeyframeCollection.GetFrameValue ( int  arrayIndex,
float  index,
bool  returnOutValue = false 
)
inline
85 {
86 return _keyArrays[arrayIndex].GetFrameValue(index, returnOutValue);
87 }
float GetFrameValue(float index, bool returnOutValue=false)
Definition: KeyframeCollection.cs:491

◆ GetKeyframe()

KeyframeEntry BrawlLib.Wii.Animations.KeyframeCollection.GetKeyframe ( int  arrayIndex,
int  index 
)
inline
80 {
81 return _keyArrays[arrayIndex].GetKeyframe(index);
82 }
KeyframeEntry GetKeyframe(int index)
Definition: KeyframeCollection.cs:475

◆ Insert()

void BrawlLib.Wii.Animations.KeyframeCollection.Insert ( int  index,
params int[]  arrays 
)
inline
112 {
113 KeyframeEntry entry = null, root;
114 foreach (int x in arrays)
115 {
116 root = _keyArrays[x]._keyRoot;
117 for (entry = root._prev; entry != root && entry._index >= index; entry = entry._prev)
118 {
119 if (++entry._index >= _frameLimit)
120 {
121 entry = entry._next;
122 entry._prev.Remove();
123 _keyArrays[x]._keyCount--;
124 }
125 }
126 }
127 }

◆ SetFrameValue()

KeyframeEntry BrawlLib.Wii.Animations.KeyframeCollection.SetFrameValue ( int  arrayIndex,
int  frameIndex,
float  value,
bool  parsing = false 
)
inline
75 {
76 return _keyArrays[arrayIndex].SetFrameValue(frameIndex, value, parsing);
77 }
KeyframeEntry SetFrameValue(int index, float value, bool parsing=false)
Definition: KeyframeCollection.cs:556

Member Data Documentation

◆ _keyArrays

KeyframeArray [] BrawlLib.Wii.Animations.KeyframeCollection._keyArrays

Property Documentation

◆ ArrayCount

int BrawlLib.Wii.Animations.KeyframeCollection.ArrayCount
get

◆ arrays

float this[int index, params int[] BrawlLib.Wii.Animations.KeyframeCollection.arrays
getset
63 {
64 get => GetFrameValue(arrays[0], index);
65 set
66 {
67 foreach (int i in arrays)
68 {
69 _keyArrays[i].SetFrameValue(index, value);
70 }
71 }
72 }
float GetFrameValue(int arrayIndex, float index, bool returnOutValue=false)
Definition: KeyframeCollection.cs:84

◆ FrameLimit

int BrawlLib.Wii.Animations.KeyframeCollection.FrameLimit
getset
40 {
41 get => _frameLimit;
42 set
43 {
44 _frameLimit = value;
45 foreach (KeyframeArray r in _keyArrays)
46 {
47 r.FrameLimit = _frameLimit;
48 }
49 }
50 }

◆ Loop

bool BrawlLib.Wii.Animations.KeyframeCollection.Loop
getset
25 {
26 get => _looped;
27 set
28 {
29 _looped = value;
30 foreach (KeyframeArray a in _keyArrays)
31 {
32 a.Loop = _looped;
33 }
34 }
35 }

◆ this[int index]

KeyframeArray BrawlLib.Wii.Animations.KeyframeCollection.this[int index]
get

The documentation for this class was generated from the following file: