Puzzle
final class Puzzle : Model, @unchecked Sendable
A Puzzle is a member of a hunt which has an answer. It may also have hints which are shown but not stored if
-
Declaration
Swift
static let schema: String
-
The puzzle’s ID.
Declaration
Swift
@Puzzle .ID var id: UUID? { get set }
-
The title of the puzzle.
Declaration
Swift
@Puzzle .Field var title: String { get set }
-
The body of the puzzle.
Declaration
Swift
@Puzzle .Field var body: String { get set }
-
The answer to the puzzle.
Declaration
Swift
@Puzzle .Field var answer: String { get set }
-
Strings that are not the answer, but which yield a helpful response. required, but can be empty.
Declaration
Swift
@Puzzle .Field var hints: [String : String] { get set }
-
The time at which the puzzle unlocks. If unset, treated as the dawn of time.
Declaration
Swift
@Puzzle .OptionalField var unlockTime: Date? { get set }
-
The Hunt to which the puzzle belongs.
Declaration
Swift
@Puzzle .Parent var hunt: Hunt { get set }
-
Attempts to answer the puzzle. But you’ll probably never load them in this direction.
Declaration
Swift
@Puzzle .Children var callIns: [PuzzleCallIn] { get set }
-
Declaration
Swift
init()
-
Initializes a new Hunt.
Declaration
Swift
init( hunt: Hunt, title: String, body: String, answer: String, hints: [String: String], unlockTime: Date? ) throws
Parameters
hunt
The hunt the puzzle belongs to
title
The title for the puzzle.
answer
The answer for the puzzle.
hints
a dictionary of hints