pxt-common-packages 10.3.25 → 10.3.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/libs/azureiot/built/debug/binary.js +461 -461
  2. package/libs/color/built/debug/binary.js +8 -8
  3. package/libs/color-sensor/built/debug/binary.js +8 -8
  4. package/libs/controller/built/debug/binary.js +7118 -7118
  5. package/libs/controller---none/built/debug/binary.js +7098 -7098
  6. package/libs/datalogger/built/debug/binary.js +63 -63
  7. package/libs/edge-connector/built/debug/binary.js +8 -8
  8. package/libs/esp32/built/debug/binary.js +462 -462
  9. package/libs/game/built/debug/binary.js +7037 -7037
  10. package/libs/game/game.ts +11 -1
  11. package/libs/game/info.ts +7 -2
  12. package/libs/lcd/built/debug/binary.js +8 -8
  13. package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
  14. package/libs/lora/built/debug/binary.js +8 -8
  15. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  16. package/libs/mqtt/built/debug/binary.js +176 -176
  17. package/libs/net/built/debug/binary.js +176 -176
  18. package/libs/net-game/built/debug/binary.js +8626 -8626
  19. package/libs/palette/built/debug/binary.js +7036 -7036
  20. package/libs/pixel/built/debug/binary.js +8 -8
  21. package/libs/power/built/debug/binary.js +8 -8
  22. package/libs/proximity/built/debug/binary.js +8 -8
  23. package/libs/radio/built/debug/binary.js +8 -8
  24. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  25. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  26. package/libs/screen/built/debug/binary.js +50 -50
  27. package/libs/servo/built/debug/binary.js +8 -8
  28. package/libs/sprite-scaling/built/debug/binary.js +7036 -7036
  29. package/libs/storyboard/built/debug/binary.js +7036 -7036
  30. package/package.json +1 -1
package/libs/game/game.ts CHANGED
@@ -348,6 +348,15 @@ namespace game {
348
348
  _gameOverImpl(true, player);
349
349
  }
350
350
 
351
+ function _mapScoreTypeToString(scoreType: ScoringType): string {
352
+ switch (scoreType) {
353
+ case ScoringType.HighScore: return "highscore";
354
+ case ScoringType.LowScore: return "lowscore";
355
+ case ScoringType.None: return "none";
356
+ default: return "none";
357
+ }
358
+ }
359
+
351
360
  function _gameOverImpl(win: boolean, winnerOverride?: number) {
352
361
  init();
353
362
  if (__isOver) return;
@@ -365,7 +374,8 @@ namespace game {
365
374
  const scores = playersWithScores.map(player => new GameOverPlayerScore(player.number, player.impl.score(), player === winner));
366
375
 
367
376
  // Save all scores. Dependency Note: this action triggers Kiosk to exit the simulator and show the high score screen.
368
- info.saveAllScores();
377
+ const scoreTypeString = _mapScoreTypeToString(goc.scoringType);
378
+ info.saveAllScores(scoreTypeString);
369
379
 
370
380
  // Save high score if this was a judged game and there was a winner (don't save in the LOSE case).
371
381
  if (judged && winner) {
package/libs/game/info.ts CHANGED
@@ -241,7 +241,7 @@ namespace info {
241
241
  return players ? players.filter(item => item.impl.hasScore()) : [];
242
242
  }
243
243
 
244
- export function saveAllScores() {
244
+ export function saveAllScores(scoringType: string) {
245
245
  const allScoresKey = "all-scores";
246
246
  let allScores: number[];
247
247
  const pws = playersWithScores();
@@ -252,7 +252,12 @@ namespace info {
252
252
  allScores = [];
253
253
  }
254
254
 
255
- settings.writeJSON(allScoresKey, allScores);
255
+ const scoresObj = {
256
+ "allScores": allScores,
257
+ "scoringType": allScores.length ? scoringType : "None"
258
+ }
259
+
260
+ settings.writeJSON(allScoresKey, scoresObj);
256
261
  }
257
262
 
258
263
  export function winningPlayer(): PlayerInfo {
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P48881(s) {
59
+ function _main___P48882(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___49124 = (undefined);
70
- globals._pollEventQueue___49137 = (undefined);
69
+ globals._intervals___49125 = (undefined);
70
+ globals._pollEventQueue___49138 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P48881.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P48881.continuations = [ ]
75
+ _main___P48882.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"characterlcd.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P48882.continuations = [ ]
77
77
 
78
- function _main___P48881_mk(s) {
78
+ function _main___P48882_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P48881, depth: s.depth + 1,
81
+ parent: s, fn: _main___P48882, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P48881_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P48881
91
+ return _main___P48882
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P98981(s) {
59
+ function _main___P98984(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___99224 = (undefined);
70
- globals._pollEventQueue___99237 = (undefined);
69
+ globals._intervals___99227 = (undefined);
70
+ globals._pollEventQueue___99240 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P98981.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P98981.continuations = [ ]
75
+ _main___P98984.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"tsl2591.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P98984.continuations = [ ]
77
77
 
78
- function _main___P98981_mk(s) {
78
+ function _main___P98984_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P98981, depth: s.depth + 1,
81
+ parent: s, fn: _main___P98984, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P98981_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P98981
91
+ return _main___P98984
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P60189(s) {
59
+ function _main___P60190(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___60432 = (undefined);
70
- globals._pollEventQueue___60445 = (undefined);
69
+ globals._intervals___60433 = (undefined);
70
+ globals._pollEventQueue___60446 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P60189.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P60189.continuations = [ ]
75
+ _main___P60190.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"lora.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P60190.continuations = [ ]
77
77
 
78
- function _main___P60189_mk(s) {
78
+ function _main___P60190_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P60189, depth: s.depth + 1,
81
+ parent: s, fn: _main___P60190, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P60189_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P60189
91
+ return _main___P60190
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P192693(s) {
59
+ function _main___P192700(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___192936 = (undefined);
70
- globals._pollEventQueue___192949 = (undefined);
69
+ globals._intervals___192943 = (undefined);
70
+ globals._pollEventQueue___192956 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P192693.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P192693.continuations = [ ]
75
+ _main___P192700.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"keypad.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P192700.continuations = [ ]
77
77
 
78
- function _main___P192693_mk(s) {
78
+ function _main___P192700_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P192693, depth: s.depth + 1,
81
+ parent: s, fn: _main___P192700, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P192693_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P192693
91
+ return _main___P192700
92
92
  })