Commit before updating debug

This commit is contained in:
2021-05-23 13:17:38 +02:00
parent c3181c6549
commit afafc245ef
2 changed files with 6 additions and 6 deletions
+1
View File
@@ -20,6 +20,7 @@ import Control.Monad.Reader
armourChaseCrit :: Creature armourChaseCrit :: Creature
armourChaseCrit = defaultCreature armourChaseCrit = defaultCreature
{ _crUpdate = stateUpdate $ impulsiveAIR $ { _crUpdate = stateUpdate $ impulsiveAIR $
watchUpdateStratR [] >=>
doStrategyActionsR >=> doStrategyActionsR >=>
performActionsR >=> performActionsR >=>
chaseTargetR targetYouLOS >=> chaseTargetR targetYouLOS >=>
+5 -6
View File
@@ -5,18 +5,14 @@ Description : Concerns carving out of static walls to create the general room pl
module Dodge.LevelGen.StaticWalls module Dodge.LevelGen.StaticWalls
where where
import Dodge.Data import Dodge.Data
--import Dodge.Base
--import Dodge.Default
import Geometry import Geometry
--import Control.Lens --import Control.Lens
import Data.List import Data.List
import Data.Maybe import Data.Maybe
--import qualified Data.IntMap as IM
--import qualified Data.Set as S
-- | Describe a wall as two points. -- | Describe a wall as two points.
-- Order is important: the wall face is to the left as you move from 'fst' -- Order is important: the wall face is to the left of the line going from
-- to 'snd'. -- 'fst' to 'snd'.
type WallP = (Point2,Point2) type WallP = (Point2,Point2)
-- | Test whether lines are near parallel. -- | Test whether lines are near parallel.
-- Assumes non-zero length lines. -- Assumes non-zero length lines.
@@ -117,6 +113,7 @@ checkWallLeft (x,y) wls
-- Step 7 is important for the check whether or not to add a wall, otherwise a -- Step 7 is important for the check whether or not to add a wall, otherwise a
-- wall may be added where it shouldn't because the wrong facing wall is -- wall may be added where it shouldn't because the wrong facing wall is
-- collided with -- collided with
-- Be aware that we do not remove all colinear walls; this may still cause bugs
cutPoly :: [Point2] -> [WallP] -> [WallP] cutPoly :: [Point2] -> [WallP] -> [WallP]
cutPoly qs wls = cutPoly qs wls =
nub nub
@@ -225,6 +222,8 @@ removeWallsInPolygon :: [Point2] -> [WallP] -> [WallP]
removeWallsInPolygon ps = filter (not . cond) removeWallsInPolygon ps = filter (not . cond)
where where
cond wall = pointInOrOnPolygon (0.5 *.* uncurry (+.+) wall) ps cond wall = pointInOrOnPolygon (0.5 *.* uncurry (+.+) wall) ps
-----------------------DEBUG CODE:
-- | Given a polygon and list of walls, finds walls inside the polygon. -- | Given a polygon and list of walls, finds walls inside the polygon.
findWallsInPolygon :: [Point2] -> [WallP] -> [WallP] findWallsInPolygon :: [Point2] -> [WallP] -> [WallP]
findWallsInPolygon ps = filter cond findWallsInPolygon ps = filter cond