-------------------------------------------------------------------------------
-- Operate the Terminal machinery.
-- 2017 Francesco Ariis GPLv3
-------------------------------------------------------------------------------

-- Basic col-on-black ASCII terminal, operations.
-- Only module to be imported.

-- todo color [release]
-- todo resize screen corruption [grave]
-- add docs [release]

module Terminal.Game ( -- * Game loop
                       gameLoop,
                       -- * Plane
                       Plane,                  -- types
                       Coords, Width, Height,
                       stringPlane,            -- crea
                       blankPlane, addVitrum,
                       copyPlane, pastePlane,  -- slice
                       planeSize, paperPlane,  -- info
                       -- * Draw
                       (%), (&), cell,         -- draw
                       box, textBox,
                       -- * Animations
                       Animation, Loop(..),    -- types
                       creaAni,
                       tick, reset,            -- operate
                                             -- xxx metti fetchframe in
                                             --     documentation
                                             --     e anche isexpired
                       getFrames,
                       encodeAni,              -- serialise
                       decodeAni,
                       -- * Timers
                       Timed,                  -- types
                       ExpBehaviour(..),
                       creaTimer,              -- crea
                       creaBoolTimer,
                       fetchFrame, isExpired,  -- operate
                       -- * Utils
                       screenSize
                     )
    where

import Terminal.Game.GameLoop
import Terminal.Game.Plane
import Terminal.Game.Draw
-- xxx rivedi gli export di animation, encapsula tutto il possibile
import Terminal.Game.Animation
import Terminal.Game.Timer
import Terminal.Game.Utils

-- todo text deve essere gestito da una cosa smart, pensa a pp leijin

-- todo [post-first-release] setTitle hSupportsANSI bold? italics? intensity

-- todo geekosaur threaded shit bug

--    geekosaur f-a, a. heh. so the thoguht I had turned out to
--           be correct:
--           Control.Concurent.rtsSupportsBoundThreads (because
--           green threads can't be usefully bound)
--            x hiratara
--              [~hiratara@240f:7:4708:1:47a:b8c4:d18a:d063]
--              has left Ping timeout: 276 seconds [#haskell]
--    geekosaur so if that produces True, it's using the
--              threaded runtime; if False, you can say
--              something useful instead of hanging