Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module to display the view reached after a successful end of GameView
.
This view sits between two games, where the player can pick new
cards to augment its deck.
Synopsis
- view :: Loot -> Styled (View Action)
- data Context = Context {}
- rewardsViewTopMargin :: Int
- rewardsViewHeight :: Int
- rewardsView :: Context -> Int -> [(ID, Picked)] -> Styled (View Action)
- nextView :: Loot -> Int -> Nat -> Styled (View Action)
- deckViewTopMargin :: Int
- deckViewHeight :: Int
- deckCardsPerRow :: Int
- deckViewWidth :: Int
- counts :: forall a. Eq a => [a] -> [(a, Nat)]
- data DeckCard a = DeckCard {}
- deckView :: Context -> Int -> [DeckCard ID] -> Styled (View Action)
- loc :: DisplayLocation
Documentation
Context that is common to all calls to deckView
The margin from the top to the row of the rewards
The height of the rewards div: the height of a card plus space for the individual legends atop each card
rewardsView :: Context -> Int -> [(ID, Picked)] -> Styled (View Action) #
The div showing the rewards. It is displayed above deckView
deckViewHeight :: Int #
deckCardsPerRow :: Int #
deckViewWidth :: Int #
counts :: forall a. Eq a => [a] -> [(a, Nat)] #
Gather equal items, counting them on the way; and *keep the order*. We could use Data.Map.Ordered, but it doesn't have mapFromListWith so it's not really easier.
A dumb container for passing structured data to deckView
Instances
Functor DeckCard # | |
Foldable DeckCard # | |
Defined in LootView fold :: Monoid m => DeckCard m -> m # foldMap :: Monoid m => (a -> m) -> DeckCard a -> m # foldr :: (a -> b -> b) -> b -> DeckCard a -> b # foldr' :: (a -> b -> b) -> b -> DeckCard a -> b # foldl :: (b -> a -> b) -> b -> DeckCard a -> b # foldl' :: (b -> a -> b) -> b -> DeckCard a -> b # foldr1 :: (a -> a -> a) -> DeckCard a -> a # foldl1 :: (a -> a -> a) -> DeckCard a -> a # elem :: Eq a => a -> DeckCard a -> Bool # maximum :: Ord a => DeckCard a -> a # minimum :: Ord a => DeckCard a -> a # | |
Traversable DeckCard # | |
Eq a => Eq (DeckCard a) # | |
deckView :: Context -> Int -> [DeckCard ID] -> Styled (View Action) #
The div showing the deck. The value of type Picked
indicates
whether the card is a reward that was picked or a card from
the deck of the previous game.
loc :: DisplayLocation #