daily update on 20241002 by nitload youmu, intrinsic function rebuild, syntax style arrange
This commit is contained in:
@@ -45,34 +45,39 @@ namespace StgSharp.BluePrint
|
||||
|
||||
private readonly int cycleCount;
|
||||
|
||||
public CrossFrameOperation(Action startup, int cycleCount)
|
||||
public CrossFrameOperation( Action startup, int cycleCount )
|
||||
{
|
||||
MainExecution = startup;
|
||||
this.cycleCount = (cycleCount > 1) ? cycleCount : throw new ArgumentException(
|
||||
$"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(BlueprintNode).Name} instead."}");
|
||||
this.cycleCount = ( cycleCount > 1 ) ?
|
||||
cycleCount : throw new ArgumentException(
|
||||
$"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(BlueprintNode).Name} instead."}" );
|
||||
this.cycleCount = cycleCount;
|
||||
currentCount = cycleCount;
|
||||
}
|
||||
|
||||
public Action MainExecution { get; private protected set; }
|
||||
public Action MainExecution
|
||||
{
|
||||
get;
|
||||
private protected set;
|
||||
}
|
||||
|
||||
public static string InputInterfacesName => "TaskIn";
|
||||
|
||||
public static string OutputInterfacesName => "TaskOut";
|
||||
|
||||
public void ExecuteMain(in Dictionary<string, BlueprintPipeline> input, in Dictionary<string, BlueprintPipeline> output)
|
||||
public void ExecuteMain(
|
||||
in Dictionary<string, BlueprintPipeline> input,
|
||||
in Dictionary<string, BlueprintPipeline> output )
|
||||
{
|
||||
if (currentCount < cycleCount)
|
||||
{
|
||||
Interlocked.Increment(ref currentCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
Interlocked.Exchange(ref currentCount, 0);
|
||||
Task.Run(MainExecution);
|
||||
if( currentCount < cycleCount ) {
|
||||
Interlocked.Increment( ref currentCount );
|
||||
} else {
|
||||
Interlocked.Exchange( ref currentCount, 0 );
|
||||
Task.Run( MainExecution );
|
||||
}
|
||||
|
||||
//Console.WriteLine(currentCount);
|
||||
BlueprintPipeline.SkipAll(output);
|
||||
BlueprintPipeline.SkipAll( output );
|
||||
}
|
||||
|
||||
string[] IConvertableToBlueprintNode.InputInterfacesName => [InputInterfacesName];
|
||||
|
||||
Reference in New Issue
Block a user