-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo
130 lines (110 loc) · 4.28 KB
/
todo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
Logic:
index:
welcome-screen:
modal:
settings:
api:
- fetchConfiguration()
-> Config {hub-port, available-ports, radio-channel, players}
// get saved config from backend
- selectHubPort(desiredPort)
-> HubStatus
// Select desiredPort and return status
- discoverTerminals(radioChannel)
-> [1, 2, 3, 4, ...]
// Pass desiredChannel and return terminals.
- save()
// TODO: dopysat'
pack-info:
api:
- getPackInfo()
// TODO: dopysat'
gameplay:
round-screen:
api:
- fetchPlayers()
- fetchRound()
- getQuestionData(topic, price)
front:
- processQuestionShow() {NORMAL/PIP/AUCTION}
modal:
pip:
api:
- sendPipVictim()
auction:
question-screen:
api:
- allowAnswer()
- waitForResponse()
-> { fastestPlayer: "Name" }
// підсвітити чувака
- answerQuestion(isCorrect)
-> UpdatedScore {"Name", score}
// true => update score, clear player selection (except dead) show round screen
// false => update score, make player inactive, set answer forbidden
gameplay:
round-screen:
setup:
- DOMEvent
- addButtonEventListeners()
- processMainScreenPlayers()
- fetchPlayers()
- fetchRound()
menu:
- menuButtonHandler()
| - confirmationModal()
- goToMainMenu()
question-price:
- processQuestionSelection()
- processQustionDisplay(topic, price)
- getQuestionData(topic, price)
QS normal => displayQuestionScreen()
MP pip => processPipPlayers(await getActivePlayerId()); -> pip modal
MA auction => processAuctionPlayers(await getActivePlayerId()); -> auction modal
player-score:
front:
- processQuestionShow() {NORMAL/PIP/AUCTION}
modal:
pip:
- processVictimSelection()
- sendPipVictim()
- closeModal(modal);
- setPipPlayersSelection()
- setAllPlayersState("inactive") .className = "player-badge " + state;
- setActivePlayerBadgeState() // await getActivePlayerId()
-
| - allowAnswer()
QS - displayQuestionScreen()
| auction:
- processAuctionPlayers()
- showAllPlayers()
| - pollBackendForNewBid() <- for activeUser
| - pollBackendForNewBid() <- for all users
| - allowAnswer()
|QS - displayQuestionScreen()
question-screen:
menu:
- the same as before
allow-answer:
| - allowAnswerHandler()
- allowAnswer()
- waitForFirstClick() {id}
- setActivePlayerBadgeState()
correct-answer:
- processCorrectAnswer()
- answerQuestion(true)
- updateUserScore()
- goToRoundScreen()
- setAllPlayersState("") .className = "player-badge " + state;
- setActivePlayerBadgeState()
- displayRoundScreen()
wrong-answer:
- processWrongAnswer()
- answerQuestion(false)
- updateUserScore()
| (>0 && normal) => forbidAnswer()
| _ => goToRoundScreen()
1. Відкрити модалку
- створюємо функцію, в якій присвоюємо змінну(саму модалку)
- викликаємо функцію openModal(тут модалка);
- викликати в середині 2 фії;