daily update on 20240305 by nitload youmu

This commit is contained in:
YoumuLiu
2024-03-05 10:17:02 +08:00
parent 1f2fca4c8f
commit 6a0cccae79
156 changed files with 23040 additions and 1385 deletions
+5 -11
View File
@@ -1,4 +1,5 @@
using StgSharp.Graphics;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -10,8 +11,6 @@ using System.Threading.Tasks;
namespace StgSharp.Logic
{
[StructLayout(LayoutKind.Explicit, Size = 8)]
internal struct LogSeperator
{
@@ -31,8 +30,6 @@ namespace StgSharp.Logic
}
}
/// <summary>
/// A linear data structure with dynamic length.
/// It contains a <see cref="List{T}"/> of <see cref="Array"/>,
@@ -44,13 +41,16 @@ namespace StgSharp.Logic
private List<T[]> arrayIndexList;
private LogSeperator indexpair;
private int lastMain = 0;
// main index to the last used element
private int lastSub = 0;
private int length;
private int subLength = 1;
// sub index to the last used element
private Queue<int> unusedMainIndex;
private Queue<int> unusedSubIndex;
public DynamicArrayList()
@@ -105,7 +105,6 @@ namespace StgSharp.Logic
/// <param name="instace"></param>
public DynamicArrayList(int count, T instace)
{
arrayIndexList = new List<T[]>();
length = count;
unusedMainIndex = new();
@@ -162,7 +161,6 @@ namespace StgSharp.Logic
}
arrayIndexList[indexpair.high_s][indexpair.low_s] = value;
}
}
public void CopyTo(DynamicArrayList<T> target)
@@ -230,7 +228,6 @@ namespace StgSharp.Logic
public int Count => length;
/// <summary>
/// Length of this <see cref="DynamicArrayList{T}"/>
/// </summary>
@@ -256,7 +253,6 @@ namespace StgSharp.Logic
length++;
subLength = 1;
return length - 1;
}
length++;
@@ -357,8 +353,6 @@ namespace StgSharp.Logic
return false;
}
[Obsolete("This method is not same, you may read data form an empty index.", false)]
public void RemoveAt(int index)
{
@@ -424,4 +418,4 @@ namespace StgSharp.Logic
indexpair.low >>= (int)(32 - mainindex);
}
}
}
}