| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- module Card exposing (CardData, CardDetails, CardPerformanceData, CardType(..), ManaColor(..), Power(..), pickRate)
- type ManaColor
- = Red
- | Blue
- | Green
- | White
- | Black
- | Colorless
- type CardType
- = Creature
- | Instant
- | Sorcery
- | Enchantment
- | Artifact
- | Planeswalker
- | Land
- | Other
- type Power
- = ConstantPower Int
- | VariablePower
- type alias CardData =
- { details : CardDetails
- , performance : CardPerformanceData
- }
- type alias CardDetails =
- { cmc : Int
- , cardType : CardType
- , typeLine : String
- , oracleText : String
- , power : Maybe Power
- , toughness : Maybe Power
- , colors : List ManaColor
- --, manaCost : List ManaColor
- }
- type alias CardPerformanceData =
- { totalTimesSeen : Int
- , totalTimesPicked : Int
- , averagePickPosition : Maybe Float
- , averageSeenPosition : Maybe Float
- , gameInHandWinRate : Maybe Float
- }
- pickRate : CardData -> Float
- pickRate card =
- if card.performance.totalTimesSeen == 0 then
- 0
- else
- toFloat card.performance.totalTimesPicked / toFloat card.performance.totalTimesSeen
|