fix some shit

This commit is contained in:
2021-05-22 14:29:29 +08:00
parent e8ca883ae9
commit 36b45942d5
5 changed files with 85 additions and 1 deletions

View File

@ -151,7 +151,7 @@ namespace BallanceTASEditor.Core {
mMem.AddBefore(node, item.Value);
}
} else {
foreach (var item in data.IterateFull()) {
foreach (var item in data.IterateFullReversed()) {
mMem.AddAfter(node, item.Value);
}
}

View File

@ -32,6 +32,16 @@ namespace BallanceTASEditor.Core {
// if (index + count > list.Count) count = list.Count - index;
// for (int i = 0; i < count; i++) list.RemoveAt(index);
//}
public static IEnumerable<LinkedListNode<FrameData>> IterateFullReversed(this LinkedList<FrameData> ls) {
var pos = ls.Last;
while (pos != null) {
yield return pos;
pos = pos.Previous;
}
}
public static IEnumerable<LinkedListNode<FrameData>> IterateFull(this LinkedList<FrameData> ls) {
var pos = ls.First;