@battle-racing/br-common-lib 2.3.0 → 2.4.0

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 (34) hide show
  1. package/dist/constants/hardware/base-hardware-status.d.ts +6 -0
  2. package/dist/constants/hardware/base-hardware-status.js +9 -0
  3. package/dist/constants/hardware/flag-status.d.ts +3 -2
  4. package/dist/constants/hardware/flag-status.js +2 -3
  5. package/dist/constants/hardware/index.d.ts +2 -0
  6. package/dist/constants/hardware/index.js +2 -0
  7. package/dist/constants/hardware/rgb-status.d.ts +8 -0
  8. package/dist/constants/hardware/rgb-status.js +11 -0
  9. package/dist/constants/hardware/speed-status.d.ts +9 -0
  10. package/dist/constants/hardware/speed-status.js +10 -0
  11. package/dist/types/gameTrack/GameTrackKartsConfig.d.ts +3 -1
  12. package/dist/types/hardware/KartHardwareState.d.ts +10 -0
  13. package/dist/types/hardware/KartHardwareState.js +2 -0
  14. package/dist/types/hardware/index.d.ts +1 -0
  15. package/dist/types/hardware/index.js +1 -0
  16. package/dist/types/hardware/rgb/RGBStatus.d.ts +3 -1
  17. package/dist/types/hardware/screen/ScreenDebugViewInput.d.ts +4 -0
  18. package/dist/types/hardware/screen/ScreenDebugViewInput.js +2 -0
  19. package/dist/types/hardware/screen/index.d.ts +1 -0
  20. package/dist/types/hardware/screen/index.js +1 -0
  21. package/dist/types/hardware/speed/SpeedStatus.d.ts +3 -1
  22. package/package.json +1 -1
  23. package/src/constants/hardware/base-hardware-status.ts +6 -0
  24. package/src/constants/hardware/flag-status.ts +3 -3
  25. package/src/constants/hardware/index.ts +2 -1
  26. package/src/constants/hardware/rgb-status.ts +8 -0
  27. package/src/constants/hardware/speed-status.ts +8 -0
  28. package/src/types/gameTrack/GameTrackKartsConfig.ts +3 -1
  29. package/src/types/hardware/KartHardwareState.ts +11 -0
  30. package/src/types/hardware/index.ts +1 -0
  31. package/src/types/hardware/rgb/RGBStatus.ts +4 -1
  32. package/src/types/hardware/screen/ScreenDebugViewInput.ts +5 -0
  33. package/src/types/hardware/screen/index.ts +1 -0
  34. package/src/types/hardware/speed/SpeedStatus.ts +4 -1
@@ -0,0 +1,6 @@
1
+ export declare const BASE_HARDWARE_STATUS: {
2
+ readonly ACTIVATED: "Activated";
3
+ readonly DEACTIVATED: "Deactivated";
4
+ readonly UNKNOWN: "Unknown";
5
+ readonly ERROR: "Error";
6
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BASE_HARDWARE_STATUS = void 0;
4
+ exports.BASE_HARDWARE_STATUS = {
5
+ ACTIVATED: 'Activated',
6
+ DEACTIVATED: 'Deactivated',
7
+ UNKNOWN: 'Unknown',
8
+ ERROR: 'Error',
9
+ };
@@ -1,9 +1,10 @@
1
1
  export declare const FLAG_STATUS: {
2
2
  readonly STANDBY: "Standby";
3
- readonly DEACTIVATED: "Deactivated";
4
- readonly ACTIVATED: "Activated";
5
3
  readonly HIT: "Hit";
6
4
  readonly SHOWING_IMAGE: "Showing Image";
7
5
  readonly SHOWING_ANIMATION: "Showing Animation";
6
+ readonly ACTIVATED: "Activated";
7
+ readonly DEACTIVATED: "Deactivated";
8
8
  readonly UNKNOWN: "Unknown";
9
+ readonly ERROR: "Error";
9
10
  };
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FLAG_STATUS = void 0;
4
+ const base_hardware_status_1 = require("./base-hardware-status");
4
5
  exports.FLAG_STATUS = {
6
+ ...base_hardware_status_1.BASE_HARDWARE_STATUS,
5
7
  STANDBY: 'Standby',
6
- DEACTIVATED: 'Deactivated',
7
- ACTIVATED: 'Activated',
8
8
  HIT: 'Hit',
9
9
  SHOWING_IMAGE: 'Showing Image',
10
10
  SHOWING_ANIMATION: 'Showing Animation',
11
- UNKNOWN: 'Unknown',
12
11
  };
@@ -1,4 +1,6 @@
1
+ export * from './base-hardware-status';
1
2
  export * from './damage';
2
3
  export * from './flag-media-name';
3
4
  export * from './flag-status';
4
5
  export * from './lights-effect';
6
+ export * from './speed-status';
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./base-hardware-status"), exports);
17
18
  __exportStar(require("./damage"), exports);
18
19
  __exportStar(require("./flag-media-name"), exports);
19
20
  __exportStar(require("./flag-status"), exports);
20
21
  __exportStar(require("./lights-effect"), exports);
22
+ __exportStar(require("./speed-status"), exports);
@@ -0,0 +1,8 @@
1
+ export declare const RGB_STATUS: {
2
+ readonly SHOWING_COLOR: "Showing Color";
3
+ readonly NOT_CONFIGURED: "Not Configured";
4
+ readonly CONFIGURING_RGB: "Configuring RGB";
5
+ readonly SHOWING_EFFECT: "Showing Effect";
6
+ readonly UNKNOWN: "Unknown";
7
+ readonly ERROR: "Error";
8
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RGB_STATUS = void 0;
4
+ exports.RGB_STATUS = {
5
+ SHOWING_COLOR: 'Showing Color',
6
+ NOT_CONFIGURED: 'Not Configured',
7
+ CONFIGURING_RGB: 'Configuring RGB',
8
+ SHOWING_EFFECT: 'Showing Effect',
9
+ UNKNOWN: 'Unknown',
10
+ ERROR: 'Error',
11
+ };
@@ -0,0 +1,9 @@
1
+ export declare const SPEED_STATUS: {
2
+ readonly STANDBY: "Standby";
3
+ readonly CHANGING_SPEED: "Changing Speed";
4
+ readonly IN_EMERGENCY: "In Emergency";
5
+ readonly ACTIVATED: "Activated";
6
+ readonly DEACTIVATED: "Deactivated";
7
+ readonly UNKNOWN: "Unknown";
8
+ readonly ERROR: "Error";
9
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPEED_STATUS = void 0;
4
+ const base_hardware_status_1 = require("./base-hardware-status");
5
+ exports.SPEED_STATUS = {
6
+ ...base_hardware_status_1.BASE_HARDWARE_STATUS,
7
+ STANDBY: 'Standby',
8
+ CHANGING_SPEED: 'Changing Speed',
9
+ IN_EMERGENCY: 'In Emergency',
10
+ };
@@ -1,7 +1,7 @@
1
1
  import type { ConfigDiskSensorBallShooterModuleOptions, ConfigureBallSensorDiskThrowerModuleOptions } from '../hardware';
2
2
  /**
3
3
  * Global Karts Config are provided from the Game Track.
4
- * Leting the specific Kart values like times, Ids, or other specific values to be set during the game.
4
+ * Letting the specific Kart values like times, Ids, or other specific values to be set during the game.
5
5
  *
6
6
  * powerUpTime: Will be the time configuration of each Module.
7
7
  */
@@ -18,4 +18,6 @@ export interface GameTrackKartsConfig {
18
18
  diskSensorBallShooter: ConfigDiskSensorBallShooterModuleOptions;
19
19
  /** Full Configuration of the Ball Sensor Disk Thrower */
20
20
  ballSensorDiskThrower: ConfigureBallSensorDiskThrowerModuleOptions;
21
+ /** Low Speed (0 - 100) */
22
+ lowSpeed: number;
21
23
  }
@@ -0,0 +1,10 @@
1
+ import type { FlagStatus } from './flag';
2
+ import type { RGBStatus } from './rgb';
3
+ import type { SpeedStatus } from './speed';
4
+ export type KartHardwareState = {
5
+ speed: SpeedStatus | null;
6
+ rgb: RGBStatus | null;
7
+ flag: FlagStatus | null;
8
+ isConnectedToServer: boolean;
9
+ isSteeringWheelPressed: boolean;
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ export * from './diskThrower';
5
5
  export * from './emergency';
6
6
  export * from './flag';
7
7
  export * from './KartEffect';
8
+ export * from './KartHardwareState';
8
9
  export * from './lights';
9
10
  export * from './ModuleName';
10
11
  export * from './ModuleStatus';
@@ -21,6 +21,7 @@ __exportStar(require("./diskThrower"), exports);
21
21
  __exportStar(require("./emergency"), exports);
22
22
  __exportStar(require("./flag"), exports);
23
23
  __exportStar(require("./KartEffect"), exports);
24
+ __exportStar(require("./KartHardwareState"), exports);
24
25
  __exportStar(require("./lights"), exports);
25
26
  __exportStar(require("./ModuleName"), exports);
26
27
  __exportStar(require("./ModuleStatus"), exports);
@@ -1 +1,3 @@
1
- export type RGBStatus = 'Showing Color' | 'Not Configured' | 'Configuring RGB' | 'Showing Effect' | 'Unknown';
1
+ import { RGB_STATUS } from '../../../constants/hardware/rgb-status';
2
+ import type { ObjectValues } from '../../utils';
3
+ export type RGBStatus = ObjectValues<typeof RGB_STATUS>;
@@ -0,0 +1,4 @@
1
+ import type { KartHardwareState } from '../KartHardwareState';
2
+ export type ScreenDebugViewInput = KartHardwareState & {
3
+ kartNumber: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export * from './ScreenBattleViewConfig';
2
2
  export * from './ScreenCountdownParams';
3
+ export * from './ScreenDebugViewInput';
3
4
  export * from './ScreenFinishViewInput';
4
5
  export * from './ScreenGameTimeLeft';
5
6
  export * from './ScreenHomeViewInput';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ScreenBattleViewConfig"), exports);
18
18
  __exportStar(require("./ScreenCountdownParams"), exports);
19
+ __exportStar(require("./ScreenDebugViewInput"), exports);
19
20
  __exportStar(require("./ScreenFinishViewInput"), exports);
20
21
  __exportStar(require("./ScreenGameTimeLeft"), exports);
21
22
  __exportStar(require("./ScreenHomeViewInput"), exports);
@@ -1 +1,3 @@
1
- export type SpeedStatus = 'Standby' | 'Deactivated' | 'Activated' | 'Changing Speed' | 'In Emergency' | 'Unknown';
1
+ import { SPEED_STATUS } from '../../../constants/hardware';
2
+ import { ObjectValues } from '../../utils';
3
+ export type SpeedStatus = ObjectValues<typeof SPEED_STATUS>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battle-racing/br-common-lib",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Common library for all Battle Racing Repositorios",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -0,0 +1,6 @@
1
+ export const BASE_HARDWARE_STATUS = {
2
+ ACTIVATED: 'Activated',
3
+ DEACTIVATED: 'Deactivated',
4
+ UNKNOWN: 'Unknown',
5
+ ERROR: 'Error',
6
+ } as const;
@@ -1,9 +1,9 @@
1
+ import { BASE_HARDWARE_STATUS } from './base-hardware-status';
2
+
1
3
  export const FLAG_STATUS = {
4
+ ...BASE_HARDWARE_STATUS,
2
5
  STANDBY: 'Standby',
3
- DEACTIVATED: 'Deactivated',
4
- ACTIVATED: 'Activated',
5
6
  HIT: 'Hit',
6
7
  SHOWING_IMAGE: 'Showing Image',
7
8
  SHOWING_ANIMATION: 'Showing Animation',
8
- UNKNOWN: 'Unknown',
9
9
  } as const;
@@ -1,5 +1,6 @@
1
+ export * from './base-hardware-status';
1
2
  export * from './damage';
2
3
  export * from './flag-media-name';
3
4
  export * from './flag-status';
4
5
  export * from './lights-effect';
5
-
6
+ export * from './speed-status';
@@ -0,0 +1,8 @@
1
+ export const RGB_STATUS = {
2
+ SHOWING_COLOR: 'Showing Color',
3
+ NOT_CONFIGURED: 'Not Configured',
4
+ CONFIGURING_RGB: 'Configuring RGB',
5
+ SHOWING_EFFECT: 'Showing Effect',
6
+ UNKNOWN: 'Unknown',
7
+ ERROR: 'Error',
8
+ } as const;
@@ -0,0 +1,8 @@
1
+ import { BASE_HARDWARE_STATUS } from './base-hardware-status';
2
+
3
+ export const SPEED_STATUS = {
4
+ ...BASE_HARDWARE_STATUS,
5
+ STANDBY: 'Standby',
6
+ CHANGING_SPEED: 'Changing Speed',
7
+ IN_EMERGENCY: 'In Emergency',
8
+ } as const;
@@ -5,7 +5,7 @@ import type {
5
5
 
6
6
  /**
7
7
  * Global Karts Config are provided from the Game Track.
8
- * Leting the specific Kart values like times, Ids, or other specific values to be set during the game.
8
+ * Letting the specific Kart values like times, Ids, or other specific values to be set during the game.
9
9
  *
10
10
  * powerUpTime: Will be the time configuration of each Module.
11
11
  */
@@ -22,4 +22,6 @@ export interface GameTrackKartsConfig {
22
22
  diskSensorBallShooter: ConfigDiskSensorBallShooterModuleOptions;
23
23
  /** Full Configuration of the Ball Sensor Disk Thrower */
24
24
  ballSensorDiskThrower: ConfigureBallSensorDiskThrowerModuleOptions;
25
+ /** Low Speed (0 - 100) */
26
+ lowSpeed: number;
25
27
  }
@@ -0,0 +1,11 @@
1
+ import type { FlagStatus } from './flag';
2
+ import type { RGBStatus } from './rgb';
3
+ import type { SpeedStatus } from './speed';
4
+
5
+ export type KartHardwareState = {
6
+ speed: SpeedStatus | null;
7
+ rgb: RGBStatus | null;
8
+ flag: FlagStatus | null;
9
+ isConnectedToServer: boolean;
10
+ isSteeringWheelPressed: boolean;
11
+ };
@@ -5,6 +5,7 @@ export * from './diskThrower';
5
5
  export * from './emergency';
6
6
  export * from './flag';
7
7
  export * from './KartEffect';
8
+ export * from './KartHardwareState';
8
9
  export * from './lights';
9
10
  export * from './ModuleName';
10
11
  export * from './ModuleStatus';
@@ -1 +1,4 @@
1
- export type RGBStatus = 'Showing Color' | 'Not Configured' | 'Configuring RGB' | 'Showing Effect' | 'Unknown';
1
+ import { RGB_STATUS } from '../../../constants/hardware/rgb-status';
2
+ import type { ObjectValues } from '../../utils';
3
+
4
+ export type RGBStatus = ObjectValues<typeof RGB_STATUS >;
@@ -0,0 +1,5 @@
1
+ import type { KartHardwareState } from '../KartHardwareState';
2
+
3
+ export type ScreenDebugViewInput = KartHardwareState & {
4
+ kartNumber: number;
5
+ };
@@ -1,5 +1,6 @@
1
1
  export * from './ScreenBattleViewConfig';
2
2
  export * from './ScreenCountdownParams';
3
+ export * from './ScreenDebugViewInput';
3
4
  export * from './ScreenFinishViewInput';
4
5
  export * from './ScreenGameTimeLeft';
5
6
  export * from './ScreenHomeViewInput';
@@ -1 +1,4 @@
1
- export type SpeedStatus = 'Standby' | 'Deactivated' | 'Activated' | 'Changing Speed' | 'In Emergency' | 'Unknown';
1
+ import { SPEED_STATUS } from '../../../constants/hardware';
2
+ import { ObjectValues } from '../../utils';
3
+
4
+ export type SpeedStatus = ObjectValues<typeof SPEED_STATUS>;