Fix wall bug, refactor placements

This commit is contained in:
2021-09-30 15:35:35 +01:00
parent eb393708c4
commit c88f88004d
17 changed files with 54 additions and 80 deletions
+5 -18
View File
@@ -23,7 +23,7 @@ import System.Random
import qualified Data.Set as S
import qualified Data.IntMap.Strict as IM
import qualified Data.Map as M
import Data.Maybe
--import Data.Maybe
--import Control.Lens
--import Data.List (partition)
--import Data.List (sortOn)
@@ -61,24 +61,11 @@ initialWorld = defaultWorld
, _worldState = M.empty
}
testStringInit :: World -> [String]
--testStringInit _ = []
--testStringInit w =
-- [show $ _worldMinX w
-- ,show $ _worldMaxX w
-- ,show $ _worldMinY w
-- ,show $ _worldMaxY w
-- ]
--testStringInit = mapMaybe f . IM.elems . wallsDoubleScreen
testStringInit _ = []
--testStringInit = mapMaybe f . IM.elems . flattenIMIMIM . _znObjects . _wallsZone
-- where
-- f (dr@Door{}) = Just . show $ _wlLine dr
-- f _ = Nothing
--testStringInit = map show . filter ((== col) . snd) . fst . wallsAndWindows
-- where
-- col = dim $ dim $ bright red
testStringInit = mapMaybe f . IM.elems . _walls
where
f dr | _wlColor dr == V4 0 1 0 1 = Just . show $ _wlLine dr
| otherwise = Nothing
-- f dr | _wlColor dr == V4 0 1 0 1 = Just . show $ _wlLine dr
-- | otherwise = Nothing
--testStringInit _ = []
--testStringInit w = [show . length $ newSounds w]
--testStringInit w = (show . _crPos $ _creatures w IM.! 0)