From afafc245ef345d5bf88e56bd8c929d03d73f42dd Mon Sep 17 00:00:00 2001 From: jgk Date: Sun, 23 May 2021 13:17:38 +0200 Subject: [PATCH] Commit before updating debug --- src/Dodge/Creature/ArmourChase.hs | 1 + src/Dodge/LevelGen/StaticWalls.hs | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Dodge/Creature/ArmourChase.hs b/src/Dodge/Creature/ArmourChase.hs index 2edbf84cf..10e593f62 100644 --- a/src/Dodge/Creature/ArmourChase.hs +++ b/src/Dodge/Creature/ArmourChase.hs @@ -20,6 +20,7 @@ import Control.Monad.Reader armourChaseCrit :: Creature armourChaseCrit = defaultCreature { _crUpdate = stateUpdate $ impulsiveAIR $ + watchUpdateStratR [] >=> doStrategyActionsR >=> performActionsR >=> chaseTargetR targetYouLOS >=> diff --git a/src/Dodge/LevelGen/StaticWalls.hs b/src/Dodge/LevelGen/StaticWalls.hs index a67595e56..52f1864f2 100644 --- a/src/Dodge/LevelGen/StaticWalls.hs +++ b/src/Dodge/LevelGen/StaticWalls.hs @@ -5,18 +5,14 @@ Description : Concerns carving out of static walls to create the general room pl module Dodge.LevelGen.StaticWalls where import Dodge.Data ---import Dodge.Base ---import Dodge.Default import Geometry --import Control.Lens import Data.List import Data.Maybe ---import qualified Data.IntMap as IM ---import qualified Data.Set as S -- | Describe a wall as two points. --- Order is important: the wall face is to the left as you move from 'fst' --- to 'snd'. +-- Order is important: the wall face is to the left of the line going from +-- 'fst' to 'snd'. type WallP = (Point2,Point2) -- | Test whether lines are near parallel. -- 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 -- wall may be added where it shouldn't because the wrong facing wall is -- collided with +-- Be aware that we do not remove all colinear walls; this may still cause bugs cutPoly :: [Point2] -> [WallP] -> [WallP] cutPoly qs wls = nub @@ -225,6 +222,8 @@ removeWallsInPolygon :: [Point2] -> [WallP] -> [WallP] removeWallsInPolygon ps = filter (not . cond) where cond wall = pointInOrOnPolygon (0.5 *.* uncurry (+.+) wall) ps + +-----------------------DEBUG CODE: -- | Given a polygon and list of walls, finds walls inside the polygon. findWallsInPolygon :: [Point2] -> [WallP] -> [WallP] findWallsInPolygon ps = filter cond