gleam-spacetraders-models/src/spacetraders_models/siphon.gleam
Lily Rose fab4c9df5d
Some checks are pending
test / test (push) Waiting to run
Initial commit
2025-07-08 23:03:42 +10:00

13 lines
454 B
Gleam

import gleam/dynamic/decode.{type Decoder}
import spacetraders_models/ship_symbol.{type ShipSymbol}
import spacetraders_models/siphon_yield.{type SiphonYield}
pub type Siphon {
Siphon(ship_symbol: ShipSymbol, yield: SiphonYield)
}
pub fn decoder() -> Decoder(Siphon) {
use ship_symbol <- decode.field("shipSymbol", ship_symbol.decoder())
use yield <- decode.field("yield", siphon_yield.decoder())
decode.success(Siphon(ship_symbol:, yield:))
}