Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- appliesTo :: ID -> T Core -> Player -> Card -> Bool
- type family ManaType (p :: Phase) where ...
- bottomSpotOfTopVisual :: Card -> Card
- empty :: Empty a b => a -> b
- type family InPlaceType (p :: Phase) where ...
- initial :: RandomGen r => r -> Teams (Team, [Card Core]) -> (r, T Core)
-
newtype HandIndex = HandIndex {
- unHandIndex :: Int
- type family InHandType (p :: Phase) where ...
- data Kind
- lookupHand :: [a] -> Int -> Either Text a
- lookupHandM :: MonadError Text m => [a] -> Int -> m a
- class Mappable a p where
- neighbors :: Neighborhood -> Card -> [Card]
- data Neighborhood
- class PlayerIndexed a p where
- class PlayerKindIndexed (k :: Kind) p a where
- data PlayerPart (p :: Phase) = PlayerPart {}
- type family StackType (p :: Phase) where ...
- small :: Model -> Teams Team -> CreatureID -> [Item] -> Player -> Card -> T Core
- setInPlace :: Player -> InPlaceType p -> T p -> T p
- setPart :: T p -> Player -> PlayerPart p -> T p
- switchLine :: Card -> Card
- toInPlace :: T p -> Player -> InPlaceType p
- line :: Line -> [Card]
-
data StackKind
- = Handed
- | Stacked
- | Discarded'
- data Teams a = Teams {}
-
data T (p :: Phase) = T {
- playerTop :: PlayerPart p
- playerBottom :: PlayerPart p
- toHoleyInPlace :: T Core -> [(Player, Card, Maybe (Creature Core))]
- toInPlaceCreature :: T Core -> Player -> Card -> Maybe (Creature Core)
- toPart :: T p -> Player -> PlayerPart p
- toPlayerHoleyInPlace :: T Core -> Player -> [(Card, Maybe (Creature Core))]
- toNeighbors :: T Core -> Player -> Card -> Neighborhood -> [(Card, Creature Core)]
- toPlayerCardSpots :: T Core -> Player -> CardTargetKind -> [Card]
- toData :: Player -> Teams a -> a
Documentation
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@
type family InPlaceType (p :: Phase) where ... #
InPlaceType Core = CardsOnTable | |
InPlaceType UI = Ts |
:: RandomGen r | |
=> r | |
-> Teams (Team, [Card Core]) | The initial decks |
-> (r, T Core) | The shared model, with its RNG updated; and the initial board |
The initial board, appropriately shuffled with a rng, and the starting decks of both teams.
Instances
Enum HandIndex # | |
Defined in Board succ :: HandIndex -> HandIndex # pred :: HandIndex -> HandIndex # fromEnum :: HandIndex -> Int # enumFrom :: HandIndex -> [HandIndex] # enumFromThen :: HandIndex -> HandIndex -> [HandIndex] # enumFromTo :: HandIndex -> HandIndex -> [HandIndex] # enumFromThenTo :: HandIndex -> HandIndex -> HandIndex -> [HandIndex] # | |
Eq HandIndex # | |
Ord HandIndex # | |
Defined in Board | |
Show HandIndex # | |
Generic HandIndex # | |
type Rep HandIndex # | |
type family InHandType (p :: Phase) where ... #
InHandType p = [HandElemType p] |
Data whose only purpose is to be lifted as a type, for disambiguating classes instances.
lookupHand :: [a] -> Int -> Either Text a #
lookupHandM :: MonadError Text m => [a] -> Int -> m a #
Functions to update content within T
values
adjust :: Player -> Card -> (a -> a) -> T p -> T p #
adjustMany :: Player -> [Card] -> (a -> a) -> T p -> T p #
neighbors :: Neighborhood -> Card -> [Card] #
data Neighborhood #
The various kinds of neighbors
Cardinal | Neighbors to the left and the right |
Diagonal | Neighbors in diagonals |
All | Cardinal + diagnoal neighbors |
Instances
Eq Neighborhood # | |
Defined in Spots (==) :: Neighborhood -> Neighborhood -> Bool # (/=) :: Neighborhood -> Neighborhood -> Bool # | |
Show Neighborhood # | |
Defined in Spots showsPrec :: Int -> Neighborhood -> ShowS # show :: Neighborhood -> String # showList :: [Neighborhood] -> ShowS # | |
Generic Neighborhood # | |
Defined in Spots type Rep Neighborhood :: Type -> Type # from :: Neighborhood -> Rep Neighborhood x # to :: Rep Neighborhood x -> Neighborhood # | |
type Rep Neighborhood # | |
class PlayerIndexed a p where #
Lenses for data that belongs to a player
Instances
PlayerIndexed (Map Card Fade) UI # | Generic access to the deco in |
PlayerIndexed (Map Card T) UI # | Generic access to effects in |
PlayerIndexed (Map Card Deco) Core # | Generic access to the deco in |
PlayerIndexed (Map Card (Creature Core)) Core # | Generic access to creatures in |
class PlayerKindIndexed (k :: Kind) p a where #
Class to generically getmapset over the data of a player
Instances
DiscardedType p ~ fam => PlayerKindIndexed Discarded p fam # | Instance of |
InHandType p ~ fam => PlayerKindIndexed Hand p fam # | Instance of |
ManaType p ~ fam => PlayerKindIndexed Mana p fam # | Instance of |
ScoreType p ~ fam => PlayerKindIndexed Score p fam # | Instance of |
StackType p ~ fam => PlayerKindIndexed Stack p fam # | Instance of |
data PlayerPart (p :: Phase) #
Instances
small :: Model -> Teams Team -> CreatureID -> [Item] -> Player -> Card -> T Core #
A board with a single creature in place. Hands are empty. Handy for debugging for example.
setInPlace :: Player -> InPlaceType p -> T p -> T p #
switchLine :: Card -> Card #
Given a frontline spot, the corresponding backline spot. Given a backline spot, the corresponding frontline spot.
toInPlace :: T p -> Player -> InPlaceType p #
Handed | Button to display the hand (only used for the enemy, in Debug mode) |
Stacked | Button to display the stack |
Discarded' | Button to display discarded cards |
Instances
Bounded StackKind # | |
Enum StackKind # | |
Defined in Board succ :: StackKind -> StackKind # pred :: StackKind -> StackKind # fromEnum :: StackKind -> Int # enumFrom :: StackKind -> [StackKind] # enumFromThen :: StackKind -> StackKind -> [StackKind] # enumFromTo :: StackKind -> StackKind -> [StackKind] # enumFromThenTo :: StackKind -> StackKind -> StackKind -> [StackKind] # |
Instances
Functor Teams # | |
Show a => Show (Teams a) # | |
Generic (Teams a) # | |
type Rep (Teams a) # | |
Defined in Board
type Rep (Teams a) = D1 (MetaData "Teams" "Board" "main" False) (C1 (MetaCons "Teams" PrefixI True) (S1 (MetaSel (Just "topTeam") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Just "botTeam") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) |
Things on the board (hand excluded)
T | |
|
Instances
Forall Eq p => Eq (T p) # | |
Forall Ord p => Ord (T p) # | |
Forall Show p => Show (T p) # | |
Generic (T p) # | |
Semigroup (T UI) # | |
Monoid (T UI) # | |
Stupid (T Core) # | |
With (Playable a) (T Core) # | |
Contains (Playable a) (T Core) # | |
(With (Playable a) (T Core), With (Playable a) a) => With (Playable a) (T Core, a) # | |
(Contains (Playable a) (T Core), Contains (Playable a) a) => Contains (Playable a) (T Core, a) # | |
With (Kernel a) (Model, T Core, T UI) # | |
Contains (Kernel a) (Model, T Core, T UI) # | |
With (Kernel a) (Model, T Core, T UI, Animation) # | |
Contains (Kernel a) (Model, T Core, T UI, Animation) # | |
type Rep (T p) # | |
Defined in Board
type Rep (T p) = D1 (MetaData "T" "Board" "main" False) (C1 (MetaCons "T" PrefixI True) (S1 (MetaSel (Just "playerTop") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (PlayerPart p)) :*: S1 (MetaSel (Just "playerBottom") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (PlayerPart p)))) |
toPart :: T p -> Player -> PlayerPart p #
toNeighbors :: T Core -> Player -> Card -> Neighborhood -> [(Card, Creature Core)] #
The neighbors of the card at the given spot, for the given player, and for the given kind of neighbors.
toPlayerCardSpots :: T Core -> Player -> CardTargetKind -> [Card] #
Returns the spots available for playing a card with the given target kind. For creature cards for example it returns empty spots. For item cards it returns occupied spots.