Commit before improving logging of annotations
This commit is contained in:
+10
-2
@@ -13,7 +13,7 @@ import Dodge.Annotation.Data
|
|||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
--import Control.Lens
|
--import Control.Lens
|
||||||
--import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
{- | Add one corridor between each parent-child link of a tree of annotations. -}
|
{- | Add one corridor between each parent-child link of a tree of annotations. -}
|
||||||
--padWithCorridors :: Annotation -> Annotation
|
--padWithCorridors :: Annotation -> Annotation
|
||||||
@@ -48,11 +48,19 @@ annoToRoomTree' an = case an of
|
|||||||
OnwardList ans -> do
|
OnwardList ans -> do
|
||||||
mts <- mapM annoToRoomTree' ans
|
mts <- mapM annoToRoomTree' ans
|
||||||
return $ foldr1 attachOnward mts
|
return $ foldr1 attachOnward mts
|
||||||
IntAnno' f -> do
|
IntAnno f -> do
|
||||||
(g,i) <- get
|
(g,i) <- get
|
||||||
put (g,i+1)
|
put (g,i+1)
|
||||||
annoToRoomTree' (f i)
|
annoToRoomTree' (f i)
|
||||||
PadWith r an -> annoToRoomTree' an
|
PadWith r an -> annoToRoomTree' an
|
||||||
|
PassthroughLockKeyLists ls ks i -> zoom _1 $ do
|
||||||
|
(functionlockroom,randomitemidentity) <- takeOne ls
|
||||||
|
lr <- functionlockroom i
|
||||||
|
ii <- randomitemidentity
|
||||||
|
keyroom <- fromJust $ lookup ii ks
|
||||||
|
return $ MTree ("PassthroughLockKeyLists-"++show ii)
|
||||||
|
(MTree "" lr [MBranch "" (toLabel' i) keyroom])
|
||||||
|
[]
|
||||||
|
|
||||||
--annoToRoomTree :: Annotation -> State StdGen (MetaTree Room)
|
--annoToRoomTree :: Annotation -> State StdGen (MetaTree Room)
|
||||||
--annoToRoomTree an = case an of
|
--annoToRoomTree an = case an of
|
||||||
|
|||||||
@@ -15,12 +15,13 @@ data Annotation
|
|||||||
PadWith Room Annotation
|
PadWith Room Annotation
|
||||||
| OnwardList [Annotation]
|
| OnwardList [Annotation]
|
||||||
-- | IntAnno Int (Int -> Annotation)
|
-- | IntAnno Int (Int -> Annotation)
|
||||||
| IntAnno' (Int -> Annotation)
|
| IntAnno (Int -> Annotation)
|
||||||
-- | OrAno [[Annotation]]
|
-- | OrAno [[Annotation]]
|
||||||
| SpecificRoom (State StdGen (MetaTree Room))
|
| SpecificRoom (State StdGen (MetaTree Room))
|
||||||
| AnoApplyInt Int (Int -> State StdGen (LabTree Room))
|
| AnoApplyInt Int (Int -> State StdGen (LabTree Room))
|
||||||
| PassthroughLockKeyLists Int
|
| PassthroughLockKeyLists
|
||||||
[(Int -> State StdGen (LabTree Room), State StdGen ItemBaseType)]
|
[(Int -> State StdGen (MetaTree Room), State StdGen ItemBaseType)]
|
||||||
[(ItemBaseType, State StdGen (LabTree Room))]
|
[(ItemBaseType, State StdGen (MetaTree Room))]
|
||||||
|
Int
|
||||||
|
|
||||||
makeLenses ''Annotation
|
makeLenses ''Annotation
|
||||||
|
|||||||
+13
-9
@@ -31,27 +31,31 @@ import RandomHelp
|
|||||||
--import Color
|
--import Color
|
||||||
--import Dodge.Wire
|
--import Dodge.Wire
|
||||||
|
|
||||||
|
import Data.List (intersperse)
|
||||||
--import Data.Sequence hiding (zipWith)
|
--import Data.Sequence hiding (zipWith)
|
||||||
--import Data.Maybe
|
--import Data.Maybe
|
||||||
--import qualified Data.IntMap.Strict as IM
|
--import qualified Data.IntMap.Strict as IM
|
||||||
|
|
||||||
initialAnoTree :: Annotation
|
initialAnoTree :: Annotation
|
||||||
initialAnoTree = PadWith door $ OnwardList
|
initialAnoTree = PadWith door $ OnwardList
|
||||||
[ IntAnno' $ SpecificRoom . startRoom
|
$ intersperse
|
||||||
-- , PassthroughLockKeyLists 2 keyCardRunPastRand itemRooms
|
(SpecificRoom . return . tToBTree $ treePost [corridor,corridor,cleatOnward corridor])
|
||||||
, IntAnno' $ SpecificRoom . warningRooms
|
[ IntAnno $ SpecificRoom . startRoom
|
||||||
|
, (SpecificRoom . return . tToBTree $ treePost [corridor,corridor,cleatOnward corridor])
|
||||||
|
, IntAnno $ PassthroughLockKeyLists
|
||||||
|
[(sensorRoomRunPast ELECTRICAL, takeOne [STATICMODULE,SPARKGUN] )] itemRooms
|
||||||
|
, IntAnno $ PassthroughLockKeyLists keyCardRunPastRand itemRooms
|
||||||
|
, IntAnno $ SpecificRoom . warningRooms
|
||||||
, SpecificRoom $ rToOnward "chaseCrit+armourChaseCrit rectRoom"
|
, SpecificRoom $ rToOnward "chaseCrit+armourChaseCrit rectRoom"
|
||||||
$ return . cleatOnward $ roomRectAutoLinks 400 400 & rmPmnts .++~
|
$ return . cleatOnward $ roomRectAutoLinks 400 400 & rmPmnts .++~
|
||||||
[ spNoID anyUnusedSpot (PutCrit invisibleChaseCrit)
|
[ spNoID anyUnusedSpot (PutCrit invisibleChaseCrit)
|
||||||
, spNoID anyUnusedSpot (PutCrit armourChaseCrit)
|
, spNoID anyUnusedSpot (PutCrit armourChaseCrit)
|
||||||
]
|
]
|
||||||
--"-- , [AnoApplyInt 100 healthTest]
|
--a-- , [AnoApplyInt 100 healthTest]
|
||||||
--" , PassthroughLockKeyLists 23
|
--a , SpecificRoom (tanksRoom [] [] >>= rToOnward "empty tanksRoom" . pure . cleatOnward)
|
||||||
--" [(sensorRoomRunPast ELECTRICAL, takeOne [STATICMODULE,SPARKGUN] )] itemRooms
|
--" , IntAnno $ PassthroughLockKeyLists lockRoomKeyItems itemRooms
|
||||||
--" , SpecificRoom (tanksRoom [] [] >>= rToOnward "empty tanksRoom" . pure . cleatOnward)
|
|
||||||
--" , PassthroughLockKeyLists 222 lockRoomKeyItems itemRooms
|
|
||||||
--" , SpecificRoom randomChallenges
|
--" , SpecificRoom randomChallenges
|
||||||
--" , AnoApplyInt 1 lasSensorTurretTest
|
--" , IntAnno $ SpecificRoom . lasSensorTurretTest
|
||||||
--"-- ,[SpecificRoom $ fmap pure roomCCrits]
|
--"-- ,[SpecificRoom $ fmap pure roomCCrits]
|
||||||
--"-- ,[AirlockAno]
|
--"-- ,[AirlockAno]
|
||||||
--"-- ,[Corridor]
|
--"-- ,[Corridor]
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ sensorRoomRunPast dt n = do
|
|||||||
(++
|
(++
|
||||||
[treePost
|
[treePost
|
||||||
[ door & rmConnectsTo .~ (\s -> S.member InLink s && not (S.member BlockedLink s))
|
[ door & rmConnectsTo .~ (\s -> S.member InLink s && not (S.member BlockedLink s))
|
||||||
, cleatLabel 0 corridor ]
|
, cleatLabel n corridor ]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ module Dodge.Tree.Compose
|
|||||||
, attachTree
|
, attachTree
|
||||||
, composeTreeRand
|
, composeTreeRand
|
||||||
, composeAndLog
|
, composeAndLog
|
||||||
, cmpToMT
|
-- , cmpToMT
|
||||||
-- , compTree
|
-- , compTree
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ toOnward s rm
|
|||||||
toOnward' :: Room -> Maybe Room
|
toOnward' :: Room -> Maybe Room
|
||||||
toOnward' = fmap snd . toOnward ""
|
toOnward' = fmap snd . toOnward ""
|
||||||
|
|
||||||
|
toLabel' :: Int -> Room -> Maybe Room
|
||||||
|
toLabel' i rm
|
||||||
|
| LabelCluster i `elem` rm ^?! rmClusterStatus . csLinks = Just rm
|
||||||
|
| otherwise = Nothing
|
||||||
|
|
||||||
rToOnward :: Monad m => String -> Tree Room -> m (MetaTree Room)
|
rToOnward :: Monad m => String -> Tree Room -> m (MetaTree Room)
|
||||||
rToOnward s t = return $ MTree s (tToBTree t) []
|
rToOnward s t = return $ MTree s (tToBTree t) []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user