Editorial illustration: Kot, Hakem-Kot and scoring exceptions

Kot, Hakem-Kot and scoring exceptions

The problem I needed to solve

A seven-zero hand differs from an ordinary win, and the Hakem’s team matters when classifying it. I did not want that exception duplicated across scoring and interface text.

Implementation in this snapshot

HokmKotRuleResolver.Resolve first checks KotEnabled. Only a seven-zero result enters Kot classification: the Hakem team’s win produces Kot, and the opposing team’s win produces HakemKot.

The design decision and its cost

HokmHandWinType and a separate result preserve that classification. Configurable points come from the game configuration, while feedback can display the appropriate outcome name.

Current boundaries

Classification depends on a valid hand-ended result. A large HUD number alone is insufficient, and disabling Kot must produce the normal outcome.

The same zero score, two different outcomes

Consider two hands in which the losing team wins no tricks. Resolve produces Kot if the Hakem team wins, and HakemKot if the opposing team wins. Zero alone does not determine the outcome name. hakemTeamId is essential context, and the service validates it against the two supported teams. Celebration text, points and recorded results can share one classification rather than independently infer a name from the numbers.

The conditions named teamAWonSevenZero and teamBWonSevenZero compare the winner’s count with config.HandTargetTricks. They do not hardcode seven. The normal Hokm target gives the familiar interpretation, but changing configuration also changes this classification condition. Configuration contracts therefore matter: variable names or product text do not guarantee that every possible setting preserves the intended game meaning.

KotEnabled is checked before special classification; disabling it returns NormalHandPoints. Outcomes that do not meet the target-versus-zero condition are also normal. KotPoints and HakemKotPoints come from configuration, and the resolver does not mutate match scores itself. A caller must apply the outcome through match scoring. The class does not reconstruct hand history either: receiving a classification does not replace validating the hand-ended event.

What this stage taught me

For me, this showed how an exception can become a small, explicit rule. Changing Kot scoring does not need to rewrite hand flow and celebration animation at the same time.

Explore Dalo

Latest devlogs

Editorial illustration: Pasur launch and telemetry in the shared structure

Pasur launch and telemetry in the shared structure

Adding Pasur needs both a correct mode handoff and valid public telemetry.

Read article
Editorial illustration: Presenting selection and captures in Pasur

Presenting selection and captures in Pasur

Pasur motion should explain which hand card was played and which table cards were captured.

Read article
Editorial illustration: Pasur bot decisions from capture options

Pasur bot decisions from capture options

My teammate’s Pasur bot chooses among legal options without inspecting hidden opposing cards.

Read article
Dalo