app

Safe Haskell Safe
Language Haskell2010

Spots

Contents

Description

Module defining the player spots as well as the card spots. Historically this was in Board but was deported to a new file to be visible both from Board and Command. |

Synopsis

Documentation

data Card #

The spot of a card, as visible from the top of the screen. For the | bottom part, think as if it was in the top, turning the board | 180 degrees clockwise; or use these values and map [bottomSpotOfTopVisual].

Constructors

TopLeft  
Top  
TopRight  
BottomLeft  
Bottom  
BottomRight  
Instances
Bounded Card #  
Instance details

Defined in Spots

Methods

minBound :: Card #

maxBound :: Card #

Enum Card #  
Instance details

Defined in Spots

Methods

succ :: Card -> Card #

pred :: Card -> Card #

toEnum :: Int -> Card #

fromEnum :: Card -> Int #

enumFrom :: Card -> [Card] #

enumFromThen :: Card -> Card -> [Card] #

enumFromTo :: Card -> Card -> [Card] #

enumFromThenTo :: Card -> Card -> Card -> [Card] #

Eq Card #  
Instance details

Defined in Spots

Methods

(==) :: Card -> Card -> Bool #

(/=) :: Card -> Card -> Bool #

Ord Card #  
Instance details

Defined in Spots

Methods

compare :: Card -> Card -> Ordering #

(<) :: Card -> Card -> Bool #

(<=) :: Card -> Card -> Bool #

(>) :: Card -> Card -> Bool #

(>=) :: Card -> Card -> Bool #

max :: Card -> Card -> Card #

min :: Card -> Card -> Card #

Show Card #  
Instance details

Defined in Spots

Methods

showsPrec :: Int -> Card -> ShowS #

show :: Card -> String #

showList :: [Card] -> ShowS #

Generic Card #  
Instance details

Defined in Spots

Associated Types

type Rep Card :: Type -> Type #

Methods

from :: Card -> Rep Card x #

to :: Rep Card x -> Card #

PlayerIndexed (Map Card Fade) UI #

Generic access to the deco in 'UI phase.

Instance details

Defined in Board

Methods

getp :: Player -> T UI -> Map Card Fade #

setp :: Map Card Fade -> Player -> T UI -> T UI #

PlayerIndexed (Map Card T) UI #

Generic access to effects in 'UI phase

Instance details

Defined in Board

Methods

getp :: Player -> T0 UI -> Map Card T #

setp :: Map Card T -> Player -> T0 UI -> T0 UI #

PlayerIndexed (Map Card Deco) Core #

Generic access to the deco in 'Core phase.

Instance details

Defined in Board

Methods

getp :: Player -> T Core -> Map Card Deco #

setp :: Map Card Deco -> Player -> T Core -> T Core #

PlayerIndexed (Map Card (Creature Core)) Core #

Generic access to creatures in 'Core phase. XXX @smelc Can this be abstracted over the phase if the type family applies to the entire Map? To remove the 'UI instance below.

Instance details

Defined in Board

Methods

getp :: Player -> T Core -> Map Card (Creature Core) #

setp :: Map Card (Creature Core) -> Player -> T Core -> T Core #

type Rep Card #  
Instance details

Defined in Spots

type Rep Card = D1 (MetaData "Card" "Spots" "main" False) ((C1 (MetaCons "TopLeft" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Top" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "TopRight" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "BottomLeft" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Bottom" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "BottomRight" PrefixI False) (U1 :: Type -> Type))))

data Player #

The position of a player

Constructors

PlayerBot  
PlayerTop  
Instances
Bounded Player #  
Instance details

Defined in Spots

Methods

minBound :: Player #

maxBound :: Player #

Enum Player #  
Instance details

Defined in Spots

Eq Player #  
Instance details

Defined in Spots

Methods

(==) :: Player -> Player -> Bool #

(/=) :: Player -> Player -> Bool #

Ord Player #

Ord instance that makes explicit that PlayerBot < PlayerTop. The point is that the Ord instance matches the order in which turns are played: the bottom player plays before the top player.

Instance details

Defined in Spots

Methods

compare :: Player -> Player -> Ordering #

(<) :: Player -> Player -> Bool #

(<=) :: Player -> Player -> Bool #

(>) :: Player -> Player -> Bool #

(>=) :: Player -> Player -> Bool #

max :: Player -> Player -> Player #

min :: Player -> Player -> Player #

Show Player #  
Instance details

Defined in Spots

Methods

showsPrec :: Int -> Player -> ShowS #

show :: Player -> String #

showList :: [Player] -> ShowS #

Generic Player #  
Instance details

Defined in Spots

Associated Types

type Rep Player :: Type -> Type #

Methods

from :: Player -> Rep Player x #

to :: Rep Player x -> Player #

With Game (Kernel Player) #  
Instance details

Defined in Move

Methods

with :: Game -> Kernel Player -> Game #

Contains Game (Kernel Player) #  
Instance details

Defined in Move

Methods

to :: Game -> Kernel Player #

type Rep Player #  
Instance details

Defined in Spots

type Rep Player = D1 (MetaData "Player" "Spots" "main" False) (C1 (MetaCons "PlayerBot" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "PlayerTop" PrefixI False) (U1 :: Type -> Type))

data Neighborhood #

The various kinds of neighbors

Constructors

Cardinal

Neighbors to the left and the right

Diagonal

Neighbors in diagonals

All

Cardinal + diagnoal neighbors

Instances
Eq Neighborhood #  
Instance details

Defined in Spots

Show Neighborhood #  
Instance details

Defined in Spots

Generic Neighborhood #  
Instance details

Defined in Spots

Associated Types

type Rep Neighborhood :: Type -> Type #

type Rep Neighborhood #  
Instance details

Defined in Spots

type Rep Neighborhood = D1 (MetaData "Neighborhood" "Spots" "main" False) (C1 (MetaCons "Cardinal" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Diagonal" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "All" PrefixI False) (U1 :: Type -> Type)))

data Line #

The back line, or the front line

Constructors

Front  
Back  
Instances
Show Line #  
Instance details

Defined in Spots

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

Functions about CardSpot

allCards :: [Card] #

All Card values.

allCardsNE :: NonEmpty Card #

All Card values, as a non-empty list.

bottomSpotOfTopVisual :: Card -> Card #

Returns a bottom position, by taking a position that makes sense visually I.e. if you give this method [TopLeft], it'll correspond to the [TopLeft] bottom position that you SEE; even if positions make sense for the top part. This method takes care of translating correctly.

TODO smelc rename me to bottomSpot@

frontSpots :: [Card] #

Spots on the frontline. TODO @smelc rename me to front.

backSpots :: [Card] #

Spots in the back line. TODO @smelc rename me to front.

inTheBack :: Card -> Bool #

Whether a spot is in the back line

inFront :: Card -> Bool #

Whether a spot is in the front line

line :: Line -> [Card] #

All spots in a given line

isCentered :: Card -> Bool #

Whether a spot is in the center

switchLine :: Card -> Card #

Given a frontline spot, the corresponding backline spot. Given a backline spot, the corresponding frontline spot.

toLine :: Card -> [Card] #

All spots in the same line

Functions about PlayerSpot

allPlayers :: [Player] #

All Player values.

startingPlayerSpot :: Player #

The spot of the player that starts a game. FIXME @smelc rename to starting and use me qualified.

endingPlayerSpot :: Player #

The spot of the player that ends a game

other :: Player -> Player #

The other Player spot. other . other == id