ritchie/hand/payment
Point payments for a winning hand. Each transaction between two players is rounded up to the nearest 100 points; basic points themselves are never rounded. The riichi pot is added to the winner without being deducted from the other players, since those points were already moved when riichi was declared.
Types
pub type PaymentInput {
PaymentInput(
score: scoring.Score,
method: agari.AgariKind,
winner: player.Player,
contributor: player.Player,
dealer: player.Player,
honba: Int,
pot: Int,
)
}
Constructors
-
PaymentInput( score: scoring.Score, method: agari.AgariKind, winner: player.Player, contributor: player.Player, dealer: player.Player, honba: Int, pot: Int, )Arguments
- contributor
-
The discarder for a ron, or the winner themself for a tsumo.
- pot
-
Riichi sticks in the pot.
Values
pub fn payments(input: PaymentInput) -> List(Int)
Returns the point delta for each player, indexed by player.to_int.