RoRo-0.1: Lupupu Cube Stage SolverContentsIndex
Game.LupupuCube.Phase
Description
Representation of a situation in a gameplay.
Synopsis
data Phase = Phase {
pSaladPos :: !Position
pMatrix :: !CubeMatrix
}
data Position = Pos {
posX :: !!Int
posY :: !!Int
}
data Size = Size {
sWidth :: !!Int
sHeight :: !!Int
}
type CubeMatrix = Map Position Cube
data Direction
= Left
| Right
| Up
| Down
walk :: Size -> Phase -> Direction -> Maybe Phase
jump :: Size -> Phase -> Direction -> Maybe Phase
fall :: Size -> Phase -> Maybe Phase
isCrushed :: Phase -> Bool
discreate :: Phase -> Maybe Phase
isCleared :: Phase -> Bool
isHopeless :: Phase -> Bool
ppPhase :: Size -> Phase -> String
Documentation
data Phase
Phase is a representation of a situation in a gameplay.
Constructors
Phase
pSaladPos :: !PositionThe position of Salad.
pMatrix :: !CubeMatrixThe geometry of cubes and walls.
show/hide Instances
Eq Phase
Ord Phase
Show Phase
XmlWrite Phase
XmlRead Phase
NFData Phase
data Position
Position is an unpacked pair of two integers X and Y.
Constructors
Pos
posX :: !!IntX
posY :: !!IntY
show/hide Instances
Eq Position
Ord Position
Show Position
XmlWrite Position
XmlRead Position
NFData Position
data Size
Size is an unpacked pair of two integers Width and Height.
Constructors
Size
sWidth :: !!IntWidth
sHeight :: !!IntHeight
show/hide Instances
Eq Size
Ord Size
Show Size
XmlWrite Size
XmlRead Size
NFData Size
type CubeMatrix = Map Position Cube
CubeMatrix is a geometry of cubes and walls.
data Direction
Constructors
Left
Right
Up
Down
show/hide Instances
walk :: Size -> Phase -> Direction -> Maybe Phase
jump :: Size -> Phase -> Direction -> Maybe Phase
fall :: Size -> Phase -> Maybe Phase
isCrushed :: Phase -> Bool
discreate :: Phase -> Maybe Phase
isCleared :: Phase -> Bool
isHopeless :: Phase -> Bool
ppPhase :: Size -> Phase -> String
Returns a brief representation of the given Phase in an ASCII art. Size is also needed because Phase doesn't know anything about the size of stage.
Produced by Haddock version 2.1.0