diff --git a/data/scenarios/Testing/1138-structures/sibling-precedence.yaml b/data/scenarios/Testing/1138-structures/sibling-precedence.yaml index 656025e40..1eec1c076 100644 --- a/data/scenarios/Testing/1138-structures/sibling-precedence.yaml +++ b/data/scenarios/Testing/1138-structures/sibling-precedence.yaml @@ -68,11 +68,11 @@ world: xx xx placements: - - src: tiny rectangle - - src: small rectangle - - src: medium rectangle - - src: big rectangle - src: huge rectangle + - src: big rectangle + - src: medium rectangle + - src: small rectangle + - src: tiny rectangle map: | ............ ............ diff --git a/data/scenarios/Testing/1356-portals/portals-and-waypoints.yaml b/data/scenarios/Testing/1356-portals/portals-and-waypoints.yaml index 0d4ae6673..099a15ca0 100644 --- a/data/scenarios/Testing/1356-portals/portals-and-waypoints.yaml +++ b/data/scenarios/Testing/1356-portals/portals-and-waypoints.yaml @@ -10,6 +10,7 @@ attrs: - name: portal_out fg: "#00a2ff" bg: "#0065ff" +solution: turn left; move; move; turn left; move; move; move; turn left; move; move; move; move; move; entities: - name: telepad entrance display: diff --git a/data/scenarios/Testing/1575-structure-recognizer/1575-placement-occlusion.yaml b/data/scenarios/Testing/1575-structure-recognizer/1575-placement-occlusion.yaml index 982f1a0d2..9c5aa6539 100644 --- a/data/scenarios/Testing/1575-structure-recognizer/1575-placement-occlusion.yaml +++ b/data/scenarios/Testing/1575-structure-recognizer/1575-placement-occlusion.yaml @@ -67,8 +67,6 @@ world: 'B': [grass, null, base] upperleft: [-97, 17] placements: - - src: green_jewel - offset: [3, -3] - src: red_jewel offset: [1, -1] - src: red_jewel @@ -77,6 +75,8 @@ world: offset: [5, -1] - src: red_jewel offset: [5, -5] + - src: green_jewel + offset: [3, -3] map: | ......... ......... diff --git a/data/scenarios/Vignettes/roadway.yaml b/data/scenarios/Vignettes/roadway.yaml index aedf88d52..6b567568e 100644 --- a/data/scenarios/Vignettes/roadway.yaml +++ b/data/scenarios/Vignettes/roadway.yaml @@ -89,14 +89,6 @@ world: SSSSSS SSSSSS placements: - - src: tunnel - offset: [3, -21] - orient: - up: west - - src: tunnel - offset: [71, -21] - orient: - up: east - src: road segment offset: [6, -22] orient: @@ -161,6 +153,14 @@ world: orient: up: west flip: true + - src: tunnel + offset: [3, -21] + orient: + up: west + - src: tunnel + offset: [71, -21] + orient: + up: east upperleft: - -18 - 30 diff --git a/src/swarm-scenario/Swarm/Game/Scenario/Topography/Structure/Assembly.hs b/src/swarm-scenario/Swarm/Game/Scenario/Topography/Structure/Assembly.hs index 044638cce..14c700486 100644 --- a/src/swarm-scenario/Swarm/Game/Scenario/Topography/Structure/Assembly.hs +++ b/src/swarm-scenario/Swarm/Game/Scenario/Topography/Structure/Assembly.hs @@ -15,7 +15,7 @@ import Control.Arrow (left, (&&&)) import Control.Monad (when) import Data.Coerce import Data.Either.Extra (maybeToEither) -import Data.Foldable (foldrM) +import Data.Foldable (foldlM) import Data.Map qualified as M import Data.Set qualified as Set import Data.Text (Text) @@ -53,8 +53,8 @@ overlaySingleStructure offsetLoc (coerce loc) . modifyLoc (reorientLandmark orientation $ getGridDimensions overArea) --- | Overlays all of the "child placements", such that the children encountered earlier --- in the YAML file supersede the later ones (due to use of 'foldr' instead of 'foldl'). +-- | Overlays all of the "child placements", such that the children encountered later +-- in the YAML file supersede the earlier ones (dictated by using 'foldl' instead of 'foldr'). mergeStructures :: M.Map StructureName (NamedStructure (Maybe a)) -> Parentage Placement -> @@ -77,8 +77,8 @@ mergeStructures inheritedStrucDefs parentPlacement (Structure origArea subStruct map wrapPlacement $ filter (\(Placed _ ns) -> isRecognizable ns) overlays - foldrM - (overlaySingleStructure structureMap) + foldlM + (flip $ overlaySingleStructure structureMap) (MergedStructure origArea wrappedOverlays originatedWaypoints) overlays where