The ExecuteAndRemoveOrCyclePassedInstructions will execute instructions which should be executed based off of the current time, then either remove or cycle any executed instructions. This method allows manual execution of Instructions without requiring the user to write the logic of time testing and cycling.
This method is used internally by the FlatRedBall Engine so calling it will guarantee behavior which matches the engine's behavior regarding Instruction management.
Assuming that instructionList is a valid instance, the following code can be called every frame to execute and remove Instructions from the instructionList:
The InstructionList class is a class which provides methods that can simplify manual interaction with Instructions. Most of the time you will not need to manually interact with Instructions as the FlatRedBall Engine provides automatic management for Instructions, but more sophisticated applications which need more direct access to Instructions will benefit from the use of the InstructionList class.
Did this article leave any questions unanswered? Post any question in our forums for a rapid response.