Give every light its own type

This commit is contained in:
Sven van Heugten 2026-02-27 17:49:20 +01:00
parent dbb0389e61
commit 50c8a413a6
6 changed files with 72 additions and 50 deletions

View file

@ -9,27 +9,27 @@ type ArbitraryLight =
type ArbitraryNonRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter _.ControlledWithRemote.IsNonRemote
|> Seq.filter (fun light -> (lightProps light).ControlledWithRemote.IsNonRemote)
|> Gen.elements
|> Arb.fromGen
type ArbitraryLeftRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter _.ControlledWithRemote.IsRemoteLeft
|> Seq.filter (fun light -> (lightProps light).ControlledWithRemote.IsRemoteLeft)
|> Gen.elements
|> Arb.fromGen
type ArbitraryRightRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter _.ControlledWithRemote.IsRemoteRight
|> Seq.filter (fun light -> (lightProps light).ControlledWithRemote.IsRemoteRight)
|> Gen.elements
|> Arb.fromGen
type ArbitraryRemotelyControlledLight =
static member Light() =
lights
|> Seq.filter (not << _.ControlledWithRemote.IsNonRemote)
|> Seq.filter (fun light -> (lightProps light).ControlledWithRemote.IsNonRemote |> not)
|> Gen.elements
|> Arb.fromGen