<commit_before>//
//  StationsViewCell.swift
//  GogoroMap
//
//  Created by 陳 冠禎 on 2017/8/11.
//  Copyright © 2017年 陳 冠禎. All rights reserved.
//

import UIKit
import StoreKit

typealias PurchaseFunc = (_ product: SKProduct) -> ()

@objc protocol StationsViewCellDelegate: class {
    @objc func performGuidePage()
    @objc func presentMail()
    @objc func recommand()
    @objc func shareThisApp()
    @objc func moreApp()
    @objc func attempUpdate()
    @objc func restorePurchase()
}


final class StationsViewCell: UICollectionViewCell {
    
    weak var delegate: StationsViewCellDelegate? {
        didSet {
            guideButton.addTarget(delegate, action: .performGuidePage(), for: .touchUpInside)
            feedBackButton.addTarget(delegate, action: .presentMail(), for: .touchUpInside)
            recommandButton.addTarget(delegate, action: .recommand(), for: .touchUpInside)
            shareButton.addTarget(delegate, action: .shareThisApp(), for: .touchUpInside)
            moreAppsButton.addTarget(delegate, action: .moreApp(), for: .touchUpInside)
            dataUpdateButton.addTarget(delegate, action: .attempUpdate(), for: .touchUpInside)
        }
    }
    
    var stationData: (totle: Int, available: Int, hasFlags: Int, hasCheckins: Int) = (0, 0, 0, 0) {
        didSet {
            availableLabel.text = "\(NSLocalizedString("Opening:", comment: "")) \(stationData.available)"
            buildingLabel.text = "\(NSLocalizedString("Building:", comment: "")) \(stationData.totle - stationData.available)"
            haveBeenLabel.text = "\(NSLocalizedString("Have been:", comment: "")) \(stationData.hasFlags)"
            completedRatioLabel.text = "\(NSLocalizedString("Completed ratio:", comment: "")) \(completedPercentage)%"<commit_msg>modify station informations<commit_after>//
//  StationsViewCell.swift
//  GogoroMap
//
//  Created by 陳 冠禎 on 2017/8/11.
//  Copyright © 2017年 <NAME>. All rights reserved.
//

import UIKit
import StoreKit

typealias PurchaseFunc = (_ product: SKProduct) -> ()

@objc protocol StationsViewCellDelegate: class {
    @objc func performGuidePage()
    @objc func presentMail()
    @objc func recommand()
    @objc func shareThisApp()
    @objc func moreApp()
    @objc func attempUpdate()
    @objc func restorePurchase()
}


final class StationsViewCell: UICollectionViewCell {
    
    weak var delegate: StationsViewCellDelegate? {
        didSet {
            guideButton.addTarget(delegate, action: .performGuidePage(), for: .touchUpInside)
            feedBackButton.addTarget(delegate, action: .presentMail(), for: .touchUpInside)
            recommandButton.addTarget(delegate, action: .recommand(), for: .touchUpInside)
            shareButton.addTarget(delegate, action: .shareThisApp(), for: .touchUpInside)
            moreAppsButton.addTarget(delegate, action: .moreApp(), for: .touchUpInside)
            dataUpdateButton.addTarget(delegate, action: .attempUpdate(), for: .touchUpInside)
        }
    }
    
    var stationData: StationDatas = (0,0,0,0) {
        didSet {
            availableLabel.text = "\(NSLocalizedString("Opening:", comment: "")) \(stationData.available)"
            buildingLabel.text = "\(NSLocalizedString("Building:", comment: "")) \(stationData.total - stationData.available)"
            haveBeenLabel.text = "\(NSLocalizedString("Have been:", comment: "")) \(stationData.hasFlags)"
            completedRatioLabel.text = "\(NSLocalizedString("Completed ratio:", comment: "")) \(completedPercentage)%"
{'fraction_non_alphanumeric': 0.12911464245175935, 'fraction_numerical': 0.00851305334846765, 'mean_word_length': 3.3411330049261085, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7297603', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1029, 'n_words': 236}