diff --git a/game/game.go b/game/game.go index d4fe1a0..0b958e2 100644 --- a/game/game.go +++ b/game/game.go @@ -237,6 +237,7 @@ func (g *Match) DTO(id player.ID) serve.Game { g.players[1].DTO(), }, Round: g.round, + Dealer: g.CurrentPlayer() == &g.players[0], Damage: g.damage, Shell: g.Peek(id), Previous: g.prev, diff --git a/game/game_test.go b/game/game_test.go index 829103f..a41e90c 100644 --- a/game/game_test.go +++ b/game/game_test.go @@ -445,6 +445,7 @@ func TestGameDTO(t *testing.T) { g.players[1].DTO(), }, Round: g.round, + Dealer: false, Damage: g.damage, Shell: nil, Previous: nil, @@ -469,6 +470,7 @@ func TestGameDTO(t *testing.T) { g.players[1].DTO(), }, Round: g.round, + Dealer: true, Damage: g.damage, Shell: nil, Previous: &g.shellArray[0], diff --git a/serve/dto.go b/serve/dto.go index 694e219..09e8c14 100644 --- a/serve/dto.go +++ b/serve/dto.go @@ -9,6 +9,8 @@ type Game struct { Players [2]Player `json:"players"` // Round is the current round. Round int8 `json:"round"` + // Dealer indicates whether the current player is the dealer. + Dealer bool `json:"dealer"` // Damage is the damage a live shell will deal this turn. Damage int8 `json:"damage"` // Shell gives whether the current shell is live if it is revealed. diff --git a/site/components.d.ts b/site/components.d.ts index 46c00f4..6eda1f4 100644 --- a/site/components.d.ts +++ b/site/components.d.ts @@ -8,9 +8,7 @@ export {} declare module 'vue' { export interface GlobalComponents { Game: typeof import('./src/components/Game.vue')['default'] - GameRound: typeof import('./src/components/GameRound.vue')['default'] GameStatus: typeof import('./src/components/GameStatus.vue')['default'] - HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] Player: typeof import('./src/components/Player.vue')['default'] PlayerHP: typeof import('./src/components/PlayerHP.vue')['default'] PlayerItems: typeof import('./src/components/PlayerItems.vue')['default'] diff --git a/site/src/components/Game.vue b/site/src/components/Game.vue index 732bb2c..f16a9b0 100644 --- a/site/src/components/Game.vue +++ b/site/src/components/Game.vue @@ -1,7 +1,7 @@