daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange
This commit is contained in:
@@ -40,7 +40,6 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.BluePrint
|
||||
{
|
||||
|
||||
public class BlueprintPipeline
|
||||
{
|
||||
|
||||
@@ -49,11 +48,12 @@ namespace StgSharp.BluePrint
|
||||
private BlueprintPipelineArgs args;
|
||||
private SemaphoreSlim formerCompleteSemaphore;
|
||||
|
||||
public BlueprintPipeline(BlueprintNode former, BlueprintNode after)
|
||||
public BlueprintPipeline( BlueprintNode former, BlueprintNode after )
|
||||
{
|
||||
this.former = former;
|
||||
this.after = after;
|
||||
formerCompleteSemaphore = new SemaphoreSlim(initialCount: 0, maxCount: 1);
|
||||
formerCompleteSemaphore = new SemaphoreSlim(
|
||||
initialCount: 0, maxCount: 1 );
|
||||
}
|
||||
|
||||
public BlueprintNode After => after;
|
||||
@@ -68,31 +68,27 @@ namespace StgSharp.BluePrint
|
||||
|
||||
public int Level => former.Level;
|
||||
|
||||
public static void SkipAll(Dictionary<string, BlueprintPipeline> ports)
|
||||
public static void SkipAll(
|
||||
Dictionary<string, BlueprintPipeline> ports )
|
||||
{
|
||||
if (ports == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(ports));
|
||||
if( ports == null ) {
|
||||
throw new ArgumentNullException( nameof( ports ) );
|
||||
}
|
||||
foreach (KeyValuePair<string, BlueprintPipeline> item in ports)
|
||||
{
|
||||
if (item.Value != null)
|
||||
{
|
||||
foreach( KeyValuePair<string, BlueprintPipeline> item in ports ) {
|
||||
if( item.Value != null ) {
|
||||
item.Value.CompleteAndSkip();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void WaitAll(Dictionary<string, BlueprintPipeline> ports)
|
||||
public static void WaitAll(
|
||||
Dictionary<string, BlueprintPipeline> ports )
|
||||
{
|
||||
if (ports == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(ports));
|
||||
if( ports == null ) {
|
||||
throw new ArgumentNullException( nameof( ports ) );
|
||||
}
|
||||
foreach (KeyValuePair<string, BlueprintPipeline> item in ports)
|
||||
{
|
||||
if (item.Value != null)
|
||||
{
|
||||
foreach( KeyValuePair<string, BlueprintPipeline> item in ports ) {
|
||||
if( item.Value != null ) {
|
||||
item.Value.WaitForStart();
|
||||
}
|
||||
}
|
||||
@@ -111,30 +107,31 @@ namespace StgSharp.BluePrint
|
||||
|
||||
#region pipline op
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[MethodImpl( MethodImplOptions.AggressiveInlining )]
|
||||
public void CompleteAndSkip()
|
||||
{
|
||||
//Console.WriteLine($"Complete\t{former.Name}\t->\t{after.Name}");
|
||||
formerCompleteSemaphore.Release();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void CompleteAndWriteData(BlueprintPipelineArgs args)
|
||||
[MethodImpl( MethodImplOptions.AggressiveInlining )]
|
||||
public void CompleteAndWriteData( BlueprintPipelineArgs args )
|
||||
{
|
||||
this.args = args;
|
||||
CompleteAndSkip();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public abstract class BlueprintPipelineArgs
|
||||
{
|
||||
|
||||
public object? Value { get; set; }
|
||||
public object? Value
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user