Continue to work on pathfinding
This commit is contained in:
@@ -7,7 +7,6 @@ module Dodge.Data.Block (
|
||||
module Dodge.Data.PathGraph,
|
||||
) where
|
||||
|
||||
import Data.Set (Set)
|
||||
import Color
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -29,7 +28,8 @@ data Block = Block
|
||||
, _blHeight :: Float
|
||||
, _blMaterial :: Material
|
||||
, _blDraw :: BlockDraw --Block -> SPic
|
||||
, _blObstructs :: Set PathEdgeNodes
|
||||
-- , _blObstructs :: Set PathEdgeNodes
|
||||
, _blObstructs :: [(Int,Int)]
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ data CWorld = CWorld
|
||||
, _cwGen :: CWGen
|
||||
, _cClock :: Int
|
||||
, _cwTiles :: [Tile]
|
||||
, _pathGraph :: Gr Point2 PathEdge
|
||||
-- , _pathGraph :: Gr Point2 PathEdge
|
||||
, _incGraph :: V.Vector [(Int,SimpleEdge)]
|
||||
, _incNode :: UV.Vector Point2
|
||||
, _numberFloorVerxs :: Int
|
||||
|
||||
@@ -8,7 +8,6 @@ module Dodge.Data.Door (
|
||||
module Dodge.Data.WorldEffect,
|
||||
) where
|
||||
|
||||
import Data.Set (Set)
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
@@ -42,7 +41,7 @@ data Door = Door
|
||||
, _drPushedBy :: PushSource
|
||||
, _drPushes :: Maybe Int
|
||||
, _drMounts :: [MountedObject]
|
||||
, _drObstructs :: Set PathEdgeNodes
|
||||
-- , _drObstructs :: [(Int,Int)]
|
||||
, _drObstacleType :: EdgeObstacle
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -24,20 +24,20 @@ import Geometry.Data
|
||||
-- }
|
||||
-- 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
|
||||
, _peDist :: Float
|
||||
, _peObstacles :: Set.Set EdgeObstacle
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
--data PathEdgeNodes = PathEdgeNodes
|
||||
-- { _penStart :: Int
|
||||
-- , _penEnd :: Int
|
||||
-- , _penPathEdge :: PathEdge
|
||||
-- }
|
||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
--
|
||||
--data PathEdge = PathEdge
|
||||
-- { _peStart :: Point2
|
||||
-- , _peEnd :: Point2
|
||||
-- , _peDist :: Float
|
||||
-- , _peObstacles :: Set.Set EdgeObstacle
|
||||
-- }
|
||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data SimpleEdge = SimpleEdge
|
||||
{ _seDist :: Float
|
||||
@@ -61,12 +61,12 @@ data EdgeObstacle
|
||||
--deriving instance (Flat (Gr Point2 PathEdge))
|
||||
|
||||
--makeLenses ''PathGraph
|
||||
makeLenses ''PathEdge
|
||||
makeLenses ''PathEdgeNodes
|
||||
--makeLenses ''PathEdge
|
||||
--makeLenses ''PathEdgeNodes
|
||||
makeLenses ''SimpleEdge
|
||||
deriveJSON defaultOptions ''EdgeObstacle
|
||||
deriveJSON defaultOptions ''PathEdge
|
||||
deriveJSON defaultOptions ''PathEdgeNodes
|
||||
--deriveJSON defaultOptions ''PathEdge
|
||||
--deriveJSON defaultOptions ''PathEdgeNodes
|
||||
deriveJSON defaultOptions ''Gr
|
||||
deriveJSON defaultOptions ''SimpleEdge
|
||||
--deriveJSON defaultOptions ''PathGraph
|
||||
|
||||
@@ -47,8 +47,8 @@ data World = World
|
||||
, _clZoning :: IntMap (IntMap [Cloud])
|
||||
, _dsZoning :: IntMap (IntMap [Dust])
|
||||
, _wlZoning :: IntMap (IntMap IntSet) -- Zoning IM.IntMap Wall
|
||||
, _pnZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature
|
||||
, _peZoning :: IntMap (IntMap (Set PathEdgeNodes))
|
||||
-- , _pnZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature
|
||||
-- , _peZoning :: IntMap (IntMap (Set PathEdgeNodes))
|
||||
, _incNodeZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature
|
||||
, _incEdgeZoning :: IntMap (IntMap [(Int,Int)]) --Zoning IM.IntMap Creature
|
||||
, _gsZoning :: IntMap (IntMap IntSet)
|
||||
|
||||
Reference in New Issue
Block a user