daily update on 20230713 by nitload youmu, linkedlistbug fixed

This commit is contained in:
Nitload
2023-07-13 06:35:38 +08:00
parent 2a78a60358
commit 01d1b7e7ef
88 changed files with 1388 additions and 1159 deletions
+5
View File
@@ -20,5 +20,10 @@ namespace StgSharp
TimeLine.allPool.Add(pool);
TimeLine._currentPool = pool;
}
public static void LoadTimeline()
{
}
}
}
+21
View File
@@ -0,0 +1,21 @@
using StgSharp.Control;
using StgSharp.Logic;
namespace StgSharp
{
public static unsafe partial class Instruction
{
public static LinkedList<T> GetAllActivatedPool<T>() where T:Pool
{
/**/
LinkedList<T> pool = new LinkedList<T>();
foreach (Pool item in TimeLine.allPool)
{
pool.Add((T)item);
}
return pool;
/**/
}
}
}
+27 -10
View File
@@ -9,7 +9,7 @@ namespace StgSharp.Control
{
[AllowNull]
internal static Pool _currentPool = default;
internal static LinkedList<Pool> allPool;
internal static LinkedList<Pool> allPool = new LinkedList<Pool>();
internal static LinkedList<Form> allForm;
/// <summary>
@@ -21,30 +21,36 @@ namespace StgSharp.Control
internal static TimelineBlock currentOperation;
private static bool isPaused = false;
public static TimelineBlock CurrentOperation
{
get { return currentOperation; }
set
{
if (currentOperation==default||
currentOperation.isComplete)
{
currentOperation = value;
}
}
}
static TimeLine()
{
allForm = new LinkedList<Form>();
allPool = new LinkedList<Pool>();
#if DEBUG
Console.WriteLine("Timeline init OK!");
#endif
internalIO.InternalInitGL();
}
internal static void OnRender()
public static void OnRender()
{
tickCounter.QuickAdd();
foreach (Pool p in allPool)
{
_currentPool = p;
if (!isPaused)
if (!currentOperation.isComplete)
{
currentOperation.OnUpdating();
}
foreach (EntityPartical b in _currentPool._bulletContainer)
{
}
}
}
@@ -58,5 +64,16 @@ namespace StgSharp.Control
{
}
public static void LoadPool(Pool pool)
{
allPool.Add(pool);
Console.WriteLine(allPool.count.Value);
}
public static Pool GetCurrentPool()
{
return _currentPool;
}
}
}
+15 -1
View File
@@ -2,8 +2,22 @@
{
public abstract class TimelineBlock
{
public T GetCurrentPool<T>() where T:Pool
{
return TimeLine._currentPool as T;
}
public abstract void OnUpdating();
public abstract bool isComplete
{
get;
}
/*
A virtual method api to define what should program do
in a framecycle, an int value is required to express
the result of the cycle, that if there is any error in the cycle
*/
public abstract int OnUpdating();
public abstract bool GetShouldComplete();
}
}