Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ComputerSolitaire.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
path = ComputerSolitaireUITests;
sourceTree = "<group>";
};
4B75C2002F1A233600761A12 /* Shared */ = {
isa = PBXFileSystemSynchronizedRootGroup;
path = Shared;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -89,6 +94,7 @@
isa = PBXGroup;
children = (
4B75C1D32F1A233400761A12 /* ComputerSolitaire */,
4B75C2002F1A233600761A12 /* Shared */,
4B75C1E52F1A233500761A12 /* ComputerSolitaireTests */,
4B75C1F22F1A233600761A12 /* ComputerSolitaireUITests */,
4B75C1D22F1A233400761A12 /* Products */,
Expand Down Expand Up @@ -122,6 +128,7 @@
);
fileSystemSynchronizedGroups = (
4B75C1D32F1A233400761A12 /* ComputerSolitaire */,
4B75C2002F1A233600761A12 /* Shared */,
);
name = ComputerSolitaire;
packageProductDependencies = (
Expand Down Expand Up @@ -168,6 +175,7 @@
);
fileSystemSynchronizedGroups = (
4B75C1F22F1A233600761A12 /* ComputerSolitaireUITests */,
4B75C2002F1A233600761A12 /* Shared */,
);
name = ComputerSolitaireUITests;
packageProductDependencies = (
Expand Down
24 changes: 1 addition & 23 deletions ComputerSolitaire/Fixtures/ScreenshotFixtures.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import Foundation

/// A staged mid-game board for App Store screenshots.
struct ScreenshotFixture: Identifiable, Hashable {
/// Bundle resource name of the `SavedGamePayload` JSON, and the screenshot
/// file name the capture UI test emits.
let name: String
/// Human-readable description of the board.
let title: String

var id: String { name }
}

/// Staged boards for App Store screenshots.
///
/// Launching with `-screenshotFixture <name>` restores the named board instead
Expand All @@ -28,18 +17,7 @@ enum ScreenshotFixtures {

/// Boards shipped in the app bundle; validated by `ScreenshotFixtureTests`.
/// One entry per App Store screenshot, in store order.
static let bundled: [ScreenshotFixture] = [
ScreenshotFixture(name: "klondike-draw3", title: "Klondike – Draw 3"),
ScreenshotFixture(name: "freecell", title: "FreeCell – fresh deal"),
ScreenshotFixture(name: "yukon", title: "Yukon – fresh deal"),
ScreenshotFixture(name: "spider", title: "Spider – 2 suits"),
ScreenshotFixture(name: "pyramid", title: "Pyramid – fresh deal"),
ScreenshotFixture(name: "tripeaks", title: "TriPeaks – fresh deal"),
ScreenshotFixture(name: "golf", title: "Golf – fresh deal"),
ScreenshotFixture(name: "fortythieves", title: "Forty Thieves – fresh deal"),
ScreenshotFixture(name: "scorpion", title: "Scorpion – fresh deal"),
ScreenshotFixture(name: "canfield", title: "Canfield – fresh deal")
]
static let bundled = ScreenshotFixtureCatalog.bundled

static func payloadFromLaunchArguments() -> SavedGamePayload? {
guard let name = value(after: launchArgument) else { return nil }
Expand Down
12 changes: 3 additions & 9 deletions ComputerSolitaireUITests/ScreenshotCaptureUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ import AppKit
/// the capture; the macOS leg (which snapshot doesn't support) runs this same
/// test via xcodebuild and collects the attachment instead.
final class ScreenshotCaptureUITests: XCTestCase {
/// Kept in sync with `ScreenshotFixtures.bundled` by hand: UI tests run in
/// a separate process and cannot import the app module. One board per App
/// Store screenshot, in store order.
private static let boards = [
"klondike-draw3",
"freecell",
"yukon",
"spider"
]
/// One board per App Store screenshot, in store order. The catalog source
/// is compiled into both targets because UI tests cannot import the app.
private static let boards = ScreenshotFixtureCatalog.bundled.map(\.name)

/// Appearance for every screenshot, pinned via UserDefaults launch
/// arguments so simulator state can't change the look between runs.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ Computer Solitaire is a fully native Solitaire app for iOS, iPadOS, and macOS.
## Features

- Fully native apps for iOS, iPadOS, and macOS
- Multiple game variants: **Klondike** (both 1-card and 3-card draw), **Spider** (1, 2, or 4 suits), **FreeCell**, **Pyramid**, **TriPeaks**, **Golf**, **Yukon**, **Scorpion**, **Forty Thieves**, and **Canfield**
- 10 game variants: **Klondike** (both 1-card and 3-card draw), **Spider** (1, 2, or 4 suits), **FreeCell**, **Pyramid**, **TriPeaks**, **Golf**, **Yukon**, **Scorpion**, **Forty Thieves**, and **Canfield**
- Solver-computed hints
- Game statistics for every variant
- Automatic game persistence and resume
- Customizable table appearance
- Customizable cards and table appearance
- Other things you enjoy

## Game Variants
Expand Down
25 changes: 25 additions & 0 deletions Shared/ScreenshotFixtureCatalog.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/// A staged board included in the App Store screenshot set.
struct ScreenshotFixture: Identifiable, Hashable {
/// Bundle resource name and emitted screenshot file name.
let name: String
/// Human-readable description of the staged board.
let title: String

var id: String { name }
}

/// The single ordered manifest shared by the app and screenshot UI tests.
enum ScreenshotFixtureCatalog {
static let bundled: [ScreenshotFixture] = [
ScreenshotFixture(name: "klondike-draw3", title: "Klondike – Draw 3"),
ScreenshotFixture(name: "freecell", title: "FreeCell"),
ScreenshotFixture(name: "yukon", title: "Yukon"),
ScreenshotFixture(name: "spider", title: "Spider – 2 suits"),
ScreenshotFixture(name: "pyramid", title: "Pyramid"),
ScreenshotFixture(name: "tripeaks", title: "TriPeaks"),
ScreenshotFixture(name: "golf", title: "Golf"),
ScreenshotFixture(name: "fortythieves", title: "Forty Thieves"),
ScreenshotFixture(name: "scorpion", title: "Scorpion"),
ScreenshotFixture(name: "canfield", title: "Canfield")
]
}
Binary file modified docs/screenshots/screen-grab-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshots/screen-grab-macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.