write shit

This commit is contained in:
2021-07-11 20:55:29 +08:00
parent b290828f58
commit 8c641db61c
4 changed files with 101 additions and 4 deletions

View File

@ -325,14 +325,26 @@ namespace BallanceTASEditor.Core.FileOperation {
long counter = 0;
if (isInsertBefore) {
foreach (var item in data.IterateFull()) {
mMem.AddBefore(node, item.Value);
if (node == null) {
// insert from tail instead
mMem.AddLast(item.Value);
} else {
mMem.AddBefore(node, item.Value);
}
if (counter == gottenPointerPos)
mPointer = node.Previous;
counter++;
}
} else {
foreach (var item in data.IterateFullReversed()) {
mMem.AddAfter(node, item.Value);
if (node == null) {
// insert from head instead
mMem.AddFirst(item.Value);
} else {
mMem.AddAfter(node, item.Value);
}
if (counter == gottenPointerPos)
mPointer = node.Next;
counter++;