splits m:b simulator state

This commit is contained in:
darzu
2016-08-30 11:51:32 -07:00
parent a984778dfd
commit 89e899cc79
12 changed files with 1519 additions and 711 deletions

17
sim/state/lightsensor.ts Normal file
View File

@ -0,0 +1,17 @@
namespace pxsim {
export class LightSensorState {
usesLightLevel = false;
lightLevel = 128;
}
}
namespace pxsim.input {
export function lightLevel(): number {
let b = board().lightSensorState;
if (!b.usesLightLevel) {
b.usesLightLevel = true;
runtime.queueDisplayUpdate();
}
return b.lightLevel;
}
}