-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes.txt
52 lines (41 loc) · 977 Bytes
/
notes.txt
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
Game process:
Deal
Bid
Play Trick (repeat for all tricks)
Score
Create game (options: player limit)
start:
@begun = true
@deal
set @expectedTurn
callback
[clients examine @expectedTurn and first bidder bids]
makeMove:
validate bid/move (validateMove)
@moves.push(move)
if move is last of the trick, call concludeTrick()
set @expectedTurn
callback
[this repeats until all players have played a card]
concludeTrick:
find winning card of trick
if trick is last trick:
calculateScore()
increment round
else
reset @table
reset
TODO: Have winner of previous round choose trumps DONE
Have dealer rotate
Sometimes the game picks the wrong person as the winner of a trick
If the client disconnects and reconnects this causes problems
Client:
move:
{type, playerID, value}
where value is
type == bid --> int
type == card --> {suit, value, owner}
type == trumps --> suit
Player rotation:
Pick [0] for fist trick
shift(winner)