Permalink
Browse files

More refactoring.

  • Loading branch information...
1 parent d8d5d0e commit d9bd0fb185994e393b6bd99afc35390913b7b501 @clanehin committed Apr 10, 2013
@@ -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
View
@@ -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
@@ -1,5 +1,5 @@
--Data
-module Roguestar.Lib.DBErrorFlag
+module Roguestar.Lib.Data.ErrorData
(DBError(..),
ErrorFlag(..))
where
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
--Data
-module Roguestar.Lib.Facing
+module Roguestar.Lib.Data.FacingData
(Facing(..),
facingToRelative,
facingToRelative7,
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
--Data
-module Roguestar.Lib.FactionData
+module Roguestar.Lib.Data.FactionData
(Faction(..),factionPrefix)
where
@@ -1,6 +1,6 @@
{-# 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
@@ -1,5 +1,4 @@
---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 =
View
@@ -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.
View
@@ -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
View
@@ -9,22 +9,22 @@ 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
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
@@ -1,6 +1,6 @@
{-# 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)
Oops, something went wrong.

0 comments on commit d9bd0fb

Please sign in to comment.