More refactoring.

parent d8d5d0ef
......@@ -13,7 +13,7 @@ import Prelude hiding (getContents)
import Roguestar.Lib.DB
import Roguestar.Lib.Logging
import Roguestar.Lib.Position
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Data.Ratio
import Roguestar.Lib.Tool
import Control.Monad.Error
......@@ -31,7 +31,7 @@ import Roguestar.Lib.Behavior.Make
import Roguestar.Lib.Behavior.Construction
import Roguestar.Lib.Core.Building
import Roguestar.Lib.Reference
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Roguestar.Lib.PlaneData
data FacingBehavior =
......
......@@ -14,10 +14,10 @@ import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Tool
import Roguestar.Lib.ToolData
import Control.Monad.Error
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Data.Maybe
import Roguestar.Lib.Utility.Contact
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Data.List as List
data AttackModel =
......
......@@ -10,7 +10,7 @@ import Roguestar.Lib.DB
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.PlaneData
import Roguestar.Lib.TerrainData
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Control.Monad
import Control.Monad.Maybe
import Control.Monad.Trans
......
......@@ -12,7 +12,7 @@ module Roguestar.Lib.Behavior.Travel
where
import Control.Monad.Maybe
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.DB as DB
import Roguestar.Lib.Core.Plane
import Data.Maybe
......@@ -26,8 +26,8 @@ import Roguestar.Lib.Core.Monster
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Logging
import Roguestar.Lib.TravelData
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.DetailedTravel as DetailedTravel
import Roguestar.Lib.Utility.DetailedLocation
import Roguestar.Lib.Utility.DetailedTravel as DetailedTravel
walkMonster :: (DBReadable db) => Facing ->
(Integer,Integer) ->
......
......@@ -12,7 +12,7 @@ import Prelude hiding (getContents)
import Roguestar.Lib.DB
import Roguestar.Lib.Data.BuildingData
import Data.List
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Data.Maybe
import Control.Monad.Maybe
import Control.Monad.Random
......@@ -23,7 +23,7 @@ import Roguestar.Lib.TerrainData
import Control.Monad.Error
import Roguestar.Lib.PowerUpData
import Roguestar.Lib.Behavior.CharacterAdvancement
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Roguestar.Lib.Data.PlayerState
-- | The total occupied surface area of a building.
......
......@@ -20,14 +20,14 @@ import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.DB
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.Species
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Control.Monad.Error
import Control.Monad.Random
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.Position
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.Data.PlayerState
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Roguestar.Lib.Logging
import qualified Data.Set as Set
......
......@@ -32,8 +32,8 @@ import Data.Maybe
import Data.List as List
import Roguestar.Lib.Position as Position
import Roguestar.Lib.Data.PlayerState
import Roguestar.Lib.FactionData
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Data.FactionData
import Roguestar.Lib.Utility.DetailedLocation
import qualified Data.ByteString.Char8 as B
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.Logging
......
......@@ -48,14 +48,14 @@ module Roguestar.Lib.DB
peepOldestSnapshot,
popOldestSnapshot,
hasSnapshot,
module Roguestar.Lib.DBData,
module Roguestar.Lib.DBErrorFlag,
module Roguestar.Lib.Data.LocationData,
module Roguestar.Lib.Data.ErrorData,
module Roguestar.Lib.Random)
where
import Prelude hiding (getContents)
import Roguestar.Lib.DBPrivate
import Roguestar.Lib.DBData
import Roguestar.Lib.Data.ReferenceTypes
import Roguestar.Lib.Data.LocationData
import Roguestar.Lib.Reference
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PlaneData
......@@ -75,7 +75,7 @@ import Data.Ord
import Control.Monad.Random as Random
import Roguestar.Lib.Random
import Roguestar.Lib.Data.PlayerState
import Roguestar.Lib.DBErrorFlag
import Roguestar.Lib.Data.ErrorData
import Control.Parallel.Strategies
import System.IO.Unsafe
import Roguestar.Lib.Logging
......
--Data
module Roguestar.Lib.DBErrorFlag
module Roguestar.Lib.Data.ErrorData
(DBError(..),
ErrorFlag(..))
where
......
{-# LANGUAGE OverloadedStrings #-}
--Data
module Roguestar.Lib.Facing
module Roguestar.Lib.Data.FacingData
(Facing(..),
facingToRelative,
facingToRelative7,
......
{-# LANGUAGE OverloadedStrings #-}
--Data
module Roguestar.Lib.FactionData
module Roguestar.Lib.Data.FactionData
(Faction(..),factionPrefix)
where
......
{-# LANGUAGE ScopedTypeVariables, PatternGuards, TypeFamilies #-}
--Data
module Roguestar.Lib.DBData
module Roguestar.Lib.Data.LocationData
(Reference,
toUID,
genericReference,
......@@ -30,8 +30,8 @@ module Roguestar.Lib.DBData
shuntToTheUniverse)
where
import Roguestar.Lib.Facing
import Roguestar.Lib.DBPrivate
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.Data.ReferenceTypes
import Roguestar.Lib.ToolData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PlaneData
......
......@@ -16,7 +16,7 @@ module Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PersistantData
import Data.Ratio
import Data.Maybe
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Data.Monoid
import qualified Data.Map as Map
import qualified Data.Set as Set
......
......@@ -5,7 +5,7 @@ module Roguestar.Lib.Data.PlayerState
GameOverReason(..))
where
import Roguestar.Lib.DBData
import Roguestar.Lib.Data.LocationData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.TravelData
import Roguestar.Lib.PersistantData
......
--Data
module Roguestar.Lib.DBPrivate
module Roguestar.Lib.Data.ReferenceTypes
(Reference(..),
unsafeReference,
toUID,
......@@ -20,7 +19,7 @@ module Roguestar.Lib.DBPrivate
where
import Roguestar.Lib.HierarchicalDatabase
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.ToolData
import Roguestar.Lib.PlaneData
......
......@@ -14,7 +14,7 @@ module Roguestar.Lib.MakeData
MakeWith(..))
where
import Roguestar.Lib.DBData
import Roguestar.Lib.Data.LocationData
import Roguestar.Lib.ToolData
import Roguestar.Lib.Substances
......
......@@ -33,26 +33,26 @@ import Control.Monad.Random
import Data.Ord
import Roguestar.Lib.DB as DB
import Roguestar.Lib.Reference
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Roguestar.Lib.Core.Monster as Monster
import Roguestar.Lib.PlaneVisibility
import Data.Maybe
import Data.List as List
import Data.Map as Map
import Control.Applicative
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.Position as Position
import Roguestar.Lib.TerrainData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.Core.Building
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Tool
import Roguestar.Lib.ToolData
import Roguestar.Lib.Behavior as Behavior
import qualified Roguestar.Lib.DetailedTravel as DT
import qualified Roguestar.Lib.Utility.DetailedTravel as DT
newtype (DBReadable db) => DBPerception db a = DBPerception { fromPerception :: (ReaderT MonsterRef db a) }
......
......@@ -7,7 +7,7 @@ module Roguestar.Lib.PlaneVisibility
where
import Prelude hiding (getContents)
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Roguestar.Lib.DB
import Roguestar.Lib.TerrainData
import Roguestar.Lib.Core.Plane
......@@ -18,13 +18,13 @@ import Data.List as List
import Roguestar.Lib.Grids
import Roguestar.Lib.GridRayCaster
import Roguestar.Lib.VisibilityData
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Data.Ratio
import Roguestar.Lib.Core.Building
import Roguestar.Lib.Position as Position
import Control.Applicative
import Roguestar.Lib.Reference
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
dbGetSeersForFaction :: (DBReadable db) => Faction -> PlaneRef -> db [MonsterRef]
dbGetSeersForFaction faction plane_ref =
......
......@@ -17,7 +17,7 @@ import Data.Ord
import Roguestar.Lib.Town
import Data.List
import Data.ByteString.Char8 as B
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Roguestar.Lib.Data.BuildingData
makePlanet :: (LocationConstructor l, ReferenceTypeOf l ~ Plane) => l -> PlanetInfo -> DB PlaneRef
......
......@@ -7,7 +7,7 @@ module Roguestar.Lib.Reference
(=/=))
where
import Roguestar.Lib.DBPrivate
import Roguestar.Lib.Data.ReferenceTypes
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.ToolData
......
......@@ -44,14 +44,14 @@ import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.World.BeginGame as BeginGame
import Roguestar.Lib.Perception
import Roguestar.Lib.TerrainData
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.Behavior as Behavior
import Roguestar.Lib.Turns
import Roguestar.Lib.Core.Plane
import Data.Text as T
import System.Time
import Control.Concurrent
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Roguestar.Lib.PlaneVisibility
-- Session timeout information.
......
......@@ -14,7 +14,7 @@ module Roguestar.Lib.Tool
import Prelude hiding (getContents)
import Roguestar.Lib.DB
import Roguestar.Lib.Reference
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Control.Monad.Error
import Data.Maybe
import Data.List as List
......
......@@ -9,14 +9,14 @@ import Control.Monad.Maybe
import Control.Monad.Trans
import Roguestar.Lib.DB
import Roguestar.Lib.Reference
import Roguestar.Lib.FactionData
import Roguestar.Lib.Data.FactionData
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.Data.MonsterData (Monster)
import Roguestar.Lib.Core.Plane
import Control.Monad
import Roguestar.Lib.Core.Monster
import Data.Ratio
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.TerrainData
import Data.Maybe
import Roguestar.Lib.Behavior
......@@ -24,7 +24,7 @@ import qualified Roguestar.Lib.Perception as P
import Roguestar.Lib.Position
import Roguestar.Lib.Data.PlayerState
import Roguestar.Lib.Logging
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Control.Monad.Random
import Data.List as List
......
......@@ -8,14 +8,14 @@ module Roguestar.Lib.Utility.Contact
import Prelude hiding (getContents)
import Roguestar.Lib.Position as Position
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.DB
import Roguestar.Lib.Data.MonsterData
import Control.Monad
import Roguestar.Lib.PlaneData
import Data.Ord
import Data.List as List
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
-- | 'Touch' contacts are on the same or facing square as the subject.
-- 'Line' contacts are on any point starting on the same square and anywhere directly along a line traced in the
......
{-# LANGUAGE TypeFamilies, EmptyDataDecls, ScopedTypeVariables, PatternGuards, FlexibleContexts #-}
--Core
module Roguestar.Lib.DetailedLocation
module Roguestar.Lib.Utility.DetailedLocation
(DetailedLocation,
PlaneLocation,
BuildingLocation,
......@@ -17,7 +17,7 @@ module Roguestar.Lib.DetailedLocation
LocationAssignmentTable)
where
import Roguestar.Lib.DBData
import Roguestar.Lib.Data.LocationData
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.ToolData
......@@ -26,7 +26,7 @@ import Roguestar.Lib.Position
import Data.Maybe
import Control.Monad
import Roguestar.Lib.Reference
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
type PlaneLocation = DetailedLocation (Child Plane)
type BuildingLocation = DetailedLocation (Child Building)
......
{-# LANGUAGE TypeFamilies #-}
--Core
module Roguestar.Lib.DetailedTravel
(Roguestar.Lib.DetailedTravel.whereIs,
Roguestar.Lib.DetailedTravel.getContents)
module Roguestar.Lib.Utility.DetailedTravel
(Roguestar.Lib.Utility.DetailedTravel.whereIs,
Roguestar.Lib.Utility.DetailedTravel.getContents)
where
import Prelude hiding (getContents)
import Roguestar.Lib.DB as DB
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Utility.DetailedLocation
import Control.Monad
import Data.Maybe
import Roguestar.Lib.Reference
......
......@@ -8,7 +8,7 @@ module Roguestar.Lib.VisibilityData
import Roguestar.Lib.TerrainData
import Data.List
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
-- |
-- We multiply a creature's hide check by this number if it is standing on this terrain.
......
......@@ -8,7 +8,7 @@ import Roguestar.Lib.Core.Plane
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.DB
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.TerrainData
import Roguestar.Lib.ToolData
import Control.Monad
......
......@@ -20,13 +20,13 @@ import qualified Data.List as List
import qualified Data.Map as Map
import Roguestar.Lib.Roguestar
import Roguestar.Lib.Data.PlayerState
import Roguestar.Lib.DBErrorFlag
import Roguestar.Lib.Data.ErrorData
import Roguestar.Lib.Perception
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.ToolData
import Roguestar.Lib.TerrainData as TerrainData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Facing
import Roguestar.Lib.Data.FacingData
import Roguestar.Lib.Logging
import Roguestar.Lib.UnitTests
import Roguestar.Lib.HTML.Mustache
......
......@@ -58,7 +58,6 @@ library
streams >= 0.8.2
other-modules: Roguestar.Lib.TravelData,
Roguestar.Lib.VisibilityData,
Roguestar.Lib.FactionData,
Roguestar.Lib.PlaneData,
Roguestar.Lib.Grids,
Roguestar.Lib.Perception,
......@@ -74,15 +73,12 @@ library
Roguestar.Lib.HierarchicalDatabase,
Roguestar.Lib.Behavior.Travel,
Roguestar.Lib.ToolData,
Roguestar.Lib.Facing,
Roguestar.Lib.DBPrivate,
Roguestar.Lib.RNG,
Roguestar.Lib.Species,
Roguestar.Lib.Position,
Roguestar.Lib.TerrainData,
Roguestar.Lib.Behavior.Combat,
Roguestar.Lib.Tests,
Roguestar.Lib.DBData,
Roguestar.Lib.GridRayCaster,
Roguestar.Lib.World.BeginGame,
Roguestar.Lib.SpeciesData,
......@@ -103,8 +99,12 @@ library
Roguestar.Lib.PowerUpData,
Roguestar.Lib.Data.BuildingData,
Roguestar.Lib.Data.CharacterData,
Roguestar.Lib.Data.FacingData,
Roguestar.Lib.Data.FactionData,
Roguestar.Lib.Data.LocationData,
Roguestar.Lib.Data.MonsterData,
Roguestar.Lib.Data.PlayerState,
Roguestar.Lib.Data.ReferenceTypes,
Roguestar.Lib.HTML.Mustache
ghc-prof-options: -prof -auto-all
ghc-shared-options: -prof -auto-all
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment