C# (CSharp) kOS.Safe.Execution YieldFinishedDetector - 2개의 예제가 발견되었습니다. 이것들은 오픈소스 프로젝트에서 추출된 C# (CSharp)의 kOS.Safe.Execution.YieldFinishedDetector에 대한 실세계 최고 등급의 예제들입니다. 예제들을 평가하여 예제의 품질 향상에 도움을 줄 수 있습니다.
When telling kOS's CPU that it should yield, using the CPU.YieldProgram() method, you make a new instance of a derivative of this class to manage the decision of when it should resume again. kOS's CPU will repeatedly re-check the instance of this class whenever it wants to execute Opcodes, and only when this class says so will it resume execution of the Opcodes.
When you make a new instance of this class you should immediately "forget" it after it is passed to YieldProgram() (i.e. don't hold a reference to it.) If you call YieldProgram() again, it should always be a with a new instance of this class.
When you inherit from this class, you should store any data values that are part of the decision "am I done waiting" as members of this class, such that each new instance gets its own set of such fields and all instances can decide "am I done" indepentantly of each other.
The reason all the above instructions are relevant is that they allow the same Opcode, or Built-in Function to cause more than one YieldProgram to exist similtaneously from them. (i.e. a Wait Opcode inside a function, and that function gets called from both the mainline code and a trigger. You want two different wait timers going for them even though they're coming from the exact same OpcodeWait instance in the program.)