C# Class kOS.Safe.Execution.YieldFinishedGameTimer

A kind of YieldFinishedDetector for use when you just want a 'dumb' timer based on the KSP game clock (note: uses the game's notion of simulated time rather than the real-time wall clock. I.e. the timer is frozen for the duration of a FixedUpdate, and doesn't move at all if the game is paused, etc.).

You'd have to make a slightly different derivative of YieldFinishedDetector in order to base your timer on the out-of-game wall clock.
Inheritance: YieldFinishedDetector
Mostrar archivo Open project: KSP-KOS/KOS

Public Methods

Method Description
Begin ( SafeSharedObjects shared ) : void

Need to track the shared object in order to query current game time. The timer starts "counting" from where the clock was when the CPU calls this (which it does as soon as you do a YieldProgram() call.)

IsFinished ( ) : bool

Return true if the timer ran out, or false if the timer has not run out.

YieldFinishedGameTimer ( double duration )

Make a new timer that will expire after the given number of seconds have passed in game-clock time (not real-world time).

Method Details

Begin() public method

Need to track the shared object in order to query current game time. The timer starts "counting" from where the clock was when the CPU calls this (which it does as soon as you do a YieldProgram() call.)
public Begin ( SafeSharedObjects shared ) : void
shared SafeSharedObjects
return void

IsFinished() public method

Return true if the timer ran out, or false if the timer has not run out.
public IsFinished ( ) : bool
return bool

YieldFinishedGameTimer() public method

Make a new timer that will expire after the given number of seconds have passed in game-clock time (not real-world time).
public YieldFinishedGameTimer ( double duration )
duration double