module Configuration ( Configuration ( Configuration , size , mines , strategy , deathProbRange , allowedDeaths , recursiveReveal , undoAllowed , hintAllowed ) , numOfSolutions , Strategy (..) , HintType (..) , Probability , configuration' ) where import Core.Square import Core.Constraints import Control.Monad import Data.Binary import Data.DeriveTH import Data.Derive.Binary ---------------------------------- data Configuration = Configuration { size :: Board , mines :: Int , numOfSolutions_ :: Integer -- cached, determined by size and mines , strategy :: Strategy , deathProbRange :: (Probability, Probability) -- (a, b): ha p valséggel halnánk meg, akkor p>a esetén meghalunk, p Integer numOfSolutions = numOfSolutions_ configuration' :: Configuration -> Configuration configuration' c = c { numOfSolutions_ = solutions $ initConstraints (size c) (mines c) } ------------------------ $( derive makeBinary ''HintType ) $( derive makeBinary ''Strategy ) $( derive makeBinary ''Configuration )