Commit before updating debug
This commit is contained in:
@@ -20,6 +20,7 @@ import Control.Monad.Reader
|
||||
armourChaseCrit :: Creature
|
||||
armourChaseCrit = defaultCreature
|
||||
{ _crUpdate = stateUpdate $ impulsiveAIR $
|
||||
watchUpdateStratR [] >=>
|
||||
doStrategyActionsR >=>
|
||||
performActionsR >=>
|
||||
chaseTargetR targetYouLOS >=>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user