// // CountryCashes.swift // TournamentStats // // Created by Laurent Morvillier on 09/06/2019. // Copyright © 2019 Stax River. All rights reserved. // import Foundation struct CountryCashes : HTMLRepresentable { var country: String var cashes: Int static func htmlHeaders() -> String { var strings: [String] = [] strings.append("Country") strings.append("Cashes") let all = strings.joined(separator: "") return "\(all)" } func html() -> String { let formattedCountry: String if let flagoji = Locale.current.flagoji(from: self.country) { formattedCountry = "\(flagoji) \(self.country)" } else { formattedCountry = self.country } var strings: [String] = [] strings.append(formattedCountry) strings.append("\(cashes)") let all = strings.joined(separator: "") return "\(all)" } }