File tree 8 files changed +29
-33
lines changed
8 files changed +29
-33
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ class User {
14
14
15
15
this . submittedCard = null ;
16
16
this . votedCard = null ;
17
- this . isReady = false ;
18
- this . isSkip = false ;
17
+ this . bReady = false ;
18
+ this . bSkip = false ;
19
19
}
20
20
21
21
initOnStart ( { turnID } = { } ) {
@@ -27,20 +27,20 @@ class User {
27
27
initOnRound ( ) {
28
28
this . submittedCard = null ;
29
29
this . votedCard = null ;
30
- this . isReady = false ;
31
- this . isSkip = false ;
30
+ this . bReady = false ;
31
+ this . bSkip = false ;
32
32
}
33
33
34
34
setTeller ( boolean ) {
35
35
this . isTeller = boolean ;
36
36
}
37
37
38
- setReady ( isReady ) {
39
- this . isReady = isReady ;
38
+ setReady ( bReady ) {
39
+ this . bReady = bReady ;
40
40
}
41
41
42
42
setSkip ( ) {
43
- this . isSkip = true ;
43
+ this . bSkip = true ;
44
44
}
45
45
46
46
setColor ( color ) {
@@ -86,7 +86,7 @@ class User {
86
86
isTeller,
87
87
cards,
88
88
score,
89
- isReady ,
89
+ bReady ,
90
90
} = this ;
91
91
92
92
return {
@@ -99,17 +99,17 @@ class User {
99
99
isTeller,
100
100
cards,
101
101
score,
102
- isReady ,
102
+ bReady ,
103
103
} ;
104
104
}
105
105
106
106
getProfile ( ) {
107
- const { nickname, color, score, isReady } = this ;
107
+ const { nickname, color, score, bReady } = this ;
108
108
return {
109
109
nickname,
110
110
color,
111
111
score,
112
- isReady ,
112
+ bReady ,
113
113
} ;
114
114
}
115
115
Original file line number Diff line number Diff line change @@ -5,11 +5,7 @@ function onSkipPlayer() {
5
5
if ( ! user || ! game ) return ;
6
6
7
7
user . setSkip ( ) ;
8
-
9
- // 모든 유저가 스킵을 눌렀을 경우
10
- if ( game . getUsers ( ) . every ( ( u ) => u . isSkip ) ) {
11
- game . endDiscussionScene ( true ) ;
12
- }
8
+ if ( game . getUsers ( ) . every ( ( u ) => u . bSkip ) ) game . endDiscussionScene ( true ) ;
13
9
}
14
10
15
11
export default function onDiscussion ( socket ) {
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ function onUpdatePlayer(updatedUserProfile = {}) {
51
51
const timeoutMap = new Map ( ) ;
52
52
53
53
const isPossibleStartGame = ( { users } ) => {
54
- const isAllReady = [ ...users ] . every ( ( [ , user ] ) => user . isReady ) ;
54
+ const isAllReady = [ ...users ] . every ( ( [ , user ] ) => user . bReady ) ;
55
55
const isValidSize = users . size >= PLAYER . MIN && users . size <= PLAYER . MAX ;
56
56
return isAllReady && isValidSize ;
57
57
} ;
@@ -63,7 +63,7 @@ const deleteGameStartTimeout = (roomID) => {
63
63
} ;
64
64
65
65
// 사용자가 레디를 눌렀을 때 or 레디를 풀었을 때
66
- function onReadyChange ( { isReady } ) {
66
+ function onReadyChange ( { bReady } ) {
67
67
const socket = this ;
68
68
const { user, game } = socket ;
69
69
@@ -77,8 +77,8 @@ function onReadyChange({ isReady }) {
77
77
const { users, roomID } = game ;
78
78
79
79
// 플레이어의 레디 상태를 변경
80
- users . get ( socket . id ) . setReady ( isReady ) ;
81
- socket . in ( roomID ) . emit ( 'ready player' , { playerID : socket . id , isReady } ) ;
80
+ users . get ( socket . id ) . setReady ( bReady ) ;
81
+ socket . in ( roomID ) . emit ( 'ready player' , { playerID : socket . id , bReady } ) ;
82
82
83
83
const validationToStart = isPossibleStartGame ( { users } ) ;
84
84
// 모든 플레이어가 레디 상태일 때
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import TIME from '@type/time';
5
5
import DuckObejct from './DuckObject' ;
6
6
7
7
class DuckCursorObject extends DuckObejct {
8
- constructor ( { isReady , ...props } ) {
8
+ constructor ( { bReady , ...props } ) {
9
9
super ( props ) ;
10
10
this . addClass ( 'cursor-duck-wrapper' ) ;
11
11
this . setOriginCenter ( ) ;
@@ -16,7 +16,7 @@ class DuckCursorObject extends DuckObejct {
16
16
this . mouseHandler = this . makeFollowMouse . bind ( this ) ;
17
17
this . width = 100 ;
18
18
this . render ( ) ;
19
- this . setVisibility ( isReady ) ;
19
+ this . setVisibility ( bReady ) ;
20
20
}
21
21
22
22
addMouseMoveEvent ( ) {
Original file line number Diff line number Diff line change @@ -34,15 +34,15 @@ export const changeNickname = (NicknameInput) => {
34
34
35
35
export const toggleReady = ( { target } ) => {
36
36
const currentPlayer = PlayerManager . getCurrentPlayer ( ) ;
37
- const { isReady } = currentPlayer ;
38
- const nextStatus = ! isReady ;
37
+ const { bReady } = currentPlayer ;
38
+ const nextStatus = ! bReady ;
39
39
40
40
target . innerText = nextStatus ? '준비 해제' : '준비 완료' ;
41
41
target . classList . toggle ( 'button-primary' ) ;
42
42
target . classList . toggle ( 'button-primary-clicked' ) ;
43
43
44
44
PlayerManager . getCurrentPlayer ( ) . setReady ( nextStatus ) ;
45
- socket . emit ( 'ready player' , { isReady : nextStatus } ) ;
45
+ socket . emit ( 'ready player' , { bReady : nextStatus } ) ;
46
46
} ;
47
47
48
48
export const changeColor = ( { target } ) => {
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ const renderWaitingRoom = (roomID = '') => {
145
145
ButtonReady . setContent ( '준비 완료' ) ;
146
146
ButtonReady . addClass ( 'button-primary' ) ;
147
147
ButtonReady . attachToObject ( ActionWrapper ) ;
148
- ButtonReady . instance . dataset . data = JSON . stringify ( { isReady : false } ) ;
148
+ ButtonReady . instance . dataset . data = JSON . stringify ( { bReady : false } ) ;
149
149
ButtonReady . addClickHandler ( toggleReady ) ;
150
150
151
151
const GameCodeWrapper = new ButtonObject ( ) ;
Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ const setupWaitingRoomSocket = () => {
46
46
PlayerManager . delete ( socketID ) ;
47
47
} ;
48
48
49
- const onReadyPlayer = ( { playerID, isReady } ) => {
49
+ const onReadyPlayer = ( { playerID, bReady } ) => {
50
50
if ( ! SceneManager . isCurrentScene ( WaitingRoom ) ) return ;
51
51
const player = PlayerManager . get ( playerID ) ;
52
- if ( player ) player . setReady ( isReady ) ;
52
+ if ( player ) player . setReady ( bReady ) ;
53
53
} ;
54
54
55
55
const onGetRoundData = ( { tellerID, cards, endTime } ) => {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const Player = class {
8
8
color,
9
9
isTeller = false ,
10
10
isCurrentPlayer = false ,
11
- isReady = false ,
11
+ bReady = false ,
12
12
} = { } ) {
13
13
this . socketID = socketID ;
14
14
this . nickname = nickname ;
@@ -20,8 +20,8 @@ const Player = class {
20
20
} ;
21
21
this . isTeller = isTeller ;
22
22
this . isCurrentPlayer = isCurrentPlayer ;
23
- this . isReady = isReady ;
24
- this . duck = new DuckCursorObject ( { isReady , color } ) ;
23
+ this . bReady = bReady ;
24
+ this . duck = new DuckCursorObject ( { bReady , color } ) ;
25
25
this . votedCardID = null ;
26
26
this . submittedCardID = null ;
27
27
}
@@ -44,8 +44,8 @@ const Player = class {
44
44
}
45
45
46
46
setReady ( value ) {
47
- if ( this . isReady === value ) return ;
48
- this . isReady = value ;
47
+ if ( this . bReady === value ) return ;
48
+ this . bReady = value ;
49
49
this . duck . setVisibility ( value , this . isCurrentPlayer ) ;
50
50
}
51
51
You can’t perform that action at this time.
0 commit comments