daily update on 20240828 by nitload youmu, autotexture added

This commit is contained in:
Nitload
2024-08-28 10:58:31 +08:00
parent d082071f2d
commit 1ee4e4a42f
586 changed files with 60910 additions and 123106 deletions
+46 -43
View File
@@ -38,11 +38,12 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace StgSharp.Logic
namespace StgSharp.BluePrint
{
public class BlueprintPipeline
{
private BlueprintNode after;
private BlueprintNode former;
private BlueprintPipelineArgs args;
@@ -59,14 +60,55 @@ namespace StgSharp.Logic
public BlueprintNode Former => former;
public int Level => former.Level;
public BlueprintPipelineArgs Args
{
get => args;
set => args = value;
}
public int Level => former.Level;
public static void SkipAll(Dictionary<string, BlueprintPipeline> ports)
{
if (ports == null)
{
throw new ArgumentNullException(nameof(ports));
}
foreach (KeyValuePair<string, BlueprintPipeline> item in ports)
{
if (item.Value != null)
{
item.Value.CompleteAndSkip();
}
}
}
public static void WaitAll(Dictionary<string, BlueprintPipeline> ports)
{
if (ports == null)
{
throw new ArgumentNullException(nameof(ports));
}
foreach (KeyValuePair<string, BlueprintPipeline> item in ports)
{
if (item.Value != null)
{
item.Value.WaitForStart();
}
}
}
public void WaitForStart()
{
//Console.WriteLine($"Waiting \t{former.ContextName}\t->\t{after.ContextName}");
formerCompleteSemaphore.Wait();
}
~BlueprintPipeline()
{
formerCompleteSemaphore.Dispose();
}
#region pipline op
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -85,52 +127,13 @@ namespace StgSharp.Logic
#endregion
public static void SkipAll(Dictionary<string, BlueprintPipeline> ports)
{
if (ports == null)
{
throw new ArgumentNullException(nameof(ports));
}
foreach (var item in ports)
{
if (item.Value!=null)
{
item.Value.CompleteAndSkip();
}
}
}
public static void WaitAll(Dictionary<string, BlueprintPipeline> ports)
{
if (ports == null)
{
throw new ArgumentNullException(nameof(ports));
}
foreach (var item in ports)
{
if (item.Value!=null)
{
item.Value.WaitForStart();
}
}
}
public void WaitForStart()
{
//Console.WriteLine($"Waiting \t{former.ContextName}\t->\t{after.ContextName}");
formerCompleteSemaphore.Wait();
}
~BlueprintPipeline()
{
formerCompleteSemaphore.Dispose();
}
}
public abstract class BlueprintPipelineArgs
{
public object? Value { get; set; }
}