More refactorings.

parent 34236215
......@@ -16,3 +16,7 @@ clean:
run:
./dist/build/roguestar-server/roguestar-server +RTS -xc -p -s 2> ./log/stdout.log
check: clean
cabal-dev configure --ghc-options="-O0"
cabal-dev build
......@@ -21,8 +21,8 @@ import Roguestar.Lib.Behavior.Combat
import Roguestar.Lib.Behavior.Activate
import Roguestar.Lib.Behavior.Travel
import Roguestar.Lib.TravelData
import Roguestar.Lib.Creature
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Core.Monster
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.PlaneVisibility
import Data.List
......
......@@ -6,7 +6,7 @@ module Roguestar.Lib.Behavior.Activate
import Roguestar.Lib.Tool
import Roguestar.Lib.ToolData
import Roguestar.Lib.Creature
import Roguestar.Lib.Core.Monster
import Roguestar.Lib.DB
import Control.Monad.Error
import Roguestar.Lib.Substances
......
-- Mechanics
module Roguestar.Lib.CharacterAdvancement
module Roguestar.Lib.Behavior.CharacterAdvancement
(CharacterBumpResult(..),
characterFitness,
bumpCharacter,
......@@ -9,7 +8,7 @@ module Roguestar.Lib.CharacterAdvancement
where
import qualified Data.Map as Map
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PowerUpData
import Roguestar.Lib.PersistantData
......
......@@ -9,14 +9,14 @@ module Roguestar.Lib.Behavior.Combat
where
import Roguestar.Lib.DB
import Roguestar.Lib.Creature
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Core.Monster
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Tool
import Roguestar.Lib.ToolData
import Control.Monad.Error
import Roguestar.Lib.Facing
import Data.Maybe
import Roguestar.Lib.Contact
import Roguestar.Lib.Utility.Contact
import Roguestar.Lib.DetailedLocation
import Data.List as List
......
......@@ -22,8 +22,8 @@ import Data.Ord
import Roguestar.Lib.Position as Position
import Roguestar.Lib.TerrainData
import Data.List (minimumBy)
import Roguestar.Lib.Creature
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Core.Monster
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Logging
import Roguestar.Lib.TravelData
import Roguestar.Lib.DetailedLocation
......
......@@ -22,7 +22,7 @@ import Roguestar.Lib.Position
import Roguestar.Lib.TerrainData
import Control.Monad.Error
import Roguestar.Lib.PowerUpData
import Roguestar.Lib.CharacterAdvancement
import Roguestar.Lib.Behavior.CharacterAdvancement
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.Data.PlayerState
......
{-# LANGUAGE TypeFamilies, PatternGuards #-}
--Core
module Roguestar.Lib.Creature
module Roguestar.Lib.Core.Monster
(generateInitialPlayerCreature,
newCreature,
getCreatureSpecial,
......@@ -16,7 +16,7 @@ module Roguestar.Lib.Creature
where
import Prelude hiding (getContents)
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.DB
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.Species
......
......@@ -25,7 +25,7 @@ import Roguestar.Lib.TerrainData
import Roguestar.Lib.PlaneData
import Roguestar.Lib.PlanetData
import Roguestar.Lib.ToolData (Tool)
import Roguestar.Lib.CreatureData (Creature)
import Roguestar.Lib.Data.MonsterData (Creature)
import Control.Monad
import Control.Monad.Random as Random
import Data.Maybe
......
......@@ -57,7 +57,7 @@ import Prelude hiding (getContents)
import Roguestar.Lib.DBPrivate
import Roguestar.Lib.DBData
import Roguestar.Lib.Reference
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.RNG
......
......@@ -33,7 +33,7 @@ module Roguestar.Lib.DBData
import Roguestar.Lib.Facing
import Roguestar.Lib.DBPrivate
import Roguestar.Lib.ToolData
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
import Control.Monad
......
......@@ -21,7 +21,7 @@ module Roguestar.Lib.DBPrivate
import Roguestar.Lib.HierarchicalDatabase
import Roguestar.Lib.Facing
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.ToolData
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
......
-- Core
module Roguestar.Lib.Character
module Roguestar.Lib.Data.CharacterData
(applyCharacterClass)
where
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.PersistantData
applyCharacterClass :: CharacterClass -> Creature -> Creature
......
--Data
module Roguestar.Lib.CreatureData
module Roguestar.Lib.Data.MonsterData
(Creature(..),
CreatureTrait(..),
CreatureSpecial(..),
......
......@@ -6,7 +6,7 @@ module Roguestar.Lib.Data.PlayerState
where
import Roguestar.Lib.DBData
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.TravelData
import Roguestar.Lib.PersistantData
import Data.Maybe
......
......@@ -21,7 +21,7 @@ import Roguestar.Lib.DBData
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.ToolData
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Position
import Data.Maybe
import Control.Monad
......
......@@ -34,7 +34,7 @@ import Data.Ord
import Roguestar.Lib.DB as DB
import Roguestar.Lib.Reference
import Roguestar.Lib.FactionData
import Roguestar.Lib.Creature as Creature
import Roguestar.Lib.Core.Monster as Creature
import Roguestar.Lib.PlaneVisibility
import Data.Maybe
import Data.List as List
......@@ -48,7 +48,7 @@ import Roguestar.Lib.Core.Building
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.DetailedLocation
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Tool
import Roguestar.Lib.ToolData
import Roguestar.Lib.Behavior as Behavior
......
......@@ -13,7 +13,7 @@ import Roguestar.Lib.TerrainData
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.PlaneData
import Control.Monad
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Data.List as List
import Roguestar.Lib.Grids
import Roguestar.Lib.GridRayCaster
......
......@@ -11,7 +11,7 @@ import Roguestar.Lib.DBPrivate
import Roguestar.Lib.PlaneData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.ToolData
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
--
-- Reference Equality
......
......@@ -39,8 +39,8 @@ import Control.Concurrent.STM
import Control.Monad
import Roguestar.Lib.Data.PlayerState
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.Creature
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Core.Monster
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.World.BeginGame as BeginGame
import Roguestar.Lib.Perception
import Roguestar.Lib.TerrainData
......
......@@ -5,7 +5,7 @@ module Roguestar.Lib.Species
where
--Data
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.SpeciesData
data SpeciesData = SpeciesData {
......
......@@ -11,10 +11,10 @@ import Roguestar.Lib.DB
import Roguestar.Lib.Reference
import Roguestar.Lib.FactionData
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.CreatureData (Creature)
import Roguestar.Lib.Data.MonsterData (Creature)
import Roguestar.Lib.Core.Plane
import Control.Monad
import Roguestar.Lib.Creature
import Roguestar.Lib.Core.Monster
import Data.Ratio
import Roguestar.Lib.Facing
import Roguestar.Lib.TerrainData
......
......@@ -97,7 +97,7 @@ testLocal =
testPickRandomClearSite :: UnitTest
testPickRandomClearSite = runWithRandomPlanes 10 "testPickRandomClearSite" $ \plane_ref ->
do Position (x,y) <- pickRandomSite (-1000,100) (-1000,100) 50 (areaClearForObjectPlacement 1) plane_ref
do Position (x,y) <- pickRandomSite (-1000,1000) (-1000,1000) 50 (areaClearForObjectPlacement 1) plane_ref
t1 <- terrainAt plane_ref $ Position (x-1,y-1)
t2 <- terrainAt plane_ref $ Position (x,y-1)
t3 <- terrainAt plane_ref $ Position (x+1,y-1)
......
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables #-}
-- Mechanics
module Roguestar.Lib.Contact
module Roguestar.Lib.Utility.Contact
(findContacts,
ContactMode(..),
ContactModeType(..))
......@@ -11,7 +10,7 @@ import Prelude hiding (getContents)
import Roguestar.Lib.Position as Position
import Roguestar.Lib.Facing
import Roguestar.Lib.DB
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Control.Monad
import Roguestar.Lib.PlaneData
import Data.Ord
......
The Utility module contains algorithms for solving various problems, such as finding suitable terrain to place an object, or figuring out which monster is in the line-of-fire when the player fires a weapon.
......@@ -5,7 +5,7 @@ module Roguestar.Lib.World.BeginGame
-- World
import Roguestar.Lib.Core.Plane
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Data.BuildingData
import Roguestar.Lib.DB
import Roguestar.Lib.Facing
......
The World module contains rules for constructing the game world on a large scale. This includes things like deciding what planets exist in the world, what kinds of monsters populate each planet.
......@@ -25,7 +25,7 @@ import Roguestar.Lib.Perception
import Roguestar.Lib.SpeciesData
import Roguestar.Lib.ToolData
import Roguestar.Lib.TerrainData as TerrainData
import Roguestar.Lib.CreatureData
import Roguestar.Lib.Data.MonsterData
import Roguestar.Lib.Facing
import Roguestar.Lib.Logging
import Roguestar.Lib.UnitTests
......
......@@ -65,16 +65,15 @@ library
Roguestar.Lib.PlaneVisibility,
Roguestar.Lib.Turns,
Roguestar.Lib.Core.Building,
Roguestar.Lib.Core.Monster,
Roguestar.Lib.Core.Plane,
Roguestar.Lib.Utility.Contact,
Roguestar.Lib.Utility.SiteCriteria,
Roguestar.Lib.CreatureData,
Roguestar.Lib.Character,
Roguestar.Lib.Tool,
Roguestar.Lib.Substances,
Roguestar.Lib.HierarchicalDatabase,
Roguestar.Lib.Behavior.Travel,
Roguestar.Lib.ToolData,
Roguestar.Lib.Creature,
Roguestar.Lib.Facing,
Roguestar.Lib.DBPrivate,
Roguestar.Lib.RNG,
......@@ -94,16 +93,17 @@ library
Roguestar.Lib.MakeData,
Roguestar.Lib.Behavior,
Roguestar.Lib.Behavior.Activate,
Roguestar.Lib.Behavior.CharacterAdvancement,
Roguestar.Lib.Behavior.Construction,
Roguestar.Lib.Behavior.Make,
Roguestar.Lib.Contact,
Roguestar.Lib.Planet,
Roguestar.Lib.PlanetData,
Roguestar.Lib.Logging,
Roguestar.Lib.CharacterAdvancement,
Roguestar.Lib.PersistantData,
Roguestar.Lib.PowerUpData,
Roguestar.Lib.Data.BuildingData,
Roguestar.Lib.Data.CharacterData,
Roguestar.Lib.Data.MonsterData,
Roguestar.Lib.Data.PlayerState,
Roguestar.Lib.HTML.Mustache
ghc-prof-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