Skip to content

Commit

Permalink
Merge pull request #2 from mvirgo/more-old-brackets
Browse files Browse the repository at this point in the history
feat: Add old 2015 to 2019 brackets
  • Loading branch information
mvirgo authored Feb 25, 2023
2 parents 7bf532d + 9084643 commit 45617ad
Show file tree
Hide file tree
Showing 15 changed files with 2,122 additions and 65 deletions.
52 changes: 48 additions & 4 deletions foam-madness.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@
7AF31A862431267400DF1605 /* GameHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF31A852431267400DF1605 /* GameHelper.swift */; };
D14C59E927DED2FE001378F1 /* mensBracket2022.plist in Resources */ = {isa = PBXBuildFile; fileRef = D14C59E827DED2FE001378F1 /* mensBracket2022.plist */; };
D14C59EB27DED30F001378F1 /* womensBracket2022.plist in Resources */ = {isa = PBXBuildFile; fileRef = D14C59EA27DED30F001378F1 /* womensBracket2022.plist */; };
D1E16E1128334BB0007280EC /* bracketIndex.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E1028334BB0007280EC /* bracketIndex.plist */; };
D1E16E1C283354B0007280EC /* womensBracket2019.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E12283354B0007280EC /* womensBracket2019.plist */; };
D1E16E1D283354B0007280EC /* mensBracket2016.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E13283354B0007280EC /* mensBracket2016.plist */; };
D1E16E1E283354B0007280EC /* mensBracket2017.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E14283354B0007280EC /* mensBracket2017.plist */; };
D1E16E1F283354B0007280EC /* womensBracket2017.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E15283354B0007280EC /* womensBracket2017.plist */; };
D1E16E20283354B0007280EC /* womensBracket2015.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E16283354B0007280EC /* womensBracket2015.plist */; };
D1E16E21283354B0007280EC /* womensBracket2018.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E17283354B0007280EC /* womensBracket2018.plist */; };
D1E16E22283354B0007280EC /* mensBracket2015.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E18283354B0007280EC /* mensBracket2015.plist */; };
D1E16E23283354B0007280EC /* mensBracket2019.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E19283354B0007280EC /* mensBracket2019.plist */; };
D1E16E24283354B0007280EC /* mensBracket2018.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E1A283354B0007280EC /* mensBracket2018.plist */; };
D1E16E25283354B0007280EC /* womensBracket2016.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1E16E1B283354B0007280EC /* womensBracket2016.plist */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -88,6 +99,17 @@
7AF31A852431267400DF1605 /* GameHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameHelper.swift; sourceTree = "<group>"; };
D14C59E827DED2FE001378F1 /* mensBracket2022.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2022.plist; sourceTree = "<group>"; };
D14C59EA27DED30F001378F1 /* womensBracket2022.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2022.plist; sourceTree = "<group>"; };
D1E16E1028334BB0007280EC /* bracketIndex.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = bracketIndex.plist; sourceTree = "<group>"; };
D1E16E12283354B0007280EC /* womensBracket2019.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2019.plist; sourceTree = "<group>"; };
D1E16E13283354B0007280EC /* mensBracket2016.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2016.plist; sourceTree = "<group>"; };
D1E16E14283354B0007280EC /* mensBracket2017.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2017.plist; sourceTree = "<group>"; };
D1E16E15283354B0007280EC /* womensBracket2017.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2017.plist; sourceTree = "<group>"; };
D1E16E16283354B0007280EC /* womensBracket2015.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2015.plist; sourceTree = "<group>"; };
D1E16E17283354B0007280EC /* womensBracket2018.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2018.plist; sourceTree = "<group>"; };
D1E16E18283354B0007280EC /* mensBracket2015.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2015.plist; sourceTree = "<group>"; };
D1E16E19283354B0007280EC /* mensBracket2019.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2019.plist; sourceTree = "<group>"; };
D1E16E1A283354B0007280EC /* mensBracket2018.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = mensBracket2018.plist; sourceTree = "<group>"; };
D1E16E1B283354B0007280EC /* womensBracket2016.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = womensBracket2016.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -207,12 +229,23 @@
D14C59E627DECEC0001378F1 /* brackets */ = {
isa = PBXGroup;
children = (
D1E16E18283354B0007280EC /* mensBracket2015.plist */,
D1E16E13283354B0007280EC /* mensBracket2016.plist */,
D1E16E14283354B0007280EC /* mensBracket2017.plist */,
D1E16E1A283354B0007280EC /* mensBracket2018.plist */,
D1E16E19283354B0007280EC /* mensBracket2019.plist */,
D1E16E16283354B0007280EC /* womensBracket2015.plist */,
D1E16E1B283354B0007280EC /* womensBracket2016.plist */,
D1E16E15283354B0007280EC /* womensBracket2017.plist */,
D1E16E17283354B0007280EC /* womensBracket2018.plist */,
D1E16E12283354B0007280EC /* womensBracket2019.plist */,
D14C59EA27DED30F001378F1 /* womensBracket2022.plist */,
D14C59E827DED2FE001378F1 /* mensBracket2022.plist */,
7A916BD725EDE5D4007E8714 /* mensBracket2021.plist */,
7A916BD625EDE5D4007E8714 /* womensBracket2021.plist */,
7AEAB80A2433086C009E7CC1 /* bracketology2020.plist */,
7AECF9C7245E779E0037E126 /* womensBracketology2020.plist */,
D1E16E1028334BB0007280EC /* bracketIndex.plist */,
);
path = brackets;
sourceTree = "<group>";
Expand Down Expand Up @@ -284,17 +317,28 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D1E16E20283354B0007280EC /* womensBracket2015.plist in Resources */,
D1E16E1128334BB0007280EC /* bracketIndex.plist in Resources */,
7AEAB80B2433086C009E7CC1 /* teams.plist in Resources */,
7AECF9C8245E779E0037E126 /* womensBracketology2020.plist in Resources */,
7A2ECEF3242EDE930065E369 /* LaunchScreen.storyboard in Resources */,
D1E16E22283354B0007280EC /* mensBracket2015.plist in Resources */,
D1E16E21283354B0007280EC /* womensBracket2018.plist in Resources */,
D1E16E25283354B0007280EC /* womensBracket2016.plist in Resources */,
7A2ECEF0242EDE930065E369 /* Assets.xcassets in Resources */,
D1E16E23283354B0007280EC /* mensBracket2019.plist in Resources */,
7AD7BC1324315125006F0AF0 /* historicalProbabilities.plist in Resources */,
7A916BD925EDE5D5007E8714 /* mensBracket2021.plist in Resources */,
D1E16E1E283354B0007280EC /* mensBracket2017.plist in Resources */,
D1E16E1D283354B0007280EC /* mensBracket2016.plist in Resources */,
7AEAB80C2433086C009E7CC1 /* bracketology2020.plist in Resources */,
D14C59EB27DED30F001378F1 /* womensBracket2022.plist in Resources */,
7A2ECEEE242EDE920065E369 /* Main.storyboard in Resources */,
D1E16E1C283354B0007280EC /* womensBracket2019.plist in Resources */,
D14C59E927DED2FE001378F1 /* mensBracket2022.plist in Resources */,
D1E16E1F283354B0007280EC /* womensBracket2017.plist in Resources */,
7AEFD6672514704E007BB16B /* ABOUT.rtf in Resources */,
D1E16E24283354B0007280EC /* mensBracket2018.plist in Resources */,
7A1B9C9D245A9A22005B40D3 /* historicalProbabilitiesWomen.plist in Resources */,
7A916BD825EDE5D5007E8714 /* womensBracket2021.plist in Resources */,
);
Expand Down Expand Up @@ -481,15 +525,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = 5X3GA242G5;
INFOPLIST_FILE = "foam-madness/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.5;
MARKETING_VERSION = 1.6;
PRODUCT_BUNDLE_IDENTIFIER = "com.mvirgo.foam-madness";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -502,15 +546,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = 5X3GA242G5;
INFOPLIST_FILE = "foam-madness/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.5;
MARKETING_VERSION = 1.6;
PRODUCT_BUNDLE_IDENTIFIER = "com.mvirgo.foam-madness";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
18 changes: 8 additions & 10 deletions foam-madness/Controller/SelectInitialBracketViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ class SelectInitialBracketViewController: UITableViewController {
// MARK: Variables
var dataController: DataController!
var isSimulated: Bool!
var brackets: [Dictionary<String, String>] = []
var chosenBracketFile = ""
let brackets = ["2020 Joe Lunardi's Bracketology": "bracketology2020",
"2020 Womens - Charlie Creme's Bracketology": "womensBracketology2020",
"2021 Men's Bracket": "mensBracket2021",
"2021 Women's Bracket": "womensBracket2021",
"2022 Men's Bracket": "mensBracket2022",
"2022 Women's Bracket": "womensBracket2022"]
let bracketIndexFile = "bracketIndex"

// MARK: View functions
override func viewDidLoad() {
super.viewDidLoad()
// Add a page title
navigationItem.title = "Choose a Starting Bracket"
// Load the bracket index
let path = Bundle.main.path(forResource: bracketIndexFile, ofType: "plist")!
brackets = NSArray(contentsOfFile: path) as! [Dictionary<String, String>]
}

// MARK: Table View functionality
Expand All @@ -36,17 +35,16 @@ class SelectInitialBracketViewController: UITableViewController {
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "bracketCell", for: indexPath)
// Return in reverse sorted order (more recent years first)
let bracket = Array(brackets.keys.sorted().reversed())[(indexPath as NSIndexPath).row]
let bracketText = brackets.reversed()[(indexPath as NSIndexPath).row].first?.value

// Set the cell details
cell.textLabel?.text = bracket
cell.textLabel?.text = bracketText

return cell
}

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let bracket = Array(brackets.keys.sorted().reversed())[(indexPath as NSIndexPath).row]
chosenBracketFile = brackets[bracket]!
chosenBracketFile = brackets.reversed()[(indexPath as NSIndexPath).row].first!.key
// Segue to bracket creation screen
performSegue(withIdentifier: "createBracket", sender: nil)
}
Expand Down
70 changes: 70 additions & 0 deletions foam-madness/brackets/bracketIndex.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>mensBracket2015</key>
<string>2015 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2015</key>
<string>2015 Women&apos;s Bracket</string>
</dict>
<dict>
<key>mensBracket2016</key>
<string>2016 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2016</key>
<string>2016 Women&apos;s Bracket</string>
</dict>
<dict>
<key>mensBracket2017</key>
<string>2017 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2017</key>
<string>2017 Women&apos;s Bracket</string>
</dict>
<dict>
<key>mensBracket2018</key>
<string>2018 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2018</key>
<string>2018 Women&apos;s Bracket</string>
</dict>
<dict>
<key>mensBracket2019</key>
<string>2019 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2019</key>
<string>2019 Women&apos;s Bracket</string>
</dict>
<dict>
<key>bracketology2020</key>
<string>2020 Joe Lunardi&apos;s Bracketology</string>
</dict>
<dict>
<key>womensBracketology2020</key>
<string>2020 Womens - Charlie Creme&apos;s Bracketology</string>
</dict>
<dict>
<key>mensBracket2021</key>
<string>2021 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2021</key>
<string>2021 Women&apos;s Bracket</string>
</dict>
<dict>
<key>mensBracket2022</key>
<string>2022 Men&apos;s Bracket</string>
</dict>
<dict>
<key>womensBracket2022</key>
<string>2022 Women&apos;s Bracket</string>
</dict>
</array>
</plist>
Loading

0 comments on commit 45617ad

Please sign in to comment.