1
Fork 0
This repository has been archived on 2023-12-08. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2022FuncProg-project2-patience/lib/Patience.hs
2022-11-15 23:29:58 +01:00

39 lines
1.6 KiB
Haskell

module Patience
( playPatience
) where
import PatienceBoard
import PatienceRenderer
import Graphics.Gloss (dim, green, play)
---------------------------------------------------------------------
-- Single module to play patience. --
-- Includes all logic and rendering. --
---------------------------------------------------------------------
----------------------------- Constants ------------------------------
-- Framerate of the game
type FPS = Int
---------------------------------------------------------------------
-- Play a game of patience.
playPatience :: FPS -> IO()
playPatience fps = do play window bgcolor fps initGame render handleInputs step
where window = getWindow
step _ g = g
bgcolor = dim green
---------------------------- Documentation ---------------------------
-- The structure of this project is based on the Model-View- --
-- Controller as known in Java. This clearly seperates different --
-- functionality from each other. I also tried to put as much --
-- functionality of the same thing into a single module. I always --
-- asked myself: "Could I use this piece of code in a different --
-- project?" If the answer was yes, there is now a module for it. --
-- -*- --
-- This block merely serves as a message to the person reviewing --
-- this code. --
----------------------------------------------------------------------