From 516cc6d29e465f9fd11ee1ae2f363a5e6c81cb24 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 1 Jul 2022 18:42:21 +0100 Subject: [PATCH] Readd PathGraph data --- src/Dodge/Data/PathGraph.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/Dodge/Data/PathGraph.hs diff --git a/src/Dodge/Data/PathGraph.hs b/src/Dodge/Data/PathGraph.hs new file mode 100644 index 000000000..d6f751844 --- /dev/null +++ b/src/Dodge/Data/PathGraph.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE StrictData #-} +module Dodge.Data.PathGraph where +import Geometry.Data +import Control.Lens +import Data.Graph.Inductive +import qualified Data.Set as Set +import Data.Map.Strict (Map) +data PathGraph = PathGraph + { _pgGraph :: Gr Point2 PathEdge + , _pgNodeMap :: Map Point2 Int + , _pgNodeCount :: Int + , _pgEdgeMap :: Map (V2 Point2) (Int,Int,PathEdge) + } +data PathEdge = PathEdge + {_peStart :: Point2 + ,_peEnd :: Point2 + ,_peObstacles :: Set.Set EdgeObstacle + } + deriving (Eq,Ord,Show) +data EdgeObstacle + = BlockObstacle + | DoorObstacle + | AutoDoorObstacle + | WallObstacle + deriving (Eq,Ord,Show,Bounded,Enum) + +makeLenses ''PathGraph