Files
loop/src/Dodge/Data/Universe.hs
T
justin 04a83ed031 Fix error in circle wall collision detection
The wall zoning did not take into account the radius of the circle
2024-12-25 00:10:26 +00:00

122 lines
3.3 KiB
Haskell

{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Universe (
module Dodge.Data.Universe,
module Dodge.Data.SelectionList,
module Dodge.Data.Config,
module Dodge.Data.World,
module Data.Preload,
module Picture.Data,
module Loop.Data,
) where
import qualified Data.Map.Strict as M
import GHC.Word (Word32)
import Dodge.Data.SelectionList
import Control.Lens
--import qualified Data.Map.Strict as M
import Data.Preload
import Data.Sequence (Seq (..))
import Dodge.Data.Config
import Dodge.Data.World
import Loop.Data
import Picture.Data
import Linear
--import SDL (Scancode)
data Universe = Universe
{ _uvWorld :: World
, _preloadData :: PreloadData
, _uvScreenLayers :: [ScreenLayer]
, _uvIOEffects :: Universe -> IO Universe
, _uvSideEffects :: Seq SideEffect
, _uvConfig :: Configuration
, _uvTestString :: Universe -> [String]
, _uvCanContinue :: Bool
, _uvMSeed :: Maybe Int
, _uvLastFrameTicks :: Word32
, _uvFrameTicks :: Word32
, _uvRAMSave :: Maybe World
, _uvDebug :: M.Map DebugBool DebugItem
, _uvDebugFloat1 :: Float
, _uvDebugFloat2 :: Float
, _uvDebugMessageOffset :: Int
}
data DebugItem = DebugItem
{ _debugPic :: Universe -> Picture
, _debugMessage :: Universe -> [String]
, _debugInfo :: DebugInfo
}
data DebugInfo
= NoDebugInfo
| DebugV3 { _debugV3 :: V3 Float}
| DebugV2 { _debugV2 :: V2 Float}
| DebugMInt { _debugMInt :: Maybe Int}
| DebugIntMInt {_debugInt :: Int, _debugMInt :: Maybe Int}
data SideEffect
= NewSideEffect
{ _ceSideEffect :: IO (Universe -> Maybe Universe)
, _ceString :: String
}
| RunningSideEffect {_ceString :: String}
| HardQuit
data OptionScreenFlag = NormalOptions | GameOverOptions | SplashOptions
| LoadingScreen
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data EscapeMenuOption
= BottomEscapeMenuOption { _emoMenuOption :: MenuOption }
| TopEscapeMenuOption { _emoMenuOption :: MenuOption }
| NoEscapeMenuOption
data ScreenLayer
= OptionScreen
{ _scTitle :: String
, _scOptions :: [MenuOption]
, _scOffset :: Int
, _scPositionedMenuOption :: EscapeMenuOption
, _scOptionFlag :: OptionScreenFlag
, _scSelectionList :: [SelectionItem (Universe -> Universe,Universe->Universe)]
, _scAvailableLines :: Int
, _scListDisplayParams :: ListDisplayParams
, _scDisplayTime :: Int
}
| InputScreen
{ _scInput :: String
, _scFooter :: String
}
data MenuOptionDisplay
= MODString {_modString :: String}
| MODBlockedString {_modString :: String}
| MODStringOption {_modString :: String, _modOption :: String}
data MenuOption
= Toggle
{ _moEff :: Universe -> Universe
, _moString :: Universe -> MenuOptionDisplay
}
| Toggle2
{ _moEff1 :: Universe -> Universe
, _moEff2 :: Universe -> Universe
, _moString :: Universe -> MenuOptionDisplay
}
data IntID a = IntID Int a
makeLenses ''Universe
makeLenses ''ScreenLayer
makeLenses ''SideEffect
makeLenses ''MenuOptionDisplay
makeLenses ''MenuOption
makeLenses ''EscapeMenuOption
makeLenses ''DebugItem
makeLenses ''DebugInfo