Skip to content

Commit

Permalink
Making more public structs public so you can access them
Browse files Browse the repository at this point in the history
  • Loading branch information
WxWatch committed Sep 9, 2018
1 parent 058fb2a commit 67fbbcc
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 184 deletions.
2 changes: 1 addition & 1 deletion DragonService.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "DragonService"
s.version = "1.0.0"
s.version = "1.0.2"
s.summary = "A library to fetch data from Data Dragon."
s.description = <<-DESC
A Swift library designed to fetch League of Legends static data from Riot Games DataDragon CDN.
Expand Down
116 changes: 58 additions & 58 deletions Sources/DragonService/Models/Champions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,91 +9,91 @@
import Foundation

public struct Champions: Codable {
let type, format, version: String
let data: [String: ChampionData]
let keys: [Int: String]?
public let type, format, version: String
public let data: [String: ChampionData]
public let keys: [Int: String]?
}

public struct ChampionData: Codable {
let id, key, name, title: String
let image: Image
let skins: [Skin]?
let lore, blurb: String?
let allytips, enemytips, tags: [String]?
let partype: String
let info: Info
let stats: [String: Double]
let spells: [Spell]?
let passive: Passive?
let recommended: [Recommended]?
public let id, key, name, title: String
public let image: Image
public let skins: [Skin]?
public let lore, blurb: String?
public let allytips, enemytips, tags: [String]?
public let partype: String
public let info: Info
public let stats: [String: Double]
public let spells: [Spell]?
public let passive: Passive?
public let recommended: [Recommended]?
}

public struct Info: Codable {
let attack, defense, magic, difficulty: Int
public let attack, defense, magic, difficulty: Int
}

public struct Passive: Codable {
let name, description: String
let image: Image
public let name, description: String
public let image: Image
}

public struct Recommended: Codable {
let champion, title, map, mode: String
let type: String
let customTag: String?
let sortrank: Int?
let extensionPage: Bool?
let useObviousCheckmark: Bool?
let customPanel: String?
let blocks: [Block]
public let champion, title, map, mode: String
public let type: String
public let customTag: String?
public let sortrank: Int?
public let extensionPage: Bool?
public let useObviousCheckmark: Bool?
public let customPanel: String?
public let blocks: [Block]
}

public struct Block: Codable {
let type: String
let recMath, recSteps: Bool?
let minSummonerLevel, maxSummonerLevel: Int?
let showIfSummonerSpell, hideIfSummonerSpell: String?
let appendAfterSection: String?
let visibleWithAllOf, hiddenWithAnyOf: [String]?
let items: [Item]
public let type: String
public let recMath, recSteps: Bool?
public let minSummonerLevel, maxSummonerLevel: Int?
public let showIfSummonerSpell, hideIfSummonerSpell: String?
public let appendAfterSection: String?
public let visibleWithAllOf, hiddenWithAnyOf: [String]?
public let items: [Item]
}

public struct Item: Codable {
let id: String
let count: Int
let hideCount: Bool?
public let id: String
public let count: Int
public let hideCount: Bool?
}

public struct Skin: Codable {
let id: String
let num: Int
let name: String
let chromas: Bool
public let id: String
public let num: Int
public let name: String
public let chromas: Bool
}

public struct Spell: Codable {
let id, name, description, tooltip: String
let leveltip: Leveltip
let maxrank: Int
let cooldown: [Double]
let cooldownBurn: String
let cost: [Int]
let costBurn: String
let datavalues: Datavalues?
let effect: [[Double]?]
let effectBurn: [String?]
let vars: [VarData]
let costType, maxammo: String
let range: [Int]
let rangeBurn: String
let image: Image
let resource: String
public let id, name, description, tooltip: String
public let leveltip: Leveltip
public let maxrank: Int
public let cooldown: [Double]
public let cooldownBurn: String
public let cost: [Int]
public let costBurn: String
public let datavalues: Datavalues?
public let effect: [[Double]?]
public let effectBurn: [String?]
public let vars: [VarData]
public let costType, maxammo: String
public let range: [Int]
public let rangeBurn: String
public let image: Image
public let resource: String
}

public struct VarData: Codable {
let link: String?
let key: String
let coeff: Coeff
public let link: String?
public let key: String
public let coeff: Coeff
}

public struct Datavalues: Codable {
Expand Down
54 changes: 27 additions & 27 deletions Sources/DragonService/Models/Common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,49 @@
import Foundation

public struct Image: Codable {
let full: String
let sprite: String
let group: String
let x, y, w, h: Int
public let full: String
public let sprite: String
public let group: String
public let x, y, w, h: Int
}

public struct Basic: Codable {
let name: String
let rune: Rune
let gold: Gold
let group, description, colloq, plaintext: String
let consumed: Bool
let stacks, depth: Int
let consumeOnFull: Bool
let from, into: [String]
let specialRecipe: Int
let inStore, hideFromAll: Bool
let requiredChampion: String
let stats: [String: Int]
let tags: [String]
let maps: [String: Bool]
public let name: String
public let rune: Rune
public let gold: Gold
public let group, description, colloq, plaintext: String
public let consumed: Bool
public let stacks, depth: Int
public let consumeOnFull: Bool
public let from, into: [String]
public let specialRecipe: Int
public let inStore, hideFromAll: Bool
public let requiredChampion: String
public let stats: [String: Int]
public let tags: [String]
public let maps: [String: Bool]
}

public struct Gold: Codable {
let base, total, sell: Int
let purchasable: Bool
public let base, total, sell: Int
public let purchasable: Bool
}

public struct Rune: Codable {
let isrune: Bool
let tier: Int
let type: String
public let isrune: Bool
public let tier: Int
public let type: String
}

public struct Leveltip: Codable {
let label, effect: [String]
public let label, effect: [String]
}

enum Coeff: Codable {
public enum Coeff: Codable {
case double(Double)
case doubleArray([Double])

init(from decoder: Decoder) throws {
public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let x = try? container.decode([Double].self) {
self = .doubleArray(x)
Expand All @@ -64,7 +64,7 @@ enum Coeff: Codable {
throw DecodingError.typeMismatch(Coeff.self, DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Wrong type for Coeff"))
}

func encode(to encoder: Encoder) throws {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
switch self {
case .double(let x):
Expand Down
60 changes: 30 additions & 30 deletions Sources/DragonService/Models/Items.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,38 @@ import Foundation
import Alamofire

public struct ItemsModel: Codable {
let type, version: String
let basic: Basic
let data: [String: ItemsDatum]
let groups: [GroupElement]
let tree: [ItemsTree]
public let type, version: String
public let basic: Basic
public let data: [String: ItemsDatum]
public let groups: [GroupElement]
public let tree: [ItemsTree]
}

public struct ItemsDatum: Codable {
let name, description, colloq, plaintext: String
let into: [String]
let image: Image
let gold: Gold
let tags: [String]
let maps: [String: Bool]
let stats: [String: Double]
let from: [String]?
let effect: Effect?
let depth: Int?
let consumed: Bool?
let stacks: Int?
let inStore, consumeOnFull: Bool?
let requiredChampion: String?
let specialRecipe: Int?
let hideFromAll: Bool?
public let name, description, colloq, plaintext: String
public let into: [String]
public let image: Image
public let gold: Gold
public let tags: [String]
public let maps: [String: Bool]
public let stats: [String: Double]
public let from: [String]?
public let effect: Effect?
public let depth: Int?
public let consumed: Bool?
public let stacks: Int?
public let inStore, consumeOnFull: Bool?
public let requiredChampion: String?
public let specialRecipe: Int?
public let hideFromAll: Bool?
}

public struct Effect: Codable {
let effect1Amount: String
let effect2Amount, effect3Amount, effect4Amount, effect5Amount: String?
let effect6Amount, effect7Amount, effect8Amount: String?
public let effect1Amount: String
public let effect2Amount, effect3Amount, effect4Amount, effect5Amount: String?
public let effect6Amount, effect7Amount, effect8Amount: String?

enum CodingKeys: String, CodingKey {
public enum CodingKeys: String, CodingKey {
case effect1Amount = "Effect1Amount"
case effect2Amount = "Effect2Amount"
case effect3Amount = "Effect3Amount"
Expand All @@ -54,16 +54,16 @@ public struct Effect: Codable {
}

public struct GroupElement: Codable {
let id: String
let maxGroupOwnable: String?
public let id: String
public let maxGroupOwnable: String?

enum CodingKeys: String, CodingKey {
public enum CodingKeys: String, CodingKey {
case id
case maxGroupOwnable = "MaxGroupOwnable"
}
}

public struct ItemsTree: Codable {
let header: String
let tags: [String]
public let header: String
public let tags: [String]
}
10 changes: 5 additions & 5 deletions Sources/DragonService/Models/Language.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import Foundation

public struct LanguageModel: Codable {
let type, version: String
let data: [String: String]
let tree: LanguageTree
public let type, version: String
public let data: [String: String]
public let tree: LanguageTree
}

public struct LanguageTree: Codable {
let searchKeyIgnore: String
let searchKeyRemap: [String]
public let searchKeyIgnore: String
public let searchKeyRemap: [String]
}
26 changes: 13 additions & 13 deletions Sources/DragonService/Models/Masteries.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@
import Foundation

public struct Masteries: Codable {
let type, version: String
let tree: MasteriesTree
let data: [String: MasteriesDatum]
public let type, version: String
public let tree: MasteriesTree
public let data: [String: MasteriesDatum]
}

public struct MasteriesDatum: Codable {
let id: Int
let name: String
let description: [String]
let image: Image
let ranks: Int
let prereq: String
public let id: Int
public let name: String
public let description: [String]
public let image: Image
public let ranks: Int
public let prereq: String
}

public struct MasteriesTree: Codable {
let ferocity, cunning, resolve: [[Cunning]]
public let ferocity, cunning, resolve: [[Cunning]]

enum CodingKeys: String, CodingKey {
public enum CodingKeys: String, CodingKey {
case ferocity = "Ferocity"
case cunning = "Cunning"
case resolve = "Resolve"
}
}

public struct Cunning: Codable {
let masteryID, prereq: String
public let masteryID, prereq: String

enum CodingKeys: String, CodingKey {
public enum CodingKeys: String, CodingKey {
case masteryID = "masteryId"
case prereq
}
Expand Down
Loading

0 comments on commit 67fbbcc

Please sign in to comment.