We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61147f7 commit 78abf79Copy full SHA for 78abf79
093.七王五二三-人机对战.html
@@ -96,13 +96,30 @@
96
}
97
98
class Round {
99
+ /** @type {Player[]} 玩家*/
100
+ players = []
101
+ /** @type {PlayerRound[]} 玩家出牌*/
102
history = []
- winner = null
103
+
104
+ get end() {
105
+ if (history.length < playerList.length) return false
106
+ let hisLen = this.history.length;
107
+ let playerLen = this.players.length;
108
+ let lastPlayerRounds = this.history.slice(hisLen - playerLen - 1)
109
+ return lastPlayerRounds.every(a => a.pass)
110
+ }
111
112
+ get winner() {
113
114
115
116
- class PlayCards {
117
+ class PlayerRound {
118
player = null
119
cards = []
120
+ get pass() {
121
+ return this.cards.length === 0
122
123
124
125
class Player {
@@ -175,7 +192,7 @@
175
192
176
193
177
194
178
-
195
179
196
180
197
181
198
/**
0 commit comments