Mercurial > public > geoquiz
annotate GeoQuiz/Models/CountryModel.swift @ 26:425078c01194
refactor code
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Wed, 09 Nov 2022 10:30:01 +0100 |
parents | GeoQuiz/Logic/CountryModel.swift@f140bb277c96 |
children |
rev | line source |
---|---|
6 | 1 // |
2 // CountryModel.swift | |
3 // GeoQuiz | |
4 // | |
5 // Created by Dennis Concepción Martín on 29/9/22. | |
6 // | |
7 | |
8 import Foundation | |
9 | |
19 | 10 struct CountryModel: Codable { |
10
a793f33f05fb
refactor code and fix layout
Dennis C. M. <dennis@denniscm.com>
parents:
6
diff
changeset
|
11 let countries: [String: Country] |
6 | 12 |
10
a793f33f05fb
refactor code and fix layout
Dennis C. M. <dennis@denniscm.com>
parents:
6
diff
changeset
|
13 struct Country: Codable, Equatable, Hashable { |
6 | 14 let flag: String |
15 let currency: String | |
16 let population: Int | |
17 let capital: String | |
18 | |
10
a793f33f05fb
refactor code and fix layout
Dennis C. M. <dennis@denniscm.com>
parents:
6
diff
changeset
|
19 static func ==(lhs: Country, rhs: Country) -> Bool { |
6 | 20 lhs.flag == rhs.flag && |
21 lhs.currency == rhs.currency && | |
22 lhs.population == rhs.population && | |
23 lhs.capital == rhs.capital | |
24 } | |
25 } | |
26 } |