- boardDouble (Form wie board): je Board entschieden, die bessere Bewertung (höhere Equity) gewinnt; Näherung offen dokumentiert (Topf geteilt, exakt wäre der Mittelwert). Ungleiche Länge, doppelte Karte -> ABSTAIN - ritOffered -> rit (ACCEPT/DECLINE/ABSTAIN) und ritReason: annehmen über dem Bruchpunkt, ohne offenen Call fairer Anteil, ohne Equity ABSTAIN - keine bestehenden Felder oder Typen geändert; Zusatzfelder werden nach der Spot-Prüfung gelesen - Tests: benannte Referenzwerte, ein Board verbessert/das andere nicht, pipeline_extras_neutral zeigt bitgleiche Antworten ohne die Felder (779) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
946 B
Rust
26 lines
946 B
Rust
use super::decode_board::board_double;
|
|
use crate::card::Card;
|
|
use crate::fault::Fault;
|
|
use crate::json::field::optional;
|
|
use crate::json::scalar::flag;
|
|
use crate::json::Value;
|
|
|
|
/// Optional request fields that do not belong to the `Spot`: they change how the
|
|
/// decision is formed or what is answered besides it.
|
|
#[derive(Clone, Debug, Default, PartialEq)]
|
|
pub struct Extras {
|
|
/// `boardDouble`: second board of a double-board hand.
|
|
pub board_double: Option<Vec<Card>>,
|
|
/// `ritOffered`: the table offers to run it twice; absent or `null` means no.
|
|
pub rit_offered: bool,
|
|
}
|
|
|
|
/// Read after the `Spot` checks, so faults of contract fields keep their precedence.
|
|
pub fn extras(root: &Value) -> Result<Extras, Fault> {
|
|
let rit_offered = match optional(root, "", "ritOffered")? {
|
|
Some(value) => flag(value, "ritOffered")?,
|
|
None => false,
|
|
};
|
|
Ok(Extras { board_double: board_double(root)?, rit_offered })
|
|
}
|