swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Game.Scenario.Topography.Structure.Overlay

Description

Generic overlay operations on grids

Synopsis

Documentation

data PositionedGrid a Source #

Constructors

PositionedGrid 

Fields

Instances

Instances details
Alternative f => Semigroup (PositionedGrid (f a)) Source #

First arg: base layer Second arg: overlay layer

The upper-left corner of the base layer is the original "origin".

If the overlay is to the west or north of the base layer, then we must pad the base layer on the left or top. And since the area expands relative to the "origin" of the base layer, we must shift the combined grid's "origin" location to the new position of the base layer's upper-left corner.

If the overlay is to the east/south, we do not have to modify the origin, since no padding is added to the left/top of the base layer.

Instance details

Defined in Swarm.Game.Scenario.Topography.Structure.Overlay

Methods

(<>) :: PositionedGrid (f a) -> PositionedGrid (f a) -> PositionedGrid (f a) #

sconcat :: NonEmpty (PositionedGrid (f a)) -> PositionedGrid (f a) #

stimes :: Integral b => b -> PositionedGrid (f a) -> PositionedGrid (f a) #

Show (PositionedGrid a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure.Overlay

Eq a => Eq (PositionedGrid a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure.Overlay

HasLocation (PositionedGrid a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure.Overlay

Exported for unit tests

data OverlayPair a Source #

Constructors

OverlayPair 

Fields