This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SuspendedVariable<T>(var scope: CoroutineScope? = GlobalScope) { | |
private var actor = scope?.actor<Op<T>> { | |
var value : T? = null | |
val deferrals = mutableListOf<CompletableDeferred<T>>() | |
try { | |
for (message in channel) { | |
when (message) { | |
is Op.Set -> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clearscreen. | |
sas on. | |
stage. | |
lock distance to ship:altitude + ship:body:radius. | |
lock weight to ship:mass * ship:body:mu / distance / distance. | |
lock twr to ship:availablethrust / weight. | |
lock atwr to twr / max(0.00001, cos(vang(ship:facing:vector,ship:up:vector))). | |
lock vspeed to 5 - alt:radar. |