本文整理汇总了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();
}