Skip to content

Commit

Permalink
[create-pull-request] automated change (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: ShikiSuen <ShikiSuen@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and ShikiSuen authored Oct 10, 2024
1 parent 7f7d964 commit 42ac662
Showing 1 changed file with 97 additions and 11 deletions.
108 changes: 97 additions & 11 deletions store/characters.json.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct CharactersJSON: Codable {
let the10000020: The10000020
let the10000021: The10000021
let the10000022: The10000022
let the10000023: The10000023
let the10000023: The10000
let the10000024: The10000024
let the10000025: The10000025
let the10000026: The10000026
Expand Down Expand Up @@ -96,6 +96,9 @@ struct CharactersJSON: Codable {
let the10000100: The10000100
let the10000101: The10000101
let the10000102: The10000102
let the10000103: The10000103
let the10000901: The10000
let the11000046: The10000015
let the10000005503: The10000005503
let the10000005504: The10000005
let the10000005506: The10000005506
Expand Down Expand Up @@ -199,6 +202,9 @@ struct CharactersJSON: Codable {
case the10000100 = "10000100"
case the10000101 = "10000101"
case the10000102 = "10000102"
case the10000103 = "10000103"
case the10000901 = "10000901"
case the11000046 = "11000046"
case the10000005503 = "10000005-503"
case the10000005504 = "10000005-504"
case the10000005506 = "10000005-506"
Expand Down Expand Up @@ -244,7 +250,7 @@ extension CharactersJSON {
the10000020: The10000020? = nil,
the10000021: The10000021? = nil,
the10000022: The10000022? = nil,
the10000023: The10000023? = nil,
the10000023: The10000? = nil,
the10000024: The10000024? = nil,
the10000025: The10000025? = nil,
the10000026: The10000026? = nil,
Expand Down Expand Up @@ -322,6 +328,9 @@ extension CharactersJSON {
the10000100: The10000100? = nil,
the10000101: The10000101? = nil,
the10000102: The10000102? = nil,
the10000103: The10000103? = nil,
the10000901: The10000? = nil,
the11000046: The10000015? = nil,
the10000005503: The10000005503? = nil,
the10000005504: The10000005? = nil,
the10000005506: The10000005506? = nil,
Expand Down Expand Up @@ -425,6 +434,9 @@ extension CharactersJSON {
the10000100: the10000100 ?? self.the10000100,
the10000101: the10000101 ?? self.the10000101,
the10000102: the10000102 ?? self.the10000102,
the10000103: the10000103 ?? self.the10000103,
the10000901: the10000901 ?? self.the10000901,
the11000046: the11000046 ?? self.the11000046,
the10000005503: the10000005503 ?? self.the10000005503,
the10000005504: the10000005504 ?? self.the10000005504,
the10000005506: the10000005506 ?? self.the10000005506,
Expand Down Expand Up @@ -1836,7 +1848,7 @@ struct The10000015: Codable {
let proudMap: [String: Int]
let nameTextMapHash: Int
let sideIconName, qualityType, weaponType: String
let costumes: The10000015_Costumes
let costumes: The10000015_Costumes?

enum CodingKeys: String, CodingKey {
case element = "Element"
Expand Down Expand Up @@ -1880,7 +1892,7 @@ extension The10000015 {
sideIconName: String? = nil,
qualityType: String? = nil,
weaponType: String? = nil,
costumes: The10000015_Costumes? = nil
costumes: The10000015_Costumes?? = nil
) -> The10000015 {
return The10000015(
element: element ?? self.element,
Expand Down Expand Up @@ -2341,8 +2353,8 @@ extension The10000022 {
}
}

// MARK: - The10000023
struct The10000023: Codable {
// MARK: - The10000
struct The10000: Codable {
let element: String
let consts: [String]
let skillOrder: [Int]
Expand All @@ -2364,11 +2376,11 @@ struct The10000023: Codable {
}
}

// MARK: The10000023 convenience initializers and mutators
// MARK: The10000 convenience initializers and mutators

extension The10000023 {
extension The10000 {
init(data: Data) throws {
self = try newJSONDecoder().decode(The10000023.self, from: data)
self = try newJSONDecoder().decode(The10000.self, from: data)
}

init(_ json: String, using encoding: String.Encoding = .utf8) throws {
Expand All @@ -2392,8 +2404,8 @@ extension The10000023 {
sideIconName: String? = nil,
qualityType: String? = nil,
weaponType: String? = nil
) -> The10000023 {
return The10000023(
) -> The10000 {
return The10000(
element: element ?? self.element,
consts: consts ?? self.consts,
skillOrder: skillOrder ?? self.skillOrder,
Expand Down Expand Up @@ -8641,6 +8653,80 @@ extension The10000102 {
}
}

// MARK: - The10000103
struct The10000103: Codable {
let element: String
let consts: [String]
let skillOrder: [Int]
let skills: [String: String]
let proudMap: [String: Int]
let nameTextMapHash: Int
let sideIconName, qualityType, weaponType: String

enum CodingKeys: String, CodingKey {
case element = "Element"
case consts = "Consts"
case skillOrder = "SkillOrder"
case skills = "Skills"
case proudMap = "ProudMap"
case nameTextMapHash = "NameTextMapHash"
case sideIconName = "SideIconName"
case qualityType = "QualityType"
case weaponType = "WeaponType"
}
}

// MARK: The10000103 convenience initializers and mutators

extension The10000103 {
init(data: Data) throws {
self = try newJSONDecoder().decode(The10000103.self, from: data)
}

init(_ json: String, using encoding: String.Encoding = .utf8) throws {
guard let data = json.data(using: encoding) else {
throw NSError(domain: "JSONDecoding", code: 0, userInfo: nil)
}
try self.init(data: data)
}

init(fromURL url: URL) throws {
try self.init(data: try Data(contentsOf: url))
}

func with(
element: String? = nil,
consts: [String]? = nil,
skillOrder: [Int]? = nil,
skills: [String: String]? = nil,
proudMap: [String: Int]? = nil,
nameTextMapHash: Int? = nil,
sideIconName: String? = nil,
qualityType: String? = nil,
weaponType: String? = nil
) -> The10000103 {
return The10000103(
element: element ?? self.element,
consts: consts ?? self.consts,
skillOrder: skillOrder ?? self.skillOrder,
skills: skills ?? self.skills,
proudMap: proudMap ?? self.proudMap,
nameTextMapHash: nameTextMapHash ?? self.nameTextMapHash,
sideIconName: sideIconName ?? self.sideIconName,
qualityType: qualityType ?? self.qualityType,
weaponType: weaponType ?? self.weaponType
)
}

func jsonData() throws -> Data {
return try newJSONEncoder().encode(self)
}

func jsonString(encoding: String.Encoding = .utf8) throws -> String? {
return String(data: try self.jsonData(), encoding: encoding)
}
}

// MARK: - Helper functions for creating encoders and decoders

func newJSONDecoder() -> JSONDecoder {
Expand Down

0 comments on commit 42ac662

Please sign in to comment.