@battle-racing/br-common-lib 1.0.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.
- package/.prettierrc +8 -0
- package/dist/checkpoint/Checkpoint.d.ts +10 -0
- package/dist/checkpoint/Checkpoint.js +2 -0
- package/dist/checkpoint/CheckpointType.d.ts +5 -0
- package/dist/checkpoint/CheckpointType.js +8 -0
- package/dist/checkpoint/index.d.ts +2 -0
- package/dist/checkpoint/index.js +18 -0
- package/dist/color/ColorInfo.d.ts +4 -0
- package/dist/color/ColorInfo.js +2 -0
- package/dist/color/ColorName.d.ts +1 -0
- package/dist/color/ColorName.js +2 -0
- package/dist/color/index.d.ts +2 -0
- package/dist/color/index.js +18 -0
- package/dist/command/CommandConfig.d.ts +156 -0
- package/dist/command/CommandConfig.js +2 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +17 -0
- package/dist/damage/Damage.d.ts +14 -0
- package/dist/damage/Damage.js +2 -0
- package/dist/damage/DamageName.d.ts +1 -0
- package/dist/damage/DamageName.js +2 -0
- package/dist/damage/DamageTarget.d.ts +1 -0
- package/dist/damage/DamageTarget.js +2 -0
- package/dist/damage/index.d.ts +3 -0
- package/dist/damage/index.js +19 -0
- package/dist/flow/Flow.d.ts +7 -0
- package/dist/flow/Flow.js +2 -0
- package/dist/flow/index.d.ts +1 -0
- package/dist/flow/index.js +17 -0
- package/dist/game/Game.d.ts +36 -0
- package/dist/game/Game.js +14 -0
- package/dist/game/GameStatus.d.ts +9 -0
- package/dist/game/GameStatus.js +12 -0
- package/dist/game/GameType.d.ts +5 -0
- package/dist/game/GameType.js +8 -0
- package/dist/game/GameWarningEvent.d.ts +1 -0
- package/dist/game/GameWarningEvent.js +2 -0
- package/dist/game/KartRankingItem.d.ts +5 -0
- package/dist/game/KartRankingItem.js +2 -0
- package/dist/game/battle/Battle.d.ts +9 -0
- package/dist/game/battle/Battle.js +2 -0
- package/dist/game/battle/index.d.ts +1 -0
- package/dist/game/battle/index.js +17 -0
- package/dist/game/index.d.ts +7 -0
- package/dist/game/index.js +23 -0
- package/dist/game/race/KartProgress.d.ts +10 -0
- package/dist/game/race/KartProgress.js +2 -0
- package/dist/game/race/Race.d.ts +17 -0
- package/dist/game/race/Race.js +2 -0
- package/dist/game/race/index.d.ts +2 -0
- package/dist/game/race/index.js +18 -0
- package/dist/gameTrack/GameTrack.d.ts +12 -0
- package/dist/gameTrack/GameTrack.js +2 -0
- package/dist/gameTrack/GameTrackKartsConfig.d.ts +21 -0
- package/dist/gameTrack/GameTrackKartsConfig.js +2 -0
- package/dist/gameTrack/index.d.ts +2 -0
- package/dist/gameTrack/index.js +18 -0
- package/dist/hardware/KartEffect.d.ts +1 -0
- package/dist/hardware/KartEffect.js +2 -0
- package/dist/hardware/ModuleName.d.ts +1 -0
- package/dist/hardware/ModuleName.js +2 -0
- package/dist/hardware/ModuleStatus.d.ts +9 -0
- package/dist/hardware/ModuleStatus.js +2 -0
- package/dist/hardware/ballSensor/BallSensorCommand.d.ts +1 -0
- package/dist/hardware/ballSensor/BallSensorCommand.js +2 -0
- package/dist/hardware/ballSensor/BallSensorDiskThrowerModuleStatus.d.ts +4 -0
- package/dist/hardware/ballSensor/BallSensorDiskThrowerModuleStatus.js +2 -0
- package/dist/hardware/ballSensor/BallSensorStatus.d.ts +1 -0
- package/dist/hardware/ballSensor/BallSensorStatus.js +2 -0
- package/dist/hardware/ballSensor/ConfigureBallSensorDiskThrowerModuleOptions.d.ts +4 -0
- package/dist/hardware/ballSensor/ConfigureBallSensorDiskThrowerModuleOptions.js +2 -0
- package/dist/hardware/ballSensor/index.d.ts +4 -0
- package/dist/hardware/ballSensor/index.js +20 -0
- package/dist/hardware/ballShooter/BallShooterCommand.d.ts +1 -0
- package/dist/hardware/ballShooter/BallShooterCommand.js +2 -0
- package/dist/hardware/ballShooter/BallShooterStatus.d.ts +1 -0
- package/dist/hardware/ballShooter/BallShooterStatus.js +2 -0
- package/dist/hardware/ballShooter/index.d.ts +2 -0
- package/dist/hardware/ballShooter/index.js +18 -0
- package/dist/hardware/diskSensor/ConfigDiskSensorBallShooterModuleOptions.d.ts +8 -0
- package/dist/hardware/diskSensor/ConfigDiskSensorBallShooterModuleOptions.js +2 -0
- package/dist/hardware/diskSensor/DiskSensorBallShooterModuleStatus.d.ts +4 -0
- package/dist/hardware/diskSensor/DiskSensorBallShooterModuleStatus.js +2 -0
- package/dist/hardware/diskSensor/DiskSensorCommand.d.ts +1 -0
- package/dist/hardware/diskSensor/DiskSensorCommand.js +2 -0
- package/dist/hardware/diskSensor/DiskSensorStatus.d.ts +1 -0
- package/dist/hardware/diskSensor/DiskSensorStatus.js +2 -0
- package/dist/hardware/diskSensor/index.d.ts +4 -0
- package/dist/hardware/diskSensor/index.js +20 -0
- package/dist/hardware/diskThrower/DiskThrowerCommand.d.ts +1 -0
- package/dist/hardware/diskThrower/DiskThrowerCommand.js +2 -0
- package/dist/hardware/diskThrower/DiskThrowerStatus.d.ts +1 -0
- package/dist/hardware/diskThrower/DiskThrowerStatus.js +2 -0
- package/dist/hardware/diskThrower/index.d.ts +2 -0
- package/dist/hardware/diskThrower/index.js +18 -0
- package/dist/hardware/emergency/EmergencyActionCommand.d.ts +1 -0
- package/dist/hardware/emergency/EmergencyActionCommand.js +2 -0
- package/dist/hardware/emergency/EmergencyModuleStatus.d.ts +4 -0
- package/dist/hardware/emergency/EmergencyModuleStatus.js +2 -0
- package/dist/hardware/emergency/EmergencyStatus.d.ts +1 -0
- package/dist/hardware/emergency/EmergencyStatus.js +2 -0
- package/dist/hardware/emergency/index.d.ts +3 -0
- package/dist/hardware/emergency/index.js +19 -0
- package/dist/hardware/flag/FlagActionCommand.d.ts +1 -0
- package/dist/hardware/flag/FlagActionCommand.js +2 -0
- package/dist/hardware/flag/FlagConfigurationOptions.d.ts +10 -0
- package/dist/hardware/flag/FlagConfigurationOptions.js +2 -0
- package/dist/hardware/flag/FlagMediaName.d.ts +74 -0
- package/dist/hardware/flag/FlagMediaName.js +85 -0
- package/dist/hardware/flag/FlagModuleStatus.d.ts +7 -0
- package/dist/hardware/flag/FlagModuleStatus.js +2 -0
- package/dist/hardware/flag/FlagShowMediaOptions.d.ts +14 -0
- package/dist/hardware/flag/FlagShowMediaOptions.js +2 -0
- package/dist/hardware/flag/FlagStatus.d.ts +1 -0
- package/dist/hardware/flag/FlagStatus.js +2 -0
- package/dist/hardware/flag/index.d.ts +6 -0
- package/dist/hardware/flag/index.js +22 -0
- package/dist/hardware/index.d.ts +15 -0
- package/dist/hardware/index.js +31 -0
- package/dist/hardware/rgb/RGBActionCommand.d.ts +1 -0
- package/dist/hardware/rgb/RGBActionCommand.js +2 -0
- package/dist/hardware/rgb/RGBConfigurationOptions.d.ts +8 -0
- package/dist/hardware/rgb/RGBConfigurationOptions.js +2 -0
- package/dist/hardware/rgb/RGBModuleStatus.d.ts +6 -0
- package/dist/hardware/rgb/RGBModuleStatus.js +2 -0
- package/dist/hardware/rgb/RGBShowEffectOptions.d.ts +4 -0
- package/dist/hardware/rgb/RGBShowEffectOptions.js +2 -0
- package/dist/hardware/rgb/RGBStatus.d.ts +1 -0
- package/dist/hardware/rgb/RGBStatus.js +2 -0
- package/dist/hardware/rgb/index.d.ts +5 -0
- package/dist/hardware/rgb/index.js +21 -0
- package/dist/hardware/screen/ScreenBattleViewConfig.d.ts +4 -0
- package/dist/hardware/screen/ScreenBattleViewConfig.js +2 -0
- package/dist/hardware/screen/ScreenCountdownParams.d.ts +11 -0
- package/dist/hardware/screen/ScreenCountdownParams.js +2 -0
- package/dist/hardware/screen/ScreenFinishViewInput.d.ts +7 -0
- package/dist/hardware/screen/ScreenFinishViewInput.js +2 -0
- package/dist/hardware/screen/ScreenGameTimeLeft.d.ts +4 -0
- package/dist/hardware/screen/ScreenGameTimeLeft.js +2 -0
- package/dist/hardware/screen/ScreenKartPosition.d.ts +4 -0
- package/dist/hardware/screen/ScreenKartPosition.js +2 -0
- package/dist/hardware/screen/ScreenRaceLaps.d.ts +4 -0
- package/dist/hardware/screen/ScreenRaceLaps.js +2 -0
- package/dist/hardware/screen/ScreenRaceViewConfig.d.ts +5 -0
- package/dist/hardware/screen/ScreenRaceViewConfig.js +2 -0
- package/dist/hardware/screen/ScreenUpdateGameViewInput.d.ts +11 -0
- package/dist/hardware/screen/ScreenUpdateGameViewInput.js +2 -0
- package/dist/hardware/screen/ScreenView.d.ts +1 -0
- package/dist/hardware/screen/ScreenView.js +2 -0
- package/dist/hardware/screen/ScreenViewBaseConfig.d.ts +11 -0
- package/dist/hardware/screen/ScreenViewBaseConfig.js +2 -0
- package/dist/hardware/screen/index.d.ts +10 -0
- package/dist/hardware/screen/index.js +26 -0
- package/dist/hardware/sound/PlaySoundOptions.d.ts +4 -0
- package/dist/hardware/sound/PlaySoundOptions.js +2 -0
- package/dist/hardware/sound/index.d.ts +1 -0
- package/dist/hardware/sound/index.js +17 -0
- package/dist/hardware/speed/SpeedActionCommand.d.ts +1 -0
- package/dist/hardware/speed/SpeedActionCommand.js +2 -0
- package/dist/hardware/speed/SpeedChangeOptions.d.ts +6 -0
- package/dist/hardware/speed/SpeedChangeOptions.js +2 -0
- package/dist/hardware/speed/SpeedConfiguration.d.ts +6 -0
- package/dist/hardware/speed/SpeedConfiguration.js +2 -0
- package/dist/hardware/speed/SpeedModuleStatus.d.ts +12 -0
- package/dist/hardware/speed/SpeedModuleStatus.js +2 -0
- package/dist/hardware/speed/SpeedStatus.d.ts +1 -0
- package/dist/hardware/speed/SpeedStatus.js +2 -0
- package/dist/hardware/speed/index.d.ts +5 -0
- package/dist/hardware/speed/index.js +21 -0
- package/dist/hardware/star-laser/StarLaserCommand.d.ts +1 -0
- package/dist/hardware/star-laser/StarLaserCommand.js +2 -0
- package/dist/hardware/star-laser/StarLaserConfigureModuleOptions.d.ts +7 -0
- package/dist/hardware/star-laser/StarLaserConfigureModuleOptions.js +2 -0
- package/dist/hardware/star-laser/StarLaserModuleStatus.d.ts +7 -0
- package/dist/hardware/star-laser/StarLaserModuleStatus.js +2 -0
- package/dist/hardware/star-laser/StarLaserSendActionsOptions.d.ts +5 -0
- package/dist/hardware/star-laser/StarLaserSendActionsOptions.js +2 -0
- package/dist/hardware/star-laser/StarLaserStatus.d.ts +1 -0
- package/dist/hardware/star-laser/StarLaserStatus.js +2 -0
- package/dist/hardware/star-laser/index.d.ts +5 -0
- package/dist/hardware/star-laser/index.js +21 -0
- package/dist/hardware/steering-wheel/SteeringWheelModuleStatus.d.ts +4 -0
- package/dist/hardware/steering-wheel/SteeringWheelModuleStatus.js +2 -0
- package/dist/hardware/steering-wheel/index.d.ts +1 -0
- package/dist/hardware/steering-wheel/index.js +17 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +36 -0
- package/dist/kart/Kart.d.ts +29 -0
- package/dist/kart/Kart.js +2 -0
- package/dist/kart/KartShield.d.ts +4 -0
- package/dist/kart/KartShield.js +2 -0
- package/dist/kart/KartStatus.d.ts +2 -0
- package/dist/kart/KartStatus.js +4 -0
- package/dist/kart/index.d.ts +2 -0
- package/dist/kart/index.js +18 -0
- package/dist/kartTracking/CheckpointEvent.d.ts +8 -0
- package/dist/kartTracking/CheckpointEvent.js +2 -0
- package/dist/kartTracking/KartTracking.d.ts +5 -0
- package/dist/kartTracking/KartTracking.js +2 -0
- package/dist/kartTracking/index.d.ts +2 -0
- package/dist/kartTracking/index.js +18 -0
- package/dist/powerUp/PowerUp.d.ts +27 -0
- package/dist/powerUp/PowerUp.js +2 -0
- package/dist/powerUp/PowerUpName.d.ts +1 -0
- package/dist/powerUp/PowerUpName.js +2 -0
- package/dist/powerUp/PowerUpShield.d.ts +6 -0
- package/dist/powerUp/PowerUpShield.js +2 -0
- package/dist/powerUp/PowerUpTarget.d.ts +11 -0
- package/dist/powerUp/PowerUpTarget.js +10 -0
- package/dist/powerUp/PowerUpType.d.ts +8 -0
- package/dist/powerUp/PowerUpType.js +7 -0
- package/dist/powerUp/index.d.ts +5 -0
- package/dist/powerUp/index.js +21 -0
- package/dist/response/ErrorResponse.d.ts +6 -0
- package/dist/response/ErrorResponse.js +2 -0
- package/dist/response/Response.d.ts +3 -0
- package/dist/response/Response.js +2 -0
- package/dist/response/SuccesResponse.d.ts +5 -0
- package/dist/response/SuccesResponse.js +2 -0
- package/dist/response/index.d.ts +3 -0
- package/dist/response/index.js +2 -0
- package/dist/socket/SocketHardwareModulesEventsParams.d.ts +65 -0
- package/dist/socket/SocketHardwareModulesEventsParams.js +2 -0
- package/dist/socket/SocketHardwareOnDataEventsParams.d.ts +16 -0
- package/dist/socket/SocketHardwareOnDataEventsParams.js +2 -0
- package/dist/socket/SocketPowerUpEventsParams.d.ts +21 -0
- package/dist/socket/SocketPowerUpEventsParams.js +2 -0
- package/dist/socket/clientToServer/SocketGameTrackClientToServerEventsParams.d.ts +13 -0
- package/dist/socket/clientToServer/SocketGameTrackClientToServerEventsParams.js +2 -0
- package/dist/socket/clientToServer/SocketKartClientToServerEventsParams.d.ts +16 -0
- package/dist/socket/clientToServer/SocketKartClientToServerEventsParams.js +2 -0
- package/dist/socket/clientToServer/SocketWebAppClientToServerEventsParams.d.ts +22 -0
- package/dist/socket/clientToServer/SocketWebAppClientToServerEventsParams.js +2 -0
- package/dist/socket/clientToServer/index.d.ts +3 -0
- package/dist/socket/clientToServer/index.js +19 -0
- package/dist/socket/index.d.ts +7 -0
- package/dist/socket/index.js +23 -0
- package/dist/socket/inputs/MacAddressGameTrackConnection.d.ts +6 -0
- package/dist/socket/inputs/MacAddressGameTrackConnection.js +2 -0
- package/dist/socket/inputs/SocketInitRaspberryInput.d.ts +3 -0
- package/dist/socket/inputs/SocketInitRaspberryInput.js +2 -0
- package/dist/socket/inputs/SocketRegisterKartCheckpointInput.d.ts +11 -0
- package/dist/socket/inputs/SocketRegisterKartCheckpointInput.js +2 -0
- package/dist/socket/inputs/index.d.ts +3 -0
- package/dist/socket/inputs/index.js +19 -0
- package/dist/socket/serverToClient/SocketGameTrackServerToClientEventParams.d.ts +10 -0
- package/dist/socket/serverToClient/SocketGameTrackServerToClientEventParams.js +2 -0
- package/dist/socket/serverToClient/SocketKartServerToClientEventsParams.d.ts +48 -0
- package/dist/socket/serverToClient/SocketKartServerToClientEventsParams.js +2 -0
- package/dist/socket/serverToClient/SocketWebAppServerToClientEventsParams.d.ts +24 -0
- package/dist/socket/serverToClient/SocketWebAppServerToClientEventsParams.js +2 -0
- package/dist/socket/serverToClient/index.d.ts +3 -0
- package/dist/socket/serverToClient/index.js +19 -0
- package/dist/socket/utils/SocketParamsToEvents.d.ts +10 -0
- package/dist/socket/utils/SocketParamsToEvents.js +2 -0
- package/dist/socket/utils/index.d.ts +1 -0
- package/dist/socket/utils/index.js +17 -0
- package/dist/sounds/SoundName.d.ts +1 -0
- package/dist/sounds/SoundName.js +2 -0
- package/dist/sounds/index.d.ts +1 -0
- package/dist/sounds/index.js +17 -0
- package/dist/user/User.d.ts +7 -0
- package/dist/user/User.js +2 -0
- package/dist/user/UserOrigin.d.ts +1 -0
- package/dist/user/UserOrigin.js +2 -0
- package/dist/user/index.d.ts +2 -0
- package/dist/user/index.js +18 -0
- package/dist/utils/ArithmeticString.d.ts +9 -0
- package/dist/utils/ArithmeticString.js +2 -0
- package/dist/utils/ObjectValues.d.ts +1 -0
- package/dist/utils/ObjectValues.js +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +18 -0
- package/package.json +22 -0
- package/src/types/checkpoint/Checkpoint.ts +11 -0
- package/src/types/checkpoint/CheckpointType.ts +6 -0
- package/src/types/checkpoint/index.ts +2 -0
- package/src/types/color/ColorInfo.ts +4 -0
- package/src/types/color/ColorName.ts +13 -0
- package/src/types/color/index.ts +2 -0
- package/src/types/command/CommandConfig.ts +91 -0
- package/src/types/command/index.ts +1 -0
- package/src/types/damage/Damage.ts +15 -0
- package/src/types/damage/DamageName.ts +1 -0
- package/src/types/damage/DamageTarget.ts +1 -0
- package/src/types/damage/index.ts +3 -0
- package/src/types/flow/Flow.ts +8 -0
- package/src/types/flow/index.ts +1 -0
- package/src/types/game/Game.ts +39 -0
- package/src/types/game/GameStatus.ts +10 -0
- package/src/types/game/GameType.ts +6 -0
- package/src/types/game/GameWarningEvent.ts +1 -0
- package/src/types/game/KartRankingItem.ts +5 -0
- package/src/types/game/battle/Battle.ts +11 -0
- package/src/types/game/battle/index.ts +1 -0
- package/src/types/game/index.ts +7 -0
- package/src/types/game/race/KartProgress.ts +10 -0
- package/src/types/game/race/Race.ts +20 -0
- package/src/types/game/race/index.ts +2 -0
- package/src/types/gameTrack/GameTrack.ts +13 -0
- package/src/types/gameTrack/GameTrackKartsConfig.ts +25 -0
- package/src/types/gameTrack/index.ts +2 -0
- package/src/types/hardware/KartEffect.ts +19 -0
- package/src/types/hardware/ModuleName.ts +10 -0
- package/src/types/hardware/ModuleStatus.ts +18 -0
- package/src/types/hardware/ballSensor/BallSensorCommand.ts +1 -0
- package/src/types/hardware/ballSensor/BallSensorDiskThrowerModuleStatus.ts +5 -0
- package/src/types/hardware/ballSensor/BallSensorStatus.ts +1 -0
- package/src/types/hardware/ballSensor/ConfigureBallSensorDiskThrowerModuleOptions.ts +4 -0
- package/src/types/hardware/ballSensor/index.ts +4 -0
- package/src/types/hardware/ballShooter/BallShooterCommand.ts +1 -0
- package/src/types/hardware/ballShooter/BallShooterStatus.ts +6 -0
- package/src/types/hardware/ballShooter/index.ts +2 -0
- package/src/types/hardware/diskSensor/ConfigDiskSensorBallShooterModuleOptions.ts +8 -0
- package/src/types/hardware/diskSensor/DiskSensorBallShooterModuleStatus.ts +5 -0
- package/src/types/hardware/diskSensor/DiskSensorCommand.ts +1 -0
- package/src/types/hardware/diskSensor/DiskSensorStatus.ts +9 -0
- package/src/types/hardware/diskSensor/index.ts +4 -0
- package/src/types/hardware/diskThrower/DiskThrowerCommand.ts +1 -0
- package/src/types/hardware/diskThrower/DiskThrowerStatus.ts +1 -0
- package/src/types/hardware/diskThrower/index.ts +2 -0
- package/src/types/hardware/emergency/EmergencyActionCommand.ts +1 -0
- package/src/types/hardware/emergency/EmergencyModuleStatus.ts +5 -0
- package/src/types/hardware/emergency/EmergencyStatus.ts +1 -0
- package/src/types/hardware/emergency/index.ts +3 -0
- package/src/types/hardware/flag/FlagActionCommand.ts +6 -0
- package/src/types/hardware/flag/FlagConfigurationOptions.ts +11 -0
- package/src/types/hardware/flag/FlagMediaName.ts +87 -0
- package/src/types/hardware/flag/FlagModuleStatus.ts +8 -0
- package/src/types/hardware/flag/FlagShowMediaOptions.ts +15 -0
- package/src/types/hardware/flag/FlagStatus.ts +8 -0
- package/src/types/hardware/flag/index.ts +6 -0
- package/src/types/hardware/index.ts +15 -0
- package/src/types/hardware/rgb/RGBActionCommand.ts +1 -0
- package/src/types/hardware/rgb/RGBConfigurationOptions.ts +9 -0
- package/src/types/hardware/rgb/RGBModuleStatus.ts +7 -0
- package/src/types/hardware/rgb/RGBShowEffectOptions.ts +5 -0
- package/src/types/hardware/rgb/RGBStatus.ts +1 -0
- package/src/types/hardware/rgb/index.ts +5 -0
- package/src/types/hardware/screen/ScreenBattleViewConfig.ts +5 -0
- package/src/types/hardware/screen/ScreenCountdownParams.ts +14 -0
- package/src/types/hardware/screen/ScreenFinishViewInput.ts +7 -0
- package/src/types/hardware/screen/ScreenGameTimeLeft.ts +4 -0
- package/src/types/hardware/screen/ScreenKartPosition.ts +4 -0
- package/src/types/hardware/screen/ScreenRaceLaps.ts +4 -0
- package/src/types/hardware/screen/ScreenRaceViewConfig.ts +6 -0
- package/src/types/hardware/screen/ScreenUpdateGameViewInput.ts +14 -0
- package/src/types/hardware/screen/ScreenView.ts +1 -0
- package/src/types/hardware/screen/ScreenViewBaseConfig.ts +12 -0
- package/src/types/hardware/screen/index.ts +10 -0
- package/src/types/hardware/sound/PlaySoundOptions.ts +5 -0
- package/src/types/hardware/sound/index.ts +1 -0
- package/src/types/hardware/speed/SpeedActionCommand.ts +1 -0
- package/src/types/hardware/speed/SpeedChangeOptions.ts +6 -0
- package/src/types/hardware/speed/SpeedConfiguration.ts +6 -0
- package/src/types/hardware/speed/SpeedModuleStatus.ts +13 -0
- package/src/types/hardware/speed/SpeedStatus.ts +1 -0
- package/src/types/hardware/speed/index.ts +5 -0
- package/src/types/hardware/star-laser/StarLaserCommand.ts +1 -0
- package/src/types/hardware/star-laser/StarLaserConfigureModuleOptions.ts +7 -0
- package/src/types/hardware/star-laser/StarLaserModuleStatus.ts +10 -0
- package/src/types/hardware/star-laser/StarLaserSendActionsOptions.ts +6 -0
- package/src/types/hardware/star-laser/StarLaserStatus.ts +1 -0
- package/src/types/hardware/star-laser/index.ts +5 -0
- package/src/types/hardware/steering-wheel/SteeringWheelModuleStatus.ts +4 -0
- package/src/types/hardware/steering-wheel/index.ts +1 -0
- package/src/types/index.ts +21 -0
- package/src/types/kart/Kart.ts +31 -0
- package/src/types/kart/KartShield.ts +4 -0
- package/src/types/kart/KartStatus.ts +2 -0
- package/src/types/kart/index.ts +2 -0
- package/src/types/kartTracking/CheckpointEvent.ts +9 -0
- package/src/types/kartTracking/KartTracking.ts +6 -0
- package/src/types/kartTracking/index.ts +2 -0
- package/src/types/powerUp/PowerUp.ts +50 -0
- package/src/types/powerUp/PowerUpName.ts +9 -0
- package/src/types/powerUp/PowerUpShield.ts +6 -0
- package/src/types/powerUp/PowerUpTarget.ts +12 -0
- package/src/types/powerUp/PowerUpType.ts +9 -0
- package/src/types/powerUp/index.ts +5 -0
- package/src/types/response/ErrorResponse.ts +6 -0
- package/src/types/response/Response.ts +4 -0
- package/src/types/response/SuccesResponse.ts +5 -0
- package/src/types/response/index.ts +3 -0
- package/src/types/socket/SocketHardwareModulesEventsParams.ts +106 -0
- package/src/types/socket/SocketHardwareOnDataEventsParams.ts +27 -0
- package/src/types/socket/SocketPowerUpEventsParams.ts +13 -0
- package/src/types/socket/clientToServer/SocketGameTrackClientToServerEventsParams.ts +7 -0
- package/src/types/socket/clientToServer/SocketKartClientToServerEventsParams.ts +11 -0
- package/src/types/socket/clientToServer/SocketWebAppClientToServerEventsParams.ts +11 -0
- package/src/types/socket/clientToServer/index.ts +3 -0
- package/src/types/socket/index.ts +7 -0
- package/src/types/socket/inputs/MacAddressGameTrackConnection.ts +7 -0
- package/src/types/socket/inputs/SocketInitRaspberryInput.ts +3 -0
- package/src/types/socket/inputs/SocketRegisterKartCheckpointInput.ts +12 -0
- package/src/types/socket/inputs/index.ts +3 -0
- package/src/types/socket/serverToClient/SocketGameTrackServerToClientEventParams.ts +14 -0
- package/src/types/socket/serverToClient/SocketKartServerToClientEventsParams.ts +47 -0
- package/src/types/socket/serverToClient/SocketWebAppServerToClientEventsParams.ts +23 -0
- package/src/types/socket/serverToClient/index.ts +3 -0
- package/src/types/socket/utils/SocketParamsToEvents.ts +16 -0
- package/src/types/socket/utils/index.ts +1 -0
- package/src/types/sounds/SoundName.ts +24 -0
- package/src/types/sounds/index.ts +1 -0
- package/src/types/user/User.ts +8 -0
- package/src/types/user/UserOrigin.ts +1 -0
- package/src/types/user/index.ts +2 -0
- package/src/types/utils/ArithmeticString.ts +17 -0
- package/src/types/utils/ObjectValues.ts +2 -0
- package/src/types/utils/index.ts +2 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Game } from '../../game';
|
|
2
|
+
import type { Kart } from '../../kart';
|
|
3
|
+
import type { CheckpointEvent } from '../../kartTracking';
|
|
4
|
+
import type { Response } from '../../response';
|
|
5
|
+
import type { MacAddressGameTrackConnection } from '../inputs';
|
|
6
|
+
import type { SocketHardwareOnDataEventsParams } from '../SocketHardwareOnDataEventsParams';
|
|
7
|
+
export interface SocketWebAppServerToClientEventsParams {
|
|
8
|
+
'karts:authenticate:response': Response<void>;
|
|
9
|
+
'karts:list:response': Response<Kart[]>;
|
|
10
|
+
'karts:onKartsUpdated': Kart[];
|
|
11
|
+
'karts:onHardwareData': {
|
|
12
|
+
kartGuid: string;
|
|
13
|
+
socketEvent: keyof SocketHardwareOnDataEventsParams;
|
|
14
|
+
payload: SocketHardwareOnDataEventsParams[keyof SocketHardwareOnDataEventsParams];
|
|
15
|
+
};
|
|
16
|
+
'karts:tracking:checkpointEvent': {
|
|
17
|
+
checkpointEvent: CheckpointEvent;
|
|
18
|
+
};
|
|
19
|
+
'game:changed': {
|
|
20
|
+
game: Game;
|
|
21
|
+
};
|
|
22
|
+
'gameTracks:onGameTrackUpdated': MacAddressGameTrackConnection[];
|
|
23
|
+
'gameTracks:list:response': Response<MacAddressGameTrackConnection[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SocketGameTrackServerToClientEventParams"), exports);
|
|
18
|
+
__exportStar(require("./SocketKartServerToClientEventsParams"), exports);
|
|
19
|
+
__exportStar(require("./SocketWebAppServerToClientEventsParams"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Map the Events Params Types to Event to be used on Socket.io */
|
|
2
|
+
export type EmptyEventParams = () => void;
|
|
3
|
+
export type EventParams<EventParams> = (payload: EventParams) => void;
|
|
4
|
+
export type EmptyEventParamsWithExtra<Extra> = (params: Extra) => void;
|
|
5
|
+
export type EventParamsWithExtra<EventParams, Extra> = (params: Extra & {
|
|
6
|
+
payload: EventParams;
|
|
7
|
+
}) => void;
|
|
8
|
+
export type SocketParamsToEvents<Event, Extra = undefined> = {
|
|
9
|
+
[EventKey in keyof Event]: Event[EventKey] extends undefined ? Extra extends undefined ? EmptyEventParams : EmptyEventParamsWithExtra<Extra> : Extra extends undefined ? EventParams<Event[EventKey]> : EventParamsWithExtra<Event[EventKey], Extra>;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SocketParamsToEvents';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SocketParamsToEvents"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SoundName = 'battle_god_activation.mp3' | 'battle_laser_activation.mp3' | 'battle_laser_damage.mp3' | 'battle_pulse_activation.mp3' | 'battle_pulse_damage.mp3' | 'battle_shield_activation.mp3' | 'battle_shot_activation.mp3' | 'battle_shot_damage.mp3' | 'battle_star_damage.mp3' | 'battle_trap_activation.mp3' | 'battle_trap_damage.mp3' | 'battle_turbo_activation.mp3' | 'countdown_3_2_1.mp3' | 'emergency_alert.mp3' | 'engine_start.mp3' | 'final_lap_mario_kart.mp3' | 'kart_skiding.mp3' | 'pick_coin_x2.mp3' | 'power_up_selection.mp3' | 'sad_trumpet_loser.mp3' | 'system_started.mp3' | 'warning_alert_this_is_not_a_test.mp3' | 'winner_laugh.mp3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SoundName';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SoundName"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UserOrigin = 'webapp' | 'hardware';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./User"), exports);
|
|
18
|
+
__exportStar(require("./UserOrigin"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ArithmeticOperator = '+' | '-' | '*' | '/';
|
|
2
|
+
/**
|
|
3
|
+
* The Value is determined by an arithmetic operator followed by a number.
|
|
4
|
+
*/
|
|
5
|
+
export type SimpleArithmeticString = `${ArithmeticOperator}${number}`;
|
|
6
|
+
export type KartContextVariable = '$kart.configuredSpeed';
|
|
7
|
+
export type ContextVariable = KartContextVariable;
|
|
8
|
+
export type ContextArithmeticString = `${ContextVariable} ${ArithmeticOperator} ${number}`;
|
|
9
|
+
export type ArithmeticExpression = number | SimpleArithmeticString | ContextArithmeticString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ObjectValues<T> = T[keyof T];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ObjectValues"), exports);
|
|
18
|
+
__exportStar(require("./ArithmeticString"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@battle-racing/br-common-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Common library for all Battle Racing Repositorios",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"Battle",
|
|
12
|
+
"Racing",
|
|
13
|
+
"Common",
|
|
14
|
+
"Library"
|
|
15
|
+
],
|
|
16
|
+
"author": "jdmaldonado",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"private": false,
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"typescript": "^5.8.3"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CheckpointType } from './CheckpointType';
|
|
2
|
+
|
|
3
|
+
export interface Checkpoint {
|
|
4
|
+
/** Autogenerated Id */
|
|
5
|
+
id: string;
|
|
6
|
+
/** This is the received from Flag Module */
|
|
7
|
+
address: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
type: CheckpointType;
|
|
10
|
+
progress: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ConfigDiskSensorBallShooterModuleOptions,
|
|
3
|
+
ConfigureBallSensorDiskThrowerModuleOptions,
|
|
4
|
+
FlagConfigurationOptions,
|
|
5
|
+
FlagShowMediaOptions,
|
|
6
|
+
PlaySoundOptions,
|
|
7
|
+
RGBConfigurationOptions,
|
|
8
|
+
RGBShowEffectOptions,
|
|
9
|
+
ScreenCountdownParams,
|
|
10
|
+
ScreenFinishViewInput,
|
|
11
|
+
ScreenUpdateGameViewInput,
|
|
12
|
+
SpeedChangeOptions,
|
|
13
|
+
SpeedConfiguration,
|
|
14
|
+
StarLaserConfigureModuleOptions,
|
|
15
|
+
StarLaserSendActionsOptions,
|
|
16
|
+
} from '../hardware';
|
|
17
|
+
import type { ArithmeticExpression } from '../utils';
|
|
18
|
+
|
|
19
|
+
export interface ChangeSpeedActionCommandOptions extends Omit<SpeedChangeOptions, 'speed'> {
|
|
20
|
+
speed: number | ArithmeticExpression;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type BallSensorDiskThrowerModuleCommands =
|
|
24
|
+
| { module: 'ballSensorDiskThrower'; action: 'activateSensor'; params?: undefined }
|
|
25
|
+
| { module: 'ballSensorDiskThrower'; action: 'deactivateSensor'; params?: undefined }
|
|
26
|
+
| {
|
|
27
|
+
module: 'ballSensorDiskThrower';
|
|
28
|
+
action: 'configureModule';
|
|
29
|
+
params: ConfigureBallSensorDiskThrowerModuleOptions;
|
|
30
|
+
}
|
|
31
|
+
| { module: 'ballSensorDiskThrower'; action: 'throwDisk'; params?: undefined }
|
|
32
|
+
| { module: 'ballSensorDiskThrower'; action: 'activateDiskThrower'; params?: undefined }
|
|
33
|
+
| { module: 'ballSensorDiskThrower'; action: 'deactivateDiskThrower'; params?: undefined };
|
|
34
|
+
|
|
35
|
+
export type DiskSensorBallShooterModuleCommands =
|
|
36
|
+
| { module: 'diskSensorBallShooter'; action: 'configure'; params: ConfigDiskSensorBallShooterModuleOptions }
|
|
37
|
+
| { module: 'diskSensorBallShooter'; action: 'prepareShooter'; params?: undefined }
|
|
38
|
+
| { module: 'diskSensorBallShooter'; action: 'shootBall'; params?: undefined }
|
|
39
|
+
| { module: 'diskSensorBallShooter'; action: 'activateSensor'; params?: undefined }
|
|
40
|
+
| { module: 'diskSensorBallShooter'; action: 'deactivateSensor'; params?: undefined }
|
|
41
|
+
| { module: 'diskSensorBallShooter'; action: 'calibrateSensor'; params?: undefined };
|
|
42
|
+
|
|
43
|
+
export type FlagModuleCommands =
|
|
44
|
+
| { module: 'flag'; action: 'activate'; params?: undefined }
|
|
45
|
+
| { module: 'flag'; action: 'deactivate'; params?: undefined }
|
|
46
|
+
| { module: 'flag'; action: 'configure'; params: FlagConfigurationOptions }
|
|
47
|
+
| { module: 'flag'; action: 'showMediaIndefinitely'; params: FlagShowMediaOptions }
|
|
48
|
+
| { module: 'flag'; action: 'showMediaTemporarily'; params: FlagShowMediaOptions };
|
|
49
|
+
|
|
50
|
+
export type RGBModuleCommands =
|
|
51
|
+
| { module: 'rgb'; action: 'configure'; params: RGBConfigurationOptions }
|
|
52
|
+
| { module: 'rgb'; action: 'showEffect'; params: RGBShowEffectOptions };
|
|
53
|
+
|
|
54
|
+
export type SpeedModuleCommands =
|
|
55
|
+
| { module: 'speed'; action: 'activate'; params?: undefined }
|
|
56
|
+
| { module: 'speed'; action: 'deactivate'; params?: undefined }
|
|
57
|
+
| { module: 'speed'; action: 'change'; params: ChangeSpeedActionCommandOptions }
|
|
58
|
+
| { module: 'speed'; action: 'configure'; params: SpeedConfiguration };
|
|
59
|
+
|
|
60
|
+
export type LeftStarBackLaserModuleCommands =
|
|
61
|
+
| { module: 'leftStarBackLaser'; action: 'action'; params: StarLaserSendActionsOptions }
|
|
62
|
+
| { module: 'leftStarBackLaser'; action: 'configure'; params: StarLaserConfigureModuleOptions };
|
|
63
|
+
|
|
64
|
+
export type RightStarFrontLaserModuleCommands =
|
|
65
|
+
| { module: 'rightStarFrontLaser'; action: 'action'; params: StarLaserSendActionsOptions }
|
|
66
|
+
| { module: 'rightStarFrontLaser'; action: 'configure'; params: StarLaserConfigureModuleOptions };
|
|
67
|
+
|
|
68
|
+
export type ScreenModuleCommands =
|
|
69
|
+
| { module: 'screen'; action: 'showHomeView'; params?: undefined }
|
|
70
|
+
| { module: 'screen'; action: 'showCountdownView'; params: ScreenCountdownParams }
|
|
71
|
+
| { module: 'screen'; action: 'updateGameView'; params: ScreenUpdateGameViewInput }
|
|
72
|
+
| { module: 'screen'; action: 'showScreenVictoryView'; params: ScreenFinishViewInput }
|
|
73
|
+
| { module: 'screen'; action: 'showScreenDefeatView'; params: ScreenFinishViewInput };
|
|
74
|
+
|
|
75
|
+
export type SteeringWheelModuleCommands =
|
|
76
|
+
| { module: 'steeringWheel'; action: 'turnLedOn'; params?: undefined }
|
|
77
|
+
| { module: 'steeringWheel'; action: 'turnLedOff'; params?: undefined };
|
|
78
|
+
|
|
79
|
+
export type SoundModuleCommands = { module: 'sound'; action: 'play'; params: PlaySoundOptions };
|
|
80
|
+
|
|
81
|
+
export type AllCommandsConfig =
|
|
82
|
+
| BallSensorDiskThrowerModuleCommands
|
|
83
|
+
| DiskSensorBallShooterModuleCommands
|
|
84
|
+
| FlagModuleCommands
|
|
85
|
+
| RGBModuleCommands
|
|
86
|
+
| SpeedModuleCommands
|
|
87
|
+
| LeftStarBackLaserModuleCommands
|
|
88
|
+
| RightStarFrontLaserModuleCommands
|
|
89
|
+
| ScreenModuleCommands
|
|
90
|
+
| SteeringWheelModuleCommands
|
|
91
|
+
| SoundModuleCommands;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CommandConfig';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { KartEffect } from '../hardware';
|
|
2
|
+
import type { SoundName } from '../sounds';
|
|
3
|
+
import type { DamageEffectName } from './DamageName';
|
|
4
|
+
import type { DamageTarget } from './DamageTarget';
|
|
5
|
+
|
|
6
|
+
export interface Damage {
|
|
7
|
+
name: DamageEffectName;
|
|
8
|
+
target: DamageTarget;
|
|
9
|
+
/** Time in seconds */
|
|
10
|
+
duration: number;
|
|
11
|
+
sound: SoundName;
|
|
12
|
+
rgbEffect: KartEffect;
|
|
13
|
+
/** Quantity of damage will affect the Kart */
|
|
14
|
+
amount: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DamageEffectName = 'Trap Hit' | 'Pulse Hit' | 'Star Hit Left' | 'Star Hit Right' | 'Shot Hit';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DamageTarget = 'Any' | 'All' | 'First' | 'Last' | 'Next' | 'Previous';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Flow';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { GameTrack } from '../gameTrack';
|
|
2
|
+
import type { PowerUp } from '../powerUp';
|
|
3
|
+
import type { GameStatus } from './GameStatus';
|
|
4
|
+
import type { GameType } from './GameType';
|
|
5
|
+
import type { KartRankingItem } from './KartRankingItem';
|
|
6
|
+
|
|
7
|
+
export enum GameFinishedReason {
|
|
8
|
+
/** The time set for the game was over */
|
|
9
|
+
TIME_IS_OVER = 'TIME_IS_OVER',
|
|
10
|
+
/** There is a winner on the game */
|
|
11
|
+
GAME_KARTS_FINISHED = 'GAME_KARTS_FINISHED',
|
|
12
|
+
/** The game was stopped by an emergency */
|
|
13
|
+
EMERGENCY = 'EMERGENCY',
|
|
14
|
+
/** The Controller of the game finished the game */
|
|
15
|
+
BY_CONTROLLER = 'BY_CONTROLLER',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface GameKartState {
|
|
19
|
+
coins: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface Game {
|
|
23
|
+
id: number;
|
|
24
|
+
status: GameStatus;
|
|
25
|
+
kartsGuids: string[];
|
|
26
|
+
powerUpsIds: PowerUp['id'][];
|
|
27
|
+
gameTrackId: GameTrack['id'];
|
|
28
|
+
type: GameType;
|
|
29
|
+
coins: number;
|
|
30
|
+
/** Time set in seconds */
|
|
31
|
+
time: number;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
startedAt?: Date;
|
|
34
|
+
finishedAt?: Date;
|
|
35
|
+
finishedReason?: GameFinishedReason;
|
|
36
|
+
/** The key is the kart guid */
|
|
37
|
+
kartsState: Record<string, GameKartState>;
|
|
38
|
+
gameRanking: KartRankingItem[];
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type GameWarningEvent = 'yellow-flag' | 'red-flag';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Game, GameKartState } from '../Game';
|
|
2
|
+
|
|
3
|
+
export interface BattleKartState extends GameKartState {
|
|
4
|
+
lives: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Battle extends Game {
|
|
8
|
+
type: 'Battle';
|
|
9
|
+
lives: number;
|
|
10
|
+
kartsState: Record<string, BattleKartState>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Battle';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Game, GameKartState } from '../Game';
|
|
2
|
+
import type { KartRankingItem } from '../KartRankingItem';
|
|
3
|
+
import type { KartProgress } from './KartProgress';
|
|
4
|
+
|
|
5
|
+
export interface RaceKartState extends GameKartState {
|
|
6
|
+
currentLap: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface RaceRakingItem extends KartRankingItem {
|
|
10
|
+
progress: number;
|
|
11
|
+
lapsCompleted: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Race extends Game {
|
|
15
|
+
type: 'Race';
|
|
16
|
+
laps: number;
|
|
17
|
+
kartsState: Record<string, RaceKartState>;
|
|
18
|
+
kartsProgress: Record<string, KartProgress[]>;
|
|
19
|
+
gameRanking: RaceRakingItem[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Checkpoint } from '../checkpoint';
|
|
2
|
+
import type { GameType } from '../game';
|
|
3
|
+
import type { GameTrackKartsConfig } from './GameTrackKartsConfig';
|
|
4
|
+
|
|
5
|
+
export interface GameTrack {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: GameType;
|
|
9
|
+
checkpoints: Checkpoint[];
|
|
10
|
+
kartsConfig: GameTrackKartsConfig;
|
|
11
|
+
macAddress?: string;
|
|
12
|
+
isConnected: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ConfigDiskSensorBallShooterModuleOptions,
|
|
3
|
+
ConfigureBallSensorDiskThrowerModuleOptions,
|
|
4
|
+
} from '../hardware';
|
|
5
|
+
|
|
6
|
+
/**
|
|
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.
|
|
9
|
+
*
|
|
10
|
+
* powerUpTime: Will be the time configuration of each Module.
|
|
11
|
+
*/
|
|
12
|
+
export interface GameTrackKartsConfig {
|
|
13
|
+
/** Percentage (0% - 100%) */
|
|
14
|
+
defaultSpeed: number;
|
|
15
|
+
/** Time in seconds: (1s - 25s) */
|
|
16
|
+
powerUpTime: number;
|
|
17
|
+
/** % Of Brightness (0 - 100) */
|
|
18
|
+
rgbBrightness: number;
|
|
19
|
+
/** % Of Brightness (0 - 100) */
|
|
20
|
+
flagBrightness: number;
|
|
21
|
+
/** Full Configuration of the Disk Sensor Ball Shooter */
|
|
22
|
+
diskSensorBallShooter: ConfigDiskSensorBallShooterModuleOptions;
|
|
23
|
+
/** Full Configuration of the Ball Sensor Disk Thrower */
|
|
24
|
+
ballSensorDiskThrower: ConfigureBallSensorDiskThrowerModuleOptions;
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type KartEffect =
|
|
2
|
+
| 'Show Color Kart'
|
|
3
|
+
| 'Star Effect'
|
|
4
|
+
| 'Ray Effect'
|
|
5
|
+
| 'Ray Hit Effect'
|
|
6
|
+
| 'Speed Boost Effect'
|
|
7
|
+
| 'Charged Power Effect'
|
|
8
|
+
| 'Roulette Effect'
|
|
9
|
+
| 'Shield Effect'
|
|
10
|
+
| 'Broken Shield Effect'
|
|
11
|
+
| 'Hit Right Effect'
|
|
12
|
+
| 'Hit Left Effect'
|
|
13
|
+
| 'Hit Front Effect'
|
|
14
|
+
| 'Hit Back Effect'
|
|
15
|
+
| 'Hit Disk Effect'
|
|
16
|
+
| 'Ball Shot Effect'
|
|
17
|
+
| 'Disk Shot Effect'
|
|
18
|
+
| 'Emergency Effect'
|
|
19
|
+
| 'Wait Effect';
|