Make pathedge zoning use sets, probably doesn't help

This commit is contained in:
2022-08-24 14:01:39 +01:00
parent 13b07b53ce
commit 6973663055
16 changed files with 68 additions and 53 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ module Dodge.Data.Block (
module Dodge.Data.PathGraph,
) where
import Data.Set (Set)
import Color
import Control.Lens
import Data.Aeson
@@ -30,7 +31,7 @@ data Block = Block
, _blHeight :: Float
, _blMaterial :: Material
, _blDraw :: BlockDraw --Block -> SPic
, _blObstructs :: [(Int, Int, PathEdge)]
, _blObstructs :: Set (Int, Int, PathEdge)
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+3 -1
View File
@@ -48,6 +48,7 @@ module Dodge.Data.CWorld (
module Dodge.Data.WorldEffect,
) where
import Data.Set (Set)
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -176,7 +177,8 @@ data CWorld = CWorld
, _corpses :: IM.IntMap Corpse
, _pathGraph :: Gr Point2 PathEdge
, _pnZoning :: IM.IntMap (IM.IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature
, _peZoning :: IM.IntMap (IM.IntMap [(Int, Int, PathEdge)]) --Zoning IM.IntMap Creature
--, _peZoning :: IM.IntMap (IM.IntMap [(Int, Int, PathEdge)]) --Zoning IM.IntMap Creature
, _peZoning :: IM.IntMap (IM.IntMap (Set (Int, Int, PathEdge))) --Zoning IM.IntMap Creature
, _hud :: HUD
, _lightSources :: IM.IntMap LightSource
, _tempLightSources :: [TempLightSource]
+2 -1
View File
@@ -10,6 +10,7 @@ module Dodge.Data.Door (
module Dodge.Data.WorldEffect,
) where
import Data.Set (Set)
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -45,7 +46,7 @@ data Door = Door
, _drPushedBy :: PushSource
, _drPushes :: Maybe Int
, _drMounts :: [MountedObject]
, _drObstructs :: [(Int, Int, PathEdge)]
, _drObstructs :: Set (Int, Int, PathEdge)
, _drObstacleType :: EdgeObstacle
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
+9
View File
@@ -30,6 +30,13 @@ data PathGraph = PathGraph
}
deriving (Eq, Show, Read) --, Generic)
data PathEdgeNodes = PathEdgeNodes
{ _penStart :: Int
, _penEnd :: Int
, _penPathEdge :: PathEdge
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data PathEdge = PathEdge
{ _peStart :: Point2
, _peEnd :: Point2
@@ -54,7 +61,9 @@ data EdgeObstacle
makeLenses ''PathGraph
makeLenses ''PathEdge
makeLenses ''PathEdgeNodes
deriveJSON defaultOptions ''EdgeObstacle
deriveJSON defaultOptions ''PathEdge
deriveJSON defaultOptions ''PathEdgeNodes
deriveJSON defaultOptions ''Gr
deriveJSON defaultOptions ''PathGraph