Lichess4545 / Chesster

Chesster Moderator Bot for Lichess45+45
28 stars 22 forks source link

Using a sum type for pairings #392

Open lakinwecker opened 3 years ago

lakinwecker commented 3 years ago

https://github.com/Lichess4545/Chesster/blob/main/src/league.ts#L35-L45

I think we should consider making that into a sumtype of LonePlayerPairing and TeamPlayerPairing, TeamPlayerPairing can require the teams to be set, and we can provide typeguards. I think that would help us catch some of these issues sooner.