Partially implement separate blocks

This commit is contained in:
2021-10-26 22:53:49 +01:00
parent d136fd910c
commit 12d43f9cf0
15 changed files with 145 additions and 115 deletions
+17 -4
View File
@@ -23,10 +23,8 @@ 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 Control.Lens
--import Data.List (partition)
--import Data.List (sortOn)
--import Data.Maybe
firstWorld :: IO World
firstWorld = do
@@ -58,8 +56,23 @@ initialWorld = defaultWorld
, _decorations = IM.empty
, _menuLayers = [TerminalScreen 300 rezText']
}
zonedBlockWalls :: World -> [String]
zonedBlockWalls = concatMap f . IM.toList . _znObjects . _wallsZone
where
f (x,ys) = map (show x ++) $ map g $ IM.toList ys
g (y,zs) = show y
testStringInit :: World -> [String]
testStringInit _ = []
--testStringInit w = map (show . _blWallIDs) . IM.elems $ _blocks w
testStringInit w = (map (f w) . filter g . IM.elems $ _walls w)
-- ++ zonedBlockWalls w
where
g Block{} = True
g _ = False
f w' wl = show (_wlID wl) ++ " : " ++ show blid ++ show (_blWallIDs $ (_blocks w') IM.! blid)
where
blid = _wlBlockID wl
--testStringInit = mapMaybe f . IM.elems . flattenIMIMIM . _znObjects . _wallsZone
-- where
-- f dr | _wlColor dr == V4 0 1 0 1 = Just . show $ _wlLine dr