feat(client_web): show holes & points progress bars
This commit is contained in:
parent
bef0ecbd8c
commit
01fa837b84
5 changed files with 242 additions and 118 deletions
|
|
@ -70,18 +70,85 @@ input[type="text"] {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Score panel ────────────────────────────────────────────────────── */
|
/* ── Player score panel ─────────────────────────────────────────────── */
|
||||||
.score-panel {
|
.player-score-panel {
|
||||||
display: flex;
|
|
||||||
gap: 2rem;
|
|
||||||
background: #f5edd8;
|
background: #f5edd8;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 0.5rem 1.5rem;
|
padding: 0.5rem 1rem;
|
||||||
font-size: 0.95rem;
|
font-size: 0.9rem;
|
||||||
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
|
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-score-header {
|
||||||
|
margin-bottom: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-name {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-bars {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-bar-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-bar-label {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #555;
|
||||||
|
width: 3.5rem;
|
||||||
|
text-align: right;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-bar {
|
||||||
|
width: 140px;
|
||||||
|
height: 10px;
|
||||||
|
background: rgba(0,0,0,0.12);
|
||||||
|
border-radius: 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-bar-fill {
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: width 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-bar-points { background: #4a7a3a; }
|
||||||
|
.score-bar-holes { background: #7a4a2a; }
|
||||||
|
|
||||||
|
.score-bar-value {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #444;
|
||||||
|
min-width: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bredouille-badge {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
background: #c07800;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 0.05em 0.35em;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.player-jans {
|
||||||
|
margin-top: 0.35rem;
|
||||||
|
border-top: 1px solid rgba(0,0,0,0.1);
|
||||||
|
padding-top: 0.25rem;
|
||||||
}
|
}
|
||||||
.score-row { display: flex; gap: 1rem; align-items: center; }
|
|
||||||
.score-name { font-weight: bold; min-width: 80px; }
|
|
||||||
|
|
||||||
/* ── Status bar ─────────────────────────────────────────────────────── */
|
/* ── Status bar ─────────────────────────────────────────────────────── */
|
||||||
.status-bar {
|
.status-bar {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
use futures::channel::mpsc::UnboundedSender;
|
use futures::channel::mpsc::UnboundedSender;
|
||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use trictrac_store::{CheckerMove, Jan};
|
use trictrac_store::CheckerMove;
|
||||||
|
|
||||||
use crate::app::{GameUiState, NetCommand};
|
use crate::app::{GameUiState, NetCommand};
|
||||||
use crate::trictrac::types::{JanEntry, PlayerAction, SerStage, SerTurnStage};
|
use crate::trictrac::types::{JanEntry, PlayerAction, SerStage, SerTurnStage};
|
||||||
|
|
||||||
use super::board::Board;
|
use super::board::Board;
|
||||||
use super::die::Die;
|
use super::die::Die;
|
||||||
use super::score_panel::ScorePanel;
|
use super::score_panel::PlayerScorePanel;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
/// Returns (d0_used, d1_used) by matching each staged move's distance to a die.
|
/// Returns (d0_used, d1_used) by matching each staged move's distance to a die.
|
||||||
|
|
@ -34,86 +34,31 @@ fn matched_dice_used(staged: &[(u8, u8)], dice: (u8, u8)) -> (bool, bool) {
|
||||||
(d0, d1)
|
(d0, d1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn jan_label(jan: &Jan) -> &'static str {
|
/// Split `dice_jans` into (viewer_jans, opponent_jans).
|
||||||
match jan {
|
/// Entries where the active player scores (total >= 0) go to the active player.
|
||||||
Jan::FilledQuarter => "Remplissage",
|
/// Entries where the active player loses (total < 0) go to the opponent, with signs flipped.
|
||||||
Jan::TrueHitSmallJan => "Battage à vrai (petit jan)",
|
fn split_jans(
|
||||||
Jan::TrueHitBigJan => "Battage à vrai (grand jan)",
|
dice_jans: &[JanEntry],
|
||||||
Jan::TrueHitOpponentCorner => "Battage coin adverse",
|
viewer_is_active: bool,
|
||||||
Jan::FirstPlayerToExit => "Premier sorti",
|
) -> (Vec<JanEntry>, Vec<JanEntry>) {
|
||||||
Jan::SixTables => "Six tables",
|
let mut mine = Vec::new();
|
||||||
Jan::TwoTables => "Deux tables",
|
let mut theirs = Vec::new();
|
||||||
Jan::Mezeas => "Mezeas",
|
for e in dice_jans {
|
||||||
Jan::FalseHitSmallJan => "Battage à faux (petit jan)",
|
if viewer_is_active {
|
||||||
Jan::FalseHitBigJan => "Battage à faux (grand jan)",
|
if e.total >= 0 {
|
||||||
Jan::ContreTwoTables => "Contre deux tables",
|
mine.push(e.clone());
|
||||||
Jan::ContreMezeas => "Contre mezeas",
|
} else {
|
||||||
Jan::HelplessMan => "Dame impuissante",
|
theirs.push(JanEntry { total: -e.total, points_per: -e.points_per, ..e.clone() });
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn format_move_pair(m1: CheckerMove, m2: CheckerMove) -> String {
|
|
||||||
let fmt = |m: CheckerMove| -> String {
|
|
||||||
let (f, t) = (m.get_from(), m.get_to());
|
|
||||||
if f == 0 && t == 0 {
|
|
||||||
"—".to_string()
|
|
||||||
} else if t == 0 {
|
|
||||||
// exit
|
|
||||||
format!("{f}↑")
|
|
||||||
} else {
|
|
||||||
format!("{f}→{t}")
|
|
||||||
}
|
|
||||||
};
|
|
||||||
format!("{} & {}", fmt(m1), fmt(m2))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn jan_row(idx: usize, entry: JanEntry, expanded: RwSignal<Option<usize>>) -> impl IntoView {
|
|
||||||
let row_class = if entry.total >= 0 {
|
|
||||||
"jan-row jan-expandable jan-positive"
|
|
||||||
} else {
|
|
||||||
"jan-row jan-expandable jan-negative"
|
|
||||||
};
|
|
||||||
let label = jan_label(&entry.jan);
|
|
||||||
let double_tag = if entry.is_double { "double" } else { "simple" };
|
|
||||||
let ways_tag = format!("×{}", entry.ways);
|
|
||||||
let pts_str = if entry.total >= 0 {
|
|
||||||
format!("+{}", entry.total)
|
|
||||||
} else {
|
|
||||||
format!("{}", entry.total)
|
|
||||||
};
|
|
||||||
|
|
||||||
let moves = entry.moves.clone();
|
|
||||||
|
|
||||||
view! {
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
class=row_class
|
|
||||||
on:click=move |_| {
|
|
||||||
expanded.update(|s| {
|
|
||||||
*s = if *s == Some(idx) { None } else { Some(idx) };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span class="jan-label">{label}</span>
|
|
||||||
<span class="jan-tag">{double_tag}</span>
|
|
||||||
<span class="jan-tag">{ways_tag}</span>
|
|
||||||
<span class="jan-pts">{pts_str}</span>
|
|
||||||
</div>
|
|
||||||
{
|
|
||||||
let move_lines: Vec<_> = moves.iter()
|
|
||||||
.map(|&(m1, m2)| {
|
|
||||||
let text = format_move_pair(m1, m2);
|
|
||||||
view! { <div class="jan-move-line">{text}</div> }
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
view! {
|
|
||||||
<div class="jan-moves" class:hidden=move || expanded.get() != Some(idx)>
|
|
||||||
{move_lines}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</div>
|
} else {
|
||||||
|
if e.total >= 0 {
|
||||||
|
theirs.push(e.clone());
|
||||||
|
} else {
|
||||||
|
mine.push(JanEntry { total: -e.total, points_per: -e.points_per, ..e.clone() });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
(mine, theirs)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
|
|
@ -174,6 +119,13 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
|
||||||
let show_roll = is_my_turn && vs.turn_stage == SerTurnStage::RollDice;
|
let show_roll = is_my_turn && vs.turn_stage == SerTurnStage::RollDice;
|
||||||
let show_hold_go = is_my_turn && vs.turn_stage == SerTurnStage::HoldOrGoChoice;
|
let show_hold_go = is_my_turn && vs.turn_stage == SerTurnStage::HoldOrGoChoice;
|
||||||
|
|
||||||
|
// ── Jan split: viewer_jans / opponent_jans ─────────────────────────────────
|
||||||
|
let (my_jans, opp_jans) = split_jans(&vs.dice_jans, is_my_turn);
|
||||||
|
|
||||||
|
// ── Scores: index = mp_player_id ──────────────────────────────────────────
|
||||||
|
let my_score = vs.scores[player_id as usize].clone();
|
||||||
|
let opp_score = vs.scores[1 - player_id as usize].clone();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<div class="game-container">
|
<div class="game-container">
|
||||||
// ── Top bar ──────────────────────────────────────────────────────
|
// ── Top bar ──────────────────────────────────────────────────────
|
||||||
|
|
@ -182,10 +134,11 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
|
||||||
<a class="quit-link" href="#" on:click=move |e| {
|
<a class="quit-link" href="#" on:click=move |e| {
|
||||||
e.prevent_default();
|
e.prevent_default();
|
||||||
cmd_tx_quit.unbounded_send(NetCommand::Disconnect).ok();
|
cmd_tx_quit.unbounded_send(NetCommand::Disconnect).ok();
|
||||||
}>"Quit"</a>
|
}>Quit</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ScorePanel scores=vs.scores.clone() player_id=player_id />
|
// ── Opponent score (above board) ─────────────────────────────────
|
||||||
|
<PlayerScorePanel score=opp_score jans=opp_jans is_you=false />
|
||||||
|
|
||||||
// ── Status ───────────────────────────────────────────────────────
|
// ── Status ───────────────────────────────────────────────────────
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
|
|
@ -207,15 +160,6 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
|
||||||
</div>
|
</div>
|
||||||
})}
|
})}
|
||||||
|
|
||||||
// ── Jan panel ────────────────────────────────────────────────────
|
|
||||||
{(!vs.dice_jans.is_empty()).then(|| {
|
|
||||||
let expanded: RwSignal<Option<usize>> = RwSignal::new(None);
|
|
||||||
let rows: Vec<_> = vs.dice_jans.iter().enumerate().map(|(i, entry)| {
|
|
||||||
jan_row(i, entry.clone(), expanded)
|
|
||||||
}).collect();
|
|
||||||
view! { <div class="jan-panel">{rows}</div> }
|
|
||||||
})}
|
|
||||||
|
|
||||||
// ── Board ────────────────────────────────────────────────────────
|
// ── Board ────────────────────────────────────────────────────────
|
||||||
<Board
|
<Board
|
||||||
view_state=vs
|
view_state=vs
|
||||||
|
|
@ -264,6 +208,9 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
// ── Player score (below board) ────────────────────────────────────
|
||||||
|
<PlayerScorePanel score=my_score jans=my_jans is_you=true />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@ mod game_screen;
|
||||||
mod login_screen;
|
mod login_screen;
|
||||||
mod score_panel;
|
mod score_panel;
|
||||||
|
|
||||||
pub use die::Die;
|
|
||||||
|
|
||||||
pub use connecting_screen::ConnectingScreen;
|
pub use connecting_screen::ConnectingScreen;
|
||||||
pub use game_screen::GameScreen;
|
pub use game_screen::GameScreen;
|
||||||
pub use login_screen::LoginScreen;
|
pub use login_screen::LoginScreen;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,135 @@
|
||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
|
use trictrac_store::{CheckerMove, Jan};
|
||||||
|
|
||||||
use crate::trictrac::types::PlayerScore;
|
use crate::trictrac::types::{JanEntry, PlayerScore};
|
||||||
|
|
||||||
|
fn jan_label(jan: &Jan) -> &'static str {
|
||||||
|
match jan {
|
||||||
|
Jan::FilledQuarter => "Remplissage",
|
||||||
|
Jan::TrueHitSmallJan => "Battage à vrai (petit jan)",
|
||||||
|
Jan::TrueHitBigJan => "Battage à vrai (grand jan)",
|
||||||
|
Jan::TrueHitOpponentCorner => "Battage coin adverse",
|
||||||
|
Jan::FirstPlayerToExit => "Premier sorti",
|
||||||
|
Jan::SixTables => "Six tables",
|
||||||
|
Jan::TwoTables => "Deux tables",
|
||||||
|
Jan::Mezeas => "Mezeas",
|
||||||
|
Jan::FalseHitSmallJan => "Battage à faux (petit jan)",
|
||||||
|
Jan::FalseHitBigJan => "Battage à faux (grand jan)",
|
||||||
|
Jan::ContreTwoTables => "Contre deux tables",
|
||||||
|
Jan::ContreMezeas => "Contre mezeas",
|
||||||
|
Jan::HelplessMan => "Dame impuissante",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn format_move_pair(m1: CheckerMove, m2: CheckerMove) -> String {
|
||||||
|
let fmt = |m: CheckerMove| -> String {
|
||||||
|
let (f, t) = (m.get_from(), m.get_to());
|
||||||
|
if f == 0 && t == 0 {
|
||||||
|
"—".to_string()
|
||||||
|
} else if t == 0 {
|
||||||
|
format!("{f}↑")
|
||||||
|
} else {
|
||||||
|
format!("{f}→{t}")
|
||||||
|
}
|
||||||
|
};
|
||||||
|
format!("{} & {}", fmt(m1), fmt(m2))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn jan_row(idx: usize, entry: JanEntry, expanded: RwSignal<Option<usize>>) -> impl IntoView {
|
||||||
|
let row_class = if entry.total >= 0 {
|
||||||
|
"jan-row jan-expandable jan-positive"
|
||||||
|
} else {
|
||||||
|
"jan-row jan-expandable jan-negative"
|
||||||
|
};
|
||||||
|
let label = jan_label(&entry.jan);
|
||||||
|
let double_tag = if entry.is_double { "double" } else { "simple" };
|
||||||
|
let ways_tag = format!("×{}", entry.ways);
|
||||||
|
let pts_str = if entry.total >= 0 {
|
||||||
|
format!("+{}", entry.total)
|
||||||
|
} else {
|
||||||
|
format!("{}", entry.total)
|
||||||
|
};
|
||||||
|
|
||||||
|
let moves = entry.moves.clone();
|
||||||
|
|
||||||
|
view! {
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class=row_class
|
||||||
|
on:click=move |_| {
|
||||||
|
expanded.update(|s| {
|
||||||
|
*s = if *s == Some(idx) { None } else { Some(idx) };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span class="jan-label">{label}</span>
|
||||||
|
<span class="jan-tag">{double_tag}</span>
|
||||||
|
<span class="jan-tag">{ways_tag}</span>
|
||||||
|
<span class="jan-pts">{pts_str}</span>
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
let move_lines: Vec<_> = moves.iter()
|
||||||
|
.map(|&(m1, m2)| {
|
||||||
|
let text = format_move_pair(m1, m2);
|
||||||
|
view! { <div class="jan-move-line">{text}</div> }
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
view! {
|
||||||
|
<div class="jan-moves" class:hidden=move || expanded.get() != Some(idx)>
|
||||||
|
{move_lines}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// One player's score panel: name, progress bars (points & holes), bredouille indicator,
|
||||||
|
/// and the list of jans scored by this player in the last roll.
|
||||||
|
/// `jans` should already be filtered and sign-corrected for this player's perspective.
|
||||||
#[component]
|
#[component]
|
||||||
pub fn ScorePanel(scores: [PlayerScore; 2], player_id: u16) -> impl IntoView {
|
pub fn PlayerScorePanel(score: PlayerScore, jans: Vec<JanEntry>, is_you: bool) -> impl IntoView {
|
||||||
let rows: Vec<_> = scores
|
let label = if is_you { " (vous)" } else { "" };
|
||||||
|
let points_pct = format!("{}%", (score.points as u32 * 100 / 12).min(100));
|
||||||
|
let holes_pct = format!("{}%", (score.holes as u32 * 100 / 12).min(100));
|
||||||
|
let points_val = format!("{}/12", score.points);
|
||||||
|
let holes_val = format!("{}/12", score.holes);
|
||||||
|
let can_bredouille = score.can_bredouille;
|
||||||
|
|
||||||
|
let expanded: RwSignal<Option<usize>> = RwSignal::new(None);
|
||||||
|
let jan_rows: Vec<_> = jans
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, score)| {
|
.map(|(i, entry)| jan_row(i, entry, expanded))
|
||||||
let label = if i as u16 == player_id { " (you)" } else { "" };
|
|
||||||
view! {
|
|
||||||
<div class="score-row">
|
|
||||||
<span class="score-name">{score.name}{label}</span>
|
|
||||||
<span class="score-points">"Points: "{score.points}</span>
|
|
||||||
<span class="score-holes">"Holes: "{score.holes}</span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<div class="score-panel">{rows}</div>
|
<div class="player-score-panel">
|
||||||
|
<div class="player-score-header">
|
||||||
|
<span class="player-name">{score.name}{label}</span>
|
||||||
|
</div>
|
||||||
|
<div class="score-bars">
|
||||||
|
<div class="score-bar-row">
|
||||||
|
<span class="score-bar-label">"Points"</span>
|
||||||
|
<div class="score-bar">
|
||||||
|
<div class="score-bar-fill score-bar-points" style=format!("width:{points_pct}")></div>
|
||||||
|
</div>
|
||||||
|
<span class="score-bar-value">{points_val}</span>
|
||||||
|
{can_bredouille.then(|| view! {
|
||||||
|
<span class="bredouille-badge" title="Peut faire bredouille">"B"</span>
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
<div class="score-bar-row">
|
||||||
|
<span class="score-bar-label">"Trous"</span>
|
||||||
|
<div class="score-bar">
|
||||||
|
<div class="score-bar-fill score-bar-holes" style=format!("width:{holes_pct}")></div>
|
||||||
|
</div>
|
||||||
|
<span class="score-bar-value">{holes_val}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{(!jan_rows.is_empty()).then(|| view! {
|
||||||
|
<div class="player-jans">{jan_rows}</div>
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,8 @@ impl ViewState {
|
||||||
turn_stage: SerTurnStage::RollDice,
|
turn_stage: SerTurnStage::RollDice,
|
||||||
active_mp_player: None,
|
active_mp_player: None,
|
||||||
scores: [
|
scores: [
|
||||||
PlayerScore { name: host_name.to_string(), points: 0, holes: 0 },
|
PlayerScore { name: host_name.to_string(), points: 0, holes: 0, can_bredouille: false },
|
||||||
PlayerScore { name: guest_name.to_string(), points: 0, holes: 0 },
|
PlayerScore { name: guest_name.to_string(), points: 0, holes: 0, can_bredouille: false },
|
||||||
],
|
],
|
||||||
dice: (0, 0),
|
dice: (0, 0),
|
||||||
dice_jans: Vec::new(),
|
dice_jans: Vec::new(),
|
||||||
|
|
@ -120,8 +120,9 @@ impl ViewState {
|
||||||
name: p.name.clone(),
|
name: p.name.clone(),
|
||||||
points: p.points,
|
points: p.points,
|
||||||
holes: p.holes,
|
holes: p.holes,
|
||||||
|
can_bredouille: p.can_bredouille,
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| PlayerScore { name: String::new(), points: 0, holes: 0 })
|
.unwrap_or_else(|| PlayerScore { name: String::new(), points: 0, holes: 0, can_bredouille: false })
|
||||||
};
|
};
|
||||||
|
|
||||||
// is_double for scoring: dice show the same value (both dice identical).
|
// is_double for scoring: dice show the same value (both dice identical).
|
||||||
|
|
@ -176,6 +177,7 @@ pub struct PlayerScore {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub points: u8,
|
pub points: u8,
|
||||||
pub holes: u8,
|
pub holes: u8,
|
||||||
|
pub can_bredouille: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Serialisable mirrors of store enums ──────────────────────────────────────
|
// ── Serialisable mirrors of store enums ──────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue