本文整理匯總了TypeScript中@services/socket.service.default類的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.default類的具體用法?TypeScript service.default怎麽用?TypeScript service.default使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了service.default類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: emitPlayerChoose
emitPlayerChoose(player: Player, match: Match, choice: number) {
this.socketService.emit(Events.PLAYER_CHOOSE_VALUE, { player, match, choice });
}
示例2: onPlayerChoosed
onPlayerChoosed(room: Room): Observable<any> {
return this.socketService.onEvent(`${Events.PLAYER_CHOOSE_VALUE}-${room.id}`);
}
示例3: onMatchStarted
onMatchStarted(room: Room): Observable<any> {
return this.socketService.onEvent(`${Events.MATCH_STARTED}-${room.id}`);
}
示例4: startMatch
startMatch(room: Room) {
this.socketService.emit(Events.START_MATCH, room);
}
示例5: emitEnteredRoom
emitEnteredRoom(room: Room, player: Player) {
this.socketService.emit(Events.PLAYER_ENTER_ROOM, { room, player });
}
示例6: onRoomsUpdate
onRoomsUpdate(): Observable<any> {
return this.socketService.onEvent(Events.ROOM_UPDATE);
}
示例7: disconnect
disconnect() {
this.socketService.disconnect();
}