egonSchiele / dominion

A Dominion simulator in Haskell
Other
111 stars 11 forks source link

Implement Library's setting-aside effect #6

Open amalloy opened 10 years ago

amalloy commented 10 years ago

I noticed https://github.com/egonSchiele/dominion/blob/2f4ff82040f075b9370fd2b38720b0502a2771b7/src/Dominion/Internal.hs#L425 - I think you want LibraryEffect to take a function like

libraryChoice :: [Card] -> [Card] -> Card -> Bool
libraryChoice cardsInHand cardsSetAside cardRevealed = -- choose whether to keep it

This isn't quite all the information available (eg, how many cards are left before my shuffle?), so maybe it needs to be lifted into State somehow, but I think it's close enough. If you agree, I think it's within my ability to make that change.

egonSchiele commented 10 years ago

Perfect, this is what I was thinking too. If you send over a pull request I'll merge it in.

amalloy commented 10 years ago

I've implemented this in https://github.com/amalloy/dominion/compare/master...library - it's in a separate branch because I don't want to suggest you pull it until it's possible to test it.

egonSchiele commented 10 years ago

You should be able to test this now.