Adds PLO to game distribution

master
Laurent 6 years ago
parent f557dba652
commit 25890809d6
  1. 4
      TournamentStats.xcodeproj/project.pbxproj
  2. 11
      TournamentStats/report/Queries.swift
  3. 14
      TournamentStats/utils/Game.swift

@ -14,6 +14,7 @@
4D26A94D23152316001C98D2 /* FestivalStats.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D26A94C23152316001C98D2 /* FestivalStats.swift */; };
4D26A94F23152A1C001C98D2 /* StatCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4D26A94E23152A1C001C98D2 /* StatCollectionViewCell.xib */; };
4D26A95123152A6B001C98D2 /* StatCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D26A95023152A6B001C98D2 /* StatCollectionViewCell.swift */; };
4D26A95423156F6F001C98D2 /* Game.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D26A95323156F6F001C98D2 /* Game.swift */; };
4D2F1C4422CC92D1007C639E /* event81 in Resources */ = {isa = PBXBuildFile; fileRef = 4D2F1C2C22CC92CE007C639E /* event81 */; };
4D2F1C4522CC92D1007C639E /* event80 in Resources */ = {isa = PBXBuildFile; fileRef = 4D2F1C2D22CC92CE007C639E /* event80 */; };
4D2F1C4622CC92D1007C639E /* event76 in Resources */ = {isa = PBXBuildFile; fileRef = 4D2F1C2E22CC92CE007C639E /* event76 */; };
@ -163,6 +164,7 @@
4D26A94C23152316001C98D2 /* FestivalStats.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FestivalStats.swift; sourceTree = "<group>"; };
4D26A94E23152A1C001C98D2 /* StatCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StatCollectionViewCell.xib; sourceTree = "<group>"; };
4D26A95023152A6B001C98D2 /* StatCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatCollectionViewCell.swift; sourceTree = "<group>"; };
4D26A95323156F6F001C98D2 /* Game.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Game.swift; sourceTree = "<group>"; };
4D2F1C2C22CC92CE007C639E /* event81 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = event81; sourceTree = "<group>"; };
4D2F1C2D22CC92CE007C639E /* event80 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = event80; sourceTree = "<group>"; };
4D2F1C2E22CC92CE007C639E /* event76 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = event76; sourceTree = "<group>"; };
@ -526,6 +528,7 @@
children = (
4DF760C122A561FF004B0EF1 /* ColumnRepresentable.swift */,
4DF760BE22A560AA004B0EF1 /* FileWriter.swift */,
4D26A95323156F6F001C98D2 /* Game.swift */,
);
path = utils;
sourceTree = "<group>";
@ -798,6 +801,7 @@
4D39B6F122F829A500625E31 /* InfographyViewController.swift in Sources */,
4DF760B322A47CAE004B0EF1 /* Realm+Extensions.swift in Sources */,
4DF7608822A3FB96004B0EF1 /* DetailViewController.swift in Sources */,
4D26A95423156F6F001C98D2 /* Game.swift in Sources */,
4DF78DD122F9AADF00C02F73 /* TableView.swift in Sources */,
4D26A94D23152316001C98D2 /* FestivalStats.swift in Sources */,
4DF78DD622F9CE7E00C02F73 /* TitleLabel.swift in Sources */,

@ -278,13 +278,16 @@ class Queries {
let tournaments: Results<Tournament> = realm.objects(Tournament.self)
let holdem = DistributionCounter(name: "Hold'em")
let not = DistributionCounter(name: "Not Hold'em")
let games: [DistributionCounter] = [holdem, not]
let holdem = DistributionCounter(name: Game.holdem.rawValue)
let omaha = DistributionCounter(name: Game.omaha.rawValue)
let not = DistributionCounter(name: "Others")
let games: [DistributionCounter] = [holdem, omaha, not]
tournaments.forEach { tournament in
if tournament.name.contains("Hold'em") {
if tournament.name.contains(Game.holdem.rawValue) {
holdem.increment()
} else if tournament.name.contains(Game.omaha.rawValue) {
omaha.increment()
} else {
not.increment()
}

@ -0,0 +1,14 @@
//
// File.swift
// TournamentStats
//
// Created by Laurent Morvillier on 27/08/2019.
// Copyright © 2019 Stax River. All rights reserved.
//
import Foundation
enum Game : String {
case holdem = "Hold'em"
case omaha = "Pot-Limit Omaha"
}
Loading…
Cancel
Save