Start to make wall flags/pathing interaction more sensible
This commit is contained in:
@@ -53,9 +53,9 @@ data PSType
|
||||
, _putEndPoint :: Point2
|
||||
}
|
||||
| PutWall {_pwPoly :: [Point2], _pwWall :: Wall}
|
||||
| PutSlideDr Door Wall EdgeObstacle Float Point2 Point2
|
||||
| PutSlideDr Door Wall (S.Set EdgeObstacle) Float Point2 Point2
|
||||
-- | PutDoor Color EdgeObstacle WdBl [(Point2, Point2)]
|
||||
| PutDoor Color EdgeObstacle WdBl Float Point2A Point2A -- [(Point2, Point2)]
|
||||
| PutDoor Color (S.Set EdgeObstacle) WdBl Float Point2A Point2A -- [(Point2, Point2)]
|
||||
| RandPS (State StdGen PSType)
|
||||
| PutForeground ForegroundShape
|
||||
| PutWorldUpdate (Int -> PlacementSpot -> GenWorld -> GenWorld)
|
||||
|
||||
@@ -8,12 +8,13 @@ The warnings have been disabled.
|
||||
-}
|
||||
module Dodge.Data.PathGraph where
|
||||
|
||||
import Dodge.Data.Wall.Structure
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Data.Graph.Inductive
|
||||
--import Data.Map.Strict (Map)
|
||||
import qualified Data.Set as Set
|
||||
import qualified Data.Set as S
|
||||
--import Geometry.Data
|
||||
|
||||
--data PathGraph = PathGraph
|
||||
@@ -41,17 +42,17 @@ import qualified Data.Set as Set
|
||||
|
||||
data SimpleEdge = SimpleEdge
|
||||
{ _seDist :: Float
|
||||
, _seObstacles :: Set.Set EdgeObstacle
|
||||
, _seObstacles :: S.Set EdgeObstacle
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data EdgeObstacle
|
||||
= BlockObstacle
|
||||
| DoorObstacle
|
||||
| AutoDoorObstacle
|
||||
| WallObstacle
|
||||
= WallObstacle WallFlag
|
||||
| ChasmObstacle
|
||||
deriving (Eq, Ord, Show, Bounded, Enum, Read) --Generic, Flat)
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
switchWallObs :: S.Set EdgeObstacle
|
||||
switchWallObs = S.fromList $ WallObstacle <$> [WallBlockVisibility,WallNotAutoOpen]
|
||||
|
||||
--instance (ToJSON a, ToJSON b) => ToJSON (Gr a b) where
|
||||
-- toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
@@ -14,12 +14,14 @@ import Data.Aeson.TH
|
||||
import Dodge.Data.Material
|
||||
import Dodge.Data.Wall.Structure
|
||||
import Geometry
|
||||
import qualified Data.Set as S
|
||||
|
||||
data Wall = Wall
|
||||
{ _wlLine :: (Point2, Point2)
|
||||
, _wlID :: Int
|
||||
, _wlColor :: Color
|
||||
, _wlOpacity :: Opacity
|
||||
, _wlPathFlag :: S.Set WallFlag
|
||||
, _wlPathable :: Bool
|
||||
, _wlPenetrable :: Bool
|
||||
, _wlBouncy :: Bool
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Wall.Structure
|
||||
where
|
||||
module Dodge.Data.Wall.Structure where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
@@ -12,8 +12,15 @@ data WallStructure
|
||||
| DoorPart {_wsDoor :: Int}
|
||||
| MachinePart {_wsMachine :: Int}
|
||||
| BlockPart {_wsBlock :: Int}
|
||||
| CreaturePart { _wlStCreature :: Int }
|
||||
| CreaturePart {_wlStCreature :: Int}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data WallFlag
|
||||
= WallBlockVisibility
|
||||
| WallNotAutoOpen
|
||||
| WallNotDestrucable
|
||||
deriving (Eq, Ord, Show, Read, Enum, Bounded) --Generic, Flat)
|
||||
|
||||
makeLenses ''WallStructure
|
||||
deriveJSON defaultOptions ''WallStructure
|
||||
deriveJSON defaultOptions ''WallFlag
|
||||
|
||||
Reference in New Issue
Block a user