Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More refactoring.

  • Loading branch information...
commit d9bd0fb185994e393b6bd99afc35390913b7b501 1 parent d8d5d0e
Christopher Lane Hinson authored
Showing with 63 additions and 65 deletions.
  1. +2 −2 Roguestar/Lib/Behavior.hs
  2. +2 −2 Roguestar/Lib/Behavior/Combat.hs
  3. +1 −1  Roguestar/Lib/Behavior/Construction.hs
  4. +3 −3 Roguestar/Lib/Behavior/Travel.hs
  5. +2 −2 Roguestar/Lib/Core/Building.hs
  6. +3 −3 Roguestar/Lib/Core/Monster.hs
  7. +2 −2 Roguestar/Lib/Core/Plane.hs
  8. +5 −5 Roguestar/Lib/DB.hs
  9. +1 −1  Roguestar/Lib/{DBErrorFlag.hs → Data/ErrorData.hs}
  10. +1 −1  Roguestar/Lib/{Facing.hs → Data/FacingData.hs}
  11. +1 −1  Roguestar/Lib/{ → Data}/FactionData.hs
  12. +3 −3 Roguestar/Lib/{DBData.hs → Data/LocationData.hs}
  13. +1 −1  Roguestar/Lib/Data/MonsterData.hs
  14. +1 −1  Roguestar/Lib/Data/PlayerState.hs
  15. +2 −3 Roguestar/Lib/{DBPrivate.hs → Data/ReferenceTypes.hs}
  16. +1 −1  Roguestar/Lib/MakeData.hs
  17. +4 −4 Roguestar/Lib/Perception.hs
  18. +3 −3 Roguestar/Lib/PlaneVisibility.hs
  19. +1 −1  Roguestar/Lib/Planet.hs
  20. +1 −1  Roguestar/Lib/Reference.hs
  21. +2 −2 Roguestar/Lib/Roguestar.hs
  22. +1 −1  Roguestar/Lib/Tool.hs
  23. +3 −3 Roguestar/Lib/Turns.hs
  24. +2 −2 Roguestar/Lib/Utility/Contact.hs
  25. +3 −3 Roguestar/Lib/{ → Utility}/DetailedLocation.hs
  26. +4 −5 Roguestar/Lib/{ → Utility}/DetailedTravel.hs
  27. +1 −1  Roguestar/Lib/VisibilityData.hs
  28. +1 −1  Roguestar/Lib/World/BeginGame.hs
  29. +2 −2 Roguestar/Server/Main.hs
  30. +4 −4 roguestar.cabal
4 Roguestar/Lib/Behavior.hs
View
@@ -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 =
4 Roguestar/Lib/Behavior/Combat.hs
View
@@ -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 =
2  Roguestar/Lib/Behavior/Construction.hs
View
@@ -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
6 Roguestar/Lib/Behavior/Travel.hs
View
@@ -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) ->
4 Roguestar/Lib/Core/Building.hs
View
@@ -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.
6 Roguestar/Lib/Core/Monster.hs
View
@@ -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
4 Roguestar/Lib/Core/Plane.hs
View
@@ -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
10 Roguestar/Lib/DB.hs
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
2  Roguestar/Lib/DBErrorFlag.hs → Roguestar/Lib/Data/ErrorData.hs
View
@@ -1,5 +1,5 @@
--Data
-module Roguestar.Lib.DBErrorFlag
+module Roguestar.Lib.Data.ErrorData
(DBError(..),
ErrorFlag(..))
where
2  Roguestar/Lib/Facing.hs → Roguestar/Lib/Data/FacingData.hs
View
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
--Data
-module Roguestar.Lib.Facing
+module Roguestar.Lib.Data.FacingData
(Facing(..),
facingToRelative,
facingToRelative7,
2  Roguestar/Lib/FactionData.hs → Roguestar/Lib/Data/FactionData.hs
View
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
--Data
-module Roguestar.Lib.FactionData
+module Roguestar.Lib.Data.FactionData
(Faction(..),factionPrefix)
where
6 Roguestar/Lib/DBData.hs → Roguestar/Lib/Data/LocationData.hs
View
@@ -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
2  Roguestar/Lib/Data/MonsterData.hs
View
@@ -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
2  Roguestar/Lib/Data/PlayerState.hs
View
@@ -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
5 Roguestar/Lib/DBPrivate.hs → Roguestar/Lib/Data/ReferenceTypes.hs
View
@@ -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
2  Roguestar/Lib/MakeData.hs
View
@@ -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
8 Roguestar/Lib/Perception.hs
View
@@ -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) }
6 Roguestar/Lib/PlaneVisibility.hs
View
@@ -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 =
2  Roguestar/Lib/Planet.hs
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
2  Roguestar/Lib/Reference.hs
View
@@ -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
4 Roguestar/Lib/Roguestar.hs
View
@@ -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.
2  Roguestar/Lib/Tool.hs
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
6 Roguestar/Lib/Turns.hs
View
@@ -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
4 Roguestar/Lib/Utility/Contact.hs
View
@@ -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
6 Roguestar/Lib/DetailedLocation.hs → Roguestar/Lib/Utility/DetailedLocation.hs
View
@@ -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)
9 Roguestar/Lib/DetailedTravel.hs → Roguestar/Lib/Utility/DetailedTravel.hs
View
@@ -1,13 +1,12 @@
{-# 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
2  Roguestar/Lib/VisibilityData.hs
View
@@ -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.
2  Roguestar/Lib/World/BeginGame.hs
View
@@ -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
4 Roguestar/Server/Main.hs
View
@@ -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
8 roguestar.cabal
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.