wizard-wipeout/src-lib/Library/Types.hs

48 lines
1.2 KiB
Haskell

module Library.Types
( module T
, module Library.Types
) where
import Data.Matrix
import Graphics.Vty
import Library.Types.Communication as T
import Library.Types.Player as T
-- | Data object for storing the client's state
data ClientState = ClientState
{ clientVty :: Vty -- ^ Context object for graphics
, clientGameOver :: Bool -- ^ client game over (contestant died)
, clientStop :: Bool -- ^ client shutdown
}
-- | Type synonym for the Map. Translates to a Matrix of 'Tile's
type ServerMap = Matrix Tile
-- | Type synonym for the Map. Translates to a Matrix of 'Maybe Tile's
type ClientMap = Matrix (Maybe Tile)
data Tile
= Air -- ^ walkable area
| Wall -- ^ obstacle
deriving (Show, Eq)
data Arena = Arena
{ arenaMap :: ServerMap
, arenaSpawners :: [Spawner]
}
deriving (Show, Eq)
data Spawner = Spawner
{ spawnerPowerup :: Wand -- ^ Which 'Powerup' is being spawned
, spawnerReloadTime :: Int -- ^ How long does it take for the 'Powerup' to reappear
, spawnerState :: SpawnerState
, spawnerReloadTTL :: Float
, spawnerPosition :: Position -- ^ Position of the `Spawner` on the map
}
deriving (Show, Eq)
data SpawnerState
= SpawnerFull
| SpawnerEmpty
deriving (Eq, Show)