Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type CardName = String
- type CardAttribute = String
- data Player
- type ManaPool = String
- type ManaString = String
- data Location
- data CardEffect = CardEffect {
- _effectEnabled :: CardMatcher
- _effectFilter :: Card -> CardMatcher
- _effectAction :: Card -> GameMonad Card
- mkEffect :: CardMatcher -> (Card -> CardMatcher) -> (Card -> GameMonad Card) -> CardEffect
- data Target
- targetPlayer :: Player -> Target
- targetCard :: CardName -> Target
- type CardLocation = (Player, Location)
- type CardAttributes = Set CardAttribute
- data CardStrength = CardStrength Int Int
- data Phase
- data Card = Card {}
- newtype BaseCard = BaseCard Card
- data CardMatcher = CardMatcher String (Card -> Bool)
- type EffectName = String
- data Board = Board {}
- data Env = Env {}
- type GameMonad a = ExceptT String (ReaderT Env (StateT Board (WriterT [(String, Board)] Identity))) a
- type Formatter = Board -> String
- stack :: Lens' Board [CardName]
- phase :: Lens' Board Phase
- manaPool :: Lens' Board (HashMap Player ManaPool)
- life :: Lens' Board (HashMap Player Int)
- counters :: Lens' Board (HashMap String Int)
- cards :: Lens' Board (HashMap CardName BaseCard)
- location :: Lens' Card (Player, Location)
- cardStrength :: Lens' Card CardStrength
- cardPlusOneCounters :: Lens' Card Int
- cardName :: Lens' Card CardName
- cardLoyalty :: Lens' Card Int
- cardEffects :: Lens' Card [CardEffect]
- cardDefaultAttributes :: Lens' Card CardAttributes
- cardDamage :: Lens' Card Int
- cardAttributes :: Lens' Card CardAttributes
- effectFilter :: Lens' CardEffect (Card -> CardMatcher)
- effectEnabled :: Lens' CardEffect CardMatcher
- effectAction :: Lens' CardEffect (Card -> GameMonad Card)
- envTemplate :: Lens' Env Card
- envSBAEnabled :: Lens' Env Bool
- envActor :: Lens' Env Player
- cardLocation :: Lens' Card (Player, Location)
- cardOwner :: Lens' Card Player
- cardPower :: Lens' Card Int
- cardToughness :: Lens' Card Int
- manaPoolFor :: Functor f => Player -> ([Char] -> f [Char]) -> Board -> f Board
- _manaPoolForTyping :: Board -> ManaPool
- emptyEnv :: Env
- mkStrength :: (Int, Int) -> CardStrength
- emptyCard :: Card
- mkCard :: CardName -> (Player, Location) -> Card
- opposing :: Player -> Player
- emptyBoard :: Board
Documentation
type CardAttribute = String Source #
type ManaString = String Source #
data CardEffect Source #
CardEffect | |
|
mkEffect :: CardMatcher -> (Card -> CardMatcher) -> (Card -> GameMonad Card) -> CardEffect Source #
TargetPlayer Player | Target a player, use |
TargetCard CardName | Target a card, use |
targetPlayer :: Player -> Target Source #
targetCard :: CardName -> Target Source #
type CardLocation = (Player, Location) Source #
type CardAttributes = Set CardAttribute Source #
data CardStrength Source #
Instances
Eq CardStrength Source # | |
Defined in Dovin.Types (==) :: CardStrength -> CardStrength -> Bool # (/=) :: CardStrength -> CardStrength -> Bool # | |
Show CardStrength Source # | |
Defined in Dovin.Types showsPrec :: Int -> CardStrength -> ShowS # show :: CardStrength -> String # showList :: [CardStrength] -> ShowS # | |
Semigroup CardStrength Source # | |
Defined in Dovin.Types (<>) :: CardStrength -> CardStrength -> CardStrength # sconcat :: NonEmpty CardStrength -> CardStrength # stimes :: Integral b => b -> CardStrength -> CardStrength # | |
Monoid CardStrength Source # | |
Defined in Dovin.Types mempty :: CardStrength # mappend :: CardStrength -> CardStrength -> CardStrength # mconcat :: [CardStrength] -> CardStrength # |
A phase or step in a turn. Phases and steps are not distinguished between because haven't seen a need to.
Untap | |
Upkeep | |
DrawStep | |
FirstMain | |
BeginCombat | |
DeclareAttackers | |
DeclareBlockers | |
FirstStrikeDamage | |
CombatDamage | |
EndCombat | |
SecondMain | |
EndStep |
data CardMatcher Source #
CardMatcher String (Card -> Bool) |
Instances
Show CardMatcher Source # | |
Defined in Dovin.Types showsPrec :: Int -> CardMatcher -> ShowS # show :: CardMatcher -> String # showList :: [CardMatcher] -> ShowS # | |
Semigroup CardMatcher Source # | |
Defined in Dovin.Types (<>) :: CardMatcher -> CardMatcher -> CardMatcher # sconcat :: NonEmpty CardMatcher -> CardMatcher # stimes :: Integral b => b -> CardMatcher -> CardMatcher # | |
Monoid CardMatcher Source # | |
Defined in Dovin.Types mempty :: CardMatcher # mappend :: CardMatcher -> CardMatcher -> CardMatcher # mconcat :: [CardMatcher] -> CardMatcher # |
type EffectName = String Source #
Env | |
|
type GameMonad a = ExceptT String (ReaderT Env (StateT Board (WriterT [(String, Board)] Identity))) a Source #
cardEffects :: Lens' Card [CardEffect] Source #
effectFilter :: Lens' CardEffect (Card -> CardMatcher) Source #
effectAction :: Lens' CardEffect (Card -> GameMonad Card) Source #
_manaPoolForTyping :: Board -> ManaPool Source #
mkStrength :: (Int, Int) -> CardStrength Source #
emptyBoard :: Board Source #