import { PLAYER_POWERUP_TYPES , ServerPackets , SERVER_PACKETS } from '@airbattle/protocol' ; import { CONNECTIONS_SEND_PACKETS , RESPONSE_PLAYER_POWERUP } from '../../events' ; import { MainConnectionId } from '../../types' ; import { System } from '../system' ; export default class PlayerPowerupResponse extends System { constructor ( { app } ) { super ( { app } ) ; this . listeners = { [ RESPONSE_PLAYER_POWERUP ] : this . onPlayerPowerup , } ; } param connectionId param type param duration onPlayerPowerup ( connectionId , type , duration ) { this . emit ( CONNECTIONS_SEND_PACKETS , { c : SERVER_PACKETS . PLAYER_POWERUP , type , duration , } as ServerPackets . PlayerPowerup , connectionId ) ; } }