summaryrefslogtreecommitdiff
blob: c982898eed92717116f31379173b7e9bce04df27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module BattleCharacters.Struct.StatusIndicator exposing
   (
      Type,
      decoder
   )

-- Elm -------------------------------------------------------------------------
import Set

import Json.Decode
import Json.Decode.Pipeline

-- Battle Character ------------------------------------------------------------

--------------------------------------------------------------------------------
-- TYPES -----------------------------------------------------------------------
--------------------------------------------------------------------------------
type Visibility =
   None
   | Limited (Set.Set Int)
   | All

type alias Type =
   {
      ix : Int,
      category : String,
      parameter : String
   }

--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------
decoder : (Json.Decode.Decoder Type)
decoder =
   (Json.Decode.succeed
      Type
      |> (Json.Decode.Pipeline.required "i" Json.Decode.int)
      |> (Json.Decode.Pipeline.required "c" Json.Decode.string)
      |> (Json.Decode.Pipeline.required "p" Json.Decode.string)
   )