Skip to content

Commit

Permalink
minor fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Jul 3, 2023
1 parent c9a89db commit 7c943cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Swarm/Game/Scenario/Topography/Navigation/Portal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ failUponDuplication message binnedMap =
-- * portals can have multiple entrances but only a single exit
-- * no two portals share the same entrance location
-- * global waypoint uniqueness when the "unique" flag is specified
validateLandmarks ::
validateNavigation ::
(MonadFail m, Traversable t) =>
V2 Int32 ->
[Originated Waypoint] ->
t Portal ->
m Navigation
validateLandmarks upperLeft unmergedWaypoints portalDefs = do
validateNavigation upperLeft unmergedWaypoints portalDefs = do
failUponDuplication "is required to be unique, but is duplicated in:" waypointsWithUniqueFlag

-- TODO(#144) Currently ignores subworld references
Expand Down
2 changes: 1 addition & 1 deletion src/Swarm/Game/Scenario/Topography/WorldDescription.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ instance FromJSONE (EntityMap, RobotMap) WorldDescription where
let struc = Structure.Structure initialArea structureDefs placementDefs $ waypointDefs <> mapWaypoints
Structure.MergedStructure mergedArea unmergedWaypoints = Structure.mergeStructures mempty Nothing struc

validatedLandmarks <- validateLandmarks (coerce upperLeft) unmergedWaypoints portalDefs
validatedLandmarks <- validateNavigation (coerce upperLeft) unmergedWaypoints portalDefs

WorldDescription
<$> v ..:? "default"
Expand Down
2 changes: 1 addition & 1 deletion src/Swarm/Game/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ instance (Valuable a, Valuable b) => Valuable (a, b) where
asValue (x, y) = VPair (asValue x) (asValue y)

instance Valuable Location where
asValue (Location x y) = VPair (asValue x) (asValue y)
asValue (Location x y) = asValue (x, y)

instance Valuable Entity where
asValue = VText . view entityName
Expand Down

0 comments on commit 7c943cc

Please sign in to comment.