You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
512 B
28 lines
512 B
//
|
|
// ChipCount.swift
|
|
// TournamentStats
|
|
//
|
|
// Created by Laurent Morvillier on 27/06/2019.
|
|
// Copyright © 2019 Stax River. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct ChipCountManager {
|
|
|
|
var chipCounts: [ChipCount]
|
|
var totalChips: Double
|
|
|
|
}
|
|
|
|
struct ChipCount {
|
|
|
|
var player: String
|
|
var chips: Double
|
|
|
|
func percentage(totalChips: Double) -> String {
|
|
let percentage = self.chips / totalChips * 100
|
|
return String(format: "%.1f%", percentage)
|
|
}
|
|
|
|
}
|
|
|