summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-11-15 19:04:47 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-11-15 19:04:47 +0100 |
commit | 5e06809bc6e4eb9f007bf2b0dd2fd53cde600611 (patch) | |
tree | c1988d11b3dd2b9b8e31e584c2b73aa8d106f757 /src/roster-editor | |
parent | 0e0738794535add036274aa4c43a74f247add899 (diff) |
[Untested][Out-of-sync] Use Strings for IDs.
Diffstat (limited to 'src/roster-editor')
-rw-r--r-- | src/roster-editor/src/Struct/Armor.elm | 12 | ||||
-rw-r--r-- | src/roster-editor/src/Struct/CharacterRecord.elm | 24 | ||||
-rw-r--r-- | src/roster-editor/src/Struct/Weapon.elm | 14 |
3 files changed, 25 insertions, 25 deletions
diff --git a/src/roster-editor/src/Struct/Armor.elm b/src/roster-editor/src/Struct/Armor.elm index 5f163fe..6bae44f 100644 --- a/src/roster-editor/src/Struct/Armor.elm +++ b/src/roster-editor/src/Struct/Armor.elm @@ -24,12 +24,12 @@ import Struct.Omnimods -------------------------------------------------------------------------------- type alias Type = { - id : Int, + id : String, name : String, omnimods : Struct.Omnimods.Type } -type alias Ref = Int +type alias Ref = String -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -38,7 +38,7 @@ type alias Ref = Int -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- -new : Int -> String -> Struct.Omnimods.Type -> Type +new : String -> String -> Struct.Omnimods.Type -> Type new id name omnimods = { id = id, @@ -53,7 +53,7 @@ get_name : Type -> String get_name ar = ar.name get_image_id : Type -> String -get_image_id ar = (toString ar.id) +get_image_id ar = ar.id get_omnimods : Type -> Struct.Omnimods.Type get_omnimods ar = ar.omnimods @@ -62,13 +62,13 @@ decoder : (Json.Decode.Decoder Type) decoder = (Json.Decode.Pipeline.decode Type - |> (Json.Decode.Pipeline.required "id" Json.Decode.int) + |> (Json.Decode.Pipeline.required "id" Json.Decode.string) |> (Json.Decode.Pipeline.required "nam" Json.Decode.string) |> (Json.Decode.Pipeline.required "omni" Struct.Omnimods.decoder) ) none : Type -none = (new 0 "None" (Struct.Omnimods.new [] [] [] [])) +none = (new "0" "None" (Struct.Omnimods.none)) default : Type default = (none) diff --git a/src/roster-editor/src/Struct/CharacterRecord.elm b/src/roster-editor/src/Struct/CharacterRecord.elm index 0807aed..62bfa93 100644 --- a/src/roster-editor/src/Struct/CharacterRecord.elm +++ b/src/roster-editor/src/Struct/CharacterRecord.elm @@ -38,9 +38,9 @@ type alias Type = index : Int, name : String, portrait_id : String, - main_weapon_id : Int, - secondary_weapon_id : Int, - armor_id : Int, + main_weapon_id : String, + secondary_weapon_id : String, + armor_id : String, glyph_board_id : String, glyph_ids : (List String) } @@ -61,13 +61,13 @@ get_name c = c.name get_portrait_id : Type -> String get_portrait_id c = c.portrait_id -get_main_weapon_id : Type -> Int +get_main_weapon_id : Type -> String get_main_weapon_id char = char.main_weapon_id -get_secondary_weapon_id : Type -> Int +get_secondary_weapon_id : Type -> String get_secondary_weapon_id char = char.secondary_weapon_id -get_armor_id : Type -> Int +get_armor_id : Type -> String get_armor_id char = char.armor_id get_glyph_board_id : Type -> String @@ -109,9 +109,9 @@ decoder = |> (Json.Decode.Pipeline.required "ix" Json.Decode.int) |> (Json.Decode.Pipeline.required "nam" Json.Decode.string) |> (Json.Decode.Pipeline.required "prt" Json.Decode.string) - |> (Json.Decode.Pipeline.required "awp" Json.Decode.int) - |> (Json.Decode.Pipeline.required "swp" Json.Decode.int) - |> (Json.Decode.Pipeline.required "ar" Json.Decode.int) + |> (Json.Decode.Pipeline.required "awp" Json.Decode.string) + |> (Json.Decode.Pipeline.required "swp" Json.Decode.string) + |> (Json.Decode.Pipeline.required "ar" Json.Decode.string) |> (Json.Decode.Pipeline.required "gb" Json.Decode.string) |> (Json.Decode.Pipeline.required "gls" @@ -126,9 +126,9 @@ encode char = ("ix", (Json.Encode.int char.index)), ("nam", (Json.Encode.string char.name)), ("prt", (Json.Encode.string char.portrait_id)), - ("awp", (Json.Encode.int char.main_weapon_id)), - ("swp", (Json.Encode.int char.secondary_weapon_id)), - ("ar", (Json.Encode.int char.armor_id)), + ("awp", (Json.Encode.string char.main_weapon_id)), + ("swp", (Json.Encode.string char.secondary_weapon_id)), + ("ar", (Json.Encode.string char.armor_id)), ("gb", (Json.Encode.string char.glyph_board_id)), ( "gls", diff --git a/src/roster-editor/src/Struct/Weapon.elm b/src/roster-editor/src/Struct/Weapon.elm index eb1f2e4..3556533 100644 --- a/src/roster-editor/src/Struct/Weapon.elm +++ b/src/roster-editor/src/Struct/Weapon.elm @@ -26,7 +26,7 @@ import Struct.Omnimods -------------------------------------------------------------------------------- type alias PartiallyDecoded = { - id : Int, + id : String, nam : String, rmi : Int, rma : Int, @@ -35,7 +35,7 @@ type alias PartiallyDecoded = type alias Type = { - id : Int, + id : String, name : String, def_range : Int, atk_range : Int, @@ -43,7 +43,7 @@ type alias Type = damage_sum : Int } -type alias Ref = Int +type alias Ref = String -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- @@ -52,7 +52,7 @@ type alias Ref = Int -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- -------------------------------------------------------------------------------- -new : Int -> String -> Int -> Int -> Struct.Omnimods.Type -> Type +new : String -> String -> Int -> Int -> Struct.Omnimods.Type -> Type new id name range_min range_max omnimods = { id = id, @@ -63,7 +63,7 @@ new id name range_min range_max omnimods = damage_sum = (Struct.Omnimods.get_damage_sum omnimods) } -get_id : Type -> Int +get_id : Type -> String get_id wp = wp.id get_name : Type -> String @@ -87,7 +87,7 @@ decoder = (\e -> {e | damage_sum = (Struct.Omnimods.get_damage_sum e.omnimods)}) (Json.Decode.Pipeline.decode Type - |> (Json.Decode.Pipeline.required "id" Json.Decode.int) + |> (Json.Decode.Pipeline.required "id" Json.Decode.string) |> (Json.Decode.Pipeline.required "nam" Json.Decode.string) |> (Json.Decode.Pipeline.required "rmi" Json.Decode.int) |> (Json.Decode.Pipeline.required "rma" Json.Decode.int) @@ -97,7 +97,7 @@ decoder = ) none : Type -none = (new 0 "None" 0 0 (Struct.Omnimods.none)) +none = (new "0" "None" 0 0 (Struct.Omnimods.none)) default : Type default = (none) |