From 040ad2d1fa5f8c07750224175a532387fcdfa113 Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Tue, 1 Dec 2026 00:56:28 +0300 Subject: [PATCH] ios: add initial iPhone SwiftUI slice --- crates/mobile-api/uniffi.toml | 6 + docs/decisions.md | 8 + docs/design/iphone-app.md | 465 + docs/dev/tasks.md | 3 +- docs/qa/iphone-fixes.md | 111 + docs/qa/iphone-structural.md | 477 + iosApp/.gitignore | 9 + iosApp/ChessPenguin/AppModel.swift | 140 + iosApp/ChessPenguin/BoardAnnotations.swift | 95 + iosApp/ChessPenguin/BoardView.swift | 253 + iosApp/ChessPenguin/ChessPenguinApp.swift | 34 + iosApp/ChessPenguin/GameCommands.swift | 30 + iosApp/ChessPenguin/GameLoadState.swift | 53 + iosApp/ChessPenguin/GameView.swift | 346 + iosApp/ChessPenguin/LibraryViews.swift | 191 + iosApp/ChessPenguin/NotationModel.swift | 264 + iosApp/ChessPenguin/NotationView.swift | 221 + .../Resources/Pieces.xcassets/Contents.json | 3 + .../Pieces.xcassets/bB.imageset/Contents.json | 6 + .../Pieces.xcassets/bB.imageset/bB.png | Bin 0 -> 4578 bytes .../Pieces.xcassets/bK.imageset/Contents.json | 6 + .../Pieces.xcassets/bK.imageset/bK.png | Bin 0 -> 9883 bytes .../Pieces.xcassets/bN.imageset/Contents.json | 6 + .../Pieces.xcassets/bN.imageset/bN.png | Bin 0 -> 6896 bytes .../Pieces.xcassets/bP.imageset/Contents.json | 6 + .../Pieces.xcassets/bP.imageset/bP.png | Bin 0 -> 2865 bytes .../Pieces.xcassets/bQ.imageset/Contents.json | 6 + .../Pieces.xcassets/bQ.imageset/bQ.png | Bin 0 -> 9028 bytes .../Pieces.xcassets/bR.imageset/Contents.json | 6 + .../Pieces.xcassets/bR.imageset/bR.png | Bin 0 -> 2466 bytes .../Pieces.xcassets/wB.imageset/Contents.json | 6 + .../Pieces.xcassets/wB.imageset/wB.png | Bin 0 -> 7376 bytes .../Pieces.xcassets/wK.imageset/Contents.json | 6 + .../Pieces.xcassets/wK.imageset/wK.png | Bin 0 -> 8759 bytes .../Pieces.xcassets/wN.imageset/Contents.json | 6 + .../Pieces.xcassets/wN.imageset/wN.png | Bin 0 -> 8134 bytes .../Pieces.xcassets/wP.imageset/Contents.json | 6 + .../Pieces.xcassets/wP.imageset/wP.png | Bin 0 -> 5167 bytes .../Pieces.xcassets/wQ.imageset/Contents.json | 6 + .../Pieces.xcassets/wQ.imageset/wQ.png | Bin 0 -> 10736 bytes .../Pieces.xcassets/wR.imageset/Contents.json | 6 + .../Pieces.xcassets/wR.imageset/wR.png | Bin 0 -> 2480 bytes .../Resources/THIRD_PARTY_NOTICES.txt | 11 + iosApp/ChessPenguin/Resources/classics.pgn | 2012 ++++ .../Resources/en.lproj/Localizable.strings | 35 + .../en.lproj/Localizable.stringsdict | 17 + .../Resources/ru.lproj/Localizable.strings | 35 + .../ru.lproj/Localizable.stringsdict | 19 + iosApp/ChessPenguin/SharedViews.swift | 113 + iosApp/ChessPenguin/Theme.swift | 81 + .../ChessPenguinTests/BoardModelTests.swift | 52 + .../GameLoadStateTests.swift | 114 + .../KeyboardAccessibilityTests.swift | 39 + .../NotationModelTests.swift | 71 + iosApp/ChessPenguinTests/TestSupport.swift | 47 + iosApp/Generated/.gitattributes | 3 + iosApp/Generated/MobileAPI/MobileAPI.swift | 8614 +++++++++++++++++ iosApp/Generated/MobileAPI/MobileAPIFFI.h | 1708 ++++ .../MobileAPI/MobileAPIFFI.modulemap | 9 + iosApp/Generated/MobileAPI/module.modulemap | 9 + iosApp/README.md | 81 + iosApp/project.yml | 48 + iosApp/scripts/build-bindings.sh | 95 + 63 files changed, 15993 insertions(+), 1 deletion(-) create mode 100644 docs/design/iphone-app.md create mode 100644 docs/qa/iphone-fixes.md create mode 100644 docs/qa/iphone-structural.md create mode 100644 iosApp/.gitignore create mode 100644 iosApp/ChessPenguin/AppModel.swift create mode 100644 iosApp/ChessPenguin/BoardAnnotations.swift create mode 100644 iosApp/ChessPenguin/BoardView.swift create mode 100644 iosApp/ChessPenguin/ChessPenguinApp.swift create mode 100644 iosApp/ChessPenguin/GameCommands.swift create mode 100644 iosApp/ChessPenguin/GameLoadState.swift create mode 100644 iosApp/ChessPenguin/GameView.swift create mode 100644 iosApp/ChessPenguin/LibraryViews.swift create mode 100644 iosApp/ChessPenguin/NotationModel.swift create mode 100644 iosApp/ChessPenguin/NotationView.swift create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/bB.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bK.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bK.imageset/bK.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/bN.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bP.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bP.imageset/bP.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/bQ.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bR.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/bR.imageset/bR.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/wB.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/wK.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wN.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wN.imageset/wN.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wP.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wP.imageset/wP.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/wQ.png create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wR.imageset/Contents.json create mode 100644 iosApp/ChessPenguin/Resources/Pieces.xcassets/wR.imageset/wR.png create mode 100644 iosApp/ChessPenguin/Resources/THIRD_PARTY_NOTICES.txt create mode 100644 iosApp/ChessPenguin/Resources/classics.pgn create mode 100644 iosApp/ChessPenguin/Resources/en.lproj/Localizable.strings create mode 100644 iosApp/ChessPenguin/Resources/en.lproj/Localizable.stringsdict create mode 100644 iosApp/ChessPenguin/Resources/ru.lproj/Localizable.strings create mode 100644 iosApp/ChessPenguin/Resources/ru.lproj/Localizable.stringsdict create mode 100644 iosApp/ChessPenguin/SharedViews.swift create mode 100644 iosApp/ChessPenguin/Theme.swift create mode 100644 iosApp/ChessPenguinTests/BoardModelTests.swift create mode 100644 iosApp/ChessPenguinTests/GameLoadStateTests.swift create mode 100644 iosApp/ChessPenguinTests/KeyboardAccessibilityTests.swift create mode 100644 iosApp/ChessPenguinTests/NotationModelTests.swift create mode 100644 iosApp/ChessPenguinTests/TestSupport.swift create mode 100644 iosApp/Generated/.gitattributes create mode 100644 iosApp/Generated/MobileAPI/MobileAPI.swift create mode 100644 iosApp/Generated/MobileAPI/MobileAPIFFI.h create mode 100644 iosApp/Generated/MobileAPI/MobileAPIFFI.modulemap create mode 100644 iosApp/Generated/MobileAPI/module.modulemap create mode 100644 iosApp/README.md create mode 100644 iosApp/project.yml create mode 100755 iosApp/scripts/build-bindings.sh diff --git a/crates/mobile-api/uniffi.toml b/crates/mobile-api/uniffi.toml index 72d3319..2d84624 100644 --- a/crates/mobile-api/uniffi.toml +++ b/crates/mobile-api/uniffi.toml @@ -1,3 +1,9 @@ # Kotlin bindings for Android: the cleaner of the system on Android 13+, JNA before. [bindings.kotlin] android = true + +# Swift bindings for the iPhone app (iosApp/scripts/build-bindings.sh). +[bindings.swift] +module_name = "MobileAPI" +ffi_module_name = "MobileAPIFFI" +link_frameworks = ["CoreFoundation", "IOKit"] diff --git a/docs/decisions.md b/docs/decisions.md index 4ca09b8..0c6e002 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -566,6 +566,14 @@ PGN для точного выбора пометок, минимальная г Владелец уточнил: подготовка строится от его стороны против выбранного соперника. Поэтому соперник белыми означает чёрные внизу (`flipped = true`), соперник чёрными — белые внизу (`flipped = false`). Прежняя реализация с цветом соперника вниз была неверной интерпретацией и исправлена. Ручной переворот доски остаётся доступным; обе стартовые ориентации и ручной flip проверены на эмуляторе и приняты независимым ревью (`docs/qa/android-prep-orientation.md`). +## iPhone: начало iOS-версии (2026-11-30) + +Владелец поручил создать проект под iOS и начать с iPhone по образу Android. Это отменяет прежнюю отсрочку задачи 7. iPad не входит в текущий этап: его решение и интерфейс будут сделаны отдельной командой позже и будут ближе к desktop. + +Первый проверяемый срез — `iosApp/` на SwiftUI с общей `mobile-api` через UniFFI: открытие комплектной PGN-базы, список баз и партий, доска с навигацией и переворотом. Движок, игра, редактирование и Stockfish в этот срез не входят. Сборка/приёмка на iPhone Simulator обязательна на macOS/Xcode; генерация Swift-биндингов и доступные Rust-проверки на Linux не заменяют её. + +2026-12-01 владелец решил пока держать iOS в отдельной ветке `feature/iphone-app` и опубликовать её только в Forgejo (`origin`). В `main` и GitHub без отдельного решения не переносим. + ## Android: список игроков с плоскими строками (2026-11-29) Владелец выбрал улучшенный экран Players по варианту B+: плоские строки 72 dp вместо двух плашек White/Black у каждого игрока. Если ненулевой цвет один, касание строки сразу открывает подготовку этим цветом; если доступны оба, открывается короткий лист с двумя действиями по 64 dp и без дополнительного подтверждения. Нулевой цвет остаётся видимым текстом, но не отдельной disabled-кнопкой. Поиск, точные имена, счётчики и возврат в подготовку сохраняются. Проект — `docs/design/android-players-improvement.md`. По ремарке владельца 2026-11-29 лист озаглавлен «Подготовиться к %1$s» (без двоеточия), действия названы «Против белых» и «Против чёрных», чтобы цвет не читался как цвет самого пользователя (`docs/qa/android-color-sheet-wording.md`). diff --git a/docs/design/iphone-app.md b/docs/design/iphone-app.md new file mode 100644 index 0000000..e39e37d --- /dev/null +++ b/docs/design/iphone-app.md @@ -0,0 +1,465 @@ +# ChessPenguin для iPhone: первый технический срез + +Дата: 2026-11-30. Статус: спецификация дизайнера для реализации; приложение и приёмка на iPhone Simulator ещё не выполнялись. Изменяется только этот документ. + +Основание — решение владельца в `docs/decisions.md` «iPhone: начало iOS-версии» и задача 7 в `docs/dev/tasks.md`: `iosApp/`, SwiftUI, iOS 16+, общий `crates/mobile-api` через UniFFI, комплектная PGN-база, цепочка «Базы → Партии → Партия», доска с навигацией, переворотом и long press. **iPad, игра с компьютером, play, редактор, импорт, Stockfish, живой Engine и Review в этот срез не входят.** Отдельной светлой темы в срезе нет. + +## 0. Задача и границы + +**Задача среза одной фразой:** на iPhone открыть комплектную базу и спокойно читать аннотированную партию — сначала людей и результат, затем доску, ходы, комментарии и ветки. + +Первый экран доказывает полный путь, а не набор заглушек: + +```text +Комплектная PGN → список баз → список партий → доска и нотация +``` + +В срез входят: + +- одна комплектная база `examples/classics.pgn` в списке баз; архитектура списка не привязана к одному элементу; +- список её партий, полные имена игроков, Elo, результат, событие, год и ECO; +- предыдущая/следующая партия в том же порядке списка; +- только просмотр дерева `GameData`: начальная позиция, ход назад/вперёд, переход по касанию SAN, развилки, переворот; +- основная линия, комментарии, NAG, варианты и результат; +- тёмная мобильная тема Android, safe area, Dynamic Type, VoiceOver и базовая поддержка аппаратной клавиатуры. + +Не показывать и не делать доступными через accessibility-tree: + +- **Engine и Review: ни кнопок, ни пустых слотов, ни пунктов меню, ни надписей «скоро»**. Они появятся только вместе с работающей реализацией на следующем этапе; +- Play/New game, настройки, добавление/переименование/удаление базы, Players/подготовку; +- поиск, сортировку, фильтры и быстрый бегунок — для небольшой комплектной базы они не нужны для проверки среза; +- копирование, Share, редактирование тегов/ходов/комментариев, сохранение и любые диалоги несохранённых изменений; +- специальную раскладку iPad. Первый срез ограничен портретной ориентацией iPhone; это не решение для будущего продукта на iPad. + +Если действие не реализовано, его визуального и семантического placeholder нет. Пустое место специально под будущие кнопки тоже не резервируется. + +## 1. Что проверено в материалах + +Просмотрены сами изображения, а не только имена файлов. + +| Материал | Что подтверждено визуально | Что переносим | +|---|---|---| +| `website/shots/raw/phone/01-home.png` | Тёмный фон, синие подписи групп, карточки баз с цветной плашкой формата 40 dp, название и число партий в двух строках | Спокойная полка баз без dashboard-стилистики. Play, FAB и меню снимка не входят в срез | +| `website/shots/raw/phone/02-games.png` | Плотный вертикальный список; номер на поле слева, белые и чёрные на отдельных строках, кружки сторон, синяя плашка победителя, тонкий разделитель, событие · год и ECO справа | Структура строки 80 dp и приоритет «игроки → результат → контекст» | +| `website/shots/raw/phone/03-game.png` | Две строки заголовка; чёрные над доской, белые под ней; доска во всю ширину; комментарий как отдельный блок; вариант с вертикальной линией; текущий `Nc3` выделен синим | Компоновка партии и чтение аннотаций. На снимке старая нижняя панель с ⏮/⏭ | +| `docs/screenshots/android.jpg` | Та же система на четырёх экранах Android рядом: список, партия, настройка игры и выбор соперника | Только первые два предметных экрана; игровые экраны не являются объёмом среза | +| `docs/screenshots/library.png`, `docs/screenshots/game.png` | Общие с Android тёмный фон, синее выделение, зелёная доска, блоки комментариев и вариантов | Общий визуальный род продукта; настольная компоновка не копируется на телефон | +| `designExample/reference.png`, `список баз и партий выбранной базы.png`, `списко партий.png`, `доска.png`, `панель ходов с коментариями.png`, `панель ходов с ответвлениями.png` | Исходный смысл данных: список партий, доска, табличная основная линия и варианты сплошным текстом | Предметная иерархия, а не оформление стороннего ChessBase и не его ресурсы | + +Проверен актуальный Compose, не только старые проектные документы: + +- `Navigation.kt`: `Databases → Games(db) → GameAt(db, place, query)`; соседняя партия меняет `place`, а не наращивает стек; +- `DatabasesScreen.kt`, `Common.kt`: строка базы 72 dp, плашка 40 dp, карточки групп с полями 12 dp и зазором 2 dp; +- `GamesScreen.kt`: строка 80 dp, постраничное чтение `GameRow`, последняя открытая строка отмечается отдельно; +- `GameScreen.kt`: плашки игроков 36 dp, доска во всю ширину, нотация под ней, панель 72 dp; +- `Notation.kt`: основная линия в две колонки, комментарии и варианты полноширинными блоками, текущий узел по `id`, а не по номеру строки; +- `Board.kt`, `BoardStyle.kt`: квадратная Canvas, координаты внутри клеток, последний ход, Merida и зелёная доска; +- `theme/Color.kt`, `Type.kt`: действующие RGB-токены ниже; +- `crates/mobile-api/src/lib.rs`: `GameRow`, `Tag`, `MoveNode`, `GameData`, `Database.rows/rowsOf/game`; для отображения не нужен второй шахматный движок в Swift. + +**Расхождение снимка и текущего Android.** В `03-game.png` шесть слотов: Engine, Flip, ⏮, ◀, ▶, ⏭. В актуальном `GameScreen.kt` и решении 2.5.2 пять: Engine, Flip, ◀, ▶, Review; удержание ◀/▶ заменяет отдельные ⏮/⏭. Для iPhone берём актуальную модель взаимодействия, но в первом срезе оставляем только реально работающие **Flip, ◀, ▶**. + +## 2. Пользовательский путь и сохранение контекста + +### 2.1. Навигация SwiftUI + +```text +NavigationStack + DatabaseListRoute + └─ GamesRoute(databaseID) + └─ GameRoute(databaseID, place) +``` + +- `NavigationStack` и value-based `NavigationLink`; не три независимых полноэкранных cover. +- Холодный запуск всегда показывает «Базы». При обычном уходе приложения в фон и возврате текущий стек, узел и ориентация доски сохраняются. +- Назад: «Партия → Партии → Базы». Системный edge-swipe и стандартный chevron назад делают одно и то же. +- ‹ › вверху партии меняют `place` внутри существующего `GameRoute`; стек не растёт. Новая партия открывается в узле `0`, переворот сохраняется. +- После возвращения в «Партии» сохраняются порядок и прокрутка. Последняя открытая партия, включая открытую через ‹ ›, видима и отмечена на время этого посещения списка. +- Повторное открытие партии из списка начинается с исходной позиции. Возврат из фона — не повторное открытие: текущий узел не сбрасывается. +- Отдельного preview движка в срезе нет, поэтому нет и особого выхода из PV. Не имитировать его ради будущего Engine. + +### 2.2. Модель состояния + +- `LibraryStore`, `GamesStore`, `GameStore` — `@MainActor ObservableObject`; тяжёлые вызовы Rust выполняет actor/repository вне главного потока. +- В `GamesStore`: стабильный `databaseID`, порядок индексов партий, `lastOpenedPlace`, состояние прокрутки. +- В `GameStore`: `GameData`, `currentNodeID`, `flipped`, `place`; идентичность позиции — **`MoveNode.id`**, не номер видимой строки и не SAN. +- Запросы списка и партии имеют generation/token. Поздний ответ прежней базы или прежнего `place` не может заменить новый экран. +- `GameData` загружается только для открытой партии. Список читает `GameRow` страницами по 100 (`rows` или `rowsOf`), не разбирает все партии заранее. + +## 3. Маппинг Compose → SwiftUI + +| Android Compose | SwiftUI на iOS 16 | Требование | +|---|---|---| +| `MainNavigation`, `NavDisplay` | `NavigationStack`, enum `Route: Hashable` | Один стек и системный назад | +| `Scaffold`, `TopAppBar` | `.navigationBarTitleDisplayMode(.inline)`, `ToolbarItem`, `.toolbarBackground(CP.surface, for: .navigationBar)` | Не использовать крупный iOS-заголовок 34 pt; сохранить компактность Android | +| `LazyColumn` баз и партий | `List` с собственными row-view и скрытыми системными separators/background | Не полагаться на него как на доказательство виртуализации: paging `GameRow` и профиль памяти обязательны отдельно | +| `KindBadge` | `ZStack` + `RoundedRectangle(cornerRadius: 10)` + `Text("PGN")` | 40×40 pt, те же RGB | +| `GameRowView` | Один `Button` с `GameRowContent`; `.buttonStyle(.plain)` | Вся строка нажимается; номер, кружки и ECO не становятся отдельными кнопками | +| `PlayerLine`, `SideDisc`, `ResultTile` | Общие `PlayerLineView`, `SideDisc`, `ResultTile` | Одно правило в списке и у доски | +| `Board` на `Canvas` | `Canvas` для клеток, подсветки, координат, стрелок и меток; `Image` для 12 фигур Merida | Размеры в pt, рендер с учётом `displayScale`; никакого hit testing фигур в read-only | +| `Notation`, `MovesRow`, `MoveCell` | `ScrollViewReader` + `LazyVStack`; `MoveRowView`, отдельный `Button` для каждого хода | `scrollTo(id)` по `MoveNode.id`, не по индексу `LazyVStack` | +| `variationText` с link annotations | Не один псевдоинтерактивный `Text`: собственный `Layout` для переноса токенов, где ход — отдельный `Button`, текст — `Text` | На iOS 16 не обещать hit testing фрагментов одного `Text`; перенос и VoiceOver проверяются на Simulator | +| `Forks` | Горизонтальный `ScrollView` + `HStack` кнопок-чипов | Первый child — продолжение текущей линии | +| `bottomBar`, `navigationBarsPadding` | `.safeAreaInset(edge: .bottom, spacing: 0)` с собственной панелью 72 pt | Кнопки выше home indicator; фон продолжается до нижнего края | +| `MaterialTheme.colorScheme` | `CPColor` semantic tokens в Asset Catalog или Swift extension | Не подменять палитру `Color(uiColor: .systemBackground)` | +| `displaySan` | Общий Swift formatter только отображения | В срезе Latin SAN; данные Rust не меняются | + +Для фигур использовать уже проверенные `apps/desktop/assets/pieces/merida/{w,b}{K,Q,R,B,N,P}.svg`; происхождение — Armando Hernandez Marroquin, GPLv2+, зафиксировано в `THIRD_PARTY_NOTICES.md`. Способ упаковки выбирает разработчик после визуальной проверки всех 12 SVG в Xcode (Asset Catalog SVG либо воспроизводимая конвертация в векторные PDF). Не скачивать другой набор и не копировать ресурсы неизвестного происхождения. Лицензия и сами исходники идут в bundle так же осмысленно, как в Android. + +## 4. Визуальные токены + +### 4.1. Только тёмная тема + +Корень получает `.preferredColorScheme(.dark)`; launch screen и фон за navigation bar тоже `#161718`, чтобы не было белой вспышки. Текст status bar светлый. + +| Роль | HEX | +|---|---| +| `background`, `surface` | `#161718` | +| `surfaceContainerLow` — карточки баз, комментарии | `#1F2022` | +| `surfaceContainer` — нижняя панель, последняя открытая строка | `#232427` | +| `surfaceContainerHigh` — плашка ничьей и результата в конце | `#2A2C2F` | +| `onSurface` | `#E8E8E8` | +| `onSurfaceVariant` | `#A3A7AD` | +| `outline` | `#4A4D52` | +| `outlineVariant` | `#2E3033` | +| `primary` | `#62AEE6` | +| `onPrimary` | `#0B2A40` | +| `primaryContainer` | `#1A4566` | +| `onPrimaryContainer` | `#D6E8F6` | +| `error` / `errorContainer` | `#F28B82` / `#5C1A14` | +| текущий ход | `#005C80`, текст `onSurface`, скругление 6 pt | +| комментарий | `#9EC4E0` | +| последний ход на доске | `#9BC700`, alpha `0x69` | +| светлая / тёмная клетка Green | `#FFFFDD` / `#86A666` | +| PGN badge: фон / текст | `#384660` / `#89B4FA` | +| кружок белых / чёрных | `#FFFFFF` / `#0E0F10`, кольцо 1 pt `onSurfaceVariant` | + +NAG берёт действующие Android-значения, не старую таблицу из общего desktop-документа: + +| NAG | `!` | `?` | `!!` | `??` | `!?` | `?!` | +|---|---|---|---|---|---|---| +| Цвет | `#81B64C` | `#FFA459` | `#26C2A3` | `#FA412D` | `#EA45D8` | `#56B4E9` | + +На выделенном ходе NAG становится `onSurface`: цветной знак на синей заливке не используется как единственный носитель смысла. Disabled — `onSurface` с alpha 0,38; позиция кнопки при этом не меняется. + +Никаких градиентов, теней карточек, фоновых изображений, декоративных KPI и новых цветных контейнеров. Фактура возможна только у доски, но в первом срезе используется плоская Green. + +### 4.2. Типографика + +Системный шрифт Apple, без встраивания Roboto/Ubuntu. Значения ниже — **размеры по умолчанию в pt**, не фиксированные пиксели. Для ролей используются Dynamic-Type-relative стили; где нужны точные 14/15/17 pt — `@ScaledMetric(relativeTo:)` или эквивалентный проверенный modifier. Один только `Font.system(size:)` без проверки масштабирования не считается реализацией Dynamic Type. + +| Роль | Размер/leading по умолчанию | Насыщенность | +|---|---:|---| +| Заголовок «ChessPenguin», пустое состояние | 22/28 | regular | +| Заголовок партии | 16/20 | medium | +| Имя базы, игрок в списке | 16/24 | regular; победитель medium | +| Вторая строка, Elo, подробности | 14/20 | regular | +| Кнопки/чипы | 14/20 | medium | +| Номер партии, ECO, маленькая подпись | 12/16 | medium у ECO | +| Ход основной линии | 17/24 | bold | +| Номер хода | 15/24 | regular | +| Комментарий | 15/22 | regular | +| Вариант | 15/28 | regular | +| Координаты доски | 10/12 | medium | + +Числа, счётчики, Elo, результат и номера — `.monospacedDigit()`. Имя сначала полное из PGN; если не помещается — `Surname F. I.` по правилу Android `shortName`; только затем многоточие. VoiceOver всегда получает полное имя. + +## 5. Экраны и геометрия + +Сетка 4 pt: 4, 8, 12, 16, 24, 32. Обычные цели касания не меньше 44×44 pt; у Android-эталона 48 dp, поэтому здесь основные кнопки также делаем не уже 48 pt, где позволяет ширина. + +### 5.1. «Базы» + +**Задача экрана:** выбрать источник партий; главная информация — имя базы, формат и число партий. + +```text +┌──────────────────────────────────────┐ +│ ChessPenguin │ navigation bar 44 +├──────────────────────────────────────┤ +│ Файлы │ 48 +│ ┌──────────────────────────────────┐ │ +│ │ [PGN] Classic games │ │ 72 +│ │ 100 games · PGN │ │ +│ └──────────────────────────────────┘ │ +└──────────────────────────────────────┘ +``` + +- Заголовок только `ChessPenguin`; шестерёнки нет. +- Заголовок группы «Файлы» слева 16 pt, `primary`, 14 pt medium. «+ Добавить» отсутствует. +- Карточка: поля экрана 12 pt, фон `surfaceContainerLow`. У единственной базы все углы 16 pt; у группы внешние 16, соседние 4, зазор 2 pt. +- Строка 72 pt: 12 pt до badge, badge 40×40, 12 pt до текста. Название 16/24 одной строкой с многоточием; под ним «100 партий · PGN», 14/20. Число — medium `onSurface`, остальное — `onSurfaceVariant`. +- Справа стандартный тонкий `chevron.right` `onSurfaceVariant`, поскольку строка ведёт глубже; меню ⋮ нет. Вся строка — одна кнопка, а не только chevron. +- Подпись второй строки занимает место и во время чтения: появление числа не меняет высоту строки. +- Нажатие открывает «Партии». Long press ничего не открывает. + +Пустая отладочная/аварийная библиотека: пингвин 96 pt, «Здесь будут ваши базы», пояснение и одна работающая кнопка «Открыть примеры партий», которая повторно загружает комплектный PGN. Кнопки импорта нет. + +### 5.2. «Партии» + +**Задача экрана:** найти нужную партию по людям и результату; плотность важнее декоративных карточек. + +Верхняя панель: стандартный назад, название базы одной строкой и под ним «100 партий». Поиск, Players и меню не показываются. + +```text +16 │ № │12│●│8│ Morphy, Paul │8│[1]│16 + │ │ │○│ │ Duke Karl / Count Isouard │ │ 0 │ + │ │ │ │ Paris Opera · 1858 │8│C41│ + └───┴──┴──┴────────────────────────────────────── +``` + +Геометрия обычной строки: + +- **80 pt = 6 + 24 + 24 + 20 + 6**; при Dynamic Type растёт по реальному leading. +- Номер — фактический номер записи PGN (`GameRow.index + 1`), не место после будущей фильтрации. Колонка единой ширины по самому большому номеру базы; выравнивание вправо, baseline белых. После неё 12 pt. +- Кружок стороны 8 pt, после него 8 pt. Имя и Elo занимают оставшуюся ширину, результат — отдельная колонка минимум 24 pt. +- Результат: у победителя `1` в плашке минимум 24×20, радиус 6, `primaryContainer/onPrimaryContainer`; проигрыш `0` без плашки; ничья `½` у обоих на `surfaceContainerHigh`; `*` — пустая колонка той же ширины. +- Подробности начинаются под именем, через 16 pt после кружка. «Событие · год» обрезается раньше ECO. ECO — отдельная рамка минимум 32×16, радиус 4, 1 pt `outline`, поля 4 pt. +- Разделитель 1 pt `outlineVariant` по низу, от колонки кружков до 16 pt справа. У последней строки нет. +- Этюд с названием в `White` и без `Black`: название занимает две строки, кружков сторон нет; высота не скачет. +- Заглушка страницы повторяет все три строки и разделитель той же высоты; пустой прозрачный прямоугольник заглушкой не считается. + +Последняя открытая строка отличается от **текущей позиции в партии**: фон `surfaceContainer` и левая полоса 3 pt `primary`, VoiceOver добавляет «Открыта последней». Нажатие снова открывает её с исходной позиции. + +### 5.3. «Партия» + +**Задача экрана:** доска и чтение аннотированной линии; игроки и результат остаются видны у самой доски, а навигация — под большим пальцем. + +#### Портретная компоновка + +```text +┌──────────────────────────────────────┐ +│ ← Paris Opera · 1858 ‹ › │ navigation bar 44 +│ 7 of 100 │ +│ ○ Duke Karl / Count Isouard 0 │ 36 +│ │ +│ ДОСКА W × W │ W = ширина экрана +│ │ +│ ● Morphy, Paul 1 │ 36 +│ 7 … Qe7 │ +│ 8 [Nc3] │ нотация, оставшаяся высота +│ ┌ Morphy prefers development… ┐ │ +│ │ 8.Qxb7 Qb4+ … only trades queens.│ │ +├──────────────────────────────────────┤ +│ ⇅ ◀ ▶ │ 72 + bottom safe area +└──────────────────────────────────────┘ +``` + +- Заголовок: `Event · year`, fallback `Site`, затем имя базы. Вторая строка — `N из M`, затем тур, если он известен. Заголовок не является кнопкой «Сведения»: такого экрана в срезе нет. +- Справа только тонкие ‹ › предыдущей/следующей партии, каждая цель не меньше 44×44. Меню ⋮ нет. На первой/последней партии соответствующая кнопка disabled и остаётся на месте. +- Плашка игрока: минимум 36 pt, поля 16 pt; кружок 12 pt, 8 pt до имени; Elo через 8 pt; результат справа в колонке 24 pt. Фон общий `surface`, без карточки и рамки. +- При обычной ориентации чёрные сверху, белые снизу; после Flip плашки меняются местами вместе с доской. Плашки существуют и при неизвестных именах, поэтому доска не прыгает. +- Доска квадратная, **без боковых полей и скругления**. Размер не зависит от Dynamic Type, комментариев и развилок. +- Ниже — только нотация и, на развилке, строка «Дальше». Никаких пустых Engine/Review-панелей. + +Иллюстративный бюджет для 390×844 pt с safe area 47/34 и navigation bar 44: + +```text +844 − 47 − 44 − 36 − 390 − 36 − 72 − 34 = 185 pt нотации +``` + +Это объяснение сетки, а не разрешение hardcode safe area. Высоты берутся из реальных `safeAreaInsets` окна. + +#### Доска + +- Парсится только placement из `MoveNode.fen`; шахматные правила повторно в Swift не реализуются. +- Координаты внутри крайних клеток, 10 pt, цветом противоположной клетки; при Flip обновляются вместе с mapping клеток. +- Последний ход подсвечивает `fromSquare` и `toSquare`. В узле `0` подсветки нет. +- Поддержать данные, которые `mobile-api` уже отдаёт для viewer: `marks` (`[%cal]`, `[%csl]`), `end == checkmate/stalemate`, NAG-badge текущего узла. Цвета и прозрачность — как Android `Board.kt`. +- Доска read-only: касание не выделяет фигуру, не ставит точек ходов и не вызывает ripple. Свайпов по доске нет. +- Короткий шаг ◀/▶ может анимировать фигуру 250 мс; прыжок по SAN, к границе и смена партии — сразу. При Reduce Motion любые перемещения мгновенные. +- Рендер проверяется на `displayScale` ×2 и ×3: диагонали Merida, координаты и линии не должны быть размыты или обрезаны. + +#### Нотация + +- Основная линия — строки минимум 48 pt: номер 40 pt, белые и чёрные поровну. Вся ячейка — `Button`; видимая заливка только вокруг SAN + NAG с полями 8×6 и радиусом 6. +- Если белого хода нет, а чёрный есть, в ячейке белых `…`; пустая ячейка чёрных остаётся пустой. +- Комментарий: внешние поля 16×4, фон `surfaceContainerLow`, радиус 12, внутренние поля 12×8. Текст переносится естественно, без ограничения числа строк. +- Вариант: блок без заливки, слева линия 2 pt `outlineVariant`, начало в 16 pt от края, текст через 12 pt. Вложенные RAV остаются в круглых скобках в потоке; ветки не сворачиваются. Каждый ход — отдельно доступный `Button`. +- Активный узел выделяется `#005C80`; VoiceOver произносит «текущий ход». Это не то же состояние, что последняя открытая строка списка или продолжение на развилке. +- При смене позиции активный ход должен быть виден. Если он за пределами или на краю viewport — прокрутка примерно на одну треть сверху, 200 мс; при Reduce Motion мгновенно. Ручная прокрутка не отменяется до следующего явного шага. +- Последний узел линии не выдаётся за конец всей партии, если есть альтернативные ветки. Результат `1-0 · White won` / `½-½ · Draw` — отдельная центрированная плашка `surfaceContainerHigh` после основной линии. +- Если две колонки физически не вмещают SAN при текущем Dynamic Type, основная линия переходит в тот же переносимый поток токенов, что вариант. Горизонтальной прокрутки нотации нет. + +#### Развилка + +Если `currentNode.children.count > 1`, непосредственно над нижней панелью появляется строка 48 pt «Дальше:»: + +- первый чип — `children[0]`, залит `primaryContainer`; остальные — контурные; +- каждый чип содержит номер и SAN, цель не ниже 44 pt; +- при переполнении прокручивается только этот ряд; +- ▶ всегда эквивалентен первому чипу; выбор другого чипа меняет текущую ветку, не переписывает PGN; +- строка отнимает высоту только у нотации. Её появление/исчезновение происходит после явного перехода пользователя, доска и нижняя панель не двигаются. + +#### Нижняя панель первого среза + +Фон `surfaceContainer`, верхний разделитель 1 pt `outlineVariant`. Контент 72 pt, ниже него фон продолжается в bottom safe area; кнопки в home indicator не попадают. + +| Слот | Относительная ширина | Иконка SF Symbols | Действие | +|---|---:|---|---| +| Flip | 48 | `arrow.up.arrow.down`, 24 pt | Перевернуть доску и плашки | +| ◀ | 78 | `play.fill`, 32 pt, отражённый | Один узел к `parent` | +| ▶ | 78 | `play.fill`, 32 pt | Один узел к `children[0]` | + +`HStack(spacing: 0)` распределяет всю ширину пропорционально `48:78:78`; на 390 pt это примерно 92/149/149 pt. ◀/▶ намеренно шире Flip. Каждая зона занимает весь слот × 72 pt, не только видимая иконка. + +- В начале ◀ disabled, в конце текущей ветки ▶ disabled; слоты не исчезают. +- **Короткое касание** выполняется при отпускании до long-press timeout и даёт ровно один шаг. +- **Удержание ◀** — один переход к узлу `0`; **удержание ▶** — к концу текущей ветки по первым children. Сначала обычный шаг не выполняется, автоповтора нет. +- Движение/отмена касания не вызывает действие. Если композиция `TapGesture` и `LongPressGesture` не доказывает эту взаимоисключимость на Simulator, используется один `UIControl` через `UIViewRepresentable`, а не две независимо срабатывающие кнопки. +- VoiceOver: отдельные действия «В начало линии» и «В конец линии» через `.accessibilityAction(named:)`; удержание — не единственный способ. +- `.accessibilityHint` у ◀/▶ объясняет удержание. Дополнительный каждодневный snackbar не нужен. + +**Будущее расширение, не объём реализации:** когда Engine и Review действительно появятся, используется актуальная пропорция Android `60:48:78:78:96` для `Engine:Flip:◀:▶:Review`. В первом срезе их слоты не рисуются, поэтому панель имеет только три рабочих действия. Изменение пропорций будет изменением версии продукта, а не внезапным скачком при загрузке данных. + +## 6. Safe area, малый экран и Dynamic Type + +### 6.1. Safe area + +- Корневой `CP.background` рисуется под системными областями; содержимое — нет. +- Navigation bar управляется системой; доска не попадает под status bar или Dynamic Island. +- Нижняя панель добавляется через `safeAreaInset`, поэтому нотация заканчивается выше кнопок, а не прячется под ними. +- Фон нижней панели расширяется только визуально `.ignoresSafeArea(edges: .bottom)`; интерактивная область остаётся выше home indicator. +- На списках нижний content inset 16 pt плюс системный safe area; последняя строка не прилипает к home indicator. + +### 6.2. Маленький поддерживаемый iPhone + +Минимальная визуальная проверка — iPhone SE (3-го поколения), 375×667 pt, ×2, портрет. Доска остаётся 375×375; обе плашки и панель 72 остаются, нотация получает оставшееся место и прокручивается. Нельзя уменьшать доску ради комментария или крупного шрифта. + +### 6.3. Dynamic Type + +- Все текстовые роли масштабируются; размер доски, 40 pt badge, кружки и иконки не раздуваются пропорционально тексту. +- Строки баз, партий и плашки игроков имеют только **минимальную** высоту 72/80/36; текст может увеличить её. Плашки результата и ECO остаются на своих строках. +- Имя может сокращаться и заканчиваться многоточием, но результат, ECO, номер и доступная кнопка не обрезаются. +- Плашка игрока остаётся однострочной по имени; полный текст доступен VoiceOver. Длинный комментарий переносится без потолка высоты. +- При accessibility-категориях основная нотация переходит к потоку; нижняя панель не получает вторую строку. +- Проверка минимум на `Large` (default), `xxxLarge`, `accessibility2`; `accessibility5` — отдельный smoke-тест переполнения. Не заявлять поддержку только по успешному Preview в Xcode. + +## 7. Accessibility и клавиатура + +### 7.1. VoiceOver + +| Элемент | Чтение | +|---|---| +| Строка базы | «Classic games, 100 партий, PGN, кнопка» | +| Строка партии | «№ 7. Белые: Morphy, Paul. Чёрные: Duke Karl / Count Isouard. 1-0, победили белые. Paris Opera, 1858, C41, кнопка»; полные имена | +| Плашка | «Чёрные: Duke Karl / Count Isouard, проигрыш»; кружок отдельно не читается | +| Доска | Один элемент: «Начальная позиция» или «Позиция после 8.Nc3»; custom action «Описать позицию» перечисляет фигуры сторонами | +| Ход | «8, белые, Nc3, текущий ход, кнопка»; NAG читается словами | +| ‹ › | «Предыдущая партия» / «Следующая партия» | +| Flip | «Перевернуть доску» | +| ◀ ▶ | «Предыдущий ход» / «Следующий ход», hint про удержание, custom actions к границам | + +Новый ход после ◀/▶ объявляется через `UIAccessibility.post(notification: .announcement)` только по явному действию пользователя; автопрокрутка и фоновая загрузку не озвучиваются. Прогресс не объявляется каждым кадром. + +Порядок обхода: navigation bar → верхняя плашка → доска → нижняя плашка → нотация → развилка → Flip → ◀ → ▶. Отсутствующие Engine/Review в дереве не встречаются. + +### 7.2. Аппаратная клавиатура и фокус + +Для iOS 16 системное Full Keyboard Access остаётся основным способом обхода; видимый системный фокус не отключается. У собственных кнопок дополнительная рамка фокуса 2 pt `primary`, не только смена tint. + +| Где | Клавиша | Действие | +|---|---|---| +| Списки | Tab / Shift+Tab, Enter или Space | Системный обход, открыть сфокусированную строку | +| Партия | ← / → | Один ход назад/вперёд | +| Партия | Shift+← / Shift+→ | Начало/конец текущей линии, альтернатива long press | +| Партия | F | Flip | +| Партия | Escape | Назад к списку партий | +| Везде | системный голосовой/клавиатурный доступ | Не перехватывается приложением | + +На iOS 16 привязку реализовать поддерживаемым `UIKeyCommand`/кнопочным shortcut API, а не переносить непроверенный новый SwiftUI API. Если Simulator не передаёт конкретную клавишу, это фиксируется как ограничение проверки, а не объявляется работающим. + +## 8. Матрица состояний + +| Состояние | Требуемое поведение | +|---|---| +| Первый запуск | Одна комплектная «Classic games», без искусственного splash/spinner; открытие по явному касанию может показать ProgressView | +| Пустая библиотека | Объяснение + рабочее «Открыть примеры партий»; нет Add/Play/Settings | +| Чтение базы | Вторая строка уже занята; «Читаю…» вместо числа. Не подменять неизвестное число нулём | +| Пустая база | «В этой базе нет партий» и назад; не открывать фиктивную партию | +| Ошибка базы | Название ошибки, понятная причина, «Повторить» если повторный вызов реально выполняется, назад | +| Чтение страницы партий | Заглушки той же геометрии, номер и разделители не прыгают | +| Чтение партии | Резервируются navigation bar, две плашки и квадрат доски; вместо фальшивой стартовой позиции нейтральный квадрат/ProgressView | +| Ошибка партии | Сообщение в области нотации, назад работает; не показывать старую `GameData` как новую | +| Длинные имена/событие | Полное → короткое имя → многоточие; результат и ECO не страдают | +| Длинный комментарий/глубокий RAV | Перенос, собственный поток токенов, без горизонтального скролла и потери кликабельности SAN | +| Развилка | Строка 48 меняет только высоту нотации после явного перехода | +| Малый iPhone | Доска и панель сохраняют размеры; нотация прокручивается; ничего не перекрыто safe area | +| Большая база | `GameRow` страницами по 100, `GameData` только при открытии. Специальный быстрый бегунок не добавлять; производительность не объявлять без Instruments | +| Несохранённые изменения | Неприменимо: viewer ничего не редактирует. Появление Save/Undo означает выход за объём | +| Фон/возврат | Стек, узел, Flip и видимая прокрутка сохраняются; повторный старый async-ответ отбрасывается | +| ×2 / ×3 HiDPI | Векторные фигуры/иконки, ровные 1 pt разделители, отсутствие обрезанных координат | +| Engine/Review отсутствуют | Нет кнопок, labels, accessibility elements, жестов и пустых панелей; Stockfish не запускается | + +## 9. Требования разработчику + +1. Собрать именно путь `Bundle → openBytes → Database.rows/game`, не переписывая PGN и chess rules на Swift. Вызовы `openBytes`, `rowsOf`, `game` не выполнять на главном потоке. +2. Комплектный `classics.pgn` остаётся read-only. Не создавать ради среза собственную базу и не вызывать `GameSession`, `ownSave`, engine/review API. +3. Разделить стабильные domain IDs и presentation layout. Смена `currentNodeID` не пересоздаёт `NavigationStack`; смена партии через ‹ › не добавляет route. +4. Перенести Android `layout(GameData)` как чистую, тестируемую модель элементов нотации: `comment`, `moveRow`, `variation`, `result`, плюс `where[nodeID]`. Не хранить `current` как номер элемента списка. +5. Сделать общие `SideDisc`, `ResultTile`, `PlayerLineView`, `MoveButton`, `BottomBarButton`, чтобы список и партия не разошлись по размерам. +6. Для варианта реализовать проверяемый wrapping `Layout`: токены текста и кнопок переносятся, parentheses сохраняются, касание попадает именно в SAN. Не использовать URL-links как обходной путь. +7. Отдельно протестировать жест ◀/▶: tap отпусканием, long press без предварительного tap, cancellation, disabled и VoiceOver actions. +8. Все числа форматировать локально и `.monospacedDigit()`; 100 — как `100`, большие числа — с локализованным разделителем групп. +9. Не добавлять сторонний UI/svg/шахматный пакет без проверки происхождения. SF Symbols использовать вместо копирования Material Icons. +10. Ограничить target первого среза iPhone + Portrait. Не включать iPad destination «для будущего» в этой задаче. + +## 10. Приёмка позже на macOS / iPhone Simulator + +Генерация Swift bindings, Rust tests и Linux screenshots **не заменяют** эту приёмку. Нужны macOS, Xcode, реальная сборка `iosApp/` и iPhone Simulator. Ревьюер — отдельный человек/агент, не автор реализации. + +### 10.1. Функциональные критерии + +1. **Комплектная база.** Холодный запуск → «Classic games», `100 games · PGN`; открытие → 100 строк, первая «McDonnell, Alexander / La Bourdonnais, Louis-Charles Mahe de», `0-1`, `London m4 · 1834`, `B32`. «Paris Opera» — запись с `GameRow.index = 6`, то есть №7: «Morphy, Paul / Duke Karl / Count Isouard», `1-0`, `Paris Opera · 1858`, `C41`. Сам PGN не изменять. +2. **Начало.** Открыть первую партию: «London m4 · 1834», «1 из 100», узел `0`, ни один ход не выделен; ◀ disabled, ▶ enabled. Для сценариев аннотации открыть Opera: «Paris Opera · 1858», «7 из 100». +3. **Ходы.** 20 коротких касаний ▶ дают ровно 20 переходов, без повторов. ◀ возвращает строго к `parent`; на первом узле варианта — к позиции перед развилкой. +4. **Long press.** Удержание ▶ идёт в конец текущей линии без предварительного шага; удержание ◀ — в `0`. Нет автоповтора, двойного срабатывания и действия после отменённого касания. +5. **Аннотация.** Пример Opera с `8.Nc3`: доска соответствует узлу, `Nc3` выделен, видны «Morphy prefers development to material.» и вариант `8.Qxb7 Qb4+ … only trades queens.` Касание SAN внутри варианта выбирает правильный `MoveNode.id`. +6. **Ветка.** На позиции с несколькими children видны «Дальше» и все продолжения; ▶ равен первому чипу, другой чип ведёт в свою ветку. Возврат назад не стирает ветку. +7. **Flip.** Меняются mapping клеток, координаты и плашки; текущий узел и прокрутка нотации не меняются. +8. **Соседние партии.** ‹ › следуют порядку списка; на границах disabled; каждая новая партия в `0`; стек не растёт; Flip сохраняется. +9. **Возврат.** После нескольких ‹ › назад возвращает в прежнюю прокрутку списка; отмечена именно последняя открытая партия. Повторный tap открывает её в `0`. +10. **Read-only.** До и после сценария checksum bundled `classics.pgn` не меняется; нет Save/Undo/меню редактирования и вызовов записи. +11. **Отсутствие заглушек.** Визуально и через Accessibility Inspector нет Engine/Review/Play/Add/Settings. Stockfish не входит в bundle и не запускается. + +### 10.2. Визуальные доказательства + +Эталонные устройства: + +- современный iPhone с notch/Dynamic Island, портрет, ×3 — например 390×844 pt; +- iPhone SE (3-го поколения), 375×667 pt, ×2 — узкий и низкий случай. + +Минимальный набор, без декоративных серий: + +| Снимок | Устройство/масштаб | Состояние | Что доказывает | +|---|---|---|---| +| `01-library.png` | Современный iPhone, ×3, Large | Заполненные базы | Токены, 72 pt, badge, safe area | +| `02-games.png` | То же | Заполненный список, первая партия | 80 pt, имена/результат/ECO, разделители | +| `03-game.png` | То же | Opera, `8.Nc3`, комментарий и вариант | Доска W×W, плашки, выделение, три нижних действия | +| `04-game-se.png` | SE, ×2, Large | Та же позиция | Низкая нотация, отсутствие перекрытий | +| `05-games-ax2.png` | Современный iPhone, ×3, accessibility2 | Длинные имена и заполненный список | Dynamic Type, результат/ECO без обрезки | +| `06-empty.png` | Современный iPhone, ×3 | Отладочная пустая библиотека | Единственное реальное действие, отсутствие мёртвых кнопок | +| `07-error.png` | Современный iPhone, ×3 | Отладочная ошибка чтения партии | Ошибка без фальшивой доски и скачка геометрии | + +Дополнительно фиксируется короткая последовательность **открытие → ▶ → long press ▶ → long press ◀ → назад**: на снимках или в отчёте с координатами board/player bars/bottom bar. Их размеры не меняются; меняются только позиция, выделенный SAN и состояние кнопок. Последняя открытая строка на возврате видна. + +Каждый verdict содержит путь к снимку, модель Simulator, версию iOS, pt/scale, Dynamic Type и состояние. Сравнение идёт с `01-home.png`, `02-games.png`, `03-game.png` Android по **системе и геометрии**, а с desktop `library.png`/`game.png` — по общей палитре и предметной иерархии. Пиксельного совпадения с Android не требуется из-за SF Symbols и системного шрифта. + +Дефект записывать конкретно: экран/состояние, ожидаемая и фактическая координата или переполнение, шаги воспроизведения, снимок. «Выглядит похоже» без доказательств не является приёмкой. + +### 10.3. Accessibility и надёжность + +- VoiceOver проходит весь порядок из §7.1; custom actions границ работают без жеста; отдельные кружки и декоративные иконки не читаются. +- Full Keyboard Access и маппинг §7.2 проверяются с hardware keyboard Simulator; фокус виден на тёмном фоне. +- `xxxLarge`, `accessibility2`, затем smoke `accessibility5`: нет перекрытий, второй нижней строки или горизонтальной нотации. +- Reduce Motion убирает анимации; Increase Contrast не делает текущий ход неотличимым от обычного (заливка + VoiceOver + форма плашки). +- Повторное открытие базы, быстрые ‹ ›, уход в фон во время чтения и поздние async-ответы не показывают старую партию под новым заголовком. +- Проверка памяти/процессора делается Instruments на списке; красивый снимок не доказывает paging и отсутствие блокировки main thread. + +## 11. Что передать тестировщику + +- Сценарии §10.1 и матрицу §8 как обязательные регрессии первого среза. +- Отдельно проверить взаимоисключимость tap/long press и custom actions VoiceOver — это наиболее рискованный жест. +- Отдельно проверить hit testing каждого SAN в многострочном RAV и стабильность `nodeID` после возврата из ветки. +- Сравнить ширину слотов и отсутствие скачков на SE и современном iPhone; Engine/Review искать также в Accessibility Inspector, а не только глазами. +- Проверить ошибку/пустоту через debug fixtures, не изменяя поставляемый PGN. +- Любую поддержку больших баз, всех Dynamic Type или производительность отмечать только после фактического прогона; заранее PASS не ставить. diff --git a/docs/dev/tasks.md b/docs/dev/tasks.md index 4b74d6d..2849341 100644 --- a/docs/dev/tasks.md +++ b/docs/dev/tasks.md @@ -71,10 +71,11 @@ - Связано с №4 и №5. ### 7. Версия для iPhone / iPad -- **Статус:** отложено (2026-10-24): владелец сделает, если программа станет популярной. +- **Статус:** в работе с 2026-11-30, ветка `feature/iphone-app`: сначала iPhone по образу Android; iPad отдельной следующей командой и ближе к desktop. - **Добавлено:** 2026-10-24. - **Почему:** пользователь из рассылки не смог попробовать — у него iPhone. - **Мысли:** ядро на Rust уже общее (UniFFI умеет Swift); нужен интерфейс на SwiftUI, аккаунт Apple Developer (99 $/год) и проверка App Store; Stockfish на iOS разрешён (есть в App Store у других). Большая отдельная работа. +- **Первый срез:** `iosApp/`, SwiftUI на iOS 16+, UniFFI к общему `mobile-api`; комплектная PGN-база, базы → партии → доска с навигацией/переворотом/long press, тёмная мобильная визуальная система. Без движка, игры и редактора до отдельных этапов. Созданы проект, XCTest-таргет и настоящие Swift-биндинги; повторная генерация идемпотентна, PGN — байтовая копия, `mobile-api` — 33 passed / 0 failed / 2 ignored, структурные проверки и Clippy зелёные. На Linux проверены генерация Swift-биндингов и Rust-сборка; независимая структурная приёмка Д1–Д10 пройдена (`docs/qa/iphone-structural.md`). Сборка и UI-приёмка на iPhone Simulator обязательна на macOS/Xcode и пока не выполнялась. ### 8. Нужна ли строка быстрого поиска, когда есть панель фильтров? - **Статус:** решено (2026-10-25): оставить оба. Аналитик и дизайнер (`docs/research/library-layout.md`, `docs/design/library-layout.md`): поиск ищет слово по всем полям сразу («вафин 2025») и виден, когда фильтры скрыты (узкое окно, доска поиска); в узком поле подсказка короткая «🔍 Поиск». diff --git a/docs/qa/iphone-fixes.md b/docs/qa/iphone-fixes.md new file mode 100644 index 0000000..9043d77 --- /dev/null +++ b/docs/qa/iphone-fixes.md @@ -0,0 +1,111 @@ +# iPhone: исправления структурной QA + +Дата: 2026-11-30. Исходный отчёт `docs/qa/iphone-structural.md` не изменён. Коммитов нет. + +## Что исправлено + +- **Д1:** `GameView.load` захватывает `requestedPlace`; после `await` success/error применяются только при совпадении с текущим `place`. Общая с View `GameLoadState` отбрасывает поздние ответы; race закреплён XCTest. +- **Д2:** `NotationModel` строит основную двухколоночную линию и все alternative-subtree с `visited`, `indent`, comments/result и `entryByNode[MoveNode.id]`. `NotationView` использует эту модель; SAN вариантов — отдельные кнопки в token-flow, включая вложенные RAV. +- **Д3:** спецификация приведена к фактическим 100 записям; Opera — `index = 6`, №7. PGN не изменён. +- **Д4:** `nextGameRowPage` ограничивает страницы 100 записей; первая страница больше не использует `rows(0, len)`. Footer `GamesView` запрашивает следующую страницу по достижении конца. Общее число партий отделено от числа загруженных строк. +- **Д5:** ←/→, Shift+←/→, F, Escape зарегистрированы через iOS 16 `keyboardShortcut` и вызывают реальный `perform(GameCommand)`; Escape использует `dismiss`. +- **Д6:** вся строка имеет отдельный accessibility label с полными именами, сторонами, результатом, событием/годом/ECO и last-opened. `ResultTile` больше не скрыт; дочерние элементы заменяются осмысленной строкой целиком. +- **Д7:** `BoardView` получает `MoveNode`; `BoardAnnotationModel` переносит marks/end/NAG. Добавлены стрелки, круги, NAG-badge и локализованные checkmate/stalemate. +- **Д8:** Green исправлен на `#FFFFDD / #86A666`. +- **Д9:** toolbar next больше не зависит от `rows.count`: `showNext` через `NextGameRequest` при необходимости выполняет `await loadNextPage()`, проверяет исходный `place` после await и вызывает прежний `show(next)` с guards/`lastOpened`. Disabled определяется только `totalGames`; previous не изменён. +- **Д10:** `AppModel.nextPageTask` теперь разделяет одну in-flight загрузку: повторный footer/Next ожидает тот же `Task`, второй loader не создаётся. Task и `isLoadingPage` очищаются после завершения; guards database identity и `rows.count == page.start` сохранены. + +## Тестовые модели + +`iosApp/ChessPenguinTests` содержит пять исходников, включая общие PGN fixtures. Тесты адресуют race A→B→late-A, границы страниц 100/100/50, переходы next 100→101 и 200→201, concurrent footer+Next с одним delayed loader и двумя ожиданиями, Opera/Qxb7, вложенные RAV, malformed cycle, FEN/flip, marks/NAG/checkmate, keyboard mapping и accessibility. `project.yml` содержит `ChessPenguinTests` и подключает его к схеме приложения. + +**XCTest на этом Linux-хосте не запускались:** Swift toolchain, Xcode и Simulator отсутствуют. + +## Фактические проверки + +### Генерация моста + +```text +$ iosApp/scripts/build-bindings.sh +Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.42s +Swift UniFFI bindings: /home/vrubel/services/chessBaseLinux/iosApp/Generated/MobileAPI +Host is not macOS: skipped iOS targets and XCFramework (no iOS build was attempted). +Binding regeneration: byte-identical outputs +``` + +### Rust-ворота + +```text +$ cargo fmt --all -- --check +# exit 0, вывода нет +$ cargo clippy -p mobile-api --all-targets -- -D warnings +Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s +$ cargo test -p mobile-api --locked +test result: ok. 33 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out +Doc-tests mobile_api: ok +``` + +### Структурные проверки и ресурсы + +```text +project.yml: application + unit-test target; 5 XCTest source files +localization: 35 EN/RU keys match; all production/test references resolve +PGN unchanged: 72704 bytes; SHA-256 52fbe73d40d90382d9d79d8c9d2c7e9af2e749f34f18de3a49d18bfe7ad1200a +fixture docs: 100 games; Opera index 6 / row 7; stale 38-game criteria absent +paging: first/next pages use model; footer requests next page; no eager rows(0,len) +race + keyboard: requestedPlace guards on success/error; six hardware shortcuts call perform +notation: full variation renderer + visited + stable IDs + Opera/nested/cycle XCTest +board: MoveNode marks/NAG/end consumed; flip/marks/badge/end XCTest +accessibility: whole-row result label; ResultTile is not hidden +board colors: Green #FFFFDD / #86A666 +assets: 13 JSON files parsed +bash syntax: OK +``` + +Дополнительный Linux mirror нового traversal применён к дампу реальной Opera из независимого probe (это не запуск Swift): + +```text +opera_nodes 50 rendered 49 unique 49 expected 49 +missing [] duplicates 0 +Qxb7_ids [20, 29] all_rendered True +``` + +Временный Rust probe проверил PGN, используемый XCTest для badge/mate/nested RAV (это не XCTest). Первый составной вариант fixture дал `Qh4+` без `end`, то есть не был матом; его разделили на отдельную NAG-партию и канонический fool's mate. Исправленный fixture уже в тестах, повторный probe: + +```text +mate_nodes=3 first_nags=[1] first_badge_square=Some("e4") +mate_nodes=5 last_san=Qh4# last_end=checkmate +nested_nodes=6 sans=["", "e4", "d4", "d5", "c5", "e5"] +``` + +## Д9: фактическая повторная проверка + +```text +D9 structure: next async loads missing page, guards origin, then show(next); previous/lastOpened preserved +XCTest model: 100→101 and 200→201 page transitions + final boundary +project.yml + test source: valid +bash syntax: OK +``` + +Повторная генерация UniFFI завершилась с `Binding regeneration: byte-identical outputs`; host снова честно пропустил iOS/XCFramework. `cargo fmt --check`, `cargo clippy -p mobile-api --all-targets -- -D warnings` и `cargo test -p mobile-api --locked` прошли: **33 passed, 0 failed, 2 ignored**. Swift/XCTest по-прежнему не запускались. + +## Д10: фактическая повторная проверка + +```text +D10 AppModel: shared in-flight nextPageTask; repeat callers await; cleanup after completion; identity guards retained +GameView: Next still awaits page loader before guarded show(next) +XCTest: concurrent footer+Next, one delayed loader, Next is awaited before footer and sees 200 rows, show(100) guard passes +project.yml: unit-test target retained +bash syntax: OK +``` + +UniFFI снова сгенерирован с `Binding regeneration: byte-identical outputs`; iOS/XCFramework на Linux не выполнялись. `cargo fmt --check`, clippy и `cargo test -p mobile-api --locked` прошли: **33 passed, 0 failed, 2 ignored**. Асинхронный XCTest с реальным scheduler по-прежнему pending macOS. + +## Pending macOS / Simulator + +1. `xcodegen generate`, Swift compile всех production/test files, XCTest и окончательная UniFFI/XCFramework link. +2. UI-проявление race retry/place и реальные async-тайминги, включая одновременные footer+Next во время активной загрузки страницы: один loader, оба ждут, затем Next показывает запрошенную партию. +3. Все касания SAN в многострочных вариантах, выделение/scroll текущего `MoveNode.id`, Dynamic Type и отсутствие переполнений. +4. Передача hardware keys Simulator, Full Keyboard Access, фактическая речь VoiceOver. +5. Визуальная проверка стрелок/кругов/badge/checkmate/stalemate, Green, ×2/×3 и safe area. +6. Paging после записи 100 на базе больше 100 и toolbar next на `place=99` и `place=199` (переходы 100→101 и 200→201): комплектный PGN ровно 100 записей, поэтому нужен отдельный debug fixture на 250 без изменения поставляемого PGN. Память/CPU заявлять только после Instruments. diff --git a/docs/qa/iphone-structural.md b/docs/qa/iphone-structural.md new file mode 100644 index 0000000..9e41f56 --- /dev/null +++ b/docs/qa/iphone-structural.md @@ -0,0 +1,477 @@ +# Независимая структурная QA первого iPhone-среза + +Дата: 2026-11-30. Исполнитель: независимый tester, не автор реализации. + +**Вердикт: структурный срез не принят.** Подтверждены гонка с подменой открытой партии и потеря вариантов в нотации; всего ниже оформлено 7 дефектов приложения и 1 дефект приёмочных данных. **Swift compile, Xcode build и Simulator PASS не выставляются:** на машине нет Xcode, XcodeGen и Swift toolchain. + +## Окружение и граница доказательств + +Обозначение **О-1** для дефектов ниже: + +- Linux x86_64, CachyOS, kernel `7.3.6-3-cachyos`; `rustc 1.99.1`, `cargo 1.99.1`; +- базовый `HEAD`: `a37c6a78f451c82f665d7908bd927460c088a863`, поверх него — незакоммиченный iPhone-срез из рабочего дерева; `MARKETING_VERSION` в `iosApp/project.yml` — `2.5.2`; +- `xcodebuild`, `swift`, `xcodegen` через `command -v` не найдены; +- production не изменялся, пользовательский PGN не перезаписывался, коммитов не было. Разрешённые записи: этот отчёт и `/tmp/opencode/qa-iphone/`; +- слова «подтверждено» ниже относятся к выполненным Linux-командам, исходным состояниям и управляемым чередованиям. Они не означают наблюдение на iPhone. + +## Фактически проверено + +### 1. Обязательная генерация моста + +Самостоятельно выполнено из корня: + +```sh +iosApp/scripts/build-bindings.sh +``` + +Результат: **exit 0**. Скрипт собрал host `mobile-api`, заново сгенерировал Swift/header/module map и честно завершился с сообщением: + +```text +Host is not macOS: skipped iOS targets and XCFramework (no iOS build was attempted). +``` + +SHA-256 четырёх файлов до и после генерации совпали попарно; в том числе: + +```text +3590ebd857c8171c18c68fdb68c1a320d0d8801999d2d70779d264829feb1dda MobileAPI.swift +c08c02850a8f32fa8b203fc3271cc1f9b725c5f3fdc845a4ee284ecadf29aa55 MobileAPIFFI.h +e4fa7efecc9539a8b2a2f2d070137f478e17a95d79f65c04a83d217bfe96647b MobileAPIFFI.modulemap +e4fa7efecc9539a8b2a2f2d070137f478e17a95d79f65c04a83d217bfe96647b module.modulemap +``` + +Проверено по фактически сгенерированному `MobileAPI.swift`: экспортируются `openBytes(name:bytes:)`, `Database.rows`, `rowsOf`, `game`, `len`; `GameData`, `GameRow`, `MoveNode`, `Mark` соответствуют Rust-записям; `Database.deinit` вызывает `uniffi_mobile_api_fn_free_database`. Это проверка наличия и воспроизводимости моста, **не проверка Apple link/ABI**. + +Журнал: `/tmp/opencode/qa-iphone/build-bindings.log`. + +### 2. Rust-тесты общего API + +```sh +cargo test -p mobile-api --locked +``` + +Результат: **exit 0; 33 passed, 0 failed, 2 ignored; doc-tests 0**. Игнорированы сценарии Maia/Rodent, требующие внешних весов/движка. Среди выполненных — дерево, комментарии/варианты, FEN, paging самого Rust API, метки и сохранность PGN. + +Журнал: `/tmp/opencode/qa-iphone/cargo-test-mobile-api.log`. + +### 3. Независимый probe реальных данных + +Создан временный крейт `/tmp/opencode/qa-iphone/probe`, вызывающий публичный `mobile-api`, а не повторяющий отчёт разработчика. Выполнено: + +```sh +cargo generate-lockfile +CARGO_TARGET_DIR=/home/vrubel/services/chessBaseLinux/target cargo run --locked --quiet +``` + +Проверены: + +- `classics.pgn`: `len = 100`; первая строка — McDonnell–La Bourdonnais; Opera имеет `index = 6`, то есть является записью №7; +- Opera: 50 узлов, корректные `id/parent/children/FEN`; у `Rd8#` мост отдаёт `end = "checkmate"`; +- алгоритм `mainLineIDs`, воспроизведенный непосредственно по Swift-коду, включает 33 хода основной линии и оставляет вне нотации 16 реальных узлов вариантов Opera: `4…dxe5`, `8.Qxb7 Qb4+ 9.Qxb4 Bxb4+`, ветки `9…Nbd7` и вложенные продолжения; +- отдельный PGN с `SetUp=1`, FEN `8/8/4k3/8/8/8/8/4K3 b - - 0 0`: корень имеет очередь чёрных, `1…Kd6` имеет `parent = 0`, `white = false`, `moveNumber = 1`, корректные `from=e6`, `to=d6` и FEN после хода; +- отдельный двухуровневый RAV: все узлы и родители приходят через Rust, но Swift-алгоритм основной линии опускает всё поддерево `1.d4`. + +Журнал: `/tmp/opencode/qa-iphone/mobile-probe.log`. Временные PGN созданы только в памяти probe; исходные файлы не менялись. + +### 4. Структурные проверки Swift и управляемая гонка + +Запущен `/tmp/opencode/qa-iphone/structural_checks.py` (**exit 0**). Он проверил: + +- eager-вызов `rows(start: 0, count: database.len())` и отсутствие paging в `AppModel`; +- отсутствие request/generation token и запись `loadedPlace = place` после `await`; +- first-child-only нотацию и отсутствие variation renderer; +- наличие FEN-гвардов на 8 рядов/64 клетки и flip mapping `63 - visualIndex`; +- управляемое чередование «retry A для партии 0 → переход к партии 1 → ответ B для партии 1 → поздний ответ A». Конечное состояние воспроизведено как: + +```text +final_place=1 loadedPlace=1 game=GAME_0 +stale_retry_displayed_as_new_place=True +``` + +Это детерминированная модель именно состояний `GameView.load/show`, а не симулятор SwiftUI. Журнал: `/tmp/opencode/qa-iphone/structural-checks.log`. + +### 5. Проект, ресурсы, локализация и поверхность записи + +- `bash -n iosApp/scripts/build-bindings.sh` — exit 0. +- `project.yml` разобран PyYAML: iOS 16.0, `TARGETED_DEVICE_FAMILY = "1"`, только `UIInterfaceOrientationPortrait`, dark UI, generated Swift и XCFramework подключены декларативно. +- Все `Contents.json` разобраны; оба `Localizable.stringsdict` разобраны `plistlib`; EN/RU имеют одинаковые 29 ключей `Localizable.strings`, отдельно присутствует `games_count` с plural rules. +- Все 12 ожидаемых фигур `w/b × KQRBNP` существуют; referenced PNG существуют, каждый имеет PNG signature и размер 256×256. +- `cmp -s examples/classics.pgn iosApp/ChessPenguin/Resources/classics.pgn` — **exit 0**. Общий SHA-256: `52fbe73d40d90382d9d79d8c9d2c7e9af2e749f34f18de3a49d18bfe7ad1200a`. +- В handwritten Swift найден единственный файловый ввод `Data(contentsOf:)` для bundled URL и `openBytes`; вызовов `ownSave`, `ownCreate`, `GameSession`, запуска Analyzer/Stockfish и API записи нет. +- Проверены `project.yml`, оба module map, notices, asset references и отсутствие внешних Swift package/CocoaPods dependencies. + +Журналы: `/tmp/opencode/qa-iphone/resources.log`, `syntax-resource-checks.log`, `surface-checks.log`. + +## Дефекты + +### Д-1. Поздний retry отображает прежнюю партию под номером новой + +- **Серьёзность:** высокая — пользователь видит неверную партию и её доску под заголовком `N of M`. +- **Окружение/версия:** О-1; гонка воспроизведена управляемым порядком завершения запросов. На Simulator дополнительно требуется подтверждение UI-проявления. +- **Шаги:** (1) открыть партию 0 и получить ошибку загрузки; (2) нажать «Повторить», не дожидаясь ответа A нажать toolbar «следующая партия»; (3) дать запросу B партии 1 завершиться первым, а retry A — последним. +- **Ожидаемо:** A отброшен по идентификатору запроса/места; остаются `GameData` партии 1 и `loadedPlace = 1`. +- **Фактически:** retry создан отдельным `Task { await load() }` и не отменяется сменой `.task(id: place)`. `load()` не сохраняет requested place/token. После `await` он присваивает `game = loaded`, но `loadedPlace = place` уже читает новое значение 1. Контрольный прогон завершился `game=GAME_0`, `loadedPlace=1`; `shownGame` считает такую партию валидной для экрана 1. +- **Файл/строка:** `iosApp/ChessPenguin/GameView.swift:47-50` (retry), `95` (отдельный `.task`), `112-126` (запись после await), `129-133` (`show`), `17-19` (`shownGame`). +- **Минимальный пример:** `/tmp/opencode/qa-iphone/structural_checks.py`, сценарий `check_retry_race`; его фактический вывод приведён выше. Обычный переход ‹ › имеет cancellation guard, но он не охватывает самостоятельный retry Task. + +### Д-2. Варианты PGN не выводятся; после выбора ветки текущий ход исчезает из нотации + +- **Серьёзность:** высокая — нарушен центральный сценарий чтения аннотированной партии и дерева. +- **Окружение/версия:** О-1; дефект доказан реальным `GameData` Opera и прямым анализом рендер-модели. +- **Шаги:** открыть Opera (фактически запись №7) → дойти до `7…Qe7` → в «Дальше» выбрать `8.Qxb7` → продолжить `8…Qb4+`. +- **Ожидаемо:** в нотации виден кликабельный вариант `8.Qxb7 Qb4+ 9.Qxb4 Bxb4+ … only trades queens.`; выбранный `MoveNode.id` присутствует и выделяется. +- **Фактически:** `NotationView` строит строки только по `children.first` от корня. `ForEach(movePairs(game))` не получает ни одного variation node. После выбора id 20 доска меняется, но ячейки `move-20` не существует, выделять и прокручивать нечего. В Opera опущены 16 узлов; `README.md:14` фактически признаёт сокращение дерева, но это противоречит назначенному объёму. +- **Файл/строка:** `iosApp/ChessPenguin/NotationView.swift:11-24`, `27-49`, `64-78`, `99-102`, `106-139`; `iosApp/ChessPenguin/GameView.swift:38-44`; критерий — `docs/design/iphone-app.md:22-23`, `277`, `400`, `416`, `462`. +- **Минимальный пример:** `1. e4 (1. d4 1... d5) 1... e5 *`. Rust probe возвращает обе ветки; Swift main-line IDs — только `e4,e5`. Реальный лог Opera: `omitted_from_swift_notation=[… (20,"Qxb7"), (21,"Qb4+"), …]`. + +### Д-3. Приёмочный fixture не соответствует спецификации: 100 партий вместо 38, Opera не первая + +- **Серьёзность:** средняя — сценарии холодного запуска и первой партии из §10.1 невозможно принять в записанном виде. +- **Окружение/версия:** О-1; tracked `examples/classics.pgn` и его байтовая копия в bundle. +- **Шаги:** выполнить временный probe либо `grep -c '^\[Event ' examples/classics.pgn`; прочитать первый заголовок и найти `[Event "Paris Opera"]`. +- **Ожидаемо:** по `docs/design/iphone-app.md:412-413` — 38 партий, первая Morphy–Duke Karl/Count Isouard, `1 of 38` на Opera. +- **Фактически:** 100 заголовков Event; `Database.len() = 100`; первая запись — McDonnell–La Bourdonnais, London m4, `0-1`, B32; Opera — index 6/строка №7. Следовательно, UI, использующий настоящие `rows`, покажет 100 и другую первую партию. +- **Файл/строка:** `docs/design/iphone-app.md:182`, `190`, `201`, `232`, `412-413`; `examples/classics.pgn:1-7` и `112-120`. +- **Минимальный пример:** `/tmp/opencode/qa-iphone/mobile-probe.log`: `classics_len=100`, `opera_index=6`. Нужно согласовать исправление критериев или отдельный fixture; существующий PGN самостоятельно не менять. + +### Д-4. Список не ленивый: при открытии материализуются все `GameRow` + +- **Серьёзность:** средняя структурная; эффект по памяти/времени на больших базах здесь **не измерялся**. +- **Окружение/версия:** О-1; статически подтверждённый путь вызова, текущий bundle содержит 100 записей. +- **Шаги:** холодный запуск → `DatabasesView.task` → `AppModel.loadSample`. +- **Ожидаемо:** `GameRow` читаются страницами по 100 по мере показа; `GameData` загружается только для открытой партии. +- **Фактически:** до показа списка выполняется один `rows(start: 0, count: database.len())`; все строки сохраняются в `@Published rows`, после чего `GamesView` перебирает весь массив. `rowsOf` и следующая страница не используются. `GameData`, наоборот, загружается отдельно — эта часть ленивая. +- **Файл/строка:** `iosApp/ChessPenguin/AppModel.swift:26-28`, `39-47`; `iosApp/ChessPenguin/LibraryViews.swift:74-90`; требование — `docs/design/iphone-app.md:87`, `387`, `395`. +- **Минимальный пример:** строка `database.rows(start: 0, count: database.len())` в `AppModel.swift:45`; структурный check напечатал `all_rows_materialized_at_open=True pages_of_100=False`. Производительность не объявляется ни PASS, ни FAIL. + +### Д-5. Не реализованы назначенные аппаратные клавиши партии + +- **Серьёзность:** средняя — отсутствует заявленный способ навигации и альтернатива long press для клавиатуры. +- **Окружение/версия:** О-1; проверка отсутствия обработчиков во всех handwritten Swift. Передача клавиш Simulator отдельно не проверялась. +- **Шаги:** на экране партии с hardware keyboard нажать ←/→, Shift+←/→, F или Escape. +- **Ожидаемо:** соответственно один ход, границы линии, Flip, назад по `docs/design/iphone-app.md:356-369`. +- **Фактически:** ни `UIKeyCommand`, ни `keyboardShortcut`, ни `onKeyPress` в `iosApp/ChessPenguin/*.swift` нет; собственной реализации этих действий для клавиатуры не существует. Это не утверждение о системном Tab/Full Keyboard Access. +- **Файл/строка:** `iosApp/ChessPenguin/ChessPenguinApp.swift:17-34` и `GameView.swift:26-96` — view/команды не регистрируют клавиши; handlers отсутствуют во всём каталоге. +- **Минимальный пример:** `grep -RInE 'UIKeyCommand|keyboardShortcut|onKeyPress' iosApp/ChessPenguin --include='*.swift'` не даёт совпадений. + +### Д-6. Результат партии исключён из accessibility-дерева строки списка + +- **Серьёзность:** средняя — VoiceOver не получает результат, хотя это основная информация строки. +- **Окружение/версия:** О-1; подтверждены модификаторы accessibility в исходнике, звук VoiceOver не записывался. +- **Шаги:** открыть список партий с VoiceOver и обойти строку с результатом `1-0`, `0-1` или `1/2-1/2`. +- **Ожидаемо:** полные имена, стороны и результат читаются в единой строке кнопки. +- **Фактически:** результат передаётся только в `ResultTile`, а весь `ResultTile` помечен `.accessibilityHidden(true)`. У внешнего `Button` нет собственного `accessibilityLabel`/`accessibilityValue` с результатом; `sideResult` больше в accessibility-текст не попадает. +- **Файл/строка:** `iosApp/ChessPenguin/SharedViews.swift:50-68`; `iosApp/ChessPenguin/LibraryViews.swift:76-83`, `121-122`, `155-176`; ожидаемое чтение — `docs/design/iphone-app.md:343-350`. +- **Минимальный пример:** строка с `row.result = "1-0"`: оба значения `1` и `0` существуют только внутри скрытых `ResultTile`; альтернативного семантического текста результата в коде нет. + +### Д-7. Мост отдаёт marks/end, но доска их полностью игнорирует + +- **Серьёзность:** средняя — теряются учебные стрелки/подсветки и индикация мата/пата на доске. +- **Окружение/версия:** О-1; Rust-поля подтверждены тестом и probe, отсутствие потребителя — прямым чтением Swift. +- **Шаги:** открыть узел с `[%cal]/[%csl]` или финальный `Rd8#` в Opera. +- **Ожидаемо:** Board использует `MoveNode.marks`, `end == checkmate/stalemate` и NAG-badge согласно `docs/design/iphone-app.md:267`. +- **Фактически:** `GameView` передаёт в `BoardView` только FEN, flip, from/to и description. Сам `BoardView` не имеет входов `marks`, `end` или NAG и рисует только клетки, last move, фигуры и координаты. При этом у реального `Rd8#` probe получил `end="checkmate"`; Rust unit-test подтверждает прохождение marks через API. +- **Файл/строка:** `iosApp/ChessPenguin/GameView.swift:30-36`; `iosApp/ChessPenguin/BoardView.swift:56-98`, `101-144`; источник данных — `crates/mobile-api/src/lib.rs:149-163`, `544-563`. +- **Минимальный пример:** `1. f3 e5 2. g4 Qh4# 0-1` для `end`; `1. e4 {[%cal Ge2e4]}` для marks. Данные доходят до `MoveNode`, но нет кода, который мог бы их отобразить. + +### Д-8. Цвета доски не соответствуют назначенной теме Green + +- **Серьёзность:** низкая, визуальная; токенное расхождение доказано без снимка. +- **Окружение/версия:** О-1; сравнение Swift, действующего Android и назначенной спецификации. +- **Шаги:** сравнить `Theme.boardLight/boardDark` с Green из спецификации/Android. +- **Ожидаемо:** `#FFFFDD / #86A666`. +- **Фактически:** `#F0D9B5 / #B58863`. README утверждает повторение Android BoardStyle, но Android `Green` задаёт `rgb(255,255,221) / rgb(134,166,102)`. +- **Файл/строка:** `iosApp/ChessPenguin/Theme.swift:30-31`; `androidApp/app/src/main/java/io/github/vrubelroman/chesspenguin/data/BoardStyle.kt:41`; `docs/design/iphone-app.md:133`, `145`. +- **Минимальный пример:** значения HEX выше. Реальный рендер, контраст и HiDPI на Simulator не оценивались. + +## Не подтвердилось + +- **Ошибка Rust-части FEN/parent для чёрных:** не подтвердилась. Probe с black-to-move и fullmove=0 вернул правильные root/child, SAN, сторону, from/to и FEN. Swift Board имеет guards рядов/64 клеток и согласованный flip mapping. Это не заменяет визуальную сверку фигур на iPhone. +- **Устаревшие или неидемпотентные сгенерированные биндинги:** не подтвердилось; повторная генерация сохранила все четыре SHA-256. +- **Пропавшие ключи EN/RU, битые stringsdict/asset JSON, отсутствующие PNG:** не подтвердилось перечисленными парсерами и проверками 12 комплектов. +- **Изменение bundled PGN во время выполненных команд:** не подтвердилось; копия побайтово равна оригиналу, handwritten Swift содержит только чтение. Сценарий checksum «до/после UI» на устройстве ещё не выполнялся. +- **Блокировка главного потока вызовами `openBytes`, `rows`, `game`:** не подтвердилась по коду — все три вызова находятся в `Task.detached`. Фактический Main Thread Checker/Instruments не запускался. +- **Постоянная утечка `Database`:** не подтвердилась по сгенерированному коду — есть `deinit → free_database`, AppModel намеренно владеет одной базой. Временное удержание базы непрерванными detached-задачами и реальные графы памяти Instruments не проверялись. +- **Дополнительная гонка обычных быстрых ‹ ›:** не подтверждена статически: `.task(id: place)` имеет cancellation checks, а `shownGame` сверяет `loadedPlace`. Найденный Д-1 относится к отдельному retry Task и не должен быть «заметён» этим пунктом. + +## Непроверенное на macOS / iPhone Simulator — явный список + +1. `xcodegen generate`, компиляция всех Swift-файлов, доступность конкретных SwiftUI API на iOS 16, импорт Clang module и отсутствие конфликтов module maps. +2. `rustup target add`, `cargo check` и `cargo rustc --crate-type staticlib` для всех трёх Apple targets; `lipo`; `xcodebuild -create-xcframework`; окончательный link с `CoreFoundation`/`IOKit`. +3. Любой запуск приложения, cold start, NavigationStack/edge-swipe, восстановление из фона, реальные async-тайминги и UI-проявление Д-1. +4. Tap/long press/cancellation, отсутствие предварительного tap у long press, disabled states и VoiceOver custom actions. +5. Визуальные FEN/flip/координаты, SVG→PNG качество на ×2/×3, safe area, SE 375×667, современный ×3, Dynamic Type и Reduce Motion. +6. Фактическая речь VoiceOver, порядок обхода, Full Keyboard Access и передача hardware keys Simulator. +7. Прокрутка списка после возврата, видимость lastOpened, отсутствие скачков доски/панели и взаимодействие с развилками. +8. Память, CPU, Main Thread Checker и Instruments на списке; эффект Д-4 на больших входах и отсутствие утечек/задержек detached tasks. +9. Подпись, запуск на физическом iPhone и поведение при реальных ошибках чтения/фоновых завершениях. + +## Оценка рисков остатка + +- **Высокий:** нет даже доказательства, что проект компилируется и линкуется на Apple toolchain; количество потенциальных платформенных ошибок после Linux-проверок не ограничено. +- **Высокий:** Д-2 закрывает не весь назначенный просмотр дерева, а Д-1 нарушает идентичность показанной партии. Их нельзя заменять зелёными Rust-тестами: тесты подтверждают данные, но не Swift-состояние/рендер. +- **Средний:** отсутствуют Swift/XCTest targets для `BoardPosition`, `movePairs`, навигации и генерации запросов; управляемые гонки и вложенные RAV сейчас не закреплены регрессиями на стороне приложения. +- **Средний:** accessibility, жесты и Dynamic Type имеют только структурную проверку; Simulator может выявить дополнительные дефекты, включая поведение составного gesture и layout. +- **Средний/латентный:** eager `GameRow` на текущих 100 записях не даёт основания заявлять деградацию, но архитектура больших баз уже отклоняется от требования; измерения проводить после исправления сценария и на macOS/Instruments. +- **Низкий:** ресурсы и локализация структурно целы, но это не доказывает их включение в итоговый `.app` без фактической Xcode-сборки. + +**Итог:** сначала устранить Д-1/Д-2 и согласовать Д-3, затем выполнить обязательный macOS/Xcode прогон по всему списку выше. Ни один пункт Simulator/визуальной приёмки этим отчётом не закрыт. + +--- + +# Повторный вердикт после `iphone-fixes.md` — 2026-11-30 + +Этот раздел добавлен при повторной независимой проверке текущего `iosApp`. Раздел первого прохода выше сохранён как история и описывает прежнюю версию исходников. `docs/qa/iphone-fixes.md` прочитан как заявление разработчика, а не использован как доказательство. + +## Итог повторной проверки + +**Полный structural PASS не выставляется.** По фактически выполненным проверкам: + +- **Д1, Д2, Д3, Д5, Д6, Д7, Д8 — структурно исправлены (PASS);** +- **Д4 — исправлено eager-чтение и реализованы страницы 100/100/50, но обнаружена оставшаяся граница навигации ‹ › на незагруженную страницу (Д9 ниже);** +- текущий комплектный PGN ровно из 100 партий не затрагивается Д9; для базы больше 100 записей дефект воспроизводится структурно; +- **Swift compile, XCTest, Xcode build и Simulator по-прежнему не выполнялись.** На хосте повторно подтверждено отсутствие `xcodebuild`, `swift`, `xcodegen`. + +Окружение повторной проверки (**О-2**): то же Linux x86_64/CachyOS, `rustc 1.99.1`, `cargo 1.99.1`, базовый `HEAD a37c6a78f451c82f665d7908bd927460c088a863` и текущее незакоммиченное дерево с исправлениями. Production не изменялся; новые проверки и probe находятся в `/tmp/opencode/qa-iphone/retest/`. + +## Независимо выполненные повторные проверки + +### Мост и Rust + +Повторно запущены самостоятельно: + +```sh +iosApp/scripts/build-bindings.sh +cargo test -p mobile-api --locked +``` + +- генерация — **exit 0**; SHA-256 всех четырёх generated-файлов до/после снова совпали; +- Linux-ветка скрипта явно пропустила iOS targets/XCFramework; +- Rust — **33 passed / 0 failed / 2 ignored**, doc-tests 0; +- в актуальном generated Swift присутствуют `openBytes`, `rows`, `game`, `MoveNode.marks/end`; оба module map равны. + +Журналы: `/tmp/opencode/qa-iphone/retest/build-bindings.log`, `cargo-test-mobile-api.log`. + +### Собственный probe дерева и данных + +Создан новый `/tmp/opencode/qa-iphone/retest/probe` с независимым executable mirror нового traversal. Это не повторный запуск тестов разработчика и не XCTest. Результаты: + +```text +classics_len=100 +opera_index=6 opera_row=7 +opera_nodes=50 rendered=49 unique=49 expected=49 missing=[] unexpected=[] duplicates=0 +qxb7_ids=[20, 29] all_rendered=true +labels=["8.Qxb7", "Qb4+", "10.Qxb7?!", "Qb4"] +nested_nodes=6 rendered=5 unique=5 expected=5 missing=[] unexpected=[] duplicates=0 +nested_labels=["1.e4", "1.d4", "d5", "1…c5", "1…e5"] parentheses=2 +cycle_rendered=[1] +paging_total=250 pages=100/100/50 boundary_indices=Some(0)/Some(100)/Some(200) +RETEST_PROBE_ASSERTIONS=OK +``` + +Дополнительно на реальных данных `mobile-api` проверено: + +- `[%cal Ge2e4,Rd7d5] [%csl Yd5]` даёт две стрелки и один square mark с ожидаемыми координатами; +- `1. e4 $1` даёт `nags=[1]`, `toSquare=e4`; +- `1. f3 e5 2. g4 Qh4# 0-1` даёт последний `san=Qh4#`, `end=checkmate`; +- сгенерированная только в памяти база из 250 одноходовых PGN подтверждает страницы Rust API 100/100/50 и индексы 0/100/200. + +Журнал: `/tmp/opencode/qa-iphone/retest/mobile-probe.log`. + +### Собственные structural checks + +Запущен `/tmp/opencode/qa-iphone/retest/structural_checks.py` (**exit 0**), не использующий XCTest как доказательство: + +- модель retry A → место B → late-A success/failure оставила `GAME_B/place1`; оба поздних исхода отброшены; +- независимые границы `nextGameRowPage`: 100/100/50, ровно 100, 0, отрицательные и выход за total; +- проверено отсутствие прежнего `rows(0, database.len())`, первая страница через модель, footer `loadNextPage`, append и guards; +- найдены все шесть `keyboardShortcut`, их `perform(GameCommand)` и реальные `stepBack/stepForward/go/goToEnd/flip/dismiss`; +- accessibility label целой строки содержит результат; `ResultTile` больше не скрыт; +- `BoardAnnotationModel` и `BoardView` соединены для arrows/circles/NAG 1…6/checkmate/stalemate; +- Green равен `0xFFFFDD / 0x86A666`. + +Журнал: `/tmp/opencode/qa-iphone/retest/structural-checks.log`. + +### Проект, тесты, локализация и ресурсы + +- `project.yml` разобран независимо: application target, `ChessPenguinTests` типа `bundle.unit-test`, dependency на приложение и `scheme.testTargets = [ChessPenguinTests]`; существуют ровно 5 XCTest-исходников. +- EN/RU: по **35 ключей**, наборы равны; все production/test references разрешаются, printf-placeholders парные, оба stringsdict валидны. +- Все 13 asset `Contents.json` разобраны. +- PGN: **72704 байта**, `cmp` успешен, SHA-256 прежний `52fbe73d40d90382d9d79d8c9d2c7e9af2e749f34f18de3a49d18bfe7ad1200a`. +- В спецификации остались 100 записей, Opera `index=6`/№7; прежних критериев `38 games`, `38 партий`, `1 of 38`, `1 из 38` нет. Единственное текстовое `38` относится к alpha `0,38`. + +## Матрица закрытия Д1–Д8 + +| Дефект | Повторный verdict | Собственное доказательство | +|---|---|---| +| Д1, retry race | **PASS, структурно** | `requestedPlace` захвачен до await; success/error имеют cancellation + current-place guards; `GameLoadState` повторно проверяет requested/current. Поздние success и failure A отброшены в моей модели. | +| Д2, дерево/Qxb7/nested RAV | **PASS, структурно** | Opera 49/49 уникальных reachable nodes, оба `Qxb7`; nested 5/5, две скобки; cycle не зацикливается. Каждый SAN связан с `NotationMoveButton` и стабильным `move-`. | +| Д3, fixture 100/Opera №7 | **PASS** | Rust `len=100`, `opera_index=6`; спецификация и фактические PGN совпадают, PGN не изменён. | +| Д4, paging | **ЧАСТИЧНО** | Eager-запрос устранён, страницы и footer подтверждены. Открыт Д9: ‹ › не запрашивает и не принимает место за пределами уже загруженных `rows`. | +| Д5, keyboard | **PASS, структурно** | Шесть shortcuts и реальные actions присутствуют. Фактическая доставка клавиш остаётся macOS-проверкой. | +| Д6, accessibility result | **PASS, структурно** | Целая кнопка имеет собственный label с именами/сторонами/результатом/контекстом/lastOpened; скрытие `ResultTile` удалено. Речь VoiceOver не проверялась. | +| Д7, marks/end/NAG | **PASS, структурно** | Реальные данные моста + модель arrows/circles/badge/ending + потребители в Board. Визуальная геометрия не проверялась. | +| Д8, Green | **PASS** | Токены `#FFFFDD/#86A666` совпали с назначенными. | + +## Оставшийся дефект Д9 (граница исправления Д4) + +- **Серьёзность:** средняя структурная, только для базы больше 100 записей; на поставляемых 100 не проявляется. +- **Окружение/версия:** О-2; воспроизведено на модели состояния 250 total/100 loaded и подтверждено прямыми условиями текущего Swift. Simulator-наблюдения не было. +- **Шаги:** (1) открыть debug-базу на 250 партий, имея загруженной первую страницу 100; (2) открыть запись `place=99` до завершения загрузки следующей страницы; (3) попытаться перейти ‹ › к записи `place=100`. +- **Ожидаемо:** переход к следующей партии в порядке списка либо явный запрос/состояние загрузки следующей страницы с последующим переходом. +- **Фактически:** кнопка следующей партии disabled, потому что условие сравнивает `place + 1` с `model.rows.count = 100`, хотя `totalGames = 250`. Даже прямой `show(100)` не проходит второй guard `model.rows.indices.contains(100)`. `GameView` сам `loadNextPage()` не вызывает. Если footer уже загрузил страницу, кнопка позже разблокируется; до загрузки, при её отсутствии или ошибке переход из экрана партии недоступен и ошибки страницы там нет. +- **Файл/строка:** `iosApp/ChessPenguin/GameView.swift:86-90` (disabled), `131-135` (`show`); загрузка существует только в `AppModel.swift:72-92` и footer `LibraryViews.swift:93-105`. +- **Минимальный пример:** `/tmp/opencode/qa-iphone/retest/structural_checks.py` вывел: + + ```text + boundary_place=99 loaded_rows=100 totalGames=250 next_disabled=True show_place_100_accepted=False + REMAINING_PAGING_NEIGHBOR_BOUNDARY=CONFIRMED + ``` + + Rust probe той же проверки подтвердил, что API способен вернуть `rows(100,100)` с индекса 100: ограничение находится в Swift-навигации, не в мосте. + +## Что остаётся обязательным на macOS / Simulator + +1. `xcodegen generate`; фактическая компиляция production и всех 5 test files; окончательная UniFFI/staticlib/XCFramework link. Наличие test target в YAML не доказывает компиляцию XCTest. +2. `xcodebuild test` на доступном iPhone Simulator: выполнить, а не только прочитать XCTest для race, pages, Opera/nested/cycle, FEN/flip, marks/NAG/end, keyboard/accessibility. +3. Отдельный debug fixture **больше 100** (например, 250), не меняя bundled PGN: footer 100→200→250, открытие №100 во время загрузки и после ошибки, ‹ › через границу 100/101, повтор и отмена запросов. Это одновременно проверит UI-проявление Д9. +4. Контролируемые задержки retry/place на живом UI: late success и late failure не должны менять партию, заголовок или ошибку нового места. +5. Касания каждого SAN в `8.Qxb7…` и вложенном RAV, выделение/scroll по `MoveNode.id`, многострочный `FlowLayout`, Dynamic Type и отсутствие переполнений. +6. Hardware keys и Full Keyboard Access; фактическая речь VoiceOver для полного имени, результата, lastOpened, текущего хода и board ending. +7. Визуальная приёмка arrows/circles/NAG/checkmate/stalemate, Green, FEN/flip, ×2/×3, safe area; tap/long press/cancellation и Reduce Motion. +8. Instruments/Main Thread Checker для paging и полного дерева; память/CPU и отсутствие утечек detached tasks не объявлять по Linux-модели. + +**Повторный итог:** заявленные исправления в основном подтверждены независимо, но полный structural PASS блокирует Д9. После его исправления всё равно обязательны перечисленные macOS/Xcode/XCTest/Simulator проверки; ни одна из них этим разделом не отмечена выполненной. + +--- + +# Итоговая проверка исправления Д9 — 2026-11-30 + +Проверен текущий код с `NextGameRequest` и `GameView.showNext`. Предыдущие разделы оставлены как историю соответствующих версий. + +## Вердикт + +- **Исходный Д9 закрыт структурно:** кнопка Next теперь ограничена только `totalGames`; `NextGameRequest` определяет необходимость страницы; независимые модели подтвердили переходы **100→101** и **200→201**, уже загруженный переход 101→102 и отмену перехода при смене origin во время ожидания. +- **Полный structural PASS всё ещё не выставляется:** независимая проверка разделяемой с footer загрузки воспроизвела новый граничный дефект **Д10** — Next во время уже активного `loadNextPage` теряется и после завершения страницы не выполняется. +- Swift compile, XCTest, Xcode build и Simulator **не запускались и PASS не получали**. + +Окружение (**О-3**): прежний Linux x86_64/CachyOS, `rustc 1.99.1`, `cargo 1.99.1`, текущее незакоммиченное дерево на базовом `HEAD a37c6a78f451c82f665d7908bd927460c088a863`. Новые проверки: `/tmp/opencode/qa-iphone/final/`; production не изменялся. + +## Фактические проверки исправления + +Повторно выполнены: + +```sh +iosApp/scripts/build-bindings.sh +cargo test -p mobile-api --locked +``` + +Генерация завершилась с **exit 0**, четыре generated SHA-256 до/после совпали; Linux-ветка не имитировала Apple targets. Rust: **33 passed / 0 failed / 2 ignored**, doc-tests 0. Журналы — `final/build-bindings.log`, `final/cargo-test-mobile-api.log`. + +Собственный `/tmp/opencode/qa-iphone/final/next_game_checks.py` проверил исходные условия Swift и управляемые асинхронные чередования, а не XCTest разработчика: + +```text +next_request_boundaries_and_source_wiring=OK +direct_100_to_101: rows=200 final_place=101 +direct_200_to_201: rows=250 final_place=201 +already_loaded_101_to_102: final_place=102 loading=False +origin_changed_during_wait: final_place=99 rows=200 +next_while_footer_loading_before_completion: final_place=100 rows=100 +next_while_footer_loading_after_completion: final_place=100 rows=200 +REMAINING_SHARED_PAGE_WAIT_RACE=CONFIRMED +NOMINAL_D9_BOUNDARIES=PASS; CONCURRENT_FOOTER_CASE=OPEN +``` + +Здесь номера `final_place` человеческие (place + 1): в последних двух строках осталась открыта партия №100 (`place=99`) при 100, затем 200 загруженных строках. Журнал: `/tmp/opencode/qa-iphone/final/next-game-checks.log`. + +## Оставшийся дефект Д10: `await loadNextPage` не ждёт уже активную страницу + +- **Серьёзность:** низкая — один Next во время загрузки молча теряется; после её завершения повторный tap возможен. Неверная партия не открывается. +- **Окружение/версия:** О-3; воспроизведено управляемой моделью текущих `AppModel`/`GameView`, без Simulator. +- **Шаги:** (1) в списке footer начал загрузку второй страницы; (2) до её завершения открыть партию №100 (`place=99`, 100 loaded/250 total) и нажать Next; (3) дождаться завершения footer-запроса. +- **Ожидаемо:** `showNext` остаётся в ожидании уже идущей страницы либо повторно проверяет загруженность после неё и затем открывает №101 (`place=100`). +- **Фактически:** `showNext` вызывает `await model.loadNextPage()`, но у `AppModel` guard `!isLoadingPage` немедленно возвращает новый вызов, не присоединяясь к текущей работе. Пока `rows.count` ещё 100, origin guard проходит, а `show(100)` отклоняется собственным `rows.indices.contains` guard. Footer позже доводит rows до 200, но уже завершённый `showNext` не повторяет переход: пользователь остаётся на №100. +- **Файл/строка:** `iosApp/ChessPenguin/AppModel.swift:72-85` (ранний guard и настоящее ожидание только первого вызова), `GameView.swift:131-147` (`await`, origin guard и одноразовый `show`). Footer использует тот же метод в `LibraryViews.swift:93-105`. +- **Минимальный пример:** сценарий `shared` в `/tmp/opencode/qa-iphone/final/next_game_checks.py`; фактический вывод приведён выше. Прямой Next без уже активной загрузки работает, поэтому этот дефект не отменяет закрытие исходного Д9. + +## Обязательная проверка на macOS после доработки + +1. Выполнить `xcodegen generate`, Swift compile production/tests и `xcodebuild test`; существование XCTest 100→101/200→201 в исходнике не считается его запуском. +2. На debug-базе 250 с управляемой задержкой страницы проверить оба порядка: **Next сам начинает загрузку** и **footer уже грузит страницу, затем Next**. Во втором случае после одного tap должна открыться №101; повторный tap не должен требоваться. +3. Там же проверить ошибку/повтор страницы, смену origin во время ожидания и быстрые последовательные Next через 100/101 и 200/201. +4. Все ранее перечисленные Simulator-проверки retry race, полного RAV, keyboard/VoiceOver, marks/end, Green, жестов, Dynamic Type, safe area и Instruments остаются обязательными. + +**Итоговый статус:** Д1–Д9 подтверждены исправленными на своих определённых сценариях; полный structural verdict удерживается только из-за воспроизведённого Д10 и отсутствия обязательного macOS/Simulator прогона. + +--- + +# Общий вердикт после shared `nextPageTask` — 2026-11-30 + +## Structural PASS для независимо проверенного объёма Д1–Д10 + +**Д10 закрыт. По совокупности независимых проходов Д1–Д10 получают Linux structural PASS.** В проверенных чередованиях shared task, cleanup, identity, second call, origin и cancellation новых гонок не подтвердилось. + +Это **не** приёмка скомпилированного приложения и **не** Simulator PASS: Swift compile, XCTest, Xcode build и Simulator в этой проверке не выполнялись. Обязательный macOS-остаток перечислен ниже. + +Окружение (**О-4**): Linux x86_64/CachyOS, `rustc 1.99.1`, `cargo 1.99.1`, текущее незакоммиченное дерево на базовом `HEAD a37c6a78f451c82f665d7908bd927460c088a863`. Production не изменялся; новые проверки и журналы — `/tmp/opencode/qa-iphone/final2/`. + +## Независимая проверка shared task + +Сначала по исходнику подтверждено: + +- повторный caller входит в `if let nextPageTask` и ждёт тот же handle вместо возврата по `isLoadingPage`; +- `nextPageTask = task` установлен до `await task.value`; запуск `performNextPageLoad` содержит единственный вызов `rowLoader`; +- `defer` после активной работы сбрасывает и `isLoadingPage`, и `nextPageTask`; +- после loader сохранены guards `self.database === database` и `rows.count == page.start`; +- `showNext` сохраняет cancellation/origin guard перед одноразовым `show(request.toPlace)`; +- delayed concurrent XCTest существует, но сам по себе не использовался как доказательство выполнения. + +Затем запущен собственный управляемый probe `/tmp/opencode/qa-iphone/final2/shared_page_checks.py` (**exit 0**). Он моделирует reentrancy MainActor и независимое ожидание shared handle, включая отмену waiter без отмены общей работы. Фактический вывод: + +```text +source_shared_task_cleanup_identity_guards=OK +footer_plus_duplicate_plus_next: loader_calls=1 rows=200 human_place=101 task_cleared=True loading=False +second_call_new_page: loader_calls=2 rows=250 human_place=201 task_cleared=True +error_cleanup_then_retry: loader_calls=2 rows=200 error=None task_cleared=True +database_identity_guard_then_second_call: loader_calls=2 rows=200 database=DB_B task_cleared=True +origin_changed_while_shared_wait: rows=200 human_place=99 +cancelled_next_waiter_shared_continues: loader_calls=1 rows=200 human_place=100 task_cleared=True +SHARED_TASK_BEHAVIORAL_ASSERTIONS=OK +D10_AND_CLEANUP_IDENTITY_SECOND_CALL=STRUCTURAL_PASS +``` + +Проверенные смыслы: + +1. **Footer + duplicate footer + Next:** три ожидающих вызова, один loader и один append; Next после общего завершения открывает №101 без повторного tap. Это закрывает исходный Д10. +2. **Second call после cleanup:** следующий вызов не ждёт старый handle и не пропускает страницу; второй loader доводит 200→250, Next открывает №201. Вызов при `rows == totalGames` нового loader не создаёт. +3. **Ошибка и retry:** неверный размер результата оставляет rows неизменными, выставляет page error и очищает handle/loading; повторный вызов запускает новый loader и успешно добавляет страницу. +4. **Identity:** результат старой базы не добавляется после смены identity; cleanup выполняется, следующий вызов для новой базы работает. Отдельно в исходнике сохранён guard изменившегося `rows.count`. +5. **Origin:** пока shared task выполняется, пользователь может уйти с исходного места; завершение загрузки не вызывает нежелательный переход. +6. **Cancellation:** отмена одного ожидающего Next не отменяет shared loader и не открывает партию; остальной waiter получает завершённую страницу, handle очищается. + +Журнал: `/tmp/opencode/qa-iphone/final2/shared-page-checks.log`. + +## Повторные мост и Rust + +Выполнены на текущем дереве: + +```sh +iosApp/scripts/build-bindings.sh +cargo test -p mobile-api --locked +``` + +- bindings — **exit 0**, все четыре generated SHA-256 до/после совпали; Apple targets на Linux не имитировались; +- Rust — **33 passed / 0 failed / 2 ignored**, doc-tests 0. + +Журналы: `/tmp/opencode/qa-iphone/final2/build-bindings.log`, `cargo-test-mobile-api.log`. + +## Неподтверждённое и обязательный macOS-остаток + +Новых структурных дефектов в перечисленных выше сценариях **не подтвердилось**, но это не исключает особенности реального Swift runtime и UI. До продуктовой приёмки обязательны: + +1. `xcodegen generate`, компиляция production/tests, окончательная UniFFI/XCFramework link и фактический `xcodebuild test`, включая delayed concurrent XCTest. +2. Живой сценарий на debug-базе 250: footer начинает загрузку → один Next во время неё → ровно один loader и переход №100→№101; затем №200→№201. Отдельно — retry после ошибки и быстрые повторные Next. +3. Отмена view/waiter во время shared load, смена origin, уход в фон и возврат; проверить реальные cancellation-тайминги SwiftUI, не только модель. +4. Instruments/Main Thread Checker: активный task временно удерживает model/loader до завершения работы; подтвердить освобождение после success/error/cancellation и отсутствие накопления задач. Заявлять об утечках или их отсутствии только по модели нельзя. +5. Все прежние Simulator-критерии: retry race, полное RAV-дерево и касания SAN, keyboard/VoiceOver, marks/NAG/checkmate/stalemate, Green, жесты, Dynamic Type, safe area и HiDPI. + +**Общий итог:** назначенный Linux structural срез Д1–Д10 принят. Следующий обязательный этап — реальная сборка, XCTest и UI/память на macOS/Simulator; эти пункты остаются открытыми и не заменяются данным PASS. diff --git a/iosApp/.gitignore b/iosApp/.gitignore new file mode 100644 index 0000000..14a8859 --- /dev/null +++ b/iosApp/.gitignore @@ -0,0 +1,9 @@ +# Generated by XcodeGen / Xcode; rebuild locally on macOS. +/ChessPenguin.xcodeproj/ +/Frameworks/ +/DerivedData/ + +# Xcode user-specific state and macOS metadata. +xcuserdata/ +*.xcuserstate +.DS_Store diff --git a/iosApp/ChessPenguin/AppModel.swift b/iosApp/ChessPenguin/AppModel.swift new file mode 100644 index 0000000..68a7511 --- /dev/null +++ b/iosApp/ChessPenguin/AppModel.swift @@ -0,0 +1,140 @@ +import Foundation + +enum AppRoute: Hashable { + case games + case game(place: Int) +} + +private enum AppModelError: LocalizedError { + case sampleMissing + case databaseNotOpen + case invalidGame + case invalidPage + + var errorDescription: String? { + switch self { + case .sampleMissing, .databaseNotOpen: + return String(localized: "sample_missing") + case .invalidGame: + return String(localized: "invalid_game") + case .invalidPage: + return String(localized: "open_failed") + } + } +} + +@MainActor +final class AppModel: ObservableObject { + typealias RowLoader = @MainActor (Database, UInt32, UInt32) async -> [GameRow] + + @Published var path: [AppRoute] = [] + @Published private(set) var database: Database? + @Published private(set) var rows: [GameRow] = [] + @Published private(set) var totalGames = 0 + @Published private(set) var isLoading = false + @Published private(set) var isLoadingPage = false + @Published private(set) var loadError: String? + @Published private(set) var pageError: String? + @Published var lastOpened: Int? + + private var nextPageTask: Task? + private let rowLoader: RowLoader + + init( + database: Database? = nil, + rows: [GameRow] = [], + totalGames: Int = 0, + rowLoader: RowLoader? = nil + ) { + self.database = database + self.rows = rows + self.totalGames = totalGames + self.rowLoader = rowLoader ?? AppModel.loadRowsDetached + } + + private static func loadRowsDetached(database: Database, start: UInt32, count: UInt32) async -> [GameRow] { + await Task.detached(priority: .userInitiated) { + database.rows(start: start, count: count) + }.value + } + + var canLoadMore: Bool { rows.count < totalGames } + + func loadSample() async { + guard database == nil, !isLoading else { return } + isLoading = true + loadError = nil + pageError = nil + defer { isLoading = false } + + do { + let opened = try await Task.detached(priority: .userInitiated) { + guard let url = Bundle.main.url(forResource: "classics", withExtension: "pgn") else { + throw AppModelError.sampleMissing + } + let bytes = try Data(contentsOf: url) + let database = try openBytes(name: "classics.pgn", bytes: bytes) + let total = Int(database.len()) + guard let page = nextGameRowPage(loaded: 0, total: total), + let count = UInt32(exactly: page.count) else { + return (database, total, [GameRow]()) + } + let rows = database.rows(start: 0, count: count) + return (database, total, rows) + }.value + database = opened.0 + totalGames = opened.1 + rows = opened.2 + } catch { + rows = [] + totalGames = 0 + loadError = error.localizedDescription + } + } + + func loadNextPage() async { + if let nextPageTask { + await nextPageTask.value + return + } + guard let database, canLoadMore else { return } + guard let page = nextGameRowPage(loaded: rows.count, total: totalGames), + let start = UInt32(exactly: page.start), let count = UInt32(exactly: page.count) else { + pageError = AppModelError.invalidPage.localizedDescription + return + } + + let task = Task { @MainActor [weak self] in + guard let self else { return } + await self.performNextPageLoad(database: database, page: page, start: start, count: count) + } + nextPageTask = task + await task.value + } + + private func performNextPageLoad(database: Database, page: GameRowPage, start: UInt32, count: UInt32) async { + isLoadingPage = true + pageError = nil + defer { + isLoadingPage = false + nextPageTask = nil + } + + let next = await rowLoader(database, start, count) + guard self.database === database, rows.count == page.start else { return } + guard next.count == page.count else { + pageError = AppModelError.invalidPage.localizedDescription + return + } + rows.append(contentsOf: next) + } + + func game(atPlace place: Int) async throws -> GameData { + guard let database else { throw AppModelError.databaseNotOpen } + guard rows.indices.contains(place) else { throw AppModelError.invalidGame } + let index = rows[place].index + return try await Task.detached(priority: .userInitiated) { + try database.game(index: index) + }.value + } +} diff --git a/iosApp/ChessPenguin/BoardAnnotations.swift b/iosApp/ChessPenguin/BoardAnnotations.swift new file mode 100644 index 0000000..0d1b0a1 --- /dev/null +++ b/iosApp/ChessPenguin/BoardAnnotations.swift @@ -0,0 +1,95 @@ +import Foundation + +enum BoardMarkColor: String, Equatable { + case red = "R" + case green = "G" + case blue = "B" + case yellow = "Y" + case other + + init(_ letter: String) { + self = BoardMarkColor(rawValue: letter) ?? .other + } + + var rgb: UInt32 { + switch self { + case .red: return 0x882020 + case .green: return 0x15781B + case .blue: return 0x003088 + case .yellow: return 0xE68F00 + case .other: return 0x787878 + } + } +} + +struct BoardArrowModel: Equatable { + let from: Int + let to: Int + let color: BoardMarkColor +} + +struct BoardCircleModel: Equatable, Identifiable { + let id: Int + let square: Int + let color: BoardMarkColor +} + +struct BoardBadgeModel: Equatable { + let square: Int + let text: String + let rgb: UInt32 +} + +enum BoardEnding: String, Equatable { + case checkmate + case stalemate +} + +struct BoardAnnotationModel: Equatable { + let arrows: [BoardArrowModel] + let circles: [BoardCircleModel] + let badge: BoardBadgeModel? + let ending: BoardEnding? + + init(node: MoveNode?) { + var arrows: [BoardArrowModel] = [] + var circles: [BoardCircleModel] = [] + for (offset, mark) in (node?.marks ?? []).enumerated() { + guard let from = squareIndex(mark.from) else { continue } + let color = BoardMarkColor(mark.color) + if let destination = mark.to, let to = squareIndex(destination) { + arrows.append(BoardArrowModel(from: from, to: to, color: color)) + } else { + circles.append(BoardCircleModel(id: offset, square: from, color: color)) + } + } + self.arrows = arrows + self.circles = circles + self.ending = node.flatMap { BoardEnding(rawValue: $0.end) } + + if let node, let square = squareIndex(node.toSquare), + let nag = node.nags.first(where: { (1...6).contains($0) }), + let badge = BoardAnnotationModel.badge(for: nag, square: square) { + self.badge = badge + } else { + self.badge = nil + } + } + + private static func badge(for nag: UInt8, square: Int) -> BoardBadgeModel? { + switch nag { + case 1: return BoardBadgeModel(square: square, text: "!", rgb: 0x81B64C) + case 2: return BoardBadgeModel(square: square, text: "?", rgb: 0xFFA459) + case 3: return BoardBadgeModel(square: square, text: "!!", rgb: 0x26C2A3) + case 4: return BoardBadgeModel(square: square, text: "??", rgb: 0xFA412D) + case 5: return BoardBadgeModel(square: square, text: "!?", rgb: 0xEA45D8) + case 6: return BoardBadgeModel(square: square, text: "?!", rgb: 0x56B4E9) + default: return nil + } + } +} + +func visualSquareIndex(_ index: Int, flipped: Bool) -> Int? { + guard (0..<64).contains(index) else { return nil } + return flipped ? 63 - index : index +} diff --git a/iosApp/ChessPenguin/BoardView.swift b/iosApp/ChessPenguin/BoardView.swift new file mode 100644 index 0000000..3013144 --- /dev/null +++ b/iosApp/ChessPenguin/BoardView.swift @@ -0,0 +1,253 @@ +import SwiftUI + +struct BoardPosition { + /// Pieces in FEN order, a8 first. Nil is an empty square. + let squares: [Character?] + + init?(fen: String) { + guard let placement = fen.split(separator: " ").first else { return nil } + let ranks = placement.split(separator: "/", omittingEmptySubsequences: false) + guard ranks.count == 8 else { return nil } + + var parsed: [Character?] = [] + parsed.reserveCapacity(64) + for rank in ranks { + var rankCount = 0 + for symbol in rank { + guard symbol.isASCII else { return nil } + if let digit = symbol.wholeNumberValue { + guard (1...8).contains(digit) else { return nil } + rankCount += digit + for _ in 0.. Int? { + guard let name else { return nil } + let bytes = Array(name.utf8) + guard bytes.count == 2 else { return nil } + let file = Int(bytes[0]) - 97 + let rank = Int(bytes[1]) - 48 + guard (0..<8).contains(file), (1...8).contains(rank) else { return nil } + return (8 - rank) * 8 + file +} + +private func pieceAssetName(_ piece: Character) -> String? { + let white = piece.isUppercase + guard let uppercase = piece.uppercased().first else { return nil } + switch uppercase { + case "K", "Q", "R", "B", "N", "P": + return "\(white ? "w" : "b")\(uppercase)" + default: + return nil + } +} + +private extension BoardMarkColor { + var color: Color { Color(rgb: rgb).opacity(170.0 / 255.0) } +} + +struct BoardView: View { + let node: MoveNode? + let flipped: Bool + let description: String + + var body: some View { + let annotations = BoardAnnotationModel(node: node) + Group { + if let position = BoardPosition(fen: node?.fen ?? "") { + GeometryReader { geometry in + let side = min(geometry.size.width, geometry.size.height) + let cell = side / 8 + ZStack { + VStack(spacing: 0) { + ForEach(0..<8, id: \.self) { row in + HStack(spacing: 0) { + ForEach(0..<8, id: \.self) { column in + BoardSquare( + visualIndex: row * 8 + column, + cell: cell, + position: position, + flipped: flipped, + highlighted: [squareIndex(node?.fromSquare), squareIndex(node?.toSquare)], + circles: annotations.circles + ) + } + } + } + } + BoardArrows(arrows: annotations.arrows, cell: cell, flipped: flipped) + if let badge = annotations.badge { + BoardBadge(badge: badge, cell: cell, flipped: flipped) + } + if let ending = annotations.ending { + Text(ending == .checkmate ? L10n.checkmate : L10n.stalemate) + .font(.headline) + .foregroundStyle(Theme.onSurface) + .padding(.horizontal, 16) + .padding(.vertical, 8) + .background(Theme.containerHigh.opacity(0.94)) + .clipShape(RoundedRectangle(cornerRadius: 8)) + } + } + .frame(width: side, height: side) + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + } else { + Text(String(localized: "invalid_position")) + .foregroundStyle(Theme.error) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(Theme.containerLow) + } + } + .frame(maxWidth: .infinity) + .aspectRatio(1, contentMode: .fit) + .accessibilityElement(children: .ignore) + .accessibilityLabel(description) + } +} + +private struct BoardSquare: View { + let visualIndex: Int + let cell: CGFloat + let position: BoardPosition + let flipped: Bool + let highlighted: [Int?] + let circles: [BoardCircleModel] + + private let files = Array("abcdefgh") + + var body: some View { + let index = flipped ? 63 - visualIndex : visualIndex + let light = (index / 8 + index % 8) % 2 == 0 + let isHighlighted = highlighted.contains { $0 == index } + let coordinateColor = light ? Theme.boardDark : Theme.boardLight + + ZStack(alignment: .topLeading) { + Rectangle().fill(light ? Theme.boardLight : Theme.boardDark) + if isHighlighted { + Rectangle().fill(Theme.lastMove) + } + if let piece = position.squares[index], let asset = pieceAssetName(piece) { + Image(asset) + .resizable() + .interpolation(.high) + .aspectRatio(contentMode: .fit) + .padding(max(0, cell * 0.04)) + } + ForEach(circles.filter { $0.square == index }) { mark in + Circle() + .stroke(mark.color.color, lineWidth: max(1, cell * 0.08)) + .frame(width: cell * 0.9, height: cell * 0.9) + } + if visualIndex % 8 == 0 { + Text(String(8 - index / 8)) + .font(.system(size: max(8, cell * 0.18), weight: .medium)) + .foregroundStyle(coordinateColor) + .padding(2) + } + if visualIndex / 8 == 7 { + Text(String(files[index % 8])) + .font(.system(size: max(8, cell * 0.18), weight: .medium)) + .foregroundStyle(coordinateColor) + .frame(width: cell, height: cell, alignment: .bottomTrailing) + .padding(2) + } + } + .frame(width: cell, height: cell) + } +} + +private struct BoardArrows: View { + let arrows: [BoardArrowModel] + let cell: CGFloat + let flipped: Bool + + var body: some View { + Canvas { context, _ in + for arrow in arrows { + guard let from = squareCenter(arrow.from, cell: cell, flipped: flipped), + let to = squareCenter(arrow.to, cell: cell, flipped: flipped) else { continue } + drawArrow(context: &context, from: from, to: to, color: arrow.color.color) + } + } + .allowsHitTesting(false) + } + + private func squareCenter(_ index: Int, cell: CGFloat, flipped: Bool) -> CGPoint? { + guard let visual = visualSquareIndex(index, flipped: flipped) else { return nil } + return CGPoint(x: CGFloat(visual % 8) * cell + cell / 2, y: CGFloat(visual / 8) * cell + cell / 2) + } + + private func drawArrow(context: inout GraphicsContext, from: CGPoint, to: CGPoint, color: Color) { + let dx = to.x - from.x + let dy = to.y - from.y + let length = hypot(dx, dy) + guard length > 1 else { return } + let direction = CGPoint(x: dx / length, y: dy / length) + let normal = CGPoint(x: -direction.y, y: direction.x) + let start = from + direction * (cell * 0.2) + let tip = to - direction * (cell * 0.12) + let base = tip - direction * (cell * 0.42) + + var shaft = Path() + shaft.move(to: start) + shaft.addLine(to: base) + context.stroke(shaft, with: .color(color), style: StrokeStyle(lineWidth: cell * 0.16, lineCap: .round)) + + var head = Path() + head.move(to: tip) + head.addLine(to: base + normal * (cell * 0.38)) + head.addLine(to: base - normal * (cell * 0.38)) + head.closeSubpath() + context.fill(head, with: .color(color)) + } +} + +private struct BoardBadge: View { + let badge: BoardBadgeModel + let cell: CGFloat + let flipped: Bool + + var body: some View { + GeometryReader { _ in + if let visual = visualSquareIndex(badge.square, flipped: flipped) { + let size = max(18, cell * 0.42) + Text(badge.text) + .font(.system(size: size * 0.52, weight: .black)) + .foregroundStyle(Color.white) + .frame(width: size, height: size) + .background(Color(rgb: badge.rgb)) + .clipShape(Circle()) + .overlay(Circle().stroke(Color.white, lineWidth: max(1, cell * 0.025))) + .position( + x: CGFloat(visual % 8) * cell + cell * 0.82, + y: CGFloat(visual / 8) * cell + cell * 0.18 + ) + } + } + .allowsHitTesting(false) + } +} + +private func + (lhs: CGPoint, rhs: CGPoint) -> CGPoint { + CGPoint(x: lhs.x + rhs.x, y: lhs.y + rhs.y) +} + +private func - (lhs: CGPoint, rhs: CGPoint) -> CGPoint { + CGPoint(x: lhs.x - rhs.x, y: lhs.y - rhs.y) +} + +private func * (lhs: CGPoint, rhs: CGFloat) -> CGPoint { + CGPoint(x: lhs.x * rhs, y: lhs.y * rhs) +} diff --git a/iosApp/ChessPenguin/ChessPenguinApp.swift b/iosApp/ChessPenguin/ChessPenguinApp.swift new file mode 100644 index 0000000..b86d526 --- /dev/null +++ b/iosApp/ChessPenguin/ChessPenguinApp.swift @@ -0,0 +1,34 @@ +import SwiftUI + +@main +struct ChessPenguinApp: App { + @StateObject private var model = AppModel() + + var body: some Scene { + WindowGroup { + RootView() + .environmentObject(model) + .preferredColorScheme(.dark) + .tint(Theme.primary) + } + } +} + +private struct RootView: View { + @EnvironmentObject private var model: AppModel + + var body: some View { + NavigationStack(path: $model.path) { + DatabasesView() + .navigationDestination(for: AppRoute.self) { route in + switch route { + case .games: + GamesView() + case .game(let place): + GameView(startPlace: place) + } + } + } + .background(Theme.background.ignoresSafeArea()) + } +} diff --git a/iosApp/ChessPenguin/GameCommands.swift b/iosApp/ChessPenguin/GameCommands.swift new file mode 100644 index 0000000..73def88 --- /dev/null +++ b/iosApp/ChessPenguin/GameCommands.swift @@ -0,0 +1,30 @@ +import Foundation + +enum GameCommand: Equatable { + case previousMove + case nextMove + case startOfLine + case endOfLine + case flip + case back +} + +enum GameKeyboardKey: Equatable { + case leftArrow + case rightArrow + case shiftLeftArrow + case shiftRightArrow + case f + case escape +} + +func gameCommand(for key: GameKeyboardKey) -> GameCommand { + switch key { + case .leftArrow: return .previousMove + case .rightArrow: return .nextMove + case .shiftLeftArrow: return .startOfLine + case .shiftRightArrow: return .endOfLine + case .f: return .flip + case .escape: return .back + } +} diff --git a/iosApp/ChessPenguin/GameLoadState.swift b/iosApp/ChessPenguin/GameLoadState.swift new file mode 100644 index 0000000..3510e91 --- /dev/null +++ b/iosApp/ChessPenguin/GameLoadState.swift @@ -0,0 +1,53 @@ +import Foundation + +/// Result of one game request. Both the request and the current visible place must match: +/// a retry is not tied to SwiftUI's `.task(id:)` cancellation and may finish later. +struct GameLoadState { + private(set) var game: Game? + private(set) var loadedPlace: Int? + private(set) var failure: String? + + mutating func begin() { + failure = nil + } + + @discardableResult + mutating func succeed(requestedPlace: Int, currentPlace: Int, game loaded: Game) -> Bool { + guard requestedPlace == currentPlace else { return false } + game = loaded + loadedPlace = requestedPlace + failure = nil + return true + } + + @discardableResult + mutating func fail(requestedPlace: Int, currentPlace: Int, message: String) -> Bool { + guard requestedPlace == currentPlace else { return false } + game = nil + loadedPlace = requestedPlace + failure = message + return true + } +} + +struct GameRowPage: Equatable { + let start: Int + let count: Int +} + +func nextGameRowPage(loaded: Int, total: Int, pageSize: Int = 100) -> GameRowPage? { + guard pageSize > 0, loaded >= 0, total >= 0, loaded < total else { return nil } + return GameRowPage(start: loaded, count: min(pageSize, total - loaded)) +} + +struct NextGameRequest: Equatable { + let fromPlace: Int + let toPlace: Int + let needsNextPage: Bool +} + +func nextGameRequest(fromPlace: Int, totalGames: Int, loadedRows: Int) -> NextGameRequest? { + let next = fromPlace + 1 + guard fromPlace >= 0, loadedRows >= 0, next < totalGames else { return nil } + return NextGameRequest(fromPlace: fromPlace, toPlace: next, needsNextPage: next >= loadedRows) +} diff --git a/iosApp/ChessPenguin/GameView.swift b/iosApp/ChessPenguin/GameView.swift new file mode 100644 index 0000000..1bcc5ec --- /dev/null +++ b/iosApp/ChessPenguin/GameView.swift @@ -0,0 +1,346 @@ +import SwiftUI + +struct GameView: View { + @EnvironmentObject private var model: AppModel + @Environment(\.dismiss) private var dismiss + + @State private var place: Int + @State private var loadState = GameLoadState() + @State private var current = 0 + @State private var flipped = false + + init(startPlace: Int) { + _place = State(initialValue: startPlace) + } + + private var shownGame: GameData? { + loadState.loadedPlace == place ? loadState.game : nil + } + + private var currentNode: MoveNode? { + guard let shownGame, shownGame.nodes.indices.contains(current) else { return nil } + return shownGame.nodes[current] + } + + var body: some View { + VStack(spacing: 0) { + if let game = shownGame { + PlayerBar(game: game, white: flipped) + BoardView( + node: currentNode ?? game.nodes.first, + flipped: flipped, + description: boardDescription + ) + PlayerBar(game: game, white: !flipped) + if let node = currentNode, node.children.count > 1 { + ForkBar(nodes: node.children.compactMap { child in + let id = Int(child) + return game.nodes.indices.contains(id) ? game.nodes[id] : nil + }, onMove: go) + } + NotationView(game: game, current: current, onMove: go) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .layoutPriority(1) + } else if loadState.loadedPlace == place, let failure = loadState.failure { + ErrorMessage(title: L10n.gameFailed, detail: failure) { + Task { await load() } + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + } else { + VStack(spacing: 12) { + ProgressView() + Text(L10n.reading).foregroundStyle(Theme.onSurfaceVariant) + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + } + } + .background(Theme.background) + .background { GameKeyboardCommands(perform: perform) } + .safeAreaInset(edge: .bottom) { + MoveControls( + canBack: currentNode?.parent != nil, + canForward: currentNode?.children.isEmpty == false, + onFlip: { flipped.toggle() }, + onBack: stepBack, + onForward: stepForward, + onStart: { go(to: 0) }, + onEnd: goToEnd + ) + } + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .principal) { + VStack(spacing: 0) { + Text(eventTitle).font(.headline).lineLimit(1) + Text(L10n.gameOf(place + 1, model.totalGames)) + .font(.caption.monospacedDigit()) + .foregroundStyle(Theme.onSurfaceVariant) + } + } + ToolbarItemGroup(placement: .navigationBarTrailing) { + Button { show(place - 1) } label: { + Image(systemName: "chevron.left") + } + .disabled(place <= 0) + .accessibilityLabel(L10n.previousGame) + Button { Task { await showNext() } } label: { + Image(systemName: "chevron.right") + } + .disabled(place + 1 >= model.totalGames) + .accessibilityLabel(L10n.nextGame) + } + } + .task(id: place) { await load() } + } + + private var eventTitle: String { + if let game = shownGame { + let event = joinedKnown([game.tag("Event"), game.tag("Date").flatMap(pgnYear)]) + if !event.isEmpty { return event } + if let site = known(game.tag("Site") ?? "") { return site } + } + return L10n.classics + } + + private var boardDescription: String { + guard let node = currentNode, current != 0 else { return L10n.boardStart } + var description = L10n.boardAfter(moveLabel(node)) + switch BoardEnding(rawValue: node.end) { + case .checkmate: description += " · \(L10n.checkmate)" + case .stalemate: description += " · \(L10n.stalemate)" + case nil: break + } + return description + } + + private func load() async { + let requestedPlace = place + loadState.begin() + do { + let loaded = try await model.game(atPlace: requestedPlace) + guard !Task.isCancelled, place == requestedPlace else { return } + guard loadState.succeed(requestedPlace: requestedPlace, currentPlace: place, game: loaded) else { return } + current = 0 + model.lastOpened = requestedPlace + } catch { + guard !Task.isCancelled, place == requestedPlace else { return } + loadState.fail(requestedPlace: requestedPlace, currentPlace: place, message: error.localizedDescription) + } + } + + private func showNext() async { + guard let request = nextGameRequest( + fromPlace: place, + totalGames: model.totalGames, + loadedRows: model.rows.count + ) else { return } + if request.needsNextPage { + await model.loadNextPage() + } + guard !Task.isCancelled, place == request.fromPlace else { return } + show(request.toPlace) + } + + private func show(_ newPlace: Int) { + guard newPlace >= 0, newPlace < model.totalGames, model.rows.indices.contains(newPlace) else { return } + place = newPlace + model.lastOpened = newPlace + } + + private func go(to id: Int) { + guard let game = shownGame, game.nodes.indices.contains(id) else { return } + current = id + } + + private func stepBack() { + guard let parent = currentNode?.parent else { return } + go(to: Int(parent)) + } + + private func stepForward() { + guard let child = currentNode?.children.first else { return } + go(to: Int(child)) + } + + private func goToEnd() { + guard let game = shownGame else { return } + var at = current + var visited: Set = [at] + for _ in 0.. Void + + var body: some View { + Group { + Button { perform(gameCommand(for: .leftArrow)) } label: { EmptyView() } + .keyboardShortcut(.leftArrow, modifiers: []) + Button { perform(gameCommand(for: .rightArrow)) } label: { EmptyView() } + .keyboardShortcut(.rightArrow, modifiers: []) + Button { perform(gameCommand(for: .shiftLeftArrow)) } label: { EmptyView() } + .keyboardShortcut(.leftArrow, modifiers: .shift) + Button { perform(gameCommand(for: .shiftRightArrow)) } label: { EmptyView() } + .keyboardShortcut(.rightArrow, modifiers: .shift) + Button { perform(gameCommand(for: .f)) } label: { EmptyView() } + .keyboardShortcut("f", modifiers: []) + Button { perform(gameCommand(for: .escape)) } label: { EmptyView() } + .keyboardShortcut(.escape, modifiers: []) + } + .frame(width: 0, height: 0) + .opacity(0) + .allowsHitTesting(false) + .accessibilityHidden(true) + } +} + +private func moveLabel(_ node: MoveNode) -> String { + let number = node.white ? "\(node.moveNumber)." : "\(node.moveNumber)…" + return number + node.san + node.nagSymbols +} + +private struct PlayerBar: View { + let game: GameData + let white: Bool + + var body: some View { + let name = white ? game.tag("White") : game.tag("Black") + let elo = white ? game.tag("WhiteElo") : game.tag("BlackElo") + let knownName = known(name ?? "") + HStack(spacing: 8) { + SideDisc(white: white) + Text(knownName ?? (white ? L10n.white : L10n.black)) + .font(.subheadline.weight(knownName == nil ? .regular : .medium)) + .foregroundStyle(knownName == nil ? Theme.onSurfaceVariant : Theme.onSurface) + .lineLimit(1) + .frame(maxWidth: .infinity, alignment: .leading) + if let elo = knownElo(elo ?? "") { + Text(elo).font(.subheadline.monospacedDigit()).foregroundStyle(Theme.onSurfaceVariant) + } + Text(sideResult(game.result, white: white) ?? "") + .font(.subheadline.monospacedDigit()) + .foregroundStyle(Theme.onSurfaceVariant) + .frame(width: 24) + } + .padding(.horizontal, 16) + .frame(minHeight: 36) + } +} + +private struct ForkBar: View { + let nodes: [MoveNode] + let onMove: (Int) -> Void + + var body: some View { + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 8) { + Text(L10n.nextMoves).font(.subheadline).foregroundStyle(Theme.onSurfaceVariant) + ForEach(Array(nodes.enumerated()), id: \.element.id) { offset, node in + Button(moveLabel(node)) { onMove(Int(node.id)) } + .buttonStyle(.bordered) + .tint(offset == 0 ? Theme.primary : Theme.onSurfaceVariant) + } + } + .padding(.horizontal, 16) + } + .frame(height: 48) + } +} + +private struct MoveControls: View { + let canBack: Bool + let canForward: Bool + let onFlip: () -> Void + let onBack: () -> Void + let onForward: () -> Void + let onStart: () -> Void + let onEnd: () -> Void + + var body: some View { + VStack(spacing: 0) { + Divider().background(Theme.outlineVariant) + HStack(spacing: 0) { + Button(action: onFlip) { + VStack(spacing: 2) { + Image(systemName: "arrow.up.arrow.down") + Text(L10n.flip).font(.caption2) + } + .frame(maxWidth: .infinity, minHeight: 56) + } + .accessibilityLabel(L10n.flip) + LongPressControl( + icon: "play.fill", + label: L10n.moveBack, + hint: L10n.moveBackHint, + longLabel: L10n.toStart, + enabled: canBack, + mirrored: true, + action: onBack, + longAction: onStart + ) + LongPressControl( + icon: "play.fill", + label: L10n.moveForward, + hint: L10n.moveForwardHint, + longLabel: L10n.toEnd, + enabled: canForward, + mirrored: false, + action: onForward, + longAction: onEnd + ) + } + .frame(height: 64) + } + .background(Theme.container.ignoresSafeAreaEdges(.bottom)) + } +} + +private struct LongPressControl: View { + let icon: String + let label: String + let hint: String + let longLabel: String + let enabled: Bool + let mirrored: Bool + let action: () -> Void + let longAction: () -> Void + + var body: some View { + Image(systemName: icon) + .font(.title2) + .scaleEffect(x: mirrored ? -1 : 1) + .foregroundStyle(enabled ? Theme.onSurface : Theme.onSurface.opacity(0.38)) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .contentShape(Rectangle()) + .gesture( + LongPressGesture(minimumDuration: 0.45) + .onEnded { _ in longAction() } + .exclusively(before: TapGesture().onEnded { _ in action() }) + ) + .disabled(!enabled) + .accessibilityElement(children: .ignore) + .accessibilityLabel(label) + .accessibilityHint(hint) + .accessibilityAddTraits(.isButton) + .accessibilityAction(named: Text(longLabel), longAction) + } +} diff --git a/iosApp/ChessPenguin/LibraryViews.swift b/iosApp/ChessPenguin/LibraryViews.swift new file mode 100644 index 0000000..9e2ac81 --- /dev/null +++ b/iosApp/ChessPenguin/LibraryViews.swift @@ -0,0 +1,191 @@ +import SwiftUI + +struct DatabasesView: View { + @EnvironmentObject private var model: AppModel + + var body: some View { + ScrollView { + VStack(alignment: .leading, spacing: 8) { + Text(L10n.files) + .font(.subheadline.weight(.medium)) + .foregroundStyle(Theme.primary) + .padding(.horizontal, 16) + .padding(.top, 8) + + if let error = model.loadError { + ErrorMessage(title: L10n.openFailed, detail: error) { + Task { await model.loadSample() } + } + .frame(minHeight: 300) + } else { + Button { + model.path.append(.games) + } label: { + HStack(spacing: 12) { + Text("PGN") + .font(.caption.weight(.medium)) + .foregroundStyle(Theme.pgnBadgeText) + .frame(width: 40, height: 40) + .background(Theme.pgnBadge) + .clipShape(RoundedRectangle(cornerRadius: 10)) + VStack(alignment: .leading, spacing: 4) { + Text(L10n.classics).foregroundStyle(Theme.onSurface) + if model.isLoading { + Text(L10n.reading).font(.subheadline).foregroundStyle(Theme.onSurfaceVariant) + } else { + Text("\(L10n.games(model.totalGames)) · PGN") + .font(.subheadline) + .foregroundStyle(Theme.onSurfaceVariant) + } + } + Spacer() + if model.isLoading { + ProgressView() + } else { + Image(systemName: "chevron.right").foregroundStyle(Theme.onSurfaceVariant) + } + } + .padding(12) + .background(Theme.containerLow) + .clipShape(RoundedRectangle(cornerRadius: 16)) + } + .buttonStyle(.plain) + .disabled(model.database == nil) + .padding(.horizontal, 12) + } + } + } + .background(Theme.background) + .navigationTitle(L10n.appName) + .task { await model.loadSample() } + } +} + +struct GamesView: View { + @EnvironmentObject private var model: AppModel + + var body: some View { + Group { + if model.rows.isEmpty { + Text(L10n.emptyDatabase) + .foregroundStyle(Theme.onSurfaceVariant) + .frame(maxWidth: .infinity, maxHeight: .infinity) + } else { + ScrollView { + LazyVStack(spacing: 0) { + ForEach(Array(model.rows.enumerated()), id: \.element.index) { place, row in + Button { + model.lastOpened = place + model.path.append(.game(place: place)) + } label: { + GameListRow(row: row, number: Int(row.index) + 1, lastOpened: model.lastOpened == place) + } + .buttonStyle(.plain) + .accessibilityElement(children: .ignore) + .accessibilityLabel(gameRowAccessibility(row: row, number: Int(row.index) + 1, lastOpened: model.lastOpened == place)) + if place + 1 < model.rows.count { + Divider() + .background(Theme.outlineVariant) + .padding(.leading, 68) + .padding(.trailing, 16) + } + } + if model.canLoadMore || model.isLoadingPage || model.pageError != nil { + VStack(spacing: 8) { + if let error = model.pageError { + Text(error).foregroundStyle(Theme.error) + Button(L10n.retry) { Task { await model.loadNextPage() } } + } else { + ProgressView() + Text(L10n.reading).foregroundStyle(Theme.onSurfaceVariant) + } + } + .frame(maxWidth: .infinity, minHeight: 80) + .task(id: model.rows.count) { await model.loadNextPage() } + } + } + } + } + } + .background(Theme.background) + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .principal) { + VStack(spacing: 0) { + Text(L10n.classics).font(.headline) + Text(L10n.games(model.totalGames)).font(.caption).foregroundStyle(Theme.onSurfaceVariant) + } + } + } + } +} + +private struct GameListRow: View { + let row: GameRow + let number: Int + let lastOpened: Bool + + var body: some View { + HStack(alignment: .top, spacing: 12) { + Text("\(number)") + .font(.caption.monospacedDigit()) + .foregroundStyle(Theme.onSurfaceVariant) + .frame(width: 28, alignment: .trailing) + .padding(.top, 4) + VStack(spacing: 0) { + ListPlayer(name: row.white, elo: row.whiteElo, result: sideResult(row.result, white: true), white: true) + ListPlayer(name: row.black, elo: row.blackElo, result: sideResult(row.result, white: false), white: false) + HStack(spacing: 8) { + Text(joinedKnown([row.event, pgnYear(row.date)])) + .font(.subheadline) + .foregroundStyle(Theme.onSurfaceVariant) + .lineLimit(1) + .frame(maxWidth: .infinity, alignment: .leading) + if let eco = known(row.eco) { + Text(eco) + .font(.caption2.monospacedDigit()) + .foregroundStyle(Theme.onSurfaceVariant) + .padding(.horizontal, 4) + .frame(minWidth: 32, minHeight: 16) + .overlay(RoundedRectangle(cornerRadius: 4).stroke(Theme.outline, lineWidth: 1)) + } + } + .frame(height: 20) + .padding(.leading, 16) + } + } + .padding(.horizontal, 16) + .padding(.vertical, 6) + .frame(maxWidth: .infinity, minHeight: 80, alignment: .leading) + .background(lastOpened ? Theme.container : Color.clear) + .overlay(alignment: .leading) { + if lastOpened { + Theme.primary.frame(width: 3) + } + } + .contentShape(Rectangle()) + } +} + +private struct ListPlayer: View { + let name: String + let elo: String + let result: String? + let white: Bool + + var body: some View { + HStack(spacing: 8) { + SideDisc(white: white, size: 8) + Text(known(name) ?? "?") + .foregroundStyle(known(name) == nil ? Theme.onSurfaceVariant : Theme.onSurface) + .fontWeight(result == "1" ? .medium : .regular) + .lineLimit(1) + .frame(maxWidth: .infinity, alignment: .leading) + if let elo = knownElo(elo) { + Text(elo).font(.subheadline.monospacedDigit()).foregroundStyle(Theme.onSurfaceVariant) + } + ResultTile(result: result) + } + .frame(height: 24) + } +} diff --git a/iosApp/ChessPenguin/NotationModel.swift b/iosApp/ChessPenguin/NotationModel.swift new file mode 100644 index 0000000..afe7470 --- /dev/null +++ b/iosApp/ChessPenguin/NotationModel.swift @@ -0,0 +1,264 @@ +import Foundation + +struct NotationMove: Equatable, Identifiable { + let id: Int + let label: String +} + +struct NotationMoveRow: Equatable, Identifiable { + let id: String + let number: UInt32 + let white: NotationMove? + let black: NotationMove? + let indent: Int +} + +struct NotationComment: Equatable, Identifiable { + let id: String + let text: String + let indent: Int +} + +enum NotationToken: Equatable, Identifiable { + case move(NotationMove) + case comment(id: String, text: String) + case punctuation(id: String, text: String) + + var id: String { + switch self { + case .move(let move): return "move-\(move.id)" + case .comment(let id, _), .punctuation(let id, _): return id + } + } +} + +struct NotationVariation: Equatable, Identifiable { + let id: String + let startNodeID: Int + let tokens: [NotationToken] + let indent: Int +} + +struct NotationResult: Equatable, Identifiable { + let id: String + let text: String + let indent: Int +} + +enum NotationEntry: Equatable, Identifiable { + case comment(NotationComment) + case moves(NotationMoveRow) + case variation(NotationVariation) + case result(NotationResult) + + var id: String { + switch self { + case .comment(let entry): return entry.id + case .moves(let entry): return entry.id + case .variation(let entry): return entry.id + case .result(let entry): return entry.id + } + } + + var indent: Int { + switch self { + case .comment(let entry): return entry.indent + case .moves(let entry): return entry.indent + case .variation(let entry): return entry.indent + case .result(let entry): return entry.indent + } + } +} + +/// Complete PGN presentation: a two-column main line and every alternative subtree as +/// clickable tokens. IDs are MoveNode.id, never visible row offsets. +struct NotationModel { + let entries: [NotationEntry] + let entryByNode: [Int: String] + + var moveIDs: [Int] { + entries.flatMap { entry -> [Int] in + switch entry { + case .moves(let row): + return [row.white?.id, row.black?.id].compactMap { $0 } + case .variation(let variation): + return variation.tokens.compactMap { + if case .move(let move) = $0 { return move.id } + return nil + } + case .comment, .result: + return [] + } + } + } + + init(game: GameData) { + var entries: [NotationEntry] = [] + var entryByNode: [Int: String] = [:] + var visited: Set = [0] + + if let root = game.nodes.first, !root.commentAfter.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { + entries.append(.comment(NotationComment( + id: "comment-root-after", + text: root.commentAfter, + indent: 0 + ))) + } + + var pendingRow: PendingRow? + func flushRow() { + guard let row = pendingRow else { return } + let entry = NotationMoveRow( + id: row.id, + number: row.number, + white: row.white.map { NotationMove(id: $0, label: game.nodes[$0].san + game.nodes[$0].nagSymbols) }, + black: row.black.map { NotationMove(id: $0, label: game.nodes[$0].san + game.nodes[$0].nagSymbols) }, + indent: 0 + ) + entries.append(.moves(entry)) + if let white = row.white { entryByNode[white] = row.id } + if let black = row.black { entryByNode[black] = row.id } + pendingRow = nil + } + + var parent = 0 + for _ in 0.., + entryByNode: inout [Int: String] + ) -> NotationVariation? { + var tokens: [NotationToken] = [] + + func appendComment(_ text: String, suffix: String) { + guard !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return } + tokens.append(.comment(id: "\(entryID)-comment-\(suffix)-\(tokens.count)", text: text)) + } + + func appendPunctuation(_ text: String) { + tokens.append(.punctuation(id: "\(entryID)-punctuation-\(tokens.count)", text: text)) + } + + func line(first: Int) { + var id = first + var showNumber = true + for _ in 0.. Void + + var body: some View { + let notation = NotationModel(game: game) + ScrollViewReader { proxy in + ScrollView { + LazyVStack(alignment: .leading, spacing: 0) { + Color.clear.frame(height: 1).id("move-0") + ForEach(notation.entries) { entry in + switch entry { + case .comment(let comment): + CommentBlock(text: comment.text, indent: comment.indent) + case .moves(let row): + MoveRowView(row: row, current: current, onMove: onMove) + case .variation(let variation): + VariationView(variation: variation, current: current, onMove: onMove) + case .result(let result): + Text(result.text) + .font(.subheadline.weight(.medium)) + .padding(.horizontal, 16) + .padding(.vertical, 8) + .background(Theme.containerHigh) + .clipShape(RoundedRectangle(cornerRadius: 8)) + .frame(maxWidth: .infinity) + .padding(16) + } + } + } + .padding(.bottom, 8) + } + .onAppear { scroll(to: current, proxy: proxy) } + .onChange(of: current) { id in scroll(to: id, proxy: proxy) } + } + .background(Theme.background) + } + + private func scroll(to id: Int, proxy: ScrollViewProxy) { + withAnimation(.easeInOut(duration: 0.2)) { + proxy.scrollTo("move-\(id)", anchor: .center) + } + } +} + +private struct MoveRowView: View { + let row: NotationMoveRow + let current: Int + let onMove: (Int) -> Void + + var body: some View { + HStack(spacing: 0) { + Text("\(row.number)") + .font(.subheadline.monospacedDigit()) + .foregroundStyle(Theme.onSurfaceVariant) + .frame(width: 40, alignment: .trailing) + .padding(.trailing, 8) + MoveCell(move: row.white, emptyPlaceholder: "…", current: current, onMove: onMove) + MoveCell(move: row.black, emptyPlaceholder: "", current: current, onMove: onMove) + } + .frame(minHeight: 48) + .padding(.leading, CGFloat(row.indent * 16)) + } +} + +private struct MoveCell: View { + let move: NotationMove? + let emptyPlaceholder: String + let current: Int + let onMove: (Int) -> Void + + var body: some View { + Group { + if let move { + NotationMoveButton(move: move, current: current, onMove: onMove) + .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading) + } else { + Text(emptyPlaceholder) + .foregroundStyle(Theme.onSurfaceVariant) + .padding(.horizontal, 12) + .frame(maxWidth: .infinity, minHeight: 44, alignment: .leading) + } + } + } +} + +private struct NotationMoveButton: View { + let move: NotationMove + let current: Int + let onMove: (Int) -> Void + + var body: some View { + Button { + onMove(move.id) + } label: { + Text(move.label) + .font(.body.weight(.bold)) + .foregroundStyle(Theme.onSurface) + .padding(.horizontal, 8) + .padding(.vertical, 6) + .background(current == move.id ? Theme.currentMove : Color.clear) + .clipShape(RoundedRectangle(cornerRadius: 6)) + } + .buttonStyle(.plain) + .frame(minHeight: 44) + .id("move-\(move.id)") + .accessibilityValue(current == move.id ? L10n.currentMove : "") + .accessibilityAddTraits(current == move.id ? .isSelected : []) + } +} + +private struct VariationView: View { + let variation: NotationVariation + let current: Int + let onMove: (Int) -> Void + + var body: some View { + HStack(alignment: .top, spacing: 12) { + Rectangle() + .fill(Theme.outlineVariant) + .frame(width: 2) + .frame(maxHeight: .infinity) + FlowLayout(spacing: 4) { + ForEach(variation.tokens) { token in + switch token { + case .move(let move): + NotationMoveButton(move: move, current: current, onMove: onMove) + case .comment(_, let text): + Text(text) + .font(.subheadline.italic()) + .foregroundStyle(Theme.comment) + .padding(.vertical, 6) + case .punctuation(_, let text): + Text(text) + .font(.body) + .foregroundStyle(Theme.onSurfaceVariant) + .padding(.vertical, 6) + } + } + } + .frame(maxWidth: .infinity, alignment: .leading) + } + .padding(.leading, CGFloat(16 + variation.indent * 16)) + .padding(.trailing, 16) + .padding(.vertical, 4) + } +} + +private struct CommentBlock: View { + let text: String + let indent: Int + + var body: some View { + Text(text) + .font(.subheadline) + .foregroundStyle(Theme.comment) + .padding(.horizontal, 12) + .padding(.vertical, 8) + .frame(maxWidth: .infinity, alignment: .leading) + .background(Theme.containerLow) + .clipShape(RoundedRectangle(cornerRadius: 12)) + .padding(.leading, CGFloat(16 + indent * 16)) + .padding(.trailing, 16) + .padding(.vertical, 4) + } +} + +/// iOS 16 token flow: every SAN remains its own Button even across lines and nested RAV. +private struct FlowLayout: Layout { + let spacing: CGFloat + + func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout Void) -> CGSize { + let available = max(0, proposal.width ?? 0) + var x: CGFloat = 0 + var y: CGFloat = 0 + var lineHeight: CGFloat = 0 + var contentWidth: CGFloat = 0 + + for subview in subviews { + let size = fittingSize(of: subview, available: available) + if x > 0, x + spacing + size.width > available { + x = 0 + y += lineHeight + spacing + lineHeight = 0 + } + if x > 0 { x += spacing } + x += size.width + lineHeight = max(lineHeight, size.height) + contentWidth = max(contentWidth, x) + } + return CGSize(width: proposal.width ?? contentWidth, height: y + lineHeight) + } + + func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout Void) { + var x = bounds.minX + var y = bounds.minY + var lineHeight: CGFloat = 0 + + for subview in subviews { + let size = fittingSize(of: subview, available: bounds.width) + if x > bounds.minX, x + spacing + size.width > bounds.maxX { + x = bounds.minX + y += lineHeight + spacing + lineHeight = 0 + } + if x > bounds.minX { x += spacing } + subview.place(at: CGPoint(x: x, y: y), proposal: ProposedViewSize(size)) + x += size.width + lineHeight = max(lineHeight, size.height) + } + } + + private func fittingSize(of subview: LayoutSubview, available: CGFloat) -> CGSize { + let intrinsic = subview.sizeThatFits(ProposedViewSize(width: nil, height: nil)) + guard available > 0, intrinsic.width > available else { return intrinsic } + return subview.sizeThatFits(ProposedViewSize(width: available, height: nil)) + } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/Contents.json new file mode 100644 index 0000000..d8b757a --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/Contents.json @@ -0,0 +1,3 @@ +{ + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/Contents.json new file mode 100644 index 0000000..b35a09e --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "bB.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/bB.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bB.imageset/bB.png new file mode 100644 index 0000000000000000000000000000000000000000..b94e70244f869cd8870ab20e88cfaeadd9bb0445 GIT binary patch literal 4578 zcma)Ac{J4D`+v_EOJpmOeNX7a$C3~;#u7uA57|k{mL+{Cm*o|#M zNo0v>vKLxt3?sr=$INd&-*bNdfA9U{xzBQ+^W5_+uXAoX(!pAgUy2_906~O}r4s;v zI7bk`$HO7sk=215!sBOWZ3(dd-4&gLJOB_aL|DQv-G00}D^Ty^meBua-s zW$uLP@vA#b$4eiY0t>^bsx@^_K9|2_dQ#}*q@x)Bc*K4pzbu=+VTzE56v5oi%xP9n z8Szz@R_)Z=l0WjTW=`|E@4eD)r)}GgWGsUp8}Kp?Z7cC+xFBdA^rJ!si2(zm&;TQh3-ec zihP??qBH$PD9gz*O2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 zik?KJ%ijqn2Sky>v2g2-5y*U3k+b-Oo+8CpXqU&p0KBVj_w_42mbs94eM=H!noVx=1k$pMOc*Z=|Zf0!F#e8#fGD6MB@qKLHy zgX`=_`(SJrbT<$nS!yOHXB3D-SjcweB^JIKvWdc1Aa!CK!YPy*INu;5I`S7Ru8V}N zeI>GDPVbev(er=q>>_zLV7Q{5;za{~enzPT%C`eaxlAN}B1&f42UMFQL!sAvKw7K{ zRo{41$)~6rOgWyQ_|_nvO++!yg-!LJ;!hyF|9I$2%DX6o?2QbK?a|68{dkUDRhxcp zpgEj_IwLGIC|W;H%x?xzya0%%6mds{>W9t4vz>BFd9#09HhyS9Jf()Xiz&E4+u3fh z6&)k|z3{SG#Ds&bd1GW0%D@wEMGh}Ea68bslAI^na%M=2dMcT3pP9 zjyujrun<+gv*T1wV=@2J_5N*~*P`>`NGy?gZ^36)b$Lc@u1~Moh!VcpRP7yBw@he5 zjizJLJB&^Ca1On7pjJ~}jw`o3?JD3~}>;0Eei z=S?^m$?p1E3kX+>)c=UyFfPQYJzF E13Q4AegFUf literal 0 HcmV?d00001 diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/Contents.json new file mode 100644 index 0000000..279e06b --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "bN.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/bN.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bN.imageset/bN.png new file mode 100644 index 0000000000000000000000000000000000000000..ee1df1c28873e9f07b0e886127ba0d7ecf53daad GIT binary patch literal 6896 zcmb_h^3C5|Qz z(uQoay%$_&91^Ycd*X4fKB>%R>Ipu7^2g;IN*q#^m6+yOpqZvH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ChVEnOy++fSzpQj@%P9`Sfl^txyG`I RkND#kg?Pl(vDP6l^*@T~{;B`~ literal 0 HcmV?d00001 diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/Contents.json new file mode 100644 index 0000000..071bf67 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "bQ.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/bQ.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bQ.imageset/bQ.png new file mode 100644 index 0000000000000000000000000000000000000000..9cd24d3a94e904521c483da8b49ff5853486ff2d GIT binary patch literal 9028 zcmcIq^;cBi*S^CLLn9yzje?|fNT+mn!vIQmBQ-FDv;hc6N=Qga_s|{E%>dFVDlL5H z^EbTfUH7be&JX*EzzC?kl+_Q&I?l#T*Pl%tczC}0{Cnw9{C7N#5|^ihad;5wKCb?k zwkhc%u`Hxp%#ZB(`}z1Z`TJ20EKMwYnI#2H%$pb-!(}etPZ_7a<9{ES`~8pM(l<_( z=Wp4``C7>CWyodu!NEzH*=c*wTKn$(geaU567m1g0(F==!^kA^p1}JLuKj>k+Dj!8 zOoR{MfdhX5xL|0f&0Z}X0-+dr?OC|8X9zc-A0%Sll~?ucm%Ekz11CfdLlhhNfFVL+ zjk14ne|iec`2Ty2DLa@g3`jkPq3j!*0nHRLM#!&Sa^O&i=)U@wq?X^mZOryTZW$j< zZNxV^_#5B?bVYz91>!-p5#mW;Ua*Y4{AnjOG6QHp($%LtIVkRMw*Z1b!5FYd@Oq+K zmVjYLpdT>S8?*4Df!l-3kC07Xur^oJcU~R{72Aa^39M)l*Y_19VZA)VKEnG1w^X z#PzKN34gP5$MV!F*1rpD6N#MbIFmm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/Resources/Pieces.xcassets/bR.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bR.imageset/Contents.json new file mode 100644 index 0000000..e58fbb3 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bR.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "bR.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/bR.imageset/bR.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/bR.imageset/bR.png new file mode 100644 index 0000000000000000000000000000000000000000..382326ba5587a04d409bffa552b139a0052bb7f1 GIT binary patch literal 2466 zcmds3dpy(q7ymBHnpq=cQLZzWa?9;iA(P7%L&zm^c}PqwiOCaFJ)WLK9+N1fk!#75 z+a^NP3ZZ6`+mz(8Fi$TD`98kn{DsyJfzU#GnMvW2cCmxW!M?|DC5z_Aj3br z@0p`!GbsCzYJaukGq4ZUseU#)p=pis=HD$s#+T36y>K~HY7*Obd*&N%JJkjuxIh+s z6BUrc`m#1t`kw{ctoL;_0h&p+W&YV+9^hWs9qG(GyKAFO5@)70LULh}o$84wY#xeu zG|^BmQI`h7K~TqYg$V)KEbre#x@ceQqjYk36$nW8*?j{0kdiS>+J5L^zAM8BcjM-4 zLNaplIr$tcN;g&0cy|wO$z(FE!Gr;227C(f)r~L($&nM4Ge$g}`Nk^!F1K~2xDm|f zzO3A|mNrGX_^K0%4Z2-PjWUN$b?5?j^kz41Ecxud@fe3L*m948`mAJjEvmzE8_U+s zkSvg5yah0F007268GjDuO~Em@3{F-}PlvJDTHJ|)fAkCuVbDn6;<7mppq969*$MEh-L|e zLIElXFIg}MoYU9WcTWDqe)Hy@kwdXI*zc@V3VG~FoYU|b^M!adYVGjD4kR?h{zoTf z7C6n_q5ETK640EkP=qC>R0_gXS|CvDrU z!O>2Hki`p$UQA!xc60D}mZ*{rQUBQB$*kF7gdFZ3g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=F5to}gZ>|N|0*#=$y8+5DpPyhe` literal 0 HcmV?d00001 diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/Contents.json new file mode 100644 index 0000000..06b1dbb --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "wB.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/wB.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wB.imageset/wB.png new file mode 100644 index 0000000000000000000000000000000000000000..cc55acd0dbecaf6015307758a2adc0a1d9c324a1 GIT binary patch literal 7376 zcmbW6^rAxlc9LHE+Bgv62yOS3%V z>-i79Ge69{&di*-=frj1*F6bZ8p=cuXdeIoK%}aopaTFH;3)=x2LTUe-sSe-0b>19 zSpm5Jw-J>}q{ zSY+Tv@r}!x(I6zyY)?Whq=wI#YHg$9OJu4XZy?VO0cLTu{zBxC!NLV!Jq~8{=KYw* z?b-t;?``Reu})#1qYIz0Tx_9Mf1%U+`@@m2t2+#q|7G)*O{C+Oi%7$a7U}~NPrdi>ZP@dSdzjO z7(z(L#*aM3JP6cBiV zNqVL10+_CAUCA%`0d5`Wk_0@*()L5W+~!}v)LV?m>WDd98SNlQ&w)lLv$Qnhk2sS4 zi6Z&QW)Dlm8U+Q#>|dE6Km?HT4*sdInHUUEa1_jQb8|aSmuox!N~EYPD^r>=FgLHx z=C_1}UjAS-xuIRf$?dQbAS3&=@F+9!V@}Q&wU;lmDio6_E0&kd;7rFtHR9U06z`J{ zd3ktr+Wii6GzO0bj%cyNeL4u361xi)^vAOKOe=}#o|UUqTXtL6+1kFxjtDXW;@4eZ z=D&h>Kj-K*a%kqeJ_Kx$q-4KT2>^#5`a|ajOH~aH<4W|vSgu&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sg3!I2vB%Oo|1XVp lIR8OmkdpoHoAu5;Ml@PdTLk8S0Dn;es)`y4FgdHp{{uwvOLYJM literal 0 HcmV?d00001 diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/Contents.json new file mode 100644 index 0000000..44e63b7 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "wK.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/wK.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wK.imageset/wK.png new file mode 100644 index 0000000000000000000000000000000000000000..565590c7287dcbff3aef5d2cdc5dc8c8fa2f9d9f GIT binary patch literal 8759 zcmb_?Wl&Ua{O?(omPQ1m8nEk(jrKww8TCB z=f1mhU)?)9vuF3rIWy05&iDJN=Rs;}C=ud6#s>g^5T-1z4FC}ECj`L71`n@XOa227 z*p{kF^1%JSPfka1JOD5PFnJkW?~MISyp)HtjRW_4Vg$o6(7{f;;UY-ByfSViX_PGe zX9OAYWRXIKkd*KGvac9JaZT={;%9LR%7pO2yd17If~UB3L>Mdt_|RU05w69HOh*A{ zTH979F9QQTuiL;CuP*w~ovZ~t4~-?igO+Ev)>vOIWJH@WNsD1_$nE)j`=$at=m zGFlpkglkyDod8C*1>oZGxdXwNRHA?^1_2$w1PLWVpn%?RXUl1VZf}5+hW%)e%uFcV zY6?OtaLF}9dqdk@51dn5ZcoZ$6@m_<#5)|<^+t- zsWEd%Z{%41{mp?Ys~L9(Ue?03@pUE@f ze}K=7jQ@M|ayZh;h+HTmYxe|%gv|W^Hp&0vvX5*`lHIG#W)NkMT&Z9ZO4=I_V7bZt zMqNQNqT=EvDUCFkmE8cM>?VD@`2y%Vx*j2s{aS);&W@-jQV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VzS4K^H1bWdJf*}D zmXW!(NFebRLvcw7SZqBD;k(*9DDFk&(AXdkHI}Il7(E>t8j`Sw=*@$G-i#!xAuYD< zl!a&IV*I2+$2-e?H2U5!k?DlDXAeV();y)&Cl}SCNfZZM;!>|VX$855H{GqB)A5ck zfi(?_NOhfSWlupXYYHUIEn*l{?VnlV2aTGJ7oDyn z`yd{B6R*T4>x%DuPwXY}ax?{kb=rsyuO6+?C7*GT^dk>?dlHgC z&(~E2u7F<=!!-zcMKJyQJd6^ty$MVhGf-SKeh}<=e`ra2KQn?g`La~_9s-ET&;En` znx(a`0>VM!$9j`HckY0<(UX+4X!k89ss%2J+qeMv;ZT6g5LL9CTHJF@79%x15q19Y zvH2INCHkK+NJ>cPTU%Ryjq*b}pyRKwEiyP$y;!9Vn#jawVsC&ZA(C+uuXCdMaJ&E9 zZDq1HI+G4Cd<8h;p@7W@Q9#lSdl3fQaQ))*;Vm^=6xfenYwz`$fB71i);^=p^1u9X bh8sRqCz~0)qbiuw{aa$Fi_{@%Ifnl~Pt4pz literal 0 HcmV?d00001 diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/Contents.json b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/Contents.json new file mode 100644 index 0000000..48a1af6 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/Contents.json @@ -0,0 +1,6 @@ +{ + "images" : [ + { "filename" : "wQ.png", "idiom" : "universal", "scale" : "1x" } + ], + "info" : { "author" : "xcode", "version" : 1 } +} diff --git a/iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/wQ.png b/iosApp/ChessPenguin/Resources/Pieces.xcassets/wQ.imageset/wQ.png new file mode 100644 index 0000000000000000000000000000000000000000..09722c8149d3f3f02543fe3f82265ea1a6ad7662 GIT binary patch literal 10736 zcmb`Ng;N_}w8u9Pv_J_IcPmbDD^8H&6fI71ceha7DehjNP^85@I7JE+cPn13xWD|~ zyg%Vh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ZC-d+tUh8yM?tvDUYv(*!;qwEJ0xnM` z7I|*;bK_d2IV5opn-{XS$}yx4HDkK53LfjD9G0LKU;%!n*1ChI5bmU#8Uc!!e*2!P zVa;3T$D5sqn0c34pT4w>Mx#lQh#QP-SUquNnl_YZcm*ts;zY;VGpk{hlcalFLv?|W zWHdq^?o>F}UoBR-W{Dkz3>htUs(J9fDhle;neLz#+oayiAmL0Su74KgiYB~8St`@ZPn@0vZu(bUfgq2s-@bQ zIH2^MeYu-j2Q9r^i@@><3=>;hFZvqBEe zG4SUNj*fa*G&UZU3|DQPgI#akt)ADf(Ii{T6fk5ipWqT7G=bxqngb=ki=6%LS>Gdz zvyUZXc}0#rc@b?%a#LIDY@HwW?Q}YtIK{~J zdM7fHNq2Up6TVbC9L(C<+*IIhS5{EC6SO4_Svqvez4uG179l?>DoUH9GFandJv&V^?_v)Z9Ji&Yd30PG#L=$M)8;NZ3%T zO&cbzqgT@TJ!Cd{_py%GR2$_>Q1KjIVlS-sQsvRc7C{FF<-_!t688lR%wx1*RrSVGN!taG!tR%et5`2joG zSrPy~pno?HvKR5W%-5Us4Gndqt?2$f6h*}-5@TXw!l-Z)LwS4C1Q%;AKz(A%AzxeM zZ?*UWNihtMM>RDyRaL~Lu+53LrtS+hNpSVuai9!cOJ*hfiSVgE<-7BnA=!wJfUj1; zKpz%2Lht7|i27`RTLYKU-Eg33QdZxKf>kJB-%wOwOEO<6ftkgeut2uhoAUs70=rpZklNeMfBH{p^B0 LX@{;d!(aUkZ`l@| literal 0 HcmV?d00001 diff --git a/iosApp/ChessPenguin/Resources/THIRD_PARTY_NOTICES.txt b/iosApp/ChessPenguin/Resources/THIRD_PARTY_NOTICES.txt new file mode 100644 index 0000000..d03a939 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/THIRD_PARTY_NOTICES.txt @@ -0,0 +1,11 @@ +ChessPenguin is licensed under GPL-3.0-or-later. + +Bundled cburnett chess pieces +Author: Colin M.L. Burnett +License: GPLv2+ +Source: https://github.com/lichess-org/lila/tree/cd2656d2787a766ba743da8da1dd3b24975e6329/public/piece/cburnett + +The SVG files were rendered unmodified into 256×256 PNG images for the iOS asset catalog. The source SVG files and the complete project notices remain in apps/desktop/assets/pieces/cburnett and THIRD_PARTY_NOTICES.md. + +Bundled games +classics.pgn is an unmodified copy of examples/classics.pgn from the ChessPenguin repository. diff --git a/iosApp/ChessPenguin/Resources/classics.pgn b/iosApp/ChessPenguin/Resources/classics.pgn new file mode 100644 index 0000000..8e741d0 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/classics.pgn @@ -0,0 +1,2012 @@ +[Event "London m4"] +[Site "London"] +[Date "1834.??.??"] +[Round "62"] +[White "McDonnell, Alexander"] +[Black "La Bourdonnais, Louis-Charles Mahe de"] +[Result "0-1"] +[ECO "B32"] +[PlyCount "74"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 e5 5. Nxc6 bxc6 6. Bc4 Nf6 7. Bg5 Be7 8. +Qe2 d5 9. Bxf6 Bxf6 10. Bb3 O-O 11. O-O a5 12. exd5 cxd5 13. Rd1 d4 14. c4 Qb6 +15. Bc2 Bb7 16. Nd2 Rae8 17. Ne4 Bd8 18. c5 Qc6 19. f3 Be7 20. Rac1 f5 21. Qc4+ +Kh8 22. Ba4 Qh6 23. Bxe8 fxe4 24. c6 exf3 25. Rc2 Qe3+ 26. Kh1 Bc8 27. Bd7 f2 +28. Rf1 d3 29. Rc3 Bxd7 30. cxd7 e4 31. Qc8 Bd8 32. Qc4 Qe1 33. Rc1 d2 34. Qc5 +Rg8 35. Rd1 e3 36. Qc3 Qxd1 37. Rxd1 e2 0-1 + + +[Event "Paris m"] +[Site "Paris"] +[Date "1843.??.??"] +[Round "5"] +[White "Saint-Amant, Pierre Charles Fournier de"] +[Black "Staunton, Howard"] +[Result "0-1"] +[ECO "C00"] +[PlyCount "78"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. f4 e6 3. Nf3 Nc6 4. c3 d5 5. e5 Qb6 6. Bd3 Bd7 7. Bc2 Rc8 8. O-O +Nh6 9. h3 Be7 10. Kh2 f5 11. a3 a5 12. a4 Nf7 13. d4 h6 14. Re1 g6 15. Na3 cxd4 +16. Nxd4 Nxd4 17. cxd4 g5 18. Nb5 Bxb5 19. axb5 Rc4 20. Bd3 Rc8 21. Be2 gxf4 +22. Rf1 Ng5 23. Bxf4 Ne4 24. Rc1 Rxc1 25. Qxc1 Kd7 26. Qe3 Bg5 27. Bd3 Rg8 28. +Bxe4 dxe4 29. Bxg5 hxg5 30. Qb3 g4 31. Rd1 gxh3 32. Qxh3 Qd8 33. d5 Kc8 34. +Qc3+ Kb8 35. d6 f4 36. Qc5 e3 37. Qc2 Qh4+ 38. Kg1 Rc8 39. Qe2 Rh8 0-1 + + +[Event "London casual game"] +[Site "London ENG"] +[Date "1851.06.21"] +[Round "?"] +[White "Anderssen, Adolf"] +[Black "Kieseritzky, Lionel"] +[Result "1-0"] +[ECO "C33"] +[PlyCount "45"] +[Annotator "ChessPenguin sample"] + +{The "Immortal Game".} 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 b5 5. Bxb5 Nf6 6. +Nf3 Qh6 7. d3 Nh5 8. Nh4 Qg5 9. Nf5 c6 10. g4 Nf6 11. Rg1 $1 cxb5 12. h4 Qg6 +13. h5 Qg5 14. Qf3 Ng8 15. Bxf4 Qf6 16. Nc3 Bc5 17. Nd5 Qxb2 18. Bd6 $3 {White +gives up both rooks.} Bxg1 (18... Qxa1+ 19. Ke2 Bxg1 20. Nxg7+ Kd8 21. Qf6+ {is +similar.}) 19. e5 $1 Qxa1+ 20. Ke2 Na6 21. Nxg7+ Kd8 22. Qf6+ $3 Nxf6 23. Be7# +1-0 + + +[Event "Endgame study"] +[Site "?"] +[Date "????.??.??"] +[Round "?"] +[White "White to move"] +[Black "Opposition"] +[Result "1-0"] +[SetUp "1"] +[FEN "4k3/8/4K3/4P3/8/8/8/8 w - - 0 1"] +[PlyCount "7"] +[Annotator "ChessPenguin sample"] + +{A starting position from FEN. With the king on the sixth rank in front of +its pawn, White wins whoever is to move.} 1. Kd6 (1. Kf6 Kf8 2. e6 Ke8 3. e7 Kd7 +4. Kf7 {also wins.}) 1... Kd8 2. e6 Ke8 3. e7 Kf7 4. Kd7 1-0 + + +[Event "Berlin casual game"] +[Site "Berlin GER"] +[Date "1852.??.??"] +[Round "?"] +[White "Anderssen, Adolf"] +[Black "Dufresne, Jean"] +[Result "1-0"] +[ECO "C52"] +[PlyCount "47"] +[Annotator "ChessPenguin sample"] + +{The "Evergreen Game".} 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. b4 {The Evans Gambit.} +Bxb4 5. c3 Ba5 6. d4 exd4 7. O-O d3 8. Qb3 Qf6 9. e5 Qg6 10. Re1 Nge7 11. Ba3 +b5 12. Qxb5 Rb8 13. Qa4 Bb6 14. Nbd2 Bb7 15. Ne4 Qf5 16. Bxd3 Qh5 17. Nf6+ $1 +gxf6 18. exf6 Rg8 19. Rad1 $3 Qxf3 20. Rxe7+ $1 Nxe7 (20... Kd8 21. Rxd7+ Kc8 +22. Rd8+ Kxd8 23. Bf5+ Qxd1 24. Qxd1+ {wins.}) 21. Qxd7+ $3 Kxd7 22. Bf5+ Ke8 +23. Bd7+ Kf8 24. Bxe7# 1-0 + + +[Event "USA-01.Congress"] +[Site "New York"] +[Date "1857.??.??"] +[Round "6"] +[White "Paulsen, Louis"] +[Black "Morphy, Paul"] +[Result "0-1"] +[ECO "C48"] +[PlyCount "56"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bc5 5. O-O O-O 6. Nxe5 Re8 7. Nxc6 dxc6 +8. Bc4 b5 9. Be2 Nxe4 10. Nxe4 Rxe4 11. Bf3 Re6 12. c3 Qd3 13. b4 Bb6 14. a4 +bxa4 15. Qxa4 Bd7 16. Ra2 Rae8 17. Qa6 Qxf3 18. gxf3 Rg6+ 19. Kh1 Bh3 20. Rd1 +Bg2+ 21. Kg1 Bxf3+ 22. Kf1 Bg2+ 23. Kg1 Bh3+ 24. Kh1 Bxf2 25. Qf1 Bxf1 26. Rxf1 +Re2 27. Ra1 Rh6 28. d4 Be3 0-1 + + +[Event "Paris Opera"] +[Site "Paris FRA"] +[Date "1858.??.??"] +[Round "?"] +[White "Morphy, Paul"] +[Black "Duke Karl / Count Isouard"] +[Result "1-0"] +[ECO "C41"] +[PlyCount "33"] +[Annotator "ChessPenguin sample"] + +{The "Opera Game": a model of rapid development and open lines.} 1. e4 e5 2. Nf3 +d6 3. d4 Bg4 $6 {Pinning the knight, but Black will have to give up the bishop +pair.} 4. dxe5 Bxf3 (4... dxe5 5. Qxd8+ Kxd8 6. Nxe5 {wins a pawn.}) 5. Qxf3 +dxe5 6. Bc4 {Threatening Qxf7#.} Nf6 7. Qb3 $1 {A double attack on f7 and b7.} +Qe7 8. Nc3 {Morphy prefers development to material.} (8. Qxb7 Qb4+ 9. Qxb4 Bxb4+ +{only trades queens.}) 8... c6 9. Bg5 b5 $2 {Black wants to chase the bishop, but opens lines towards his own king.} +(9... Nbd7 {is the healthy move:} 10. O-O-O {keeps the pressure on d7.} (10. Qxb7 $6 Qb4+ +11. Qxb4 Bxb4 {[%csl Gb4] and Black is fine.}) 10... h6 11. Bh4 $14) 10. Nxb5 $1 +{[%cal Gb5d6,Gc4f7] The knight sacrifice opens the c-file and the a4-e8 diagonal.} cxb5 11. +Bxb5+ Nbd7 12. O-O-O {[%csl Rd7][%cal Gd1d7,Gb5d7] All of White's pieces aim at d7.} Rd8 +13. Rxd7 $1 Rxd7 14. Rd1 Qe6 15. Bxd7+ Nxd7 16. Qb8+ $3 {[%cal Gb3b8,Gd1d8] The famous +queen sacrifice.} Nxb8 17. Rd8# {[%csl Re8] A model of rapid development.} +1-0 + + +[Event "London m5"] +[Site "London"] +[Date "1858.??.??"] +[Round "?"] +[White "Bird, Henry Edward"] +[Black "Morphy, Paul"] +[Result "0-1"] +[ECO "C41"] +[PlyCount "58"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 d6 3. d4 f5 4. Nc3 fxe4 5. Nxe4 d5 6. Ng3 e4 7. Ne5 Nf6 8. Bg5 +Bd6 9. Nh5 O-O 10. Qd2 Qe8 11. g4 Nxg4 12. Nxg4 Qxh5 13. Ne5 Nc6 14. Be2 Qh3 +15. Nxc6 bxc6 16. Be3 Rb8 17. O-O-O Rxf2 18. Bxf2 Qa3 19. c3 Qxa2 20. b4 Qa1+ +21. Kc2 Qa4+ 22. Kb2 Bxb4 23. cxb4 Rxb4+ 24. Qxb4 Qxb4+ 25. Kc2 e3 26. Bxe3 +Bf5+ 27. Rd3 Qc4+ 28. Kd2 Qa2+ 29. Kd1 Qb1+ 0-1 + + +[Event "London mt"] +[Site "London"] +[Date "1862.??.??"] +[Round "?"] +[White "Steinitz, William"] +[Black "Mongredien, Augustus"] +[Result "1-0"] +[ECO "B01"] +[PlyCount "57"] +[Annotator "ChessPenguin sample"] + +1. e4 d5 2. exd5 Qxd5 3. Nc3 Qd8 4. d4 e6 5. Nf3 Nf6 6. Bd3 Be7 7. O-O O-O 8. +Be3 b6 9. Ne5 Bb7 10. f4 Nbd7 11. Qe2 Nd5 12. Nxd5 exd5 13. Rf3 f5 14. Rh3 g6 +15. g4 fxg4 16. Rxh7 Nxe5 17. fxe5 Kxh7 18. Qxg4 Rg8 19. Qh5+ Kg7 20. Qh6+ Kf7 +21. Qh7+ Ke6 22. Qh3+ Kf7 23. Rf1+ Ke8 24. Qe6 Rg7 25. Bg5 Qd7 26. Bxg6+ Rxg6 +27. Qxg6+ Kd8 28. Rf8+ Qe8 29. Qxe8# 1-0 + + +[Event "London International Masters"] +[Site "London"] +[Date "1883.05.05"] +[Round "6.2"] +[White "Zukertort, Johannes Hermann"] +[Black "Blackburne, Joseph Henry"] +[Result "1-0"] +[ECO "A13"] +[PlyCount "65"] +[Annotator "ChessPenguin sample"] + +{London 1883, the tournament Zukertort won ahead of Steinitz. His masterpiece: +28.Qb4!! offers the queen, which Black cannot take.} 1. c4 e6 2. e3 Nf6 3. Nf3 +b6 4. Be2 Bb7 5. O-O d5 6. d4 Bd6 7. Nc3 O-O 8. b3 Nbd7 9. Bb2 Qe7 10. Nb5 Ne4 +11. Nxd6 cxd6 12. Nd2 Ndf6 13. f3 Nxd2 14. Qxd2 dxc4 15. Bxc4 d5 16. Bd3 Rfc8 +17. Rae1 Rc7 18. e4 Rac8 19. e5 Ne8 20. f4 g6 21. Re3 f5 22. exf6 Nxf6 23. f5 +Ne4 24. Bxe4 dxe4 25. fxg6 Rc2 26. gxh7+ Kh8 27. d5+ e5 28. Qb4 R8c5 29. Rf8+ +Kxh7 30. Qxe4+ Kg7 31. Bxe5+ Kxf8 32. Bg7+ Kg8 33. Qxe7 1-0 + + +[Event "Amsterdam VAS Int-01 Masters"] +[Site "Amsterdam"] +[Date "1889.08.26"] +[Round "1"] +[White "Lasker, Emanuel"] +[Black "Bauer, Johann Hermann"] +[Result "1-0"] +[ECO "A03"] +[PlyCount "75"] +[Annotator "ChessPenguin sample"] + +{Amsterdam 1889: the classic double bishop sacrifice. Bxh7+ and Bxg7 strip the +black king of its pawns.} 1. f4 d5 2. e3 Nf6 3. b3 e6 4. Bb2 Be7 5. Bd3 b6 6. +Nf3 Bb7 7. Nc3 Nbd7 8. O-O O-O 9. Ne2 c5 10. Ng3 Qc7 11. Ne5 Nxe5 12. Bxe5 Qc6 +13. Qe2 a6 14. Nh5 Nxh5 15. Bxh7+ Kxh7 16. Qxh5+ Kg8 17. Bxg7 Kxg7 18. Qg4+ Kh7 +19. Rf3 e5 20. Rh3+ Qh6 21. Rxh6+ Kxh6 22. Qd7 Bf6 23. Qxb7 Kg7 24. Rf1 Rab8 +25. Qd7 Rfd8 26. Qg4+ Kf8 27. fxe5 Bg7 28. e6 Rb7 29. Qg6 f6 30. Rxf6+ Bxf6 31. +Qxf6+ Ke8 32. Qh8+ Ke7 33. Qg7+ Kxe6 34. Qxb7 Rd6 35. Qxa6 d4 36. exd4 cxd4 37. +h4 d3 38. Qxd3 1-0 + + +[Event "World Championship 4th"] +[Site "Havana"] +[Date "1892.??.??"] +[Round "4"] +[White "Steinitz, William"] +[Black "Chigorin, Mikhail"] +[Result "1-0"] +[ECO "C65"] +[PlyCount "55"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 d6 5. c3 g6 6. Nbd2 Bg7 7. Nf1 O-O 8. Ba4 +Nd7 9. Ne3 Nc5 10. Bc2 Ne6 11. h4 Ne7 12. h5 d5 13. hxg6 fxg6 14. exd5 Nxd5 15. +Nxd5 Qxd5 16. Bb3 Qc6 17. Qe2 Bd7 18. Be3 Kh8 19. O-O-O Rae8 20. Qf1 a5 21. d4 +exd4 22. Nxd4 Bxd4 23. Rxd4 Nxd4 24. Rxh7+ Kxh7 25. Qh1+ Kg7 26. Bh6+ Kf6 27. +Qh4+ Ke5 28. Qxd4+ 1-0 + + +[Event "Hastings International Masters"] +[Site "Hastings"] +[Date "1895.08.17"] +[Round "10"] +[White "Steinitz, William"] +[Black "Von Bardeleben, Curt"] +[Result "1-0"] +[ECO "C54"] +[PlyCount "49"] +[Annotator "ChessPenguin sample"] + +{Hastings 1895. Steinitz keeps Black's king in the centre and finishes with a +famous combination in which his rook gives check after check. Von Bardeleben is +said to have left the hall rather than resign.} 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 +4. c3 Nf6 5. d4 exd4 6. cxd4 Bb4+ 7. Nc3 d5 8. exd5 Nxd5 9. O-O Be6 10. Bg5 Be7 +11. Bxd5 Bxd5 12. Nxd5 Qxd5 13. Bxe7 Nxe7 14. Re1 f6 15. Qe2 Qd7 16. Rac1 c6 +17. d5 cxd5 18. Nd4 Kf7 19. Ne6 Rhc8 20. Qg4 g6 21. Ng5+ Ke8 22. Rxe7+ Kf8 23. +Rf7+ Kg8 24. Rg7+ Kh8 25. Rxh7+ 1-0 + + +[Event "Hastings"] +[Site "Hastings"] +[Date "1895.??.??"] +[Round "?"] +[White "Pillsbury, Harry Nelson"] +[Black "Tarrasch, Siegbert"] +[Result "1-0"] +[ECO "D55"] +[PlyCount "103"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Be7 5. Nf3 Nbd7 6. Rc1 O-O 7. e3 b6 8. cxd5 +exd5 9. Bd3 Bb7 10. O-O c5 11. Re1 c4 12. Bb1 a6 13. Ne5 b5 14. f4 Re8 15. Qf3 +Nf8 16. Ne2 Ne4 17. Bxe7 Rxe7 18. Bxe4 dxe4 19. Qg3 f6 20. Ng4 Kh8 21. f5 Qd7 +22. Rf1 Rd8 23. Rf4 Qd6 24. Qh4 Rde8 25. Nc3 Bd5 26. Nf2 Qc6 27. Rf1 b4 28. Ne2 +Qa4 29. Ng4 Nd7 30. R4f2 Kg8 31. Nc1 c3 32. b3 Qc6 33. h3 a5 34. Nh2 a4 35. g4 +axb3 36. axb3 Ra8 37. g5 Ra3 38. Ng4 Bxb3 39. Rg2 Kh8 40. gxf6 gxf6 41. Nxb3 +Rxb3 42. Nh6 Rg7 43. Rxg7 Kxg7 44. Qg3+ Kxh6 45. Kh1 Qd5 46. Rg1 Qxf5 47. Qh4+ +Qh5 48. Qf4+ Qg5 49. Rxg5 fxg5 50. Qd6+ Kh5 51. Qxd7 c2 52. Qxh7# 1-0 + + +[Event "Hastings"] +[Site "Hastings"] +[Date "1895.??.??"] +[Round "?"] +[White "Pillsbury, Harry Nelson"] +[Black "Gunsberg, Isidor"] +[Result "1-0"] +[ECO "D94"] +[PlyCount "79"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. c4 c6 3. e3 g6 4. Nc3 Bg7 5. Nf3 Nf6 6. Bd3 O-O 7. Ne5 dxc4 8. Bxc4 +Nd5 9. f4 Be6 10. Qb3 b5 11. Bxd5 Bxd5 12. Nxd5 Qxd5 13. Qxd5 cxd5 14. Nd3 Nd7 +15. Bd2 Rfc8 16. Ke2 e6 17. Rhc1 Bf8 18. Rxc8 Rxc8 19. Rc1 Rxc1 20. Bxc1 Bd6 +21. Bd2 Kf8 22. Bb4 Ke7 23. Bc5 a6 24. b4 f6 25. g4 Bxc5 26. bxc5 Nb8 27. f5 g5 +28. Nb4 a5 29. c6 Kd6 30. fxe6 Nxc6 31. Nxc6 Kxc6 32. e4 dxe4 33. d5+ Kd6 34. +Ke3 b4 35. Kxe4 a4 36. Kd4 h5 37. gxh5 a3 38. Kc4 f5 39. h6 f4 40. h7 1-0 + + +[Event "St Petersburg Four Masters"] +[Site "St Petersburg"] +[Date "1896.01.04"] +[Round "4.1"] +[White "Pillsbury, Harry Nelson"] +[Black "Lasker, Emanuel"] +[Result "0-1"] +[ECO "D50"] +[PlyCount "64"] +[Annotator "ChessPenguin sample"] + +{St Petersburg 1895/96. Lasker answers Pillsbury's attack with the rook +sacrifice 17...Rxc3!! and hunts the white king.} 1. d4 d5 2. c4 e6 3. Nc3 Nf6 +4. Nf3 c5 5. Bg5 cxd4 6. Qxd4 Nc6 7. Qh4 Be7 8. O-O-O Qa5 9. e3 Bd7 10. Kb1 h6 +11. cxd5 exd5 12. Nd4 O-O 13. Bxf6 Bxf6 14. Qh5 Nxd4 15. exd4 Be6 16. f4 Rac8 +17. f5 Rxc3 18. fxe6 Ra3 19. exf7+ Rxf7 20. bxa3 Qb6+ 21. Bb5 Qxb5+ 22. Ka1 Rc7 +23. Rd2 Rc4 24. Rhd1 Rc3 25. Qf5 Qc4 26. Kb2 Rxa3 27. Qe6+ Kh7 28. Kxa3 Qc3+ +29. Ka4 b5+ 30. Kxb5 Qc4+ 31. Ka5 Bd8+ 32. Qb6 Bxb6# 0-1 + + +[Event "Cambridge Springs"] +[Site "Cambridge"] +[Date "1904.??.??"] +[Round "3"] +[White "Lasker, Emanuel"] +[Black "Napier, William Ewart"] +[Result "1-0"] +[ECO "B72"] +[PlyCount "69"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nc3 Nc6 3. Nf3 g6 4. d4 cxd4 5. Nxd4 Bg7 6. Be3 d6 7. h3 Nf6 8. g4 +O-O 9. g5 Ne8 10. h4 Nc7 11. f4 e5 12. Nde2 d5 13. exd5 Nd4 14. Nxd4 Nxd5 15. +Nf5 Nxc3 16. Qxd8 Rxd8 17. Ne7+ Kh8 18. h5 Re8 19. Bc5 gxh5 20. Bc4 exf4 21. +Bxf7 Ne4 22. Bxe8 Bxb2 23. Rb1 Bc3+ 24. Kf1 Bg4 25. Bxh5 Bxh5 26. Rxh5 Ng3+ 27. +Kg2 Nxh5 28. Rxb7 a5 29. Rb3 Bg7 30. Rh3 Ng3 31. Kf3 Ra6 32. Kxf4 Ne2+ 33. Kf5 +Nc3 34. a3 Na4 35. Be3 1-0 + + +[Event "Lodz"] +[Site "Lodz"] +[Date "1907.12.26"] +[Round "?"] +[White "Rotlewi, Georg A"] +[Black "Rubinstein, Akiba"] +[Result "0-1"] +[ECO "D40"] +[PlyCount "50"] +[Annotator "ChessPenguin sample"] + +{Lodz 1907, "Rubinstein's Immortal". After 22...Rxc3! and 23...Rd2!! Black's +queen is left hanging, and the bishops and rooks finish the attack.} 1. d4 d5 +2. Nf3 e6 3. e3 c5 4. c4 Nc6 5. Nc3 Nf6 6. dxc5 Bxc5 7. a3 a6 8. b4 Bd6 9. Bb2 +O-O 10. Qd2 Qe7 11. Bd3 dxc4 12. Bxc4 b5 13. Bd3 Rd8 14. Qe2 Bb7 15. O-O Ne5 +16. Nxe5 Bxe5 17. f4 Bc7 18. e4 Rac8 19. e5 Bb6+ 20. Kh1 Ng4 21. Be4 Qh4 22. g3 +Rxc3 23. gxh4 Rd2 24. Qxd2 Bxe4+ 25. Qg2 Rh3 0-1 + + +[Event "St Petersburg"] +[Site "St Petersburg"] +[Date "1909.??.??"] +[Round "?"] +[White "Rubinstein, Akiba"] +[Black "Lasker, Emanuel"] +[Result "1-0"] +[ECO "D32"] +[PlyCount "79"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. Nf3 Nf6 3. c4 e6 4. Bg5 c5 5. cxd5 exd5 6. Nc3 cxd4 7. Nxd4 Nc6 8. +e3 Be7 9. Bb5 Bd7 10. Bxf6 Bxf6 11. Nxd5 Bxd4 12. exd4 Qg5 13. Bxc6 Bxc6 14. +Ne3 O-O-O 15. O-O Rhe8 16. Rc1 Rxe3 17. Rxc6+ bxc6 18. Qc1 Rxd4 19. fxe3 Rd7 +20. Qxc6+ Kd8 21. Rf4 f5 22. Qc5 Qe7 23. Qxe7+ Kxe7 24. Rxf5 Rd1+ 25. Kf2 Rd2+ +26. Kf3 Rxb2 27. Ra5 Rb7 28. Ra6 Kf8 29. e4 Rc7 30. h4 Kf7 31. g4 Kf8 32. Kf4 +Ke7 33. h5 h6 34. Kf5 Kf7 35. e5 Rb7 36. Rd6 Ke7 37. Ra6 Kf7 38. Rd6 Kf8 39. +Rc6 Kf7 40. a3 1-0 + + +[Event "Wien"] +[Site "Vienna"] +[Date "1910.??.??"] +[Round "?"] +[White "Reti, Richard"] +[Black "Tartakower, Saviely"] +[Result "1-0"] +[ECO "B15"] +[PlyCount "21"] +[Annotator "ChessPenguin sample"] + +{Vienna 1910, a miniature everyone should know: 9.Qd8+!! Kxd8 10.Bg5++ and mate +next move.} 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nf6 5. Qd3 e5 6. dxe5 Qa5+ 7. +Bd2 Qxe5 8. O-O-O Nxe4 9. Qd8+ Kxd8 10. Bg5+ Kc7 11. Bd8# 1-0 + + +[Event "San Sebastian"] +[Site "San Sebastian"] +[Date "1911.??.??"] +[Round "1"] +[White "Capablanca, Jose Raul"] +[Black "Bernstein, Ossip"] +[Result "1-0"] +[ECO "C66"] +[PlyCount "67"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Be7 5. Nc3 d6 6. Bxc6+ bxc6 7. d4 exd4 8. +Nxd4 Bd7 9. Bg5 O-O 10. Re1 h6 11. Bh4 Nh7 12. Bxe7 Qxe7 13. Qd3 Rab8 14. b3 +Ng5 15. Rad1 Qe5 16. Qe3 Ne6 17. Nce2 Qa5 18. Nf5 Nc5 19. Ned4 Kh7 20. g4 Rbe8 +21. f3 Ne6 22. Ne2 Qxa2 23. Neg3 Qxc2 24. Rc1 Qb2 25. Nh5 Rh8 26. Re2 Qe5 27. +f4 Qb5 28. Nfxg7 Nc5 29. Nxe8 Bxe8 30. Qc3 f6 31. Nxf6+ Kg6 32. Nh5 Rg8 33. f5+ +Kg5 34. Qe3+ 1-0 + + +[Event "DSB Kongress-18 Meisterturnier-17"] +[Site "Breslau"] +[Date "1912.07.20"] +[Round "6"] +[White "Levitsky, Stepan Mikhailovich"] +[Black "Marshall, Frank James"] +[Result "0-1"] +[ECO "C10"] +[PlyCount "46"] +[Annotator "ChessPenguin sample"] + +{Breslau 1912. Legend says the spectators showered the board with gold coins +after 23...Qg3!!: every capture of the queen loses.} 1. e4 e6 2. d4 d5 3. Nc3 +c5 4. Nf3 Nc6 5. exd5 exd5 6. Be2 Nf6 7. O-O Be7 8. Bg5 O-O 9. dxc5 Be6 10. Nd4 +Bxc5 11. Nxe6 fxe6 12. Bg4 Qd6 13. Bh3 Rae8 14. Qd2 Bb4 15. Bxf6 Rxf6 16. Rad1 +Qc5 17. Qe2 Bxc3 18. bxc3 Qxc3 19. Rxd5 Nd4 20. Qh5 Ref8 21. Re5 Rh6 22. Qg5 +Rxh3 23. Rc5 Qg3 0-1 + + +[Event "London blitz"] +[Site "London (City of London CC)"] +[Date "1912.10.29"] +[Round "?"] +[White "Lasker, Edward"] +[Black "Thomas, George Alan"] +[Result "1-0"] +[ECO "A83"] +[PlyCount "35"] +[Annotator "ChessPenguin sample"] + +{London 1912, the most famous king hunt: after the queen sacrifice 11.Qxh7+!! +the black king is driven from g8 all the way down the board and mated.} 1. d4 +e6 2. Nf3 f5 3. Nc3 Nf6 4. Bg5 Be7 5. Bxf6 Bxf6 6. e4 fxe4 7. Nxe4 b6 8. Ne5 +O-O 9. Bd3 Bb7 10. Qh5 Qe7 11. Qxh7+ Kxh7 12. Nxf6+ Kh6 13. Neg4+ Kg5 14. h4+ +Kf4 15. g3+ Kf3 16. Be2+ Kg2 17. Rh2+ Kg1 18. Kd2# 1-0 + + +[Event "St Petersburg f"] +[Site "St Petersburg"] +[Date "1914.??.??"] +[Round "?"] +[White "Lasker, Emanuel"] +[Black "Capablanca, Jose Raul"] +[Result "1-0"] +[ECO "C68"] +[PlyCount "83"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Bxc6 dxc6 5. d4 exd4 6. Qxd4 Qxd4 7. Nxd4 Bd6 +8. Nc3 Ne7 9. O-O O-O 10. f4 Re8 11. Nb3 f6 12. f5 b6 13. Bf4 Bb7 14. Bxd6 cxd6 +15. Nd4 Rad8 16. Ne6 Rd7 17. Rad1 Nc8 18. Rf2 b5 19. Rfd2 Rde7 20. b4 Kf7 21. +a3 Ba8 22. Kf2 Ra7 23. g4 h6 24. Rd3 a5 25. h4 axb4 26. axb4 Rae7 27. Kf3 Rg8 +28. Kf4 g6 29. Rg3 g5+ 30. Kf3 Nb6 31. hxg5 hxg5 32. Rh3 Rd7 33. Kg3 Ke8 34. +Rdh1 Bb7 35. e5 dxe5 36. Ne4 Nd5 37. N6c5 Bc8 38. Nxd7 Bxd7 39. Rh7 Rf8 40. Ra1 +Kd8 41. Ra8+ Bc8 42. Nc5 1-0 + + +[Event "St Petersburg prel"] +[Site "St Petersburg"] +[Date "1914.??.??"] +[Round "?"] +[White "Nimzowitsch, Aron"] +[Black "Tarrasch, Siegbert"] +[Result "0-1"] +[ECO "D30"] +[PlyCount "64"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. Nf3 c5 3. c4 e6 4. e3 Nf6 5. Bd3 Nc6 6. O-O Bd6 7. b3 O-O 8. Bb2 b6 +9. Nbd2 Bb7 10. Rc1 Qe7 11. cxd5 exd5 12. Nh4 g6 13. Nhf3 Rad8 14. dxc5 bxc5 +15. Bb5 Ne4 16. Bxc6 Bxc6 17. Qc2 Nxd2 18. Nxd2 d4 19. exd4 Bxh2+ 20. Kxh2 Qh4+ +21. Kg1 Bxg2 22. f3 Rfe8 23. Ne4 Qh1+ 24. Kf2 Bxf1 25. d5 f5 26. Qc3 Qg2+ 27. +Ke3 Rxe4+ 28. fxe4 f4+ 29. Kxf4 Rf8+ 30. Ke5 Qh2+ 31. Ke6 Re8+ 32. Kd7 Bb5# 0-1 + + +[Event "Manhattan CC International"] +[Site "New York"] +[Date "1918.??.??"] +[Round "?"] +[White "Capablanca, Jose Raul"] +[Black "Marshall, Frank James"] +[Result "1-0"] +[ECO "C89"] +[PlyCount "71"] +[Annotator "ChessPenguin sample"] + +{New York 1918. Marshall springs his gambit in the Ruy Lopez, 8...d5, kept +secret for years; Capablanca defends calmly and wins.} 1. e4 e5 2. Nf3 Nc6 3. +Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O 8. c3 d5 9. exd5 Nxd5 10. +Nxe5 Nxe5 11. Rxe5 Nf6 12. Re1 Bd6 13. h3 Ng4 14. Qf3 Qh4 15. d4 Nxf2 16. Re2 +Bg4 17. hxg4 Bh2+ 18. Kf1 Bg3 19. Rxf2 Qh1+ 20. Ke2 Bxf2 21. Bd2 Bh4 22. Qh3 +Rae8+ 23. Kd3 Qf1+ 24. Kc2 Bf2 25. Qf3 Qg1 26. Bd5 c5 27. dxc5 Bxc5 28. b4 Bd6 +29. a4 a5 30. axb5 axb4 31. Ra6 bxc3 32. Nxc3 Bb4 33. b6 Bxc3 34. Bxc3 h6 35. +b7 Re3 36. Bxf7+ 1-0 + + +[Event "Berlin"] +[Site "Berlin"] +[Date "1918.??.??"] +[Round "?"] +[White "Rubinstein, Akiba"] +[Black "Vidmar, Milan"] +[Result "0-1"] +[ECO "A52"] +[PlyCount "48"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 e5 3. dxe5 Ng4 4. Bf4 Nc6 5. Nf3 Bb4+ 6. Nc3 Qe7 7. Qd5 Bxc3+ +8. bxc3 Qa3 9. Rc1 f6 10. exf6 Nxf6 11. Qd2 d6 12. Nd4 O-O 13. e3 Nxd4 14. cxd4 +Ne4 15. Qc2 Qa5+ 16. Ke2 Rxf4 17. exf4 Bf5 18. Qb2 Re8 19. Kf3 Nd2+ 20. Kg3 +Ne4+ 21. Kh4 Re6 22. Be2 Rh6+ 23. Bh5 Rxh5+ 24. Kxh5 Bg6+ 0-1 + + +[Event "New Orleans"] +[Site "New Orleans"] +[Date "1920.??.??"] +[Round "?"] +[White "Adams, Edwin Ziegler"] +[Black "Torre Repetto, Carlos"] +[Result "1-0"] +[ECO "C62"] +[PlyCount "45"] +[Annotator "ChessPenguin sample"] + +{New Orleans 1920, the famous "overloading" game: White's queen is offered +again and again (Qg4!, Qc4!, Qc7!) until Black's defence breaks. Its +authenticity is debated.} 1. e4 e5 2. Nf3 d6 3. d4 exd4 4. Qxd4 Nc6 5. Bb5 Bd7 +6. Bxc6 Bxc6 7. Nc3 Nf6 8. O-O Be7 9. Nd5 Bxd5 10. exd5 O-O 11. Bg5 c6 12. c4 +cxd5 13. cxd5 Re8 14. Rfe1 a5 15. Re2 Rc8 16. Rae1 Qd7 17. Bxf6 Bxf6 18. Qg4 +Qb5 19. Qc4 Qd7 20. Qc7 Qb5 21. a4 Qxa4 22. Re4 Qb5 23. Qxb7 1-0 + + +[Event "Hastings"] +[Site "Hastings"] +[Date "1922.??.??"] +[Round "?"] +[White "Bogoljubow, Efim"] +[Black "Alekhine, Alexander"] +[Result "0-1"] +[ECO "A90"] +[PlyCount "106"] +[Annotator "ChessPenguin sample"] + +1. d4 f5 2. c4 Nf6 3. g3 e6 4. Bg2 Bb4+ 5. Bd2 Bxd2+ 6. Nxd2 Nc6 7. Ngf3 O-O 8. +O-O d6 9. Qb3 Kh8 10. Qc3 e5 11. e3 a5 12. b3 Qe8 13. a3 Qh5 14. h4 Ng4 15. Ng5 +Bd7 16. f3 Nf6 17. f4 e4 18. Rfd1 h6 19. Nh3 d5 20. Nf1 Ne7 21. a4 Nc6 22. Rd2 +Nb4 23. Bh1 Qe8 24. Rg2 dxc4 25. bxc4 Bxa4 26. Nf2 Bd7 27. Nd2 b5 28. Nd1 Nd3 +29. Rxa5 b4 30. Rxa8 bxc3 31. Rxe8 c2 32. Rxf8+ Kh7 33. Nf2 c1=Q+ 34. Nf1 Ne1 +35. Rh2 Qxc4 36. Rb8 Bb5 37. Rxb5 Qxb5 38. g4 Nf3+ 39. Bxf3 exf3 40. gxf5 Qe2 +41. d5 Kg8 42. h5 Kh7 43. e4 Nxe4 44. Nxe4 Qxe4 45. d6 cxd6 46. f6 gxf6 47. Rd2 +Qe2 48. Rxe2 fxe2 49. Kf2 exf1=Q+ 50. Kxf1 Kg7 51. Kf2 Kf7 52. Ke3 Ke6 53. Ke4 +d5+ 0-1 + + +[Event "Copenhagen 6 Masters"] +[Site "Copenhagen"] +[Date "1923.03.10"] +[Round "7"] +[White "Saemisch, Friedrich"] +[Black "Nimzowitsch, Aron"] +[Result "0-1"] +[ECO "E06"] +[PlyCount "50"] +[Annotator "ChessPenguin sample"] + +{Copenhagen 1923, the "Immortal Zugzwang Game": White resigns with plenty of +material, because every move he can make loses.} 1. d4 Nf6 2. c4 e6 3. Nf3 b6 +4. g3 Bb7 5. Bg2 Be7 6. Nc3 O-O 7. O-O d5 8. Ne5 c6 9. cxd5 cxd5 10. Bf4 a6 11. +Rc1 b5 12. Qb3 Nc6 13. Nxc6 Bxc6 14. h3 Qd7 15. Kh2 Nh5 16. Bd2 f5 17. Qd1 b4 +18. Nb1 Bb5 19. Rg1 Bd6 20. e4 fxe4 21. Qxh5 Rxf2 22. Qg5 Raf8 23. Kh1 R8f5 24. +Qe3 Bd3 25. Rce1 h6 0-1 + + +[Event "New York International Masters-01"] +[Site "New York"] +[Date "1924.03.23"] +[Round "6"] +[White "Capablanca, Jose Raul"] +[Black "Tartakower, Saviely"] +[Result "1-0"] +[ECO "A85"] +[PlyCount "103"] +[Annotator "ChessPenguin sample"] + +{New York 1924. A celebrated rook endgame: Capablanca gives up pawns to bring +his king and rook to the most active squares.} 1. d4 e6 2. Nf3 f5 3. c4 Nf6 4. +Bg5 Be7 5. Nc3 O-O 6. e3 b6 7. Bd3 Bb7 8. O-O Qe8 9. Qe2 Ne4 10. Bxe7 Nxc3 11. +bxc3 Qxe7 12. a4 Bxf3 13. Qxf3 Nc6 14. Rfb1 Rae8 15. Qh3 Rf6 16. f4 Na5 17. Qf3 +d6 18. Re1 Qd7 19. e4 fxe4 20. Qxe4 g6 21. g3 Kf8 22. Kg2 Rf7 23. h4 d5 24. +cxd5 exd5 25. Qxe8+ Qxe8 26. Rxe8+ Kxe8 27. h5 Rf6 28. hxg6 hxg6 29. Rh1 Kf8 +30. Rh7 Rc6 31. g4 Nc4 32. g5 Ne3+ 33. Kf3 Nf5 34. Bxf5 gxf5 35. Kg3 Rxc3+ 36. +Kh4 Rf3 37. g6 Rxf4+ 38. Kg5 Re4 39. Kf6 Kg8 40. Rg7+ Kh8 41. Rxc7 Re8 42. Kxf5 +Re4 43. Kf6 Rf4+ 44. Ke5 Rg4 45. g7+ Kg8 46. Rxa7 Rg1 47. Kxd5 Rc1 48. Kd6 Rc2 +49. d5 Rc1 50. Rc7 Ra1 51. Kc6 Rxa4 52. d6 1-0 + + +[Event "New York"] +[Site "New York"] +[Date "1924.??.??"] +[Round "?"] +[White "Reti, Richard"] +[Black "Capablanca, Jose Raul"] +[Result "1-0"] +[ECO "A15"] +[PlyCount "61"] +[Annotator "ChessPenguin sample"] + +1. Nf3 Nf6 2. c4 g6 3. b4 Bg7 4. Bb2 O-O 5. g3 b6 6. Bg2 Bb7 7. O-O d6 8. d3 +Nbd7 9. Nbd2 e5 10. Qc2 Re8 11. Rfd1 a5 12. a3 h6 13. Nf1 c5 14. b5 Nf8 15. e3 +Qc7 16. d4 Be4 17. Qc3 exd4 18. exd4 N6d7 19. Qd2 cxd4 20. Bxd4 Qxc4 21. Bxg7 +Kxg7 22. Qb2+ Kg8 23. Rxd6 Qc5 24. Rad1 Ra7 25. Ne3 Qh5 26. Nd4 Bxg2 27. Kxg2 +Qe5 28. Nc4 Qc5 29. Nc6 Rc7 30. Ne3 Ne5 31. R1d5 1-0 + + +[Event "Baden-Baden"] +[Site "Baden-Baden"] +[Date "1925.??.??"] +[Round "?"] +[White "Reti, Richard"] +[Black "Alekhine, Alexander"] +[Result "0-1"] +[ECO "A00"] +[PlyCount "84"] +[Annotator "ChessPenguin sample"] + +1. g3 e5 2. Nf3 e4 3. Nd4 d5 4. d3 exd3 5. Qxd3 Nf6 6. Bg2 Bb4+ 7. Bd2 Bxd2+ 8. +Nxd2 O-O 9. c4 Na6 10. cxd5 Nb4 11. Qc4 Nbxd5 12. N2b3 c6 13. O-O Re8 14. Rfd1 +Bg4 15. Rd2 Qc8 16. Nc5 Bh3 17. Bf3 Bg4 18. Bg2 Bh3 19. Bf3 Bg4 20. Bh1 h5 21. +b4 a6 22. Rc1 h4 23. a4 hxg3 24. hxg3 Qc7 25. b5 axb5 26. axb5 Re3 27. Nf3 cxb5 +28. Qxb5 Nc3 29. Qxb7 Qxb7 30. Nxb7 Nxe2+ 31. Kh2 Ne4 32. Rc4 Nxf2 33. Bg2 Be6 +34. Rcc2 Ng4+ 35. Kh3 Ne5+ 36. Kh2 Rxf3 37. Rxe2 Ng4+ 38. Kh3 Ne3+ 39. Kh2 Nxc2 +40. Bxf3 Nd4 41. Rf2 Nxf3+ 42. Rxf3 Bd5 0-1 + + +[Event "Moscow"] +[Site "Moscow"] +[Date "1925.??.??"] +[Round "?"] +[White "Torre Repetto, Carlos"] +[Black "Lasker, Emanuel"] +[Result "1-0"] +[ECO "A46"] +[PlyCount "85"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. Nf3 e6 3. Bg5 c5 4. e3 cxd4 5. exd4 Be7 6. Nbd2 d6 7. c3 Nbd7 8. +Bd3 b6 9. Nc4 Bb7 10. Qe2 Qc7 11. O-O O-O 12. Rfe1 Rfe8 13. Rad1 Nf8 14. Bc1 +Nd5 15. Ng5 b5 16. Na3 b4 17. cxb4 Nxb4 18. Qh5 Bxg5 19. Bxg5 Nxd3 20. Rxd3 Qa5 +21. b4 Qf5 22. Rg3 h6 23. Nc4 Qd5 24. Ne3 Qb5 25. Bf6 Qxh5 26. Rxg7+ Kh8 27. +Rxf7+ Kg8 28. Rg7+ Kh8 29. Rxb7+ Kg8 30. Rg7+ Kh8 31. Rg5+ Kh7 32. Rxh5 Kg6 33. +Rh3 Kxf6 34. Rxh6+ Kg5 35. Rh3 Reb8 36. Rg3+ Kf6 37. Rf3+ Kg6 38. a3 a5 39. +bxa5 Rxa5 40. Nc4 Rd5 41. Rf4 Nd7 42. Rxe6+ Kg5 43. g3 1-0 + + +[Event "World Championship 13th"] +[Site "Buenos Aires"] +[Date "1927.??.??"] +[Round "34"] +[White "Alekhine, Alexander"] +[Black "Capablanca, Jose Raul"] +[Result "1-0"] +[ECO "D51"] +[PlyCount "163"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7 5. e3 c6 6. a3 Be7 7. Nf3 O-O 8. Bd3 +dxc4 9. Bxc4 Nd5 10. Bxe7 Qxe7 11. Ne4 N5f6 12. Ng3 c5 13. O-O Nb6 14. Ba2 cxd4 +15. Nxd4 g6 16. Rc1 Bd7 17. Qe2 Rac8 18. e4 e5 19. Nf3 Kg7 20. h3 h6 21. Qd2 +Be6 22. Bxe6 Qxe6 23. Qa5 Nc4 24. Qxa7 Nxb2 25. Rxc8 Rxc8 26. Qxb7 Nc4 27. Qb4 +Ra8 28. Ra1 Qc6 29. a4 Nxe4 30. Nxe5 Qd6 31. Qxc4 Qxe5 32. Re1 Nd6 33. Qc1 Qf6 +34. Ne4 Nxe4 35. Rxe4 Rb8 36. Re2 Ra8 37. Ra2 Ra5 38. Qc7 Qa6 39. Qc3+ Kh7 40. +Rd2 Qb6 41. Rd7 Qb1+ 42. Kh2 Qb8+ 43. g3 Rf5 44. Qd4 Qe8 45. Rd5 Rf3 46. h4 Qh8 +47. Qb6 Qa1 48. Kg2 Rf6 49. Qd4 Qxd4 50. Rxd4 Kg7 51. a5 Ra6 52. Rd5 Rf6 53. +Rd4 Ra6 54. Ra4 Kf6 55. Kf3 Ke5 56. Ke3 h5 57. Kd3 Kd5 58. Kc3 Kc5 59. Ra2 Kb5 +60. Kb3 Kc5 61. Kc3 Kb5 62. Kd4 Rd6+ 63. Ke5 Re6+ 64. Kf4 Ka6 65. Kg5 Re5+ 66. +Kh6 Rf5 67. f4 Rc5 68. Ra3 Rc7 69. Kg7 Rd7 70. f5 gxf5 71. Kh6 f4 72. gxf4 Rd5 +73. Kg7 Rf5 74. Ra4 Kb5 75. Re4 Ka6 76. Kh6 Rxa5 77. Re5 Ra1 78. Kxh5 Rg1 79. +Rg5 Rh1 80. Rf5 Kb6 81. Rxf7 Kc6 82. Re7 1-0 + + +[Event "Warsaw"] +[Site "Warsaw"] +[Date "1929.??.??"] +[Round "?"] +[White "Glucksberg"] +[Black "Najdorf, Miguel"] +[Result "0-1"] +[ECO "A85"] +[PlyCount "44"] +[Annotator "ChessPenguin sample"] + +1. d4 f5 2. c4 Nf6 3. Nc3 e6 4. Nf3 d5 5. e3 c6 6. Bd3 Bd6 7. O-O O-O 8. Ne2 +Nbd7 9. Ng5 Bxh2+ 10. Kh1 Ng4 11. f4 Qe8 12. g3 Qh5 13. Kg2 Bg1 14. Nxg1 Qh2+ +15. Kf3 e5 16. dxe5 Ndxe5+ 17. fxe5 Nxe5+ 18. Kf4 Ng6+ 19. Kf3 f4 20. exf4 Bg4+ +21. Kxg4 Ne5+ 22. fxe5 h5# 0-1 + + +[Event "San Remo"] +[Site "San Remo"] +[Date "1930.??.??"] +[Round "?"] +[White "Alekhine, Alexander"] +[Black "Nimzowitsch, Aron"] +[Result "1-0"] +[ECO "C17"] +[PlyCount "63"] +[Annotator "ChessPenguin sample"] + +1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. Bd2 Ne7 6. Nb5 Bxd2+ 7. Qxd2 O-O 8. c3 +b6 9. f4 Ba6 10. Nf3 Qd7 11. a4 Nbc6 12. b4 cxb4 13. cxb4 Bb7 14. Nd6 f5 15. a5 +Nc8 16. Nxb7 Qxb7 17. a6 Qf7 18. Bb5 N8e7 19. O-O h6 20. Rfc1 Rfc8 21. Rc2 Qe8 +22. Rac1 Rab8 23. Qe3 Rc7 24. Rc3 Qd7 25. R1c2 Kf8 26. Qc1 Rbc8 27. Ba4 b5 28. +Bxb5 Ke8 29. Ba4 Kd8 30. h4 h5 31. Kh2 g6 32. g3 1-0 + + +[Event "World Championship 16th"] +[Site "NLD"] +[Date "1935.??.??"] +[Round "26"] +[White "Euwe, Max"] +[Black "Alekhine, Alexander"] +[Result "1-0"] +[ECO "E18"] +[PlyCount "93"] +[Annotator "ChessPenguin sample"] + +1. d4 e6 2. c4 f5 3. g3 Bb4+ 4. Bd2 Be7 5. Bg2 Nf6 6. Nc3 O-O 7. Nf3 Ne4 8. O-O +b6 9. Qc2 Bb7 10. Ne5 Nxc3 11. Bxc3 Bxg2 12. Kxg2 Qc8 13. d5 d6 14. Nd3 e5 15. +Kh1 c6 16. Qb3 Kh8 17. f4 e4 18. Nb4 c5 19. Nc2 Nd7 20. Ne3 Bf6 21. Nxf5 Bxc3 +22. Nxd6 Qb8 23. Nxe4 Bf6 24. Nd2 g5 25. e4 gxf4 26. gxf4 Bd4 27. e5 Qe8 28. e6 +Rg8 29. Nf3 Qg6 30. Rg1 Bxg1 31. Rxg1 Qf6 32. Ng5 Rg7 33. exd7 Rxd7 34. Qe3 Re7 +35. Ne6 Rf8 36. Qe5 Qxe5 37. fxe5 Rf5 38. Re1 h6 39. Nd8 Rf2 40. e6 Rd2 41. Nc6 +Re8 42. e7 b5 43. Nd8 Kg7 44. Nb7 Kf6 45. Re6+ Kg5 46. Nd6 Rxe7 47. Ne4+ 1-0 + + +[Event "AVRO"] +[Site "Netherlands"] +[Date "1938.11.22"] +[Round "11"] +[White "Botvinnik, Mikhail"] +[Black "Capablanca, Jose Raul"] +[Result "1-0"] +[ECO "E49"] +[PlyCount "81"] +[Annotator "ChessPenguin sample"] + +{AVRO 1938. Botvinnik's best-known combination begins with 30.Ba3!!, deflecting +the black queen.} 1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. e3 d5 5. a3 Bxc3+ 6. bxc3 c5 +7. cxd5 exd5 8. Bd3 O-O 9. Ne2 b6 10. O-O Ba6 11. Bxa6 Nxa6 12. Bb2 Qd7 13. a4 +Rfe8 14. Qd3 c4 15. Qc2 Nb8 16. Rae1 Nc6 17. Ng3 Na5 18. f3 Nb3 19. e4 Qxa4 20. +e5 Nd7 21. Qf2 g6 22. f4 f5 23. exf6 Nxf6 24. f5 Rxe1 25. Rxe1 Re8 26. Re6 Rxe6 +27. fxe6 Kg7 28. Qf4 Qe8 29. Qe5 Qe7 30. Ba3 Qxa3 31. Nh5+ gxh5 32. Qg5+ Kf8 +33. Qxf6+ Kg8 34. e7 Qc1+ 35. Kf2 Qc2+ 36. Kg3 Qd3+ 37. Kh4 Qe4+ 38. Kxh5 Qe2+ +39. Kh4 Qe4+ 40. g4 Qe1+ 41. Kh5 1-0 + + +[Event "Candidates Tournament"] +[Site "Zuerich"] +[Date "1953.08.31"] +[Round "2"] +[White "Geller, Efim P"] +[Black "Euwe, Max"] +[Result "0-1"] +[ECO "E28"] +[PlyCount "52"] +[Annotator "ChessPenguin sample"] + +{Candidates tournament, Zurich 1953. Former world champion Euwe answers +Geller's kingside attack with a precise counter-attack.} 1. d4 Nf6 2. c4 e6 3. +Nc3 Bb4 4. e3 c5 5. a3 Bxc3+ 6. bxc3 b6 7. Bd3 Bb7 8. f3 Nc6 9. Ne2 O-O 10. O-O +Na5 11. e4 Ne8 12. Ng3 cxd4 13. cxd4 Rc8 14. f4 Nxc4 15. f5 f6 16. Rf4 b5 17. +Rh4 Qb6 18. e5 Nxe5 19. fxe6 Nxd3 20. Qxd3 Qxe6 21. Qxh7+ Kf7 22. Bh6 Rh8 23. +Qxh8 Rc2 24. Rc1 Rxg2+ 25. Kf1 Qb3 26. Ke1 Qf3 0-1 + + +[Event "Candidates Tournament"] +[Site "Zuerich"] +[Date "1953.09.23"] +[Round "14"] +[White "Averbakh, Yuri L"] +[Black "Kotov, Alexander"] +[Result "0-1"] +[ECO "A55"] +[PlyCount "102"] +[Annotator "ChessPenguin sample"] + +{Candidates tournament, Zurich 1953. Kotov's queen sacrifice 30...Qxh3+!! +drives the white king up the board to its death.} 1. d4 Nf6 2. c4 d6 3. Nf3 +Nbd7 4. Nc3 e5 5. e4 Be7 6. Be2 O-O 7. O-O c6 8. Qc2 Re8 9. Rd1 Bf8 10. Rb1 a5 +11. d5 Nc5 12. Be3 Qc7 13. h3 Bd7 14. Rbc1 g6 15. Nd2 Rab8 16. Nb3 Nxb3 17. +Qxb3 c5 18. Kh2 Kh8 19. Qc2 Ng8 20. Bg4 Nh6 21. Bxd7 Qxd7 22. Qd2 Ng8 23. g4 f5 +24. f3 Be7 25. Rg1 Rf8 26. Rcf1 Rf7 27. gxf5 gxf5 28. Rg2 f4 29. Bf2 Rf6 30. +Ne2 Qxh3+ 31. Kxh3 Rh6+ 32. Kg4 Nf6+ 33. Kf5 Nd7 34. Rg5 Rf8+ 35. Kg4 Nf6+ 36. +Kf5 Ng8+ 37. Kg4 Nf6+ 38. Kf5 Nxd5+ 39. Kg4 Nf6+ 40. Kf5 Ng8+ 41. Kg4 Nf6+ 42. +Kf5 Ng8+ 43. Kg4 Bxg5 44. Kxg5 Rf7 45. Bh4 Rg6+ 46. Kh5 Rfg7 47. Bg5 Rxg5+ 48. +Kh4 Nf6 49. Ng3 Rxg3 50. Qxd6 R3g6 51. Qb8+ Rg8 0-1 + + +[Event "World Championship 20th"] +[Site "Moscow"] +[Date "1954.??.??"] +[Round "14"] +[White "Botvinnik, Mikhail"] +[Black "Smyslov, Vassily V"] +[Result "0-1"] +[ECO "E68"] +[PlyCount "66"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 g6 3. g3 Bg7 4. Bg2 O-O 5. Nc3 d6 6. Nf3 Nbd7 7. O-O e5 8. e4 +c6 9. Be3 Ng4 10. Bg5 Qb6 11. h3 exd4 12. Na4 Qa6 13. hxg4 b5 14. Nxd4 bxa4 15. +Nxc6 Qxc6 16. e5 Qxc4 17. Bxa8 Nxe5 18. Rc1 Qb4 19. a3 Qxb2 20. Qxa4 Bb7 21. +Rb1 Nf3+ 22. Kh1 Bxa8 23. Rxb2 Nxg5+ 24. Kh2 Nf3+ 25. Kh3 Bxb2 26. Qxa7 Be4 27. +a4 Kg7 28. Rd1 Be5 29. Qe7 Rc8 30. a5 Rc2 31. Kg2 Nd4+ 32. Kf1 Bf3 33. Rb1 Nc6 +0-1 + + +[Event "New York Rosenwald-03"] +[Site "New York"] +[Date "1956.10.17"] +[Round "8"] +[White "Byrne, Donald"] +[Black "Fischer, Robert James"] +[Result "0-1"] +[ECO "D92"] +[PlyCount "82"] +[Annotator "ChessPenguin sample"] + +{New York 1956, "The Game of the Century": 13-year-old Bobby Fischer gives up +his queen with 17...Be6!! and his pieces mate the white king.} 1. Nf3 Nf6 2. c4 +g6 3. Nc3 Bg7 4. d4 O-O 5. Bf4 d5 6. Qb3 dxc4 7. Qxc4 c6 8. e4 Nbd7 9. Rd1 Nb6 +10. Qc5 Bg4 11. Bg5 Na4 12. Qa3 Nxc3 13. bxc3 Nxe4 14. Bxe7 Qb6 15. Bc4 Nxc3 +16. Bc5 Rfe8+ 17. Kf1 Be6 18. Bxb6 Bxc4+ 19. Kg1 Ne2+ 20. Kf1 Nxd4+ 21. Kg1 +Ne2+ 22. Kf1 Nc3+ 23. Kg1 axb6 24. Qb4 Ra4 25. Qxb6 Nxd1 26. h3 Rxa2 27. Kh2 +Nxf2 28. Re1 Rxe1 29. Qd8+ Bf8 30. Nxe1 Bd5 31. Nf3 Ne4 32. Qb8 b5 33. h4 h5 +34. Ne5 Kg7 35. Kg1 Bc5+ 36. Kf1 Ng3+ 37. Ke1 Bb4+ 38. Kd1 Bb3+ 39. Kc1 Ne2+ +40. Kb1 Nc3+ 41. Kc1 Rc2# 0-1 + + +[Event "RSFSR-ch18"] +[Site "Sochi"] +[Date "1958.??.??"] +[Round "?"] +[White "Polugaevsky, Lev"] +[Black "Nezhmetdinov, Rashid"] +[Result "0-1"] +[ECO "A53"] +[PlyCount "66"] +[Annotator "ChessPenguin sample"] + +{Sochi 1958. One of the most admired attacking games: Nezhmetdinov sacrifices +material again and again around White's king.} 1. d4 Nf6 2. c4 d6 3. Nc3 e5 4. +e4 exd4 5. Qxd4 Nc6 6. Qd2 g6 7. b3 Bg7 8. Bb2 O-O 9. Bd3 Ng4 10. Nge2 Qh4 11. +Ng3 Nge5 12. O-O f5 13. f3 Bh6 14. Qd1 f4 15. Nge2 g5 16. Nd5 g4 17. g3 fxg3 +18. hxg3 Qh3 19. f4 Be6 20. Bc2 Rf7 21. Kf2 Qh2+ 22. Ke3 Bxd5 23. cxd5 Nb4 24. +Rh1 Rxf4 25. Rxh2 Rf3+ 26. Kd4 Bg7 27. a4 c5+ 28. dxc6 bxc6 29. Bd3 Nexd3+ 30. +Kc4 d5+ 31. exd5 cxd5+ 32. Kb5 Rb8+ 33. Ka5 Nc6+ 0-1 + + +[Event "Candidates Tournament"] +[Site "Bled/Zagreb/Belgrade"] +[Date "1959.09.18"] +[Round "8"] +[White "Tal, Mihail"] +[Black "Smyslov, Vassily V"] +[Result "1-0"] +[ECO "B10"] +[PlyCount "51"] +[Annotator "ChessPenguin sample"] + +{Candidates tournament 1959, which Tal went on to win: the magician from Riga +at his most daring against a former world champion.} 1. e4 c6 2. d3 d5 3. Nd2 +e5 4. Ngf3 Nd7 5. d4 dxe4 6. Nxe4 exd4 7. Qxd4 Ngf6 8. Bg5 Be7 9. O-O-O O-O 10. +Nd6 Qa5 11. Bc4 b5 12. Bd2 Qa6 13. Nf5 Bd8 14. Qh4 bxc4 15. Qg5 Nh5 16. Nh6+ +Kh8 17. Qxh5 Qxa2 18. Bc3 Nf6 19. Qxf7 Qa1+ 20. Kd2 Rxf7 21. Nxf7+ Kg8 22. Rxa1 +Kxf7 23. Ne5+ Ke6 24. Nxc6 Ne4+ 25. Ke3 Bb6+ 26. Bd4 1-0 + + +[Event "Candidats Tournament"] +[Site "Bled/Zagreb/Belgrade"] +[Date "1959.??.??"] +[Round "16"] +[White "Fischer, Robert James"] +[Black "Petrosian, Tigran V"] +[Result "1/2-1/2"] +[ECO "B11"] +[PlyCount "96"] +[Annotator "ChessPenguin sample"] + +1. e4 c6 2. Nc3 d5 3. Nf3 Bg4 4. h3 Bxf3 5. Qxf3 Nf6 6. d3 e6 7. g3 Bb4 8. Bd2 +d4 9. Nb1 Bxd2+ 10. Nxd2 e5 11. Bg2 c5 12. O-O Nc6 13. Qe2 Qe7 14. f4 O-O-O 15. +a3 Ne8 16. b4 cxb4 17. Nc4 f6 18. fxe5 fxe5 19. axb4 Nc7 20. Na5 Nb5 21. Nxc6 +bxc6 22. Rf2 g6 23. h4 Kb7 24. h5 Qxb4 25. Rf7+ Kb6 26. Qf2 a5 27. c4 Nc3 28. +Rf1 a4 29. Qf6 Qc5 30. Rxh7 Rdf8 31. Qxg6 Rxf1+ 32. Bxf1 Rxh7 33. Qxh7 a3 34. +h6 a2 35. Qg8 a1=Q 36. h7 Qd6 37. h8=Q Qa7 38. g4 Kc5 39. Qf8 Qae7 40. Qa8 Kb4 +41. Qh2 Kb3 42. Qa1 Qa3 43. Qxa3+ Kxa3 44. Qh6 Qf7 45. Kg2 Kb3 46. Qd2 Qh7 47. +Kg3 Qxe4 48. Qf2 Qh1 1/2-1/2 + + +[Event "URS-ch27 Final"] +[Site "Leningrad"] +[Date "1960.02.20"] +[Round "16"] +[White "Spassky, Boris Vasilievich"] +[Black "Bronstein, David Ionovich"] +[Result "1-0"] +[ECO "C36"] +[PlyCount "45"] +[Annotator "ChessPenguin sample"] + +{USSR Championship 1960. A King's Gambit with a sacrificial attack; the final +position was used in the James Bond film "From Russia with Love".} 1. e4 e5 2. +f4 exf4 3. Nf3 d5 4. exd5 Bd6 5. Nc3 Ne7 6. d4 O-O 7. Bd3 Nd7 8. O-O h6 9. Ne4 +Nxd5 10. c4 Ne3 11. Bxe3 fxe3 12. c5 Be7 13. Bc2 Re8 14. Qd3 e2 15. Nd6 Nf8 16. +Nxf7 exf1=Q+ 17. Rxf1 Bf5 18. Qxf5 Qd7 19. Qf4 Bf6 20. N3e5 Qe7 21. Bb3 Bxe5 +22. Nxe5+ Kh7 23. Qe4+ 1-0 + + +[Event "World Championship 23th"] +[Site "Moscow"] +[Date "1960.??.??"] +[Round "1"] +[White "Tal, Mihail"] +[Black "Botvinnik, Mikhail"] +[Result "1-0"] +[ECO "C18"] +[PlyCount "63"] +[Annotator "ChessPenguin sample"] + +1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Qc7 7. Qg4 f5 8. Qg3 +Ne7 9. Qxg7 Rg8 10. Qxh7 cxd4 11. Kd1 Bd7 12. Qh5+ Ng6 13. Ne2 d3 14. cxd3 Ba4+ +15. Ke1 Qxe5 16. Bg5 Nc6 17. d4 Qc7 18. h4 e5 19. Rh3 Qf7 20. dxe5 Ncxe5 21. +Re3 Kd7 22. Rb1 b6 23. Nf4 Rae8 24. Rb4 Bc6 25. Qd1 Nxf4 26. Rxf4 Ng6 27. Rd4 +Rxe3+ 28. fxe3 Kc7 29. c4 dxc4 30. Bxc4 Qg7 31. Bxg8 Qxg8 32. h5 1-0 + + +[Event "World Championship 23th"] +[Site "Moscow"] +[Date "1960.??.??"] +[Round "6"] +[White "Botvinnik, Mikhail"] +[Black "Tal, Mihail"] +[Result "0-1"] +[ECO "E69"] +[PlyCount "92"] +[Annotator "ChessPenguin sample"] + +1. c4 Nf6 2. Nf3 g6 3. g3 Bg7 4. Bg2 O-O 5. d4 d6 6. Nc3 Nbd7 7. O-O e5 8. e4 +c6 9. h3 Qb6 10. d5 cxd5 11. cxd5 Nc5 12. Ne1 Bd7 13. Nd3 Nxd3 14. Qxd3 Rfc8 +15. Rb1 Nh5 16. Be3 Qb4 17. Qe2 Rc4 18. Rfc1 Rac8 19. Kh2 f5 20. exf5 Bxf5 21. +Ra1 Nf4 22. gxf4 exf4 23. Bd2 Qxb2 24. Rab1 f3 25. Rxb2 fxe2 26. Rb3 Rd4 27. +Be1 Be5+ 28. Kg1 Bf4 29. Nxe2 Rxc1 30. Nxd4 Rxe1+ 31. Bf1 Be4 32. Ne2 Be5 33. +f4 Bf6 34. Rxb7 Bxd5 35. Rc7 Bxa2 36. Rxa7 Bc4 37. Ra8+ Kf7 38. Ra7+ Ke6 39. +Ra3 d5 40. Kf2 Bh4+ 41. Kg2 Kd6 42. Ng3 Bxg3 43. Bxc4 dxc4 44. Kxg3 Kd5 45. Ra7 +c3 46. Rc7 Kd4 0-1 + + +[Event "Mar del Plata"] +[Site "Mar del Plata"] +[Date "1960.??.??"] +[Round "2"] +[White "Spassky, Boris Vasilievich"] +[Black "Fischer, Robert James"] +[Result "1-0"] +[ECO "C39"] +[PlyCount "57"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. f4 exf4 3. Nf3 g5 4. h4 g4 5. Ne5 Nf6 6. d4 d6 7. Nd3 Nxe4 8. Bxf4 +Bg7 9. Nc3 Nxc3 10. bxc3 c5 11. Be2 cxd4 12. O-O Nc6 13. Bxg4 O-O 14. Bxc8 Rxc8 +15. Qg4 f5 16. Qg3 dxc3 17. Rae1 Kh8 18. Kh1 Rg8 19. Bxd6 Bf8 20. Be5+ Nxe5 21. +Qxe5+ Rg7 22. Rxf5 Qxh4+ 23. Kg1 Qg4 24. Rf2 Be7 25. Re4 Qg5 26. Qd4 Rf8 27. +Re5 Rd8 28. Qe4 Qh4 29. Rf4 1-0 + + +[Event "Bled"] +[Site "Bled"] +[Date "1961.??.??"] +[Round "6"] +[White "Petrosian, Tigran V"] +[Black "Pachman, Ludek"] +[Result "1-0"] +[ECO "A04"] +[PlyCount "41"] +[Annotator "ChessPenguin sample"] + +1. Nf3 c5 2. g3 Nc6 3. Bg2 g6 4. O-O Bg7 5. d3 e6 6. e4 Nge7 7. Re1 O-O 8. e5 +d6 9. exd6 Qxd6 10. Nbd2 Qc7 11. Nb3 Nd4 12. Bf4 Qb6 13. Ne5 Nxb3 14. Nc4 Qb5 +15. axb3 a5 16. Bd6 Bf6 17. Qf3 Kg7 18. Re4 Rd8 19. Qxf6+ Kxf6 20. Be5+ Kg5 21. +Bg7 1-0 + + +[Event "RSFSR Chigorin Cup"] +[Site "Rostov on Don"] +[Date "1962.??.??"] +[Round "?"] +[White "Nezhmetdinov, Rashid"] +[Black "Chernikov, Oleg L"] +[Result "1-0"] +[ECO "B35"] +[PlyCount "65"] +[Annotator "ChessPenguin sample"] + +{Rostov-on-Don 1962. Nezhmetdinov gives up his queen for two minor pieces with +12.Qxf6!! and attacks for twenty more moves.} 1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. +Nxd4 g6 5. Nc3 Bg7 6. Be3 Nf6 7. Bc4 O-O 8. Bb3 Ng4 9. Qxg4 Nxd4 10. Qh4 Qa5 +11. O-O Bf6 12. Qxf6 Ne2+ 13. Nxe2 exf6 14. Nc3 Re8 15. Nd5 Kg7 16. Bd4 Re6 17. +Rad1 d6 18. Rd3 Bd7 19. Rf3 Bb5 20. Bc3 Qd8 21. Nxf6 Be2 22. Nxh7+ Kg8 23. Rh3 +Re5 24. f4 Bxf1 25. Kxf1 Rc8 26. Bd4 b5 27. Ng5 Rc7 28. Bxf7+ Rxf7 29. Rh8+ +Kxh8 30. Nxf7+ Kh7 31. Nxd8 Rxe4 32. Nc6 Rxf4+ 33. Ke2 1-0 + + +[Event "WchT U26"] +[Site "Marianske Lazne"] +[Date "1962.??.??"] +[Round "?"] +[White "Gufeld, Eduard"] +[Black "Kavalek, Lubomir"] +[Result "0-1"] +[ECO "C64"] +[PlyCount "64"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. c3 f5 5. d4 fxe4 6. Ng5 Bb6 7. d5 e3 8. Ne4 +Qh4 9. Qf3 Nf6 10. Nxf6+ gxf6 11. dxc6 exf2+ 12. Kd1 dxc6 13. Be2 Be6 14. Qh5+ +Qxh5 15. Bxh5+ Ke7 16. b3 Bd5 17. Ba3+ Ke6 18. Bg4+ f5 19. Bh3 Rhg8 20. Nd2 +Bxg2 21. Bxg2 Rxg2 22. Rf1 Rd8 23. Ke2 Rxd2+ 24. Kxd2 e4 25. Bf8 f4 26. b4 Rg5 +27. Bc5 Rxc5 28. bxc5 Bxc5 29. Rab1 f3 30. Rb4 Kf5 31. Rd4 Bxd4 32. cxd4 Kf4 +0-1 + + +[Event "USA-ch"] +[Site "New York"] +[Date "1963.12.18"] +[Round "3"] +[White "Byrne, Robert Eugene"] +[Black "Fischer, Robert James"] +[Result "0-1"] +[ECO "D71"] +[PlyCount "42"] +[Annotator "ChessPenguin sample"] + +{US Championship 1963/64, which Fischer won with 11 out of 11. Here his attack +is so deep that the commentators in the press room thought Black was lost; +Byrne resigned first.} 1. d4 Nf6 2. c4 g6 3. g3 c6 4. Bg2 d5 5. cxd5 cxd5 6. +Nc3 Bg7 7. e3 O-O 8. Nge2 Nc6 9. O-O b6 10. b3 Ba6 11. Ba3 Re8 12. Qd2 e5 13. +dxe5 Nxe5 14. Rfd1 Nd3 15. Qc2 Nxf2 16. Kxf2 Ng4+ 17. Kg1 Nxe3 18. Qd2 Nxg2 19. +Kxg2 d4 20. Nxd4 Bb7+ 21. Kf1 Qd7 0-1 + + +[Event "USA-ch"] +[Site "New York"] +[Date "1963.??.??"] +[Round "10"] +[White "Fischer, Robert James"] +[Black "Benko, Pal C"] +[Result "1-0"] +[ECO "B09"] +[PlyCount "41"] +[Annotator "ChessPenguin sample"] + +1. e4 g6 2. d4 Bg7 3. Nc3 d6 4. f4 Nf6 5. Nf3 O-O 6. Bd3 Bg4 7. h3 Bxf3 8. Qxf3 +Nc6 9. Be3 e5 10. dxe5 dxe5 11. f5 gxf5 12. Qxf5 Nd4 13. Qf2 Ne8 14. O-O Nd6 +15. Qg3 Kh8 16. Qg4 c6 17. Qh5 Qe8 18. Bxd4 exd4 19. Rf6 Kg8 20. e5 h6 21. Ne2 +1-0 + + +[Event "Candidats sf1"] +[Site "Bled"] +[Date "1965.??.??"] +[Round "10"] +[White "Tal, Mihail"] +[Black "Larsen, Bent"] +[Result "1-0"] +[ECO "B82"] +[PlyCount "73"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 e6 5. Nc3 d6 6. Be3 Nf6 7. f4 Be7 8. Qf3 +O-O 9. O-O-O Qc7 10. Ndb5 Qb8 11. g4 a6 12. Nd4 Nxd4 13. Bxd4 b5 14. g5 Nd7 15. +Bd3 b4 16. Nd5 exd5 17. exd5 f5 18. Rde1 Rf7 19. h4 Bb7 20. Bxf5 Rxf5 21. Rxe7 +Ne5 22. Qe4 Qf8 23. fxe5 Rf4 24. Qe3 Rf3 25. Qe2 Qxe7 26. Qxf3 dxe5 27. Re1 Rd8 +28. Rxe5 Qd6 29. Qf4 Rf8 30. Qe4 b3 31. axb3 Rf1+ 32. Kd2 Qb4+ 33. c3 Qd6 34. +Bc5 Qxc5 35. Re8+ Rf8 36. Qe6+ Kh8 37. Qf7 1-0 + + +[Event "World-ch25 Petrosian-Spassky +4-3=17"] +[Site "Moscow"] +[Date "1966.05.02"] +[Round "10"] +[White "Petrosian, Tigran V"] +[Black "Spassky, Boris Vasilievich"] +[Result "1-0"] +[ECO "E66"] +[PlyCount "59"] +[Annotator "ChessPenguin sample"] + +{World Championship 1966, game 10. Petrosian, known for defence, finishes with +the queen sacrifice 30.Qh8+!!} 1. Nf3 Nf6 2. g3 g6 3. c4 Bg7 4. Bg2 O-O 5. O-O +Nc6 6. Nc3 d6 7. d4 a6 8. d5 Na5 9. Nd2 c5 10. Qc2 e5 11. b3 Ng4 12. e4 f5 13. +exf5 gxf5 14. Nd1 b5 15. f3 e4 16. Bb2 exf3 17. Bxf3 Bxb2 18. Qxb2 Ne5 19. Be2 +f4 20. gxf4 Bh3 21. Ne3 Bxf1 22. Rxf1 Ng6 23. Bg4 Nxf4 24. Rxf4 Rxf4 25. Be6+ +Rf7 26. Ne4 Qh4 27. Nxd6 Qg5+ 28. Kh1 Ra7 29. Bxf7+ Rxf7 30. Qh8+ 1-0 + + +[Event "Sousse Interzonal+"] +[Site "Sousse"] +[Date "1967.??.??"] +[Round "3"] +[White "Fischer, Robert James"] +[Black "Myagmarsuren, Lhamsuren"] +[Result "1-0"] +[ECO "A08"] +[PlyCount "61"] +[Annotator "ChessPenguin sample"] + +1. e4 e6 2. d3 d5 3. Nd2 Nf6 4. g3 c5 5. Bg2 Nc6 6. Ngf3 Be7 7. O-O O-O 8. e5 +Nd7 9. Re1 b5 10. Nf1 b4 11. h4 a5 12. Bf4 a4 13. a3 bxa3 14. bxa3 Na5 15. Ne3 +Ba6 16. Bh3 d4 17. Nf1 Nb6 18. Ng5 Nd5 19. Bd2 Bxg5 20. Bxg5 Qd7 21. Qh5 Rfc8 +22. Nd2 Nc3 23. Bf6 Qe8 24. Ne4 g6 25. Qg5 Nxe4 26. Rxe4 c4 27. h5 cxd3 28. Rh4 +Ra7 29. Bg2 dxc2 30. Qh6 Qf8 31. Qxh7+ 1-0 + + +[Event "Monaco Grand Prix-02 GM"] +[Site "Monte Carlo"] +[Date "1968.04.09"] +[Round "7"] +[White "Botvinnik, Mikhail"] +[Black "Portisch, Lajos"] +[Result "1-0"] +[ECO "A29"] +[PlyCount "51"] +[Annotator "ChessPenguin sample"] + +{Monaco 1968. One of Botvinnik's most celebrated attacks: a series of +sacrifices opens the black king.} 1. c4 e5 2. Nc3 Nf6 3. g3 d5 4. cxd5 Nxd5 5. +Bg2 Be6 6. Nf3 Nc6 7. O-O Nb6 8. d3 Be7 9. a3 a5 10. Be3 O-O 11. Na4 Nxa4 12. +Qxa4 Bd5 13. Rfc1 Re8 14. Rc2 Bf8 15. Rac1 Nb8 16. Rxc7 Bc6 17. R1xc6 bxc6 18. +Rxf7 h6 19. Rb7 Qc8 20. Qc4+ Kh8 21. Nh4 Qxb7 22. Ng6+ Kh7 23. Be4 Bd6 24. +Nxe5+ g6 25. Bxg6+ Kg7 26. Bxh6+ 1-0 + + +[Event "World Championship 27th"] +[Site "Moscow"] +[Date "1969.??.??"] +[Round "19"] +[White "Spassky, Boris Vasilievich"] +[Black "Petrosian, Tigran V"] +[Result "1-0"] +[ECO "B94"] +[PlyCount "47"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Bg5 Nbd7 7. Bc4 Qa5 8. +Qd2 h6 9. Bxf6 Nxf6 10. O-O-O e6 11. Rhe1 Be7 12. f4 O-O 13. Bb3 Re8 14. Kb1 +Bf8 15. g4 Nxg4 16. Qg2 Nf6 17. Rg1 Bd7 18. f5 Kh8 19. Rdf1 Qd8 20. fxe6 fxe6 +21. e5 dxe5 22. Ne4 Nh5 23. Qg6 exd4 24. Ng5 1-0 + + +[Event "Match/Team URS-World 20,5-19,5"] +[Site "Belgrade"] +[Date "1970.03.29"] +[Round "2.1"] +[White "Larsen, Bent"] +[Black "Spassky, Boris Vasilievich"] +[Result "0-1"] +[WhiteElo "2650"] +[BlackElo "2670"] +[ECO "A01"] +[PlyCount "34"] +[Annotator "ChessPenguin sample"] + +{USSR v Rest of the World, Belgrade 1970. Spassky crushes Larsen in 17 moves; +14...Rh1!! is the key blow.} 1. b3 e5 2. Bb2 Nc6 3. c4 Nf6 4. Nf3 e4 5. Nd4 Bc5 +6. Nxc6 dxc6 7. e3 Bf5 8. Qc2 Qe7 9. Be2 O-O-O 10. f4 Ng4 11. g3 h5 12. h3 h4 +13. hxg4 hxg3 14. Rg1 Rh1 15. Rxh1 g2 16. Rf1 Qh4+ 17. Kd1 gxf1=Q+ 0-1 + + +[Event "Candidats qf3"] +[Site "Vancouver"] +[Date "1971.??.??"] +[Round "4"] +[White "Fischer, Robert James"] +[Black "Taimanov, Mark E"] +[Result "1-0"] +[ECO "B47"] +[PlyCount "141"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Qc7 5. Nc3 e6 6. g3 a6 7. Bg2 Nf6 8. O-O +Nxd4 9. Qxd4 Bc5 10. Bf4 d6 11. Qd2 h6 12. Rad1 e5 13. Be3 Bg4 14. Bxc5 dxc5 +15. f3 Be6 16. f4 Rd8 17. Nd5 Bxd5 18. exd5 e4 19. Rfe1 Rxd5 20. Rxe4+ Kd8 21. +Qe2 Rxd1+ 22. Qxd1+ Qd7 23. Qxd7+ Kxd7 24. Re5 b6 25. Bf1 a5 26. Bc4 Rf8 27. +Kg2 Kd6 28. Kf3 Nd7 29. Re3 Nb8 30. Rd3+ Kc7 31. c3 Nc6 32. Re3 Kd6 33. a4 Ne7 +34. h3 Nc6 35. h4 h5 36. Rd3+ Kc7 37. Rd5 f5 38. Rd2 Rf6 39. Re2 Kd7 40. Re3 g6 +41. Bb5 Rd6 42. Ke2 Kd8 43. Rd3 Kc7 44. Rxd6 Kxd6 45. Kd3 Ne7 46. Be8 Kd5 47. +Bf7+ Kd6 48. Kc4 Kc6 49. Be8+ Kb7 50. Kb5 Nc8 51. Bc6+ Kc7 52. Bd5 Ne7 53. Bf7 +Kb7 54. Bb3 Ka7 55. Bd1 Kb7 56. Bf3+ Kc7 57. Ka6 Nc8 58. Bd5 Ne7 59. Bc4 Nc6 +60. Bf7 Ne7 61. Be8 Kd8 62. Bxg6 Nxg6 63. Kxb6 Kd7 64. Kxc5 Ne7 65. b4 axb4 66. +cxb4 Nc8 67. a5 Nd6 68. b5 Ne4+ 69. Kb6 Kc8 70. Kc6 Kb8 71. b6 1-0 + + +[Event "World-ch27 Fischer-Spassky +7-3=11"] +[Site "Reykjavik"] +[Date "1972.07.23"] +[Round "6"] +[White "Fischer, Robert James"] +[Black "Spassky, Boris Vasilievich"] +[Result "1-0"] +[WhiteElo "2785"] +[BlackElo "2660"] +[ECO "D59"] +[PlyCount "81"] +[Annotator "ChessPenguin sample"] + +{World Championship 1972, game 6. Fischer surprises with 1.c4 and plays a model +Queen's Gambit; Spassky reportedly joined the audience's applause.} 1. c4 e6 2. +Nf3 d5 3. d4 Nf6 4. Nc3 Be7 5. Bg5 O-O 6. e3 h6 7. Bh4 b6 8. cxd5 Nxd5 9. Bxe7 +Qxe7 10. Nxd5 exd5 11. Rc1 Be6 12. Qa4 c5 13. Qa3 Rc8 14. Bb5 a6 15. dxc5 bxc5 +16. O-O Ra7 17. Be2 Nd7 18. Nd4 Qf8 19. Nxe6 fxe6 20. e4 d4 21. f4 Qe7 22. e5 +Rb8 23. Bc4 Kh8 24. Qh3 Nf8 25. b3 a5 26. f5 exf5 27. Rxf5 Nh7 28. Rcf1 Qd8 29. +Qg3 Re7 30. h4 Rbb7 31. e6 Rbc7 32. Qe5 Qe8 33. a4 Qd8 34. R1f2 Qe8 35. R2f3 +Qd8 36. Bd3 Qe8 37. Qe4 Nf6 38. Rxf6 gxf6 39. Rxf6 Kg8 40. Bc4 Kh8 41. Qf4 1-0 + + +[Event "World Championship 28th"] +[Site "Reykjavik"] +[Date "1972.??.??"] +[Round "13"] +[White "Spassky, Boris Vasilievich"] +[Black "Fischer, Robert James"] +[Result "0-1"] +[ECO "B04"] +[PlyCount "148"] +[Annotator "ChessPenguin sample"] + +1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. Nf3 g6 5. Bc4 Nb6 6. Bb3 Bg7 7. Nbd2 O-O 8. h3 +a5 9. a4 dxe5 10. dxe5 Na6 11. O-O Nc5 12. Qe2 Qe8 13. Ne4 Nbxa4 14. Bxa4 Nxa4 +15. Re1 Nb6 16. Bd2 a4 17. Bg5 h6 18. Bh4 Bf5 19. g4 Be6 20. Nd4 Bc4 21. Qd2 +Qd7 22. Rad1 Rfe8 23. f4 Bd5 24. Nc5 Qc8 25. Qc3 e6 26. Kh2 Nd7 27. Nd3 c5 28. +Nb5 Qc6 29. Nd6 Qxd6 30. exd6 Bxc3 31. bxc3 f6 32. g5 hxg5 33. fxg5 f5 34. Bg3 +Kf7 35. Ne5+ Nxe5 36. Bxe5 b5 37. Rf1 Rh8 38. Bf6 a3 39. Rf4 a2 40. c4 Bxc4 41. +d7 Bd5 42. Kg3 Ra3+ 43. c3 Rha8 44. Rh4 e5 45. Rh7+ Ke6 46. Re7+ Kd6 47. Rxe5 +Rxc3+ 48. Kf2 Rc2+ 49. Ke1 Kxd7 50. Rexd5+ Kc6 51. Rd6+ Kb7 52. Rd7+ Ka6 53. +R7d2 Rxd2 54. Kxd2 b4 55. h4 Kb5 56. h5 c4 57. Ra1 gxh5 58. g6 h4 59. g7 h3 60. +Be7 Rg8 61. Bf8 h2 62. Kc2 Kc6 63. Rd1 b3+ 64. Kc3 h1=Q 65. Rxh1 Kd5 66. Kb2 f4 +67. Rd1+ Ke4 68. Rc1 Kd3 69. Rd1+ Ke2 70. Rc1 f3 71. Bc5 Rxg7 72. Rxc4 Rd7 73. +Re4+ Kf1 74. Bd4 f2 0-1 + + +[Event "Petropolis Interzonal"] +[Site "Petropolis"] +[Date "1973.??.??"] +[Round "11"] +[White "Bronstein, David Ionovich"] +[Black "Ljubojevic, Ljubomir"] +[Result "1-0"] +[ECO "B03"] +[PlyCount "81"] +[Annotator "ChessPenguin sample"] + +1. e4 Nf6 2. e5 Nd5 3. d4 d6 4. c4 Nb6 5. f4 dxe5 6. fxe5 c5 7. d5 e6 8. Nc3 +exd5 9. cxd5 c4 10. Nf3 Bg4 11. Qd4 Bxf3 12. gxf3 Bb4 13. Bxc4 O-O 14. Rg1 g6 +15. Bg5 Qc7 16. Bb3 Bc5 17. Qf4 Bxg1 18. d6 Qc8 19. Ke2 Bc5 20. Ne4 N8d7 21. +Rc1 Qc6 22. Rxc5 Nxc5 23. Nf6+ Kh8 24. Qh4 Qb5+ 25. Ke3 h5 26. Nxh5 Qxb3+ 27. +axb3 Nd5+ 28. Kd4 Ne6+ 29. Kxd5 Nxg5 30. Nf6+ Kg7 31. Qxg5 Rfd8 32. e6 fxe6+ +33. Kxe6 Rf8 34. d7 a5 35. Ng4 Ra6+ 36. Ke5 Rf5+ 37. Qxf5 gxf5 38. d8=Q fxg4 +39. Qd7+ Kh6 40. Qxb7 Rg6 41. f4 1-0 + + +[Event "Olympiad-21 Final A"] +[Site "Nice"] +[Date "1974.06.17"] +[Round "3"] +[White "Karpov, Anatoly"] +[Black "Unzicker, Wolfgang"] +[Result "1-0"] +[ECO "C98"] +[PlyCount "87"] +[Annotator "ChessPenguin sample"] + +{Nice Olympiad 1974. A model of positional play: Karpov slowly squeezes Black +until there is nothing left to do.} 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. +O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Na5 10. Bc2 c5 11. d4 Qc7 12. Nbd2 +Nc6 13. d5 Nd8 14. a4 Rb8 15. axb5 axb5 16. b4 Nb7 17. Nf1 Bd7 18. Be3 Ra8 19. +Qd2 Rfc8 20. Bd3 g6 21. Ng3 Bf8 22. Ra2 c4 23. Bb1 Qd8 24. Ba7 Ne8 25. Bc2 Nc7 +26. Rea1 Qe7 27. Bb1 Be8 28. Ne2 Nd8 29. Nh2 Bg7 30. f4 f6 31. f5 g5 32. Bc2 +Bf7 33. Ng3 Nb7 34. Bd1 h6 35. Bh5 Qe8 36. Qd1 Nd8 37. Ra3 Kf8 38. R1a2 Kg8 39. +Ng4 Kf8 40. Ne3 Kg8 41. Bxf7+ Nxf7 42. Qh5 Nd8 43. Qg6 Kf8 44. Nh5 1-0 + + +[Event "Candidats sf1"] +[Site "Leningrad"] +[Date "1974.??.??"] +[Round "9"] +[White "Karpov, Anatoly"] +[Black "Spassky, Boris Vasilievich"] +[Result "1-0"] +[ECO "B83"] +[PlyCount "69"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 d6 6. Be2 Be7 7. O-O O-O 8. f4 +Nc6 9. Be3 Bd7 10. Nb3 a5 11. a4 Nb4 12. Bf3 Bc6 13. Nd4 g6 14. Rf2 e5 15. Nxc6 +bxc6 16. fxe5 dxe5 17. Qf1 Qc8 18. h3 Nd7 19. Bg4 h5 20. Bxd7 Qxd7 21. Qc4 Bh4 +22. Rd2 Qe7 23. Rf1 Rfd8 24. Nb1 Qb7 25. Kh2 Kg7 26. c3 Na6 27. Re2 Rf8 28. Nd2 +Bd8 29. Nf3 f6 30. Rd2 Be7 31. Qe6 Rad8 32. Rxd8 Bxd8 33. Rd1 Nb8 34. Bc5 Rh8 +35. Rxd8 1-0 + + +[Event "EU-chT"] +[Site "Skara"] +[Date "1980.??.??"] +[Round "1"] +[White "Karpov, Anatoly"] +[Black "Miles, Anthony John"] +[Result "0-1"] +[ECO "B00"] +[PlyCount "92"] +[Annotator "ChessPenguin sample"] + +1. e4 a6 2. d4 b5 3. Nf3 Bb7 4. Bd3 Nf6 5. Qe2 e6 6. a4 c5 7. dxc5 Bxc5 8. Nbd2 +b4 9. e5 Nd5 10. Ne4 Be7 11. O-O Nc6 12. Bd2 Qc7 13. c4 bxc3 14. Nxc3 Nxc3 15. +Bxc3 Nb4 16. Bxb4 Bxb4 17. Rac1 Qb6 18. Be4 O-O 19. Ng5 h6 20. Bh7+ Kh8 21. Bb1 +Be7 22. Ne4 Rac8 23. Qd3 Rxc1 24. Rxc1 Qxb2 25. Re1 Qxe5 26. Qxd7 Bb4 27. Re3 +Qd5 28. Qxd5 Bxd5 29. Nc3 Rc8 30. Ne2 g5 31. h4 Kg7 32. hxg5 hxg5 33. Bd3 a5 +34. Rg3 Kf6 35. Rg4 Bd6 36. Kf1 Be5 37. Ke1 Rh8 38. f4 gxf4 39. Nxf4 Bc6 40. +Ne2 Rh1+ 41. Kd2 Rh2 42. g3 Bf3 43. Rg8 Rg2 44. Ke1 Bxe2 45. Bxe2 Rxg3 46. Ra8 +Bc7 0-1 + + +[Event "Niksic"] +[Site "Niksic"] +[Date "1983.??.??"] +[Round "4"] +[White "Kasparov, Garry"] +[Black "Portisch, Lajos"] +[Result "1-0"] +[ECO "E12"] +[PlyCount "69"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 e6 3. Nf3 b6 4. Nc3 Bb7 5. a3 d5 6. cxd5 Nxd5 7. e3 Nxc3 8. +bxc3 Be7 9. Bb5+ c6 10. Bd3 c5 11. O-O Nc6 12. Bb2 Rc8 13. Qe2 O-O 14. Rad1 Qc7 +15. c4 cxd4 16. exd4 Na5 17. d5 exd5 18. cxd5 Bxd5 19. Bxh7+ Kxh7 20. Rxd5 Kg8 +21. Bxg7 Kxg7 22. Ne5 Rfd8 23. Qg4+ Kf8 24. Qf5 f6 25. Nd7+ Rxd7 26. Rxd7 Qc5 +27. Qh7 Rc7 28. Qh8+ Kf7 29. Rd3 Nc4 30. Rfd1 Ne5 31. Qh7+ Ke6 32. Qg8+ Kf5 33. +g4+ Kf4 34. Rd4+ Kf3 35. Qb3+ 1-0 + + +[Event "World-ch31-KK2 Kasparov-Karpov +5-3=16"] +[Site "Moscow"] +[Date "1985.10.15"] +[Round "16"] +[White "Karpov, Anatoly"] +[Black "Kasparov, Garry"] +[Result "0-1"] +[WhiteElo "2720"] +[BlackElo "2700"] +[ECO "B44"] +[PlyCount "80"] +[Annotator "ChessPenguin sample"] + +{World Championship 1985, game 16. Kasparov's knight on d3 paralyses White's +whole position; he won the title later in the match.} 1. e4 c5 2. Nf3 e6 3. d4 +cxd4 4. Nxd4 Nc6 5. Nb5 d6 6. c4 Nf6 7. N1c3 a6 8. Na3 d5 9. cxd5 exd5 10. exd5 +Nb4 11. Be2 Bc5 12. O-O O-O 13. Bf3 Bf5 14. Bg5 Re8 15. Qd2 b5 16. Rad1 Nd3 17. +Nab1 h6 18. Bh4 b4 19. Na4 Bd6 20. Bg3 Rc8 21. b3 g5 22. Bxd6 Qxd6 23. g3 Nd7 +24. Bg2 Qf6 25. a3 a5 26. axb4 axb4 27. Qa2 Bg6 28. d6 g4 29. Qd2 Kg7 30. f3 +Qxd6 31. fxg4 Qd4+ 32. Kh1 Nf6 33. Rf4 Ne4 34. Qxd3 Nf2+ 35. Rxf2 Bxd3 36. Rfd2 +Qe3 37. Rxd3 Rc1 38. Nb2 Qf2 39. Nd2 Rxd1+ 40. Nxd1 Re1+ 0-1 + + +[Event "World Championship 32th-KK2"] +[Site "Moscow"] +[Date "1985.??.??"] +[Round "24"] +[White "Karpov, Anatoly"] +[Black "Kasparov, Garry"] +[Result "0-1"] +[ECO "B85"] +[PlyCount "84"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be2 e6 7. O-O Be7 8. f4 +O-O 9. Kh1 Qc7 10. a4 Nc6 11. Be3 Re8 12. Bf3 Rb8 13. Qd2 Bd7 14. Nb3 b6 15. g4 +Bc8 16. g5 Nd7 17. Qf2 Bf8 18. Bg2 Bb7 19. Rad1 g6 20. Bc1 Rbc8 21. Rd3 Nb4 22. +Rh3 Bg7 23. Be3 Re7 24. Kg1 Rce8 25. Rd1 f5 26. gxf6 Nxf6 27. Rg3 Rf7 28. Bxb6 +Qb8 29. Be3 Nh5 30. Rg4 Nf6 31. Rh4 g5 32. fxg5 Ng4 33. Qd2 Nxe3 34. Qxe3 Nxc2 +35. Qb6 Ba8 36. Rxd6 Rb7 37. Qxa6 Rxb3 38. Rxe6 Rxb2 39. Qc4 Kh8 40. e5 Qa7+ +41. Kh1 Bxg2+ 42. Kxg2 Nd4+ 0-1 + + +[Event "World Championship 33th-KK3"] +[Site "London/Leningrad"] +[Date "1986.??.??"] +[Round "16"] +[White "Kasparov, Garry"] +[Black "Karpov, Anatoly"] +[Result "1-0"] +[ECO "C92"] +[PlyCount "81"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 +O-O 9. h3 Bb7 10. d4 Re8 11. Nbd2 Bf8 12. a4 h6 13. Bc2 exd4 14. cxd4 Nb4 15. +Bb1 c5 16. d5 Nd7 17. Ra3 c4 18. Nd4 Qf6 19. N2f3 Nc5 20. axb5 axb5 21. Nxb5 +Rxa3 22. Nxa3 Ba6 23. Re3 Rb8 24. e5 dxe5 25. Nxe5 Nbd3 26. Ng4 Qb6 27. Rg3 g6 +28. Bxh6 Qxb2 29. Qf3 Nd7 30. Bxf8 Kxf8 31. Kh2 Rb3 32. Bxd3 cxd3 33. Qf4 Qxa3 +34. Nh6 Qe7 35. Rxg6 Qe5 36. Rg8+ Ke7 37. d6+ Ke6 38. Re8+ Kd5 39. Rxe5+ Nxe5 +40. d7 Rb8 41. Nxf7 1-0 + + +[Event "World Championship 34th-KK4"] +[Site "Sevilla"] +[Date "1987.??.??"] +[Round "24"] +[White "Kasparov, Garry"] +[Black "Karpov, Anatoly"] +[Result "1-0"] +[ECO "A14"] +[PlyCount "127"] +[Annotator "ChessPenguin sample"] + +1. c4 e6 2. Nf3 Nf6 3. g3 d5 4. b3 Be7 5. Bg2 O-O 6. O-O b6 7. Bb2 Bb7 8. e3 +Nbd7 9. Nc3 Ne4 10. Ne2 a5 11. d3 Bf6 12. Qc2 Bxb2 13. Qxb2 Nd6 14. cxd5 Bxd5 +15. d4 c5 16. Rfd1 Rc8 17. Nf4 Bxf3 18. Bxf3 Qe7 19. Rac1 Rfd8 20. dxc5 Nxc5 +21. b4 axb4 22. Qxb4 Qa7 23. a3 Nf5 24. Rb1 Rxd1+ 25. Rxd1 Qc7 26. Nd3 h6 27. +Rc1 Ne7 28. Qb5 Nf5 29. a4 Nd6 30. Qb1 Qa7 31. Ne5 Nxa4 32. Rxc8+ Nxc8 33. Qd1 +Ne7 34. Qd8+ Kh7 35. Nxf7 Ng6 36. Qe8 Qe7 37. Qxa4 Qxf7 38. Be4 Kg8 39. Qb5 Nf8 +40. Qxb6 Qf6 41. Qb5 Qe7 42. Kg2 g6 43. Qa5 Qg7 44. Qc5 Qf7 45. h4 h5 46. Qc6 +Qe7 47. Bd3 Qf7 48. Qd6 Kg7 49. e4 Kg8 50. Bc4 Kg7 51. Qe5+ Kg8 52. Qd6 Kg7 53. +Bb5 Kg8 54. Bc6 Qa7 55. Qb4 Qc7 56. Qb7 Qd8 57. e5 Qa5 58. Be8 Qc5 59. Qf7+ Kh8 +60. Ba4 Qd5+ 61. Kh2 Qc5 62. Bb3 Qc8 63. Bd1 Qc5 64. Kg2 1-0 + + +[Event "World Championship 35th-KK5"] +[Site "Lyon/New York"] +[Date "1990.??.??"] +[Round "20"] +[White "Kasparov, Garry"] +[Black "Karpov, Anatoly"] +[Result "1-0"] +[ECO "C92"] +[PlyCount "81"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 +O-O 9. h3 Bb7 10. d4 Re8 11. Nbd2 Bf8 12. a4 h6 13. Bc2 exd4 14. cxd4 Nb4 15. +Bb1 c5 16. d5 Nd7 17. Ra3 f5 18. Rae3 Nf6 19. Nh2 Kh8 20. b3 bxa4 21. bxa4 c4 +22. Bb2 fxe4 23. Nxe4 Nfxd5 24. Rg3 Re6 25. Ng4 Qe8 26. Nxh6 c3 27. Nf5 cxb2 +28. Qg4 Bc8 29. Qh4+ Rh6 30. Nxh6 gxh6 31. Kh2 Qe5 32. Ng5 Qf6 33. Re8 Bf5 34. +Qxh6+ Qxh6 35. Nf7+ Kh7 36. Bxf5+ Qg6 37. Bxg6+ Kg7 38. Rxa8 Be7 39. Rb8 a5 40. +Be4+ Kxf7 41. Bxd5+ 1-0 + + +[Event "Tilburg"] +[Site "Tilburg"] +[Date "1991.10.??"] +[Round "4"] +[White "Short, Nigel D"] +[Black "Timman, Jan H"] +[Result "1-0"] +[WhiteElo "2660"] +[BlackElo "2630"] +[ECO "B04"] +[PlyCount "67"] +[Annotator "ChessPenguin sample"] + +{Tilburg 1991. With queens still on the board, Short marches his king +g1-h2-g3-f4-g5 to support the mating attack, and Black resigns.} 1. e4 Nf6 2. +e5 Nd5 3. d4 d6 4. Nf3 g6 5. Bc4 Nb6 6. Bb3 Bg7 7. Qe2 Nc6 8. O-O O-O 9. h3 a5 +10. a4 dxe5 11. dxe5 Nd4 12. Nxd4 Qxd4 13. Re1 e6 14. Nd2 Nd5 15. Nf3 Qc5 16. +Qe4 Qb4 17. Bc4 Nb6 18. b3 Nxc4 19. bxc4 Re8 20. Rd1 Qc5 21. Qh4 b6 22. Be3 Qc6 +23. Bh6 Bh8 24. Rd8 Bb7 25. Rad1 Bg7 26. R8d7 Rf8 27. Bxg7 Kxg7 28. R1d4 Rae8 +29. Qf6+ Kg8 30. h4 h5 31. Kh2 Rc8 32. Kg3 Rce8 33. Kf4 Bc8 34. Kg5 1-0 + + +[Event "Candidats qf3 rapid60"] +[Site "Brussels"] +[Date "1991.??.??"] +[Round "9"] +[White "Ivanchuk, Vasyl"] +[Black "Yusupov, Artur"] +[Result "0-1"] +[ECO "E67"] +[PlyCount "78"] +[Annotator "ChessPenguin sample"] + +1. c4 e5 2. g3 d6 3. Bg2 g6 4. d4 Nd7 5. Nc3 Bg7 6. Nf3 Ngf6 7. O-O O-O 8. Qc2 +Re8 9. Rd1 c6 10. b3 Qe7 11. Ba3 e4 12. Ng5 e3 13. f4 Nf8 14. b4 Bf5 15. Qb3 h6 +16. Nf3 Ng4 17. b5 g5 18. bxc6 bxc6 19. Ne5 gxf4 20. Nxc6 Qg5 21. Bxd6 Ng6 22. +Nd5 Qh5 23. h4 Nxh4 24. gxh4 Qxh4 25. Nde7+ Kh8 26. Nxf5 Qh2+ 27. Kf1 Re6 28. +Qb7 Rg6 29. Qxa8+ Kh7 30. Qg8+ Kxg8 31. Nce7+ Kh7 32. Nxg6 fxg6 33. Nxg7 Nf2 +34. Bxf4 Qxf4 35. Ne6 Qh2 36. Rdb1 Nh3 37. Rb7+ Kg8 38. Rb8+ Qxb8 39. Bxh3 Qg3 +0-1 + + +[Event "Buenos Aires Sicilian"] +[Site "Buenos Aires"] +[Date "1994.??.??"] +[Round "8"] +[White "Shirov, Alexei"] +[Black "Polgar, Judit"] +[Result "0-1"] +[ECO "B54"] +[PlyCount "58"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nc3 d6 6. g4 a6 7. Be3 Nge7 8. Nb3 +b5 9. f4 Bb7 10. Qf3 g5 11. fxg5 Ne5 12. Qg2 b4 13. Ne2 h5 14. gxh5 Nf5 15. Bf2 +Qxg5 16. Na5 Ne3 17. Qg3 Qxg3 18. Nxg3 Nxc2+ 19. Kd1 Nxa1 20. Nxb7 b3 21. axb3 +Nxb3 22. Kc2 Nc5 23. Nxc5 dxc5 24. Be1 Nf3 25. Bc3 Nd4+ 26. Kd3 Bd6 27. Bg2 Be5 +28. Kc4 Ke7 29. Ra1 Nc6 0-1 + + +[Event "Hoogovens op"] +[Site "Wijk aan Zee"] +[Date "1995.??.??"] +[Round "1"] +[White "Cifuentes Parada, Roberto"] +[Black "Zvjaginsev, Vadim"] +[Result "0-1"] +[ECO "D45"] +[PlyCount "70"] +[Annotator "ChessPenguin sample"] + +1. d4 e6 2. Nf3 d5 3. c4 Nf6 4. Nc3 c6 5. e3 Nbd7 6. Qc2 b6 7. Be2 Bb7 8. O-O +Be7 9. Rd1 O-O 10. e4 dxe4 11. Nxe4 Qc7 12. Nc3 c5 13. d5 exd5 14. cxd5 a6 15. +Nh4 g6 16. Bh6 Rfe8 17. Qd2 Bd6 18. g3 b5 19. Bf3 b4 20. Ne2 Ne4 21. Qc2 Ndf6 +22. Ng2 Qd7 23. Ne3 Rad8 24. Bg2 Nxf2 25. Kxf2 Rxe3 26. Bxe3 Ng4+ 27. Kf3 Nxh2+ +28. Kf2 Ng4+ 29. Kf3 Qe6 30. Bf4 Re8 31. Qc4 Qe3+ 32. Bxe3 Rxe3+ 33. Kxg4 Bc8+ +34. Kg5 h6+ 35. Kxh6 Re5 0-1 + + +[Event "Philadelphia m"] +[Site "Philadelphia"] +[Date "1996.??.??"] +[Round "1"] +[White "Deep Blue (computer)"] +[Black "Kasparov, Garry"] +[Result "1-0"] +[ECO "B22"] +[PlyCount "73"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. c3 d5 3. exd5 Qxd5 4. d4 Nf6 5. Nf3 Bg4 6. Be2 e6 7. h3 Bh5 8. O-O +Nc6 9. Be3 cxd4 10. cxd4 Bb4 11. a3 Ba5 12. Nc3 Qd6 13. Nb5 Qe7 14. Ne5 Bxe2 +15. Qxe2 O-O 16. Rac1 Rac8 17. Bg5 Bb6 18. Bxf6 gxf6 19. Nc4 Rfd8 20. Nxb6 axb6 +21. Rfd1 f5 22. Qe3 Qf6 23. d5 Rxd5 24. Rxd5 exd5 25. b3 Kh8 26. Qxb6 Rg8 27. +Qc5 d4 28. Nd6 f4 29. Nxb7 Ne5 30. Qd5 f3 31. g3 Nd3 32. Rc7 Re8 33. Nd6 Re1+ +34. Kh2 Nxf2 35. Nxf7+ Kg7 36. Ng5+ Kh6 37. Rxh7+ 1-0 + + +[Event "New York Man-Machine"] +[Site "New York"] +[Date "1997.05.11"] +[Round "6"] +[White "Deep Blue (computer)"] +[Black "Kasparov, Garry"] +[Result "1-0"] +[BlackElo "2785"] +[ECO "B17"] +[PlyCount "37"] +[Annotator "ChessPenguin sample"] + +{New York 1997, game 6 of the rematch: the first time a computer beat the +reigning world champion in a match.} 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Nd7 +5. Ng5 Ngf6 6. Bd3 e6 7. N1f3 h6 8. Nxe6 Qe7 9. O-O fxe6 10. Bg6+ Kd8 11. Bf4 +b5 12. a4 Bb7 13. Re1 Nd5 14. Bg3 Kc8 15. axb5 cxb5 16. Qd3 Bc6 17. Bf5 exf5 +18. Rxe7 Bxe7 19. c4 1-0 + + +[Event "Linares"] +[Site "Linares"] +[Date "1998.03.04"] +[Round "10"] +[White "Topalov, Veselin"] +[Black "Shirov, Alexei"] +[Result "0-1"] +[ECO "D85"] +[PlyCount "106"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Bb5+ c6 8. +Ba4 O-O 9. Ne2 Nd7 10. O-O e5 11. f3 Qe7 12. Be3 Rd8 13. Qc2 Nb6 14. Bb3 Be6 +15. Rad1 Nc4 16. Bc1 b5 17. f4 exd4 18. Nxd4 Bg4 19. Rde1 Qc5 20. Kh1 a5 21. h3 +Bd7 22. a4 bxa4 23. Ba2 Be8 24. e5 Nb6 25. f5 Nd5 26. Bd2 Nb4 27. Qxa4 Nxa2 28. +Qxa2 Bxe5 29. fxg6 hxg6 30. Bg5 Rd5 31. Re3 Qd6 32. Qe2 Bd7 33. c4 Bxd4 34. +cxd5 Bxe3 35. Qxe3 Re8 36. Qc3 Qxd5 37. Bh6 Re5 38. Rf3 Qc5 39. Qa1 Bf5 40. Re3 +f6 41. Rxe5 Qxe5 42. Qa2+ Qd5 43. Qxd5+ cxd5 44. Bd2 a4 45. Bc3 Kf7 46. h4 Ke6 +47. Kg1 Bh3 48. gxh3 Kf5 49. Kf2 Ke4 50. Bxf6 d4 51. Be7 Kd3 52. Bc5 Kc4 53. +Be7 Kb3 0-1 + + +[Event "Hoogovens"] +[Site "Wijk aan Zee"] +[Date "1999.01.20"] +[Round "4"] +[White "Kasparov, Garry"] +[Black "Topalov, Veselin"] +[Result "1-0"] +[WhiteElo "2812"] +[BlackElo "2700"] +[ECO "B07"] +[PlyCount "87"] +[Annotator "ChessPenguin sample"] + +{Wijk aan Zee 1999, "Kasparov's Immortal": 24.Rxd4!! starts a king hunt across +the whole board.} 1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be3 Bg7 5. Qd2 c6 6. f3 b5 7. +Nge2 Nbd7 8. Bh6 Bxh6 9. Qxh6 Bb7 10. a3 e5 11. O-O-O Qe7 12. Kb1 a6 13. Nc1 +O-O-O 14. Nb3 exd4 15. Rxd4 c5 16. Rd1 Nb6 17. g3 Kb8 18. Na5 Ba8 19. Bh3 d5 +20. Qf4+ Ka7 21. Rhe1 d4 22. Nd5 Nbxd5 23. exd5 Qd6 24. Rxd4 cxd4 25. Re7+ Kb6 +26. Qxd4+ Kxa5 27. b4+ Ka4 28. Qc3 Qxd5 29. Ra7 Bb7 30. Rxb7 Qc4 31. Qxf6 Kxa3 +32. Qxa6+ Kxb4 33. c3+ Kxc3 34. Qa1+ Kd2 35. Qb2+ Kd1 36. Bf1 Rd2 37. Rd7 Rxd7 +38. Bxc4 bxc4 39. Qxh8 Rd3 40. Qa8 c3 41. Qa4+ Ke1 42. f4 f5 43. Kc1 Rd2 44. +Qa7 1-0 + + +[Event "Kasparov vs The World"] +[Site "Internet MSN"] +[Date "1999.06.21"] +[Round "1"] +[White "Kasparov, Garry"] +[Black "The World"] +[Result "1-0"] +[ECO "B52"] +[PlyCount "123"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 d6 3. Bb5+ Bd7 4. Bxd7+ Qxd7 5. c4 Nc6 6. Nc3 Nf6 7. O-O g6 8. +d4 cxd4 9. Nxd4 Bg7 10. Nde2 Qe6 11. Nd5 Qxe4 12. Nc7+ Kd7 13. Nxa8 Qxc4 14. +Nb6+ axb6 15. Nc3 Ra8 16. a4 Ne4 17. Nxe4 Qxe4 18. Qb3 f5 19. Bg5 Qb4 20. Qf7 +Be5 21. h3 Rxa4 22. Rxa4 Qxa4 23. Qxh7 Bxb2 24. Qxg6 Qe4 25. Qf7 Bd4 26. Qb3 f4 +27. Qf7 Be5 28. h4 b5 29. h5 Qc4 30. Qf5+ Qe6 31. Qxe6+ Kxe6 32. g3 fxg3 33. +fxg3 b4 34. Bf4 Bd4+ 35. Kh1 b3 36. g4 Kd5 37. g5 e6 38. h6 Ne7 39. Rd1 e5 40. +Be3 Kc4 41. Bxd4 exd4 42. Kg2 b2 43. Kf3 Kc3 44. h7 Ng6 45. Ke4 Kc2 46. Rh1 d3 +47. Kf5 b1=Q 48. Rxb1 Kxb1 49. Kxg6 d2 50. h8=Q d1=Q 51. Qh7 b5 52. Kf6+ Kb2 +53. Qh2+ Ka1 54. Qf4 b4 55. Qxb4 Qf3+ 56. Kg7 d5 57. Qd4+ Kb1 58. g6 Qe4 59. +Qg1+ Kb2 60. Qf2+ Kc1 61. Kf6 d4 62. g7 1-0 + + +[Event "World-ch Kramnik-Kasparov +2-0=13"] +[Site "London"] +[Date "2000.10.10"] +[Round "2"] +[White "Kramnik, Vladimir"] +[Black "Kasparov, Garry"] +[Result "1-0"] +[WhiteElo "2770"] +[BlackElo "2849"] +[ECO "D85"] +[PlyCount "79"] +[Annotator "ChessPenguin sample"] + +{World Championship, London 2000, game 2: Kramnik's first win in the match in +which he took the title from Kasparov.} 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 +Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Nf3 c5 8. Be3 Qa5 9. Qd2 Bg4 10. Rb1 a6 11. Rxb7 +Bxf3 12. gxf3 Nc6 13. Bc4 O-O 14. O-O cxd4 15. cxd4 Bxd4 16. Bd5 Bc3 17. Qc1 +Nd4 18. Bxd4 Bxd4 19. Rxe7 Ra7 20. Rxa7 Bxa7 21. f4 Qd8 22. Qc3 Bb8 23. Qf3 Qh4 +24. e5 g5 25. Re1 Qxf4 26. Qxf4 gxf4 27. e6 fxe6 28. Rxe6 Kg7 29. Rxa6 Rf5 30. +Be4 Re5 31. f3 Re7 32. a4 Ra7 33. Rb6 Be5 34. Rb4 Rd7 35. Kg2 Rd2+ 36. Kh3 h5 +37. Rb5 Kf6 38. a5 Ra2 39. Rb6+ Ke7 40. Bd5 1-0 + + +[Event "RUS vs. ROW"] +[Site "Moscow RUS"] +[Date "2002.09.09"] +[Round "5"] +[White "Polgar, Judit"] +[Black "Kasparov, Garry"] +[Result "1-0"] +[ECO "C67"] +[PlyCount "84"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nd6 6. Bxc6 dxc6 7. dxe5 Nf5 +8. Qxd8+ Kxd8 9. Nc3 h6 10. Rd1+ Ke8 11. h3 Be7 12. Ne2 Nh4 13. Nxh4 Bxh4 14. +Be3 Bf5 15. Nd4 Bh7 16. g4 Be7 17. Kg2 h5 18. Nf5 Bf8 19. Kf3 Bg6 20. Rd2 hxg4+ +21. hxg4 Rh3+ 22. Kg2 Rh7 23. Kg3 f6 24. Bf4 Bxf5 25. gxf5 fxe5 26. Re1 Bd6 27. +Bxe5 Kd7 28. c4 c5 29. Bxd6 cxd6 30. Re6 Rah8 31. Rexd6+ Kc8 32. R2d5 Rh3+ 33. +Kg2 Rh2+ 34. Kf3 R2h3+ 35. Ke4 b6 36. Rc6+ Kb8 37. Rd7 Rh2 38. Ke3 Rf8 39. Rcc7 +Rxf5 40. Rb7+ Kc8 41. Rdc7+ Kd8 42. Rxg7 Kc8 1-0 + + +[Event "Corus-C"] +[Site "Wijk aan Zee"] +[Date "2004.01.24"] +[Round "12"] +[White "Carlsen, Magnus"] +[Black "Ernst, Sipke"] +[Result "1-0"] +[WhiteElo "2484"] +[BlackElo "2474"] +[ECO "B19"] +[PlyCount "57"] +[Annotator "ChessPenguin sample"] + +{Wijk aan Zee 2004. Thirteen-year-old Magnus Carlsen wins with a series of +sacrifices in 29 moves.} 1. e4 c6 2. d4 d5 3. Nc3 dxe4 4. Nxe4 Bf5 5. Ng3 Bg6 +6. h4 h6 7. Nf3 Nd7 8. h5 Bh7 9. Bd3 Bxd3 10. Qxd3 e6 11. Bf4 Ngf6 12. O-O-O +Be7 13. Ne4 Qa5 14. Kb1 O-O 15. Nxf6+ Nxf6 16. Ne5 Rad8 17. Qe2 c5 18. Ng6 fxg6 +19. Qxe6+ Kh8 20. hxg6 Ng8 21. Bxh6 gxh6 22. Rxh6+ Nxh6 23. Qxe7 Nf7 24. gxf7 +Kg7 25. Rd3 Rd6 26. Rg3+ Rg6 27. Qe5+ Kxf7 28. Qf5+ Rf6 29. Qd7# 1-0 + + +[Event "WCh"] +[Site "Brissago SUI"] +[Date "2004.10.18"] +[Round "14"] +[White "Kramnik, Vladimir"] +[Black "Leko, Peter"] +[Result "1-0"] +[ECO "B12"] +[PlyCount "81"] +[Annotator "ChessPenguin sample"] + +1. e4 c6 2. d4 d5 3. e5 Bf5 4. h4 h6 5. g4 Bd7 6. Nd2 c5 7. dxc5 e6 8. Nb3 Bxc5 +9. Nxc5 Qa5+ 10. c3 Qxc5 11. Nf3 Ne7 12. Bd3 Nbc6 13. Be3 Qa5 14. Qd2 Ng6 15. +Bd4 Nxd4 16. cxd4 Qxd2+ 17. Kxd2 Nf4 18. Rac1 h5 19. Rhg1 Bc6 20. gxh5 Nxh5 21. +b4 a6 22. a4 Kd8 23. Ng5 Be8 24. b5 Nf4 25. b6 Nxd3 26. Kxd3 Rc8 27. Rxc8+ Kxc8 +28. Rc1+ Bc6 29. Nxf7 Rxh4 30. Nd6+ Kd8 31. Rg1 Rh3+ 32. Ke2 Ra3 33. Rxg7 Rxa4 +34. f4 Ra2+ 35. Kf3 Ra3+ 36. Kg4 Rd3 37. f5 Rxd4+ 38. Kg5 exf5 39. Kf6 Rg4 40. +Rc7 Rh4 41. Nf7+ 1-0 + + +[Event "Corus A"] +[Site "Wijk aan Zee NED"] +[Date "2006.01.14"] +[Round "1"] +[White "Karjakin, Sergey"] +[Black "Anand, Viswanathan"] +[Result "0-1"] +[ECO "B90"] +[PlyCount "74"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be6 8. f3 +Be7 9. Qd2 O-O 10. O-O-O Nbd7 11. g4 b5 12. g5 b4 13. Ne2 Ne8 14. f4 a5 15. f5 +a4 16. Nbd4 exd4 17. Nxd4 b3 18. Kb1 bxc2+ 19. Nxc2 Bb3 20. axb3 axb3 21. Na3 +Ne5 22. h4 Ra5 23. Qc3 Qa8 24. Bg2 Nc7 25. Qxc7 Rc8 26. Qxe7 Nc4 27. g6 hxg6 +28. fxg6 Nxa3+ 29. bxa3 Rxa3 30. gxf7+ Kh7 31. f8=N+ Rxf8 32. Qxf8 Ra1+ 33. Kb2 +Ra2+ 34. Kc3 Qa5+ 35. Kd3 Qb5+ 36. Kd4 Ra4+ 37. Kc3 Qc4+ 0-1 + + +[Event "WCh Playoffs"] +[Site "Elista RUS"] +[Date "2006.10.13"] +[Round "4"] +[White "Kramnik, Vladimir"] +[Black "Topalov, Veselin"] +[Result "1-0"] +[ECO "D47"] +[PlyCount "89"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Be2 +Bb7 9. O-O Be7 10. e4 b4 11. e5 bxc3 12. exf6 Bxf6 13. bxc3 c5 14. dxc5 Nxc5 +15. Bb5+ Kf8 16. Qxd8+ Rxd8 17. Ba3 Rc8 18. Nd4 Be7 19. Rfd1 a6 20. Bf1 Na4 21. +Rab1 Be4 22. Rb3 Bxa3 23. Rxa3 Nc5 24. Nb3 Ke7 25. Rd4 Bg6 26. c4 Rc6 27. Nxc5 +Rxc5 28. Rxa6 Rb8 29. Rd1 Rb2 30. Ra7+ Kf6 31. Ra1 Rf5 32. f3 Re5 33. Ra3 Rc2 +34. Rb3 Ra5 35. a4 Ke7 36. Rb5 Ra7 37. a5 Kd6 38. a6 Kc7 39. c5 Rc3 40. Raa5 +Rc1 41. Rb3 Kc6 42. Rb6+ Kc7 43. Kf2 Rc2+ 44. Ke3 Rxc5 45. Rb7+ 1-0 + + +[Event "WCh"] +[Site "Bonn GER"] +[Date "2008.10.17"] +[Round "3"] +[White "Kramnik, Vladimir"] +[Black "Anand, Viswanathan"] +[Result "0-1"] +[ECO "D49"] +[PlyCount "82"] +[Annotator "ChessPenguin sample"] + +1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. Bxc4 b5 8. Bd3 +a6 9. e4 c5 10. e5 cxd4 11. Nxb5 axb5 12. exf6 gxf6 13. O-O Qb6 14. Qe2 Bb7 15. +Bxb5 Bd6 16. Rd1 Rg8 17. g3 Rg4 18. Bf4 Bxf4 19. Nxd4 h5 20. Nxe6 fxe6 21. Rxd7 +Kf8 22. Qd3 Rg7 23. Rxg7 Kxg7 24. gxf4 Rd8 25. Qe2 Kh6 26. Kf1 Rg8 27. a4 Bg2+ +28. Ke1 Bh3 29. Ra3 Rg1+ 30. Kd2 Qd4+ 31. Kc2 Bg4 32. f3 Bf5+ 33. Bd3 Bh3 34. +a5 Rg2 35. a6 Rxe2+ 36. Bxe2 Bf5+ 37. Kb3 Qe3+ 38. Ka2 Qxe2 39. a7 Qc4+ 40. Ka1 +Qf1+ 41. Ka2 Bb1+ 0-1 + + +[Event "WCh"] +[Site "Bonn GER"] +[Date "2008.10.21"] +[Round "6"] +[White "Anand, Viswanathan"] +[Black "Kramnik, Vladimir"] +[Result "1-0"] +[ECO "E34"] +[PlyCount "93"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. cxd5 Qxd5 6. Nf3 Qf5 7. Qb3 Nc6 8. +Bd2 O-O 9. h3 b6 10. g4 Qa5 11. Rc1 Bb7 12. a3 Bxc3 13. Bxc3 Qd5 14. Qxd5 Nxd5 +15. Bd2 Nf6 16. Rg1 Rac8 17. Bg2 Ne7 18. Bb4 c5 19. dxc5 Rfd8 20. Ne5 Bxg2 21. +Rxg2 bxc5 22. Rxc5 Ne4 23. Rxc8 Rxc8 24. Nd3 Nd5 25. Bd2 Rc2 26. Bc1 f5 27. Kd1 +Rc8 28. f3 Nd6 29. Ke1 a5 30. e3 e5 31. gxf5 e4 32. fxe4 Nxe4 33. Bd2 a4 34. +Nf2 Nd6 35. Rg4 Nc4 36. e4 Nf6 37. Rg3 Nxb2 38. e5 Nd5 39. f6 Kf7 40. Ne4 Nc4 +41. fxg7 Kg8 42. Rd3 Ndb6 43. Bh6 Nxe5 44. Nf6+ Kf7 45. Rc3 Rxc3 46. g8=Q+ Kxf6 +47. Bg7+ 1-0 + + +[Event "Tata Steel-A 75th"] +[Site "Wijk aan Zee"] +[Date "2013.01.15"] +[Round "4"] +[White "Aronian, Levon"] +[Black "Anand, Viswanathan"] +[Result "0-1"] +[WhiteElo "2802"] +[BlackElo "2772"] +[ECO "D46"] +[PlyCount "46"] +[Annotator "ChessPenguin sample"] + +{Wijk aan Zee 2013. Anand, with Black, launches a sacrificial attack and wins +in 23 moves.} 1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4 7. +Bxc4 b5 8. Bd3 Bd6 9. O-O O-O 10. Qc2 Bb7 11. a3 Rc8 12. Ng5 c5 13. Nxh7 Ng4 +14. f4 cxd4 15. exd4 Bc5 16. Be2 Nde5 17. Bxg4 Bxd4+ 18. Kh1 Nxg4 19. Nxf8 f5 +20. Ng6 Qf6 21. h3 Qxg6 22. Qe2 Qh5 23. Qd3 Be3 0-1 + + +[Event "WCh 2013"] +[Site "Chennai IND"] +[Date "2013.11.15"] +[Round "5"] +[White "Carlsen, Magnus"] +[Black "Anand, Viswanathan"] +[Result "1-0"] +[ECO "D31"] +[PlyCount "115"] +[Annotator "ChessPenguin sample"] + +1. c4 e6 2. d4 d5 3. Nc3 c6 4. e4 dxe4 5. Nxe4 Bb4+ 6. Nc3 c5 7. a3 Ba5 8. Nf3 +Nf6 9. Be3 Nc6 10. Qd3 cxd4 11. Nxd4 Ng4 12. O-O-O Nxe3 13. fxe3 Bc7 14. Nxc6 +bxc6 15. Qxd8+ Bxd8 16. Be2 Ke7 17. Bf3 Bd7 18. Ne4 Bb6 19. c5 f5 20. cxb6 fxe4 +21. b7 Rab8 22. Bxe4 Rxb7 23. Rhf1 Rb5 24. Rf4 g5 25. Rf3 h5 26. Rdf1 Be8 27. +Bc2 Rc5 28. Rf6 h4 29. e4 a5 30. Kd2 Rb5 31. b3 Bh5 32. Kc3 Rc5+ 33. Kb2 Rd8 +34. R1f2 Rd4 35. Rh6 Bd1 36. Bb1 Rb5 37. Kc3 c5 38. Rb2 e5 39. Rg6 a4 40. Rxg5 +Rxb3+ 41. Rxb3 Bxb3 42. Rxe5+ Kd6 43. Rh5 Rd1 44. e5+ Kd5 45. Bh7 Rc1+ 46. Kb2 +Rg1 47. Bg8+ Kc6 48. Rh6+ Kd7 49. Bxb3 axb3 50. Kxb3 Rxg2 51. Rxh4 Ke6 52. a4 +Kxe5 53. a5 Kd6 54. Rh7 Kd5 55. a6 c4+ 56. Kc3 Ra2 57. a7 Kc5 58. h4 1-0 + + +[Event "WCh 2013"] +[Site "Chennai IND"] +[Date "2013.11.21"] +[Round "9"] +[White "Anand, Viswanathan"] +[Black "Carlsen, Magnus"] +[Result "0-1"] +[ECO "E25"] +[PlyCount "56"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. f3 d5 5. a3 Bxc3+ 6. bxc3 c5 7. cxd5 exd5 8. +e3 c4 9. Ne2 Nc6 10. g4 O-O 11. Bg2 Na5 12. O-O Nb3 13. Ra2 b5 14. Ng3 a5 15. +g5 Ne8 16. e4 Nxc1 17. Qxc1 Ra6 18. e5 Nc7 19. f4 b4 20. axb4 axb4 21. Rxa6 +Nxa6 22. f5 b3 23. Qf4 Nc7 24. f6 g6 25. Qh4 Ne8 26. Qh6 b2 27. Rf4 b1=Q+ 28. +Nf1 Qe1 0-1 + + +[Event "6th Hainan Danzhou GM"] +[Site "Danzhou CHN"] +[Date "2015.07.03"] +[Round "2.4"] +[White "Wei, Yi"] +[Black "Bruzon Batista, Lazaro"] +[Result "1-0"] +[ECO "B40"] +[PlyCount "71"] +[Annotator "ChessPenguin sample"] + +1. e4 c5 2. Nf3 e6 3. Nc3 a6 4. Be2 Nc6 5. d4 cxd4 6. Nxd4 Qc7 7. O-O Nf6 8. +Be3 Be7 9. f4 d6 10. Kh1 O-O 11. Qe1 Nxd4 12. Bxd4 b5 13. Qg3 Bb7 14. a3 Rad8 +15. Rae1 Rd7 16. Bd3 Qd8 17. Qh3 g6 18. f5 e5 19. Be3 Re8 20. fxg6 hxg6 21. Nd5 +Nxd5 22. Rxf7 Kxf7 23. Qh7+ Ke6 24. exd5+ Kxd5 25. Be4+ Kxe4 26. Qf7 Bf6 27. +Bd2+ Kd4 28. Be3+ Ke4 29. Qb3 Kf5 30. Rf1+ Kg4 31. Qd3 Bxg2+ 32. Kxg2 Qa8+ 33. +Kg1 Bg5 34. Qe2+ Kh4 35. Bf2+ Kh3 36. Be1 1-0 + + +[Event "World-ch Carlsen-Karjakin Tiebreak"] +[Site "New York"] +[Date "2016.11.30"] +[Round "4"] +[White "Carlsen, Magnus"] +[Black "Karjakin, Sergey"] +[Result "1-0"] +[WhiteElo "2853"] +[BlackElo "2772"] +[ECO "B55"] +[PlyCount "99"] +[Annotator "ChessPenguin sample"] + +{World Championship 2016, the fourth rapid tie-break game. Carlsen keeps his +title with the queen sacrifice 50.Qh6+!!} 1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 +Nf6 5. f3 e5 6. Nb3 Be7 7. c4 a5 8. Be3 a4 9. Nc1 O-O 10. Nc3 Qa5 11. Qd2 Na6 +12. Be2 Nc5 13. O-O Bd7 14. Rb1 Rfc8 15. b4 axb3 16. axb3 Qd8 17. Nd3 Ne6 18. +Nb4 Bc6 19. Rfd1 h5 20. Bf1 h4 21. Qf2 Nd7 22. g3 Ra3 23. Bh3 Rca8 24. Nc2 R3a6 +25. Nb4 Ra5 26. Nc2 b6 27. Rd2 Qc7 28. Rbd1 Bf8 29. gxh4 Nf4 30. Bxf4 exf4 31. +Bxd7 Qxd7 32. Nb4 Ra3 33. Nxc6 Qxc6 34. Nb5 Rxb3 35. Nd4 Qxc4 36. Nxb3 Qxb3 37. +Qe2 Be7 38. Kg2 Qe6 39. h5 Ra3 40. Rd3 Ra2 41. R3d2 Ra3 42. Rd3 Ra7 43. Rd5 Rc7 +44. Qd2 Qf6 45. Rf5 Qh4 46. Rc1 Ra7 47. Qxf4 Ra2+ 48. Kh1 Qf2 49. Rc8+ Kh7 50. +Qh6+ 1-0 + + +[Event "TCh-CHN 2017"] +[Site "China CHN"] +[Date "2017.11.04"] +[Round "18.4"] +[White "Bai, Jinshi"] +[Black "Ding, Liren"] +[Result "0-1"] +[ECO "E21"] +[PlyCount "64"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Nf3 O-O 5. Bg5 c5 6. e3 cxd4 7. Qxd4 Nc6 8. +Qd3 h6 9. Bh4 d5 10. Rd1 g5 11. Bg3 Ne4 12. Nd2 Nc5 13. Qc2 d4 14. Nf3 e5 15. +Nxe5 dxc3 16. Rxd8 cxb2+ 17. Ke2 Rxd8 18. Qxb2 Na4 19. Qc2 Nc3+ 20. Kf3 Rd4 21. +h3 h5 22. Bh2 g4+ 23. Kg3 Rd2 24. Qb3 Ne4+ 25. Kh4 Be7+ 26. Kxh5 Kg7 27. Bf4 +Bf5 28. Bh6+ Kh7 29. Qxb7 Rxf2 30. Bg5 Rh8 31. Nxf7 Bg6+ 32. Kxg4 Ne5+ 0-1 + + +[Event "WCh 2021"] +[Site "Dubai UAE"] +[Date "2021.12.03"] +[Round "6"] +[White "Carlsen, Magnus"] +[Black "Nepomniachtchi, Ian"] +[Result "1-0"] +[ECO "D02"] +[PlyCount "271"] +[Annotator "ChessPenguin sample"] + +1. d4 Nf6 2. Nf3 d5 3. g3 e6 4. Bg2 Be7 5. O-O O-O 6. b3 c5 7. dxc5 Bxc5 8. c4 +dxc4 9. Qc2 Qe7 10. Nbd2 Nc6 11. Nxc4 b5 12. Nce5 Nb4 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. Nf3 Qb1 98. Ng5+ Kg7 99. Ne6+ Kf7 100. Nd4 Qh1 101. Rc7+ Kf6 102. Nf3 Qb1 +103. Rd7 Qb2+ 104. Rd2 Qb1 105. Ng1 Qb4 106. Rd1 Qb3 107. Rd6+ Kg7 108. Rd4 +Qb2+ 109. Ne2 Qb1 110. e4 Qh1 111. Rd7+ Kg8 112. Rd4 Qh2+ 113. Ke3 h4 114. gxh4 +Qh3+ 115. Kd2 Qxh4 116. Rd3 Kf8 117. Rf3 Qd8+ 118. Ke3 Qa5 119. Kf2 Qa7+ 120. +Re3 Qd7 121. Ng3 Qd2+ 122. Kf3 Qd1+ 123. Re2 Qb3+ 124. Kg2 Qb7 125. Rd2 Qb3 +126. Rd5 Ke7 127. Re5+ Kf7 128. Rf5+ Ke8 129. e5 Qa2+ 130. Kh3 Qe6 131. Kh4 +Qh6+ 132. Nh5 Qh7 133. e6 Qg6 134. Rf7 Kd8 135. f5 Qg1 136. Ng7 1-0 + + +[Event "WCh Rapid TB 2023"] +[Site "Astana KAZ"] +[Date "2023.04.30"] +[Round "4.1"] +[White "Nepomniachtchi, Ian"] +[Black "Ding, Liren"] +[Result "0-1"] +[ECO "C84"] +[PlyCount "136"] +[Annotator "ChessPenguin sample"] + +1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. d3 b5 7. Bb3 d6 8. a4 +Bd7 9. h3 O-O 10. Be3 Na5 11. Ba2 bxa4 12. Nc3 Rb8 13. Bb1 Qe8 14. b3 c5 15. +Nxa4 Nc6 16. Nc3 a5 17. Nd2 Be6 18. Nc4 d5 19. exd5 Nxd5 20. Bd2 Nxc3 21. Bxc3 +Bxc4 22. bxc4 Bd8 23. Bd2 Bc7 24. c3 f5 25. Re1 Rd8 26. Ra2 Qg6 27. Qe2 Qd6 28. +g3 Rde8 29. Qf3 e4 30. dxe4 Ne5 31. Qg2 Nd3 32. Bxd3 Qxd3 33. exf5 Rxe1+ 34. +Bxe1 Qxc4 35. Ra1 Rxf5 36. Bd2 h6 37. Qc6 Rf7 38. Re1 Kh7 39. Be3 Be5 40. Qe8 +Bxc3 41. Rc1 Rf6 42. Qd7 Qe2 43. Qd5 Bb4 44. Qe4+ Kg8 45. Qd5+ Kh7 46. Qe4+ Rg6 +47. Qf5 c4 48. h4 Qd3 49. Qf3 Rf6 50. Qg4 c3 51. Rd1 Qg6 52. Qc8 Rc6 53. Qa8 +Rd6 54. Rxd6 Qxd6 55. Qe4+ Qg6 56. Qc4 Qb1+ 57. Kh2 a4 58. Bd4 a3 59. Qc7 Qg6 +60. Qc4 c2 61. Be3 Bd6 62. Kg2 h5 63. Kf1 Be5 64. g4 hxg4 65. h5 Qf5 66. Qd5 g3 +67. f4 a2 68. Qxa2 Bxf4 0-1 + + +[Event "WCh 2024"] +[Site "Singapore SIN"] +[Date "2024.12.12"] +[Round "14.1"] +[White "Ding, Liren"] +[Black "Gukesh, Dommaraju"] +[Result "0-1"] +[ECO "A08"] +[PlyCount "116"] +[Annotator "ChessPenguin sample"] + +1. Nf3 d5 2. g3 c5 3. Bg2 Nc6 4. d4 e6 5. O-O cxd4 6. Nxd4 Nge7 7. c4 Nxd4 8. +Qxd4 Nc6 9. Qd1 d4 10. e3 Bc5 11. exd4 Bxd4 12. Nc3 O-O 13. Nb5 Bb6 14. b3 a6 +15. Nc3 Bd4 16. Bb2 e5 17. Qd2 Be6 18. Nd5 b5 19. cxb5 axb5 20. Nf4 exf4 21. +Bxc6 Bxb2 22. Qxb2 Rb8 23. Rfd1 Qb6 24. Bf3 fxg3 25. hxg3 b4 26. a4 bxa3 27. +Rxa3 g6 28. Qd4 Qb5 29. b4 Qxb4 30. Qxb4 Rxb4 31. Ra8 Rxa8 32. Bxa8 g5 33. Bd5 +Bf5 34. Rc1 Kg7 35. Rc7 Bg6 36. Rc4 Rb1+ 37. Kg2 Re1 38. Rb4 h5 39. Ra4 Re5 40. +Bf3 Kh6 41. Kg1 Re6 42. Rc4 g4 43. Bd5 Rd6 44. Bb7 Kg5 45. f3 f5 46. fxg4 hxg4 +47. Rb4 Bf7 48. Kf2 Rd2+ 49. Kg1 Kf6 50. Rb6+ Kg5 51. Rb4 Be6 52. Ra4 Rb2 53. +Ba8 Kf6 54. Rf4 Ke5 55. Rf2 Rxf2 56. Kxf2 Bd5 57. Bxd5 Kxd5 58. Ke3 Ke5 0-1 diff --git a/iosApp/ChessPenguin/Resources/en.lproj/Localizable.strings b/iosApp/ChessPenguin/Resources/en.lproj/Localizable.strings new file mode 100644 index 0000000..8735b10 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/en.lproj/Localizable.strings @@ -0,0 +1,35 @@ +"app_name" = "ChessPenguin"; +"files" = "Files"; +"classic_games" = "Classic games"; +"reading" = "Reading…"; +"retry" = "Try again"; +"open_failed" = "Could not open the database"; +"game_failed" = "Could not read the game"; +"sample_missing" = "The bundled Classic games database is missing."; +"invalid_game" = "This game is no longer in the database."; +"invalid_position" = "The position cannot be shown."; +"empty_database" = "There are no games in this database."; +"game_of" = "%1$ld of %2$ld"; +"previous_game" = "Previous game"; +"next_game" = "Next game"; +"flip" = "Flip board"; +"move_back" = "Move back"; +"move_forward" = "Move forward"; +"to_start" = "To the start"; +"to_end" = "To the end of the line"; +"next_moves" = "Next:"; +"white" = "White"; +"black" = "Black"; +"white_won" = "White won"; +"black_won" = "Black won"; +"draw" = "Draw"; +"board_start" = "Board, starting position"; +"board_after" = "Board, position after %@"; +"move_back_hint" = "Previous move. Hold for the first position"; +"move_forward_hint" = "Next move. Hold for the end of the line"; +"checkmate" = "Checkmate"; +"stalemate" = "Stalemate"; +"current_move" = "Current move"; +"unfinished" = "Unfinished"; +"last_opened" = "Last opened"; +"game_number" = "Game %1$ld"; diff --git a/iosApp/ChessPenguin/Resources/en.lproj/Localizable.stringsdict b/iosApp/ChessPenguin/Resources/en.lproj/Localizable.stringsdict new file mode 100644 index 0000000..e627a8c --- /dev/null +++ b/iosApp/ChessPenguin/Resources/en.lproj/Localizable.stringsdict @@ -0,0 +1,17 @@ + + + + + games_count + + NSStringLocalizedFormatKey%#@games@ + games + + NSStringFormatSpecTypeKeyNSStringPluralRuleType + NSStringFormatValueTypeKeyd + one%d game + other%d games + + + + diff --git a/iosApp/ChessPenguin/Resources/ru.lproj/Localizable.strings b/iosApp/ChessPenguin/Resources/ru.lproj/Localizable.strings new file mode 100644 index 0000000..d63f103 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/ru.lproj/Localizable.strings @@ -0,0 +1,35 @@ +"app_name" = "ChessPenguin"; +"files" = "Файлы"; +"classic_games" = "Классические партии"; +"reading" = "Читаю…"; +"retry" = "Попробовать снова"; +"open_failed" = "Не удалось открыть базу"; +"game_failed" = "Не удалось прочитать партию"; +"sample_missing" = "Встроенная база «Классические партии» не найдена."; +"invalid_game" = "Этой партии больше нет в базе."; +"invalid_position" = "Позицию невозможно показать."; +"empty_database" = "В этой базе нет партий."; +"game_of" = "%1$ld из %2$ld"; +"previous_game" = "Предыдущая партия"; +"next_game" = "Следующая партия"; +"flip" = "Перевернуть доску"; +"move_back" = "Ход назад"; +"move_forward" = "Ход вперёд"; +"to_start" = "В начало"; +"to_end" = "В конец линии"; +"next_moves" = "Дальше:"; +"white" = "Белые"; +"black" = "Чёрные"; +"white_won" = "Победили белые"; +"black_won" = "Победили чёрные"; +"draw" = "Ничья"; +"board_start" = "Доска, начальная позиция"; +"board_after" = "Доска, позиция после %@"; +"move_back_hint" = "Предыдущий ход. Удерживайте для перехода в начало"; +"move_forward_hint" = "Следующий ход. Удерживайте для перехода в конец линии"; +"checkmate" = "Мат"; +"stalemate" = "Пат"; +"current_move" = "Текущий ход"; +"unfinished" = "Партия не завершена"; +"last_opened" = "Открыта последней"; +"game_number" = "Партия %1$ld"; diff --git a/iosApp/ChessPenguin/Resources/ru.lproj/Localizable.stringsdict b/iosApp/ChessPenguin/Resources/ru.lproj/Localizable.stringsdict new file mode 100644 index 0000000..6e20790 --- /dev/null +++ b/iosApp/ChessPenguin/Resources/ru.lproj/Localizable.stringsdict @@ -0,0 +1,19 @@ + + + + + games_count + + NSStringLocalizedFormatKey%#@games@ + games + + NSStringFormatSpecTypeKeyNSStringPluralRuleType + NSStringFormatValueTypeKeyd + one%d партия + few%d партии + many%d партий + other%d партии + + + + diff --git a/iosApp/ChessPenguin/SharedViews.swift b/iosApp/ChessPenguin/SharedViews.swift new file mode 100644 index 0000000..5b66981 --- /dev/null +++ b/iosApp/ChessPenguin/SharedViews.swift @@ -0,0 +1,113 @@ +import SwiftUI + +func known(_ value: String) -> String? { + let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines) + return trimmed.isEmpty || trimmed == "?" ? nil : trimmed +} + +func knownElo(_ value: String) -> String? { + guard let text = known(value), let rating = Int(text), rating > 0 else { return nil } + return text +} + +func pgnYear(_ date: String) -> String? { + let year = String(date.prefix(4)) + return year.count == 4 && Int(year) != nil ? year : nil +} + +func joinedKnown(_ values: [String?]) -> String { + values.compactMap { $0.flatMap(known) }.joined(separator: " · ") +} + +func sideResult(_ result: String, white: Bool) -> String? { + switch result { + case "1-0": return white ? "1" : "0" + case "0-1": return white ? "0" : "1" + case "1/2-1/2": return "½" + default: return nil + } +} + +func gameResultAccessibility(_ result: String) -> String { + switch result { + case "1-0": return "1-0, \(String(localized: "white_won"))" + case "0-1": return "0-1, \(String(localized: "black_won"))" + case "1/2-1/2": return "½-½, \(String(localized: "draw"))" + default: return "\(result.isEmpty ? "*" : result), \(String(localized: "unfinished"))" + } +} + +func gameRowAccessibility(row: GameRow, number: Int, lastOpened: Bool) -> String { + var parts = [String(format: String(localized: "game_number"), number)] + for (side, name, rating) in [(L10n.white, row.white, row.whiteElo), (L10n.black, row.black, row.blackElo)] { + var player = "\(side): \(known(name) ?? "?")" + if let elo = knownElo(rating) { player += ", Elo \(elo)" } + parts.append(player) + } + parts.append(gameResultAccessibility(row.result)) + let context = joinedKnown([row.event, pgnYear(row.date), row.eco]) + if !context.isEmpty { parts.append(context) } + if lastOpened { parts.append(String(localized: "last_opened")) } + return parts.joined(separator: ". ") +} + +extension GameData { + func tag(_ name: String) -> String? { + tags.first { $0.name == name }?.value + } +} + +struct SideDisc: View { + let white: Bool + var size: CGFloat = 10 + + var body: some View { + Circle() + .fill(white ? Color.white : Color(rgb: 0x0E0F10)) + .overlay(Circle().stroke(Theme.onSurfaceVariant, lineWidth: 1)) + .frame(width: size, height: size) + .accessibilityHidden(true) + } +} + +struct ResultTile: View { + let result: String? + + var body: some View { + Group { + if let result { + Text(result) + .font(.subheadline.monospacedDigit()) + .fontWeight(result == "1" ? .bold : .regular) + .foregroundStyle(result == "0" ? Theme.onSurfaceVariant : Theme.onSurface) + .frame(minWidth: 24, minHeight: 20) + .background(result == "0" ? Color.clear : (result == "½" ? Theme.containerHigh : Theme.primaryContainer)) + .clipShape(RoundedRectangle(cornerRadius: 6)) + } else { + Color.clear.frame(width: 24, height: 20) + } + } + } +} + +struct ErrorMessage: View { + let title: String + let detail: String + var retry: (() -> Void)? + + var body: some View { + VStack(spacing: 12) { + Text(title).font(.title3).multilineTextAlignment(.center) + if !detail.isEmpty { + Text(detail) + .foregroundStyle(Theme.onSurfaceVariant) + .multilineTextAlignment(.center) + } + if let retry { + Button(L10n.retry, action: retry) + } + } + .padding(32) + .frame(maxWidth: .infinity) + } +} diff --git a/iosApp/ChessPenguin/Theme.swift b/iosApp/ChessPenguin/Theme.swift new file mode 100644 index 0000000..fd5cd44 --- /dev/null +++ b/iosApp/ChessPenguin/Theme.swift @@ -0,0 +1,81 @@ +import Foundation +import SwiftUI + +extension Color { + init(rgb: UInt32) { + self.init( + red: Double((rgb >> 16) & 0xFF) / 255, + green: Double((rgb >> 8) & 0xFF) / 255, + blue: Double(rgb & 0xFF) / 255 + ) + } +} + +enum Theme { + static let background = Color(rgb: 0x161718) + static let containerLow = Color(rgb: 0x1F2022) + static let container = Color(rgb: 0x232427) + static let containerHigh = Color(rgb: 0x2A2C2F) + static let onSurface = Color(rgb: 0xE8E8E8) + static let onSurfaceVariant = Color(rgb: 0xA3A7AD) + static let outline = Color(rgb: 0x4A4D52) + static let outlineVariant = Color(rgb: 0x2E3033) + static let primary = Color(rgb: 0x62AEE6) + static let primaryContainer = Color(rgb: 0x1A4566) + static let error = Color(rgb: 0xF28B82) + static let pgnBadge = Color(rgb: 0x384660) + static let pgnBadgeText = Color(rgb: 0x89B4FA) + static let currentMove = Color(rgb: 0x005C80) + static let comment = Color(rgb: 0x9EC4E0) + static let boardLight = Color(rgb: 0xFFFFDD) + static let boardDark = Color(rgb: 0x86A666) + static let lastMove = Color(rgb: 0x9BC700).opacity(0.41) +} + +enum L10n { + static let appName = String(localized: "app_name") + static let files = String(localized: "files") + static let classics = String(localized: "classic_games") + static let reading = String(localized: "reading") + static let retry = String(localized: "retry") + static let openFailed = String(localized: "open_failed") + static let gameFailed = String(localized: "game_failed") + static let emptyDatabase = String(localized: "empty_database") + static let previousGame = String(localized: "previous_game") + static let nextGame = String(localized: "next_game") + static let flip = String(localized: "flip") + static let moveBack = String(localized: "move_back") + static let moveForward = String(localized: "move_forward") + static let toStart = String(localized: "to_start") + static let toEnd = String(localized: "to_end") + static let nextMoves = String(localized: "next_moves") + static let white = String(localized: "white") + static let black = String(localized: "black") + static let boardStart = String(localized: "board_start") + static let checkmate = String(localized: "checkmate") + static let stalemate = String(localized: "stalemate") + static let currentMove = String(localized: "current_move") + static let moveBackHint = String(localized: "move_back_hint") + static let moveForwardHint = String(localized: "move_forward_hint") + + static func games(_ count: Int) -> String { + String.localizedStringWithFormat(NSLocalizedString("games_count", comment: "Number of games"), count) + } + + static func gameOf(_ current: Int, _ total: Int) -> String { + String(format: String(localized: "game_of"), current, total) + } + + static func boardAfter(_ move: String) -> String { + String(format: String(localized: "board_after"), move) + } + + static func resultLine(_ result: String) -> String { + switch result { + case "1-0": return "1-0 · \(String(localized: "white_won"))" + case "0-1": return "0-1 · \(String(localized: "black_won"))" + case "1/2-1/2": return "½-½ · \(String(localized: "draw"))" + default: return "" + } + } +} diff --git a/iosApp/ChessPenguinTests/BoardModelTests.swift b/iosApp/ChessPenguinTests/BoardModelTests.swift new file mode 100644 index 0000000..ce61872 --- /dev/null +++ b/iosApp/ChessPenguinTests/BoardModelTests.swift @@ -0,0 +1,52 @@ +import XCTest +@testable import ChessPenguin + +final class BoardModelTests: XCTestCase { + func testFlipUsesSameSquareTransformAsBoard() { + XCTAssertEqual(visualSquareIndex(0, flipped: false), 0) + XCTAssertEqual(visualSquareIndex(0, flipped: true), 63) + XCTAssertEqual(visualSquareIndex(63, flipped: true), 0) + XCTAssertEqual(visualSquareIndex(36, flipped: true), 27) + XCTAssertNil(visualSquareIndex(-1, flipped: false)) + XCTAssertNil(visualSquareIndex(64, flipped: true)) + XCTAssertEqual(squareIndex("a8"), 0) + XCTAssertEqual(squareIndex("h1"), 63) + XCTAssertNil(squareIndex("i9")) + } + + func testStartingPositionHasAllPiecesAndRejectsMalformedFEN() { + let position = BoardPosition(fen: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1") + XCTAssertEqual(position?.squares.count, 64) + XCTAssertEqual(position?.squares.compactMap { $0 }.count, 32) + XCTAssertNil(BoardPosition(fen: "8/8/8 w - - 0 1")) + XCTAssertNil(BoardPosition(fen: "9/8/8/8/8/8/8/8 w - - 0 1")) + } + + func testCommentArrowsAndSquareMarksReachBoardModel() throws { + let game = try loadGame("1. e4 {[%cal Ge2e4,Rd7d5] [%csl Yd5] Center} e5 *") + let model = BoardAnnotationModel(node: game.nodes[1]) + XCTAssertEqual(model.arrows.count, 2) + XCTAssertEqual(model.arrows[0].from, squareIndex("e2")) + XCTAssertEqual(model.arrows[0].to, squareIndex("e4")) + XCTAssertEqual(model.arrows[0].color, .green) + XCTAssertEqual(model.arrows[1].color, .red) + XCTAssertEqual(model.circles.count, 1) + XCTAssertEqual(model.circles[0].square, squareIndex("d5")) + XCTAssertEqual(model.circles[0].color, .yellow) + XCTAssertNil(model.badge) + } + + func testCurrentNAGBadgeAndCheckmateReachBoardModel() throws { + let badgeGame = try loadGame("1. e4 $1 e5 *") + let first = BoardAnnotationModel(node: badgeGame.nodes[1]) + XCTAssertEqual(first.badge?.text, "!") + XCTAssertEqual(first.badge?.square, squareIndex("e4")) + XCTAssertEqual(first.badge?.rgb, 0x81B64C) + + let mateGame = try loadGame("1. f3 e5 2. g4 Qh4# 0-1") + let lastNode = try XCTUnwrap(mateGame.nodes.last { !$0.end.isEmpty }) + let last = BoardAnnotationModel(node: lastNode) + XCTAssertEqual(last.ending, .checkmate) + XCTAssertEqual(BoardEnding(rawValue: "stalemate"), .stalemate) + } +} diff --git a/iosApp/ChessPenguinTests/GameLoadStateTests.swift b/iosApp/ChessPenguinTests/GameLoadStateTests.swift new file mode 100644 index 0000000..efe769b --- /dev/null +++ b/iosApp/ChessPenguinTests/GameLoadStateTests.swift @@ -0,0 +1,114 @@ +import Foundation +import XCTest +@testable import ChessPenguin + +private actor PageLoaderProbe { + private(set) var calls = 0 + + func load(database: Database, start: UInt32, count: UInt32) async -> [GameRow] { + calls += 1 + try? await Task.sleep(nanoseconds: 100_000_000) + return database.rows(start: start, count: count) + } +} + +final class GameLoadStateTests: XCTestCase { + func testLateRetryCannotReplaceGameFromNewPlace() { + var state = GameLoadState() + + // Retry A is pending. Place B opens and finishes first. + state.begin() + XCTAssertTrue(state.succeed(requestedPlace: 1, currentPlace: 1, game: "GAME_B")) + + // Late success and failure from retry A are both ignored. + XCTAssertFalse(state.succeed(requestedPlace: 0, currentPlace: 1, game: "GAME_A")) + XCTAssertFalse(state.fail(requestedPlace: 0, currentPlace: 1, message: "late A")) + XCTAssertEqual(state.loadedPlace, 1) + XCTAssertEqual(state.game, "GAME_B") + XCTAssertNil(state.failure) + } + + func testCurrentRequestStillApplies() { + var state = GameLoadState() + XCTAssertTrue(state.succeed(requestedPlace: 0, currentPlace: 0, game: "GAME_A")) + XCTAssertEqual(state.loadedPlace, 0) + XCTAssertEqual(state.game, "GAME_A") + + state.begin() + XCTAssertNil(state.failure) + XCTAssertTrue(state.fail(requestedPlace: 0, currentPlace: 0, message: "read error")) + XCTAssertNil(state.game) + XCTAssertEqual(state.failure, "read error") + } + + func testPagesContainAtMostOneHundredRows() { + XCTAssertEqual(nextGameRowPage(loaded: 0, total: 250), GameRowPage(start: 0, count: 100)) + XCTAssertEqual(nextGameRowPage(loaded: 100, total: 250), GameRowPage(start: 100, count: 100)) + XCTAssertEqual(nextGameRowPage(loaded: 200, total: 250), GameRowPage(start: 200, count: 50)) + XCTAssertNil(nextGameRowPage(loaded: 250, total: 250)) + XCTAssertNil(nextGameRowPage(loaded: 0, total: 0)) + XCTAssertEqual(nextGameRowPage(loaded: 0, total: 100), GameRowPage(start: 0, count: 100)) + } + + func testNextAcrossPageBoundariesRequestsPageThenUsesLoadedRow() { + // Human transition 100 → 101: place 99 needs the second page for place 100. + XCTAssertEqual( + nextGameRequest(fromPlace: 99, totalGames: 250, loadedRows: 100), + NextGameRequest(fromPlace: 99, toPlace: 100, needsNextPage: true) + ) + XCTAssertEqual( + nextGameRequest(fromPlace: 100, totalGames: 250, loadedRows: 200), + NextGameRequest(fromPlace: 100, toPlace: 101, needsNextPage: false) + ) + + // Human transition 200 → 201 follows the same rule at the third page. + XCTAssertEqual( + nextGameRequest(fromPlace: 199, totalGames: 250, loadedRows: 200), + NextGameRequest(fromPlace: 199, toPlace: 200, needsNextPage: true) + ) + XCTAssertEqual( + nextGameRequest(fromPlace: 200, totalGames: 250, loadedRows: 250), + NextGameRequest(fromPlace: 200, toPlace: 201, needsNextPage: false) + ) + XCTAssertNil(nextGameRequest(fromPlace: 249, totalGames: 250, loadedRows: 250)) + } + + @MainActor + func testConcurrentFooterAndNextShareInFlightPageLoad() async throws { + let pgn = (0..<250).map { + "[Event \"Game \($0)\"]\n[White \"White\"]\n[Black \"Black\"]\n\n1. e4 *\n\n" + }.joined() + let database = try openBytes(name: "250.pgn", bytes: Data(pgn.utf8)) + let probe = PageLoaderProbe() + let model = AppModel( + database: database, + rows: database.rows(start: 0, count: 100), + totalGames: 250 + ) { database, start, count in + await probe.load(database: database, start: start, count: count) + } + + // Footer starts the delayed page load. Next must await the same task, not return early. + async let footer = model.loadNextPage() + async let next = model.loadNextPage() + await next + XCTAssertEqual(model.rows.count, 200, "Next returned before the shared page was appended") + await footer + + let calls = await probe.calls + XCTAssertEqual(calls, 1) + XCTAssertEqual(model.rows.count, 200) + XCTAssertFalse(model.isLoadingPage) + + // The guard used by show(100) now passes for both awaiting callers. + let request = try XCTUnwrap(nextGameRequest( + fromPlace: 99, + totalGames: model.totalGames, + loadedRows: model.rows.count + )) + XCTAssertEqual(request.toPlace, 100) + XCTAssertFalse(request.needsNextPage) + XCTAssertTrue(model.rows.indices.contains(request.toPlace)) + XCTAssertEqual(model.rows[request.toPlace].index, 100) + } +} diff --git a/iosApp/ChessPenguinTests/KeyboardAccessibilityTests.swift b/iosApp/ChessPenguinTests/KeyboardAccessibilityTests.swift new file mode 100644 index 0000000..3a60ef1 --- /dev/null +++ b/iosApp/ChessPenguinTests/KeyboardAccessibilityTests.swift @@ -0,0 +1,39 @@ +import XCTest +@testable import ChessPenguin + +final class KeyboardAccessibilityTests: XCTestCase { + func testEveryHardwareKeyHasRealGameCommand() { + let mapping: [(GameKeyboardKey, GameCommand)] = [ + (.leftArrow, .previousMove), + (.rightArrow, .nextMove), + (.shiftLeftArrow, .startOfLine), + (.shiftRightArrow, .endOfLine), + (.f, .flip), + (.escape, .back), + ] + for (key, expected) in mapping { + XCTAssertEqual(gameCommand(for: key), expected) + } + } + + func testWholeRowAccessibilityIncludesResultAndFullNames() { + let row = makeGameRow(result: "1-0") + let label = gameRowAccessibility(row: row, number: 7, lastOpened: true) + XCTAssertTrue(label.contains(row.white)) + XCTAssertTrue(label.contains(row.black)) + XCTAssertTrue(label.contains("1-0")) + XCTAssertTrue(label.contains(row.event)) + XCTAssertTrue(label.contains("1858")) + XCTAssertTrue(label.contains(row.eco)) + XCTAssertFalse(gameResultAccessibility(row.result).isEmpty) + XCTAssertFalse(label.isEmpty) + } + + func testEveryResultHasMeaningfulAccessibilityText() { + for result in ["1-0", "0-1", "1/2-1/2", "*"] { + let spoken = gameResultAccessibility(result) + XCTAssertFalse(spoken.isEmpty) + if result != "1/2-1/2" { XCTAssertTrue(spoken.contains(result)) } + } + } +} diff --git a/iosApp/ChessPenguinTests/NotationModelTests.swift b/iosApp/ChessPenguinTests/NotationModelTests.swift new file mode 100644 index 0000000..20cbe56 --- /dev/null +++ b/iosApp/ChessPenguinTests/NotationModelTests.swift @@ -0,0 +1,71 @@ +import XCTest +@testable import ChessPenguin + +final class NotationModelTests: XCTestCase { + func testOperaContainsMainLineAndEveryVariationNode() throws { + let game = try loadGame(operaPGN) + let model = NotationModel(game: game) + let expected = Set(game.nodes.dropFirst().map { Int($0.id) }) + + XCTAssertEqual(Set(model.moveIDs), expected) + XCTAssertEqual(model.moveIDs.count, expected.count, "a reachable node is rendered exactly once") + + let qxb7 = try XCTUnwrap(game.nodes.first { $0.san == "Qxb7" && $0.moveNumber == 8 }) + let nc3 = try XCTUnwrap(game.nodes.first { $0.san == "Nc3" }) + XCTAssertNotNil(model.entryByNode[Int(qxb7.id)]) + XCTAssertNotNil(model.entryByNode[Int(nc3.id)]) + + let labels = model.entries.flatMap { entry -> [String] in + guard case .variation(let variation) = entry else { return [] } + return variation.tokens.compactMap { + if case .move(let move) = $0 { return move.label } + return nil + } + } + XCTAssertTrue(labels.contains("8.Qxb7")) + XCTAssertTrue(labels.contains("Qb4+")) + XCTAssertTrue(labels.contains("9.Qxb4")) + XCTAssertTrue(labels.contains("Bxb4+")) + } + + func testNestedRAVRemainsClickableWithParentheses() throws { + let game = try loadGame("1. e4 (1. d4 d5 (1... c5)) 1... e5 *") + let model = NotationModel(game: game) + let expected = Set(game.nodes.dropFirst().map { Int($0.id) }) + + XCTAssertEqual(Set(model.moveIDs), expected) + XCTAssertEqual(model.moveIDs.count, expected.count) + for id in expected { + XCTAssertNotNil(model.entryByNode[id], "node \(id) has no clickable notation entry") + } + + let tokens = model.entries.flatMap { entry -> [NotationToken] in + guard case .variation(let variation) = entry else { return [] } + return variation.tokens + } + let punctuation = tokens.compactMap { + if case .punctuation(_, let text) = $0 { return text } + return nil + } + XCTAssertEqual(punctuation.filter { $0 == "(" }.count, 1) + XCTAssertEqual(punctuation.filter { $0 == ")" }.count, 1) + } + + func testVisitedSetStopsMalformedCyclesWithoutDroppingFirstNode() throws { + var game = try loadGame("1. e4 e5 *") + game.nodes[1].children = [1] + let model = NotationModel(game: game) + XCTAssertEqual(model.moveIDs, [1]) + XCTAssertEqual(model.moveIDs.count, Set(model.moveIDs).count) + } + + func testResultIsSeparateEntry() throws { + let model = NotationModel(game: try loadGame("1. e4 e5 1-0")) + let last = try XCTUnwrap(model.entries.last) + guard case .result(let result) = last else { + return XCTFail("missing result entry") + } + XCTAssertTrue(result.text.contains("1-0")) + XCTAssertEqual(result.indent, 0) + } +} diff --git a/iosApp/ChessPenguinTests/TestSupport.swift b/iosApp/ChessPenguinTests/TestSupport.swift new file mode 100644 index 0000000..83651bc --- /dev/null +++ b/iosApp/ChessPenguinTests/TestSupport.swift @@ -0,0 +1,47 @@ +import Foundation +@testable import ChessPenguin + +func loadGame(_ pgn: String, index: UInt32 = 0) throws -> GameData { + let database = try openBytes(name: "fixture.pgn", bytes: Data(pgn.utf8)) + return try database.game(index: index) +} + +func makeGameRow(result: String = "1-0") -> GameRow { + GameRow( + index: 6, + white: "Morphy, Paul", + black: "Duke Karl / Count Isouard", + result: result, + date: "1858.??.??", + event: "Paris Opera", + eco: "C41", + whiteElo: "", + blackElo: "" + ) +} + +let operaPGN = #""" +[Event "Paris Opera"] +[Site "Paris FRA"] +[Date "1858.??.??"] +[Round "?"] +[White "Morphy, Paul"] +[Black "Duke Karl / Count Isouard"] +[Result "1-0"] +[ECO "C41"] +[PlyCount "33"] + +{The "Opera Game": a model of rapid development and open lines.} 1. e4 e5 2. Nf3 +d6 3. d4 Bg4 $6 {Pinning the knight, but Black will have to give up the bishop +pair.} 4. dxe5 Bxf3 (4... dxe5 5. Qxd8+ Kxd8 6. Nxe5 {wins a pawn.}) 5. Qxf3 +dxe5 6. Bc4 {Threatening Qxf7#.} Nf6 7. Qb3 $1 {A double attack on f7 and b7.} +Qe7 8. Nc3 {Morphy prefers development to material.} (8. Qxb7 Qb4+ 9. Qxb4 Bxb4+ +{only trades queens.}) 8... c6 9. Bg5 b5 $2 {Black wants to chase the bishop, but opens lines towards his own king.} +(9... Nbd7 {is the healthy move:} 10. O-O-O {keeps the pressure on d7.} (10. Qxb7 $6 Qb4+ +11. Qxb4 Bxb4 {[%csl Gb4] and Black is fine.}) 10... h6 11. Bh4 $14) 10. Nxb5 $1 +{[%cal Gb5d6,Gc4f7] The knight sacrifice opens the c-file and the a4-e8 diagonal.} cxb5 11. +Bxb5+ Nbd7 12. O-O-O {[%csl Rd7][%cal Gd1d7,Gb5d7] All of White's pieces aim at d7.} Rd8 +13. Rxd7 $1 Rxd7 14. Rd1 Qe6 15. Bxd7+ Nxd7 16. Qb8+ $3 {[%cal Gb3b8,Gd1d8] The famous +queen sacrifice.} Nxb8 17. Rd8# {[%csl Re8] A model of rapid development.} +1-0 +"""# diff --git a/iosApp/Generated/.gitattributes b/iosApp/Generated/.gitattributes new file mode 100644 index 0000000..d2b20fe --- /dev/null +++ b/iosApp/Generated/.gitattributes @@ -0,0 +1,3 @@ +# Preserve UniFFI output byte-for-byte: its templates emit trailing spaces. +*.swift whitespace=-trailing-space +*.h whitespace=-trailing-space diff --git a/iosApp/Generated/MobileAPI/MobileAPI.swift b/iosApp/Generated/MobileAPI/MobileAPI.swift new file mode 100644 index 0000000..ff469af --- /dev/null +++ b/iosApp/Generated/MobileAPI/MobileAPI.swift @@ -0,0 +1,8614 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +// swiftlint:disable all +import Foundation + +// Depending on the consumer's build setup, the low-level FFI code +// might be in a separate module, or it might be compiled inline into +// this module. This is a bit of light hackery to work with both. +#if canImport(MobileAPIFFI) +import MobileAPIFFI +#endif + +fileprivate extension RustBuffer { + // Allocate a new buffer, copying the contents of a `UInt8` array. + init(bytes: [UInt8]) { + let rbuf = bytes.withUnsafeBufferPointer { ptr in + RustBuffer.from(ptr) + } + self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data) + } + + static func empty() -> RustBuffer { + RustBuffer(capacity: 0, len:0, data: nil) + } + + static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { + try! rustCall { ffi_mobile_api_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } + } + + // Frees the buffer in place. + // The buffer must not be used after this is called. + func deallocate() { + try! rustCall { ffi_mobile_api_rustbuffer_free(self, $0) } + } +} + +fileprivate extension ForeignBytes { + init(bufferPointer: UnsafeBufferPointer) { + self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress) + } + + init(rawBufferPointer: UnsafeRawBufferPointer) { + self.init( + len: Int32(rawBufferPointer.count), + data: rawBufferPointer.baseAddress?.assumingMemoryBound(to: UInt8.self) + ) + } +} + +// Converter for `&[u8]` / `[ByRef] bytes` arguments. +// +// Conforms to `FfiConverter` so the compiler enforces the full converter +// method set. Only the scope-bound `lower(_:_body:)` overload is sound — +// zero-copy byte buffers only flow foreign -> Rust, and only in argument +// position. The four protocol-witness methods (`lift`, `lower`, `read`, +// `write`) `fatalError` at runtime if anyone reaches them. +// +// The scope-bound `lower` takes a closure because the `ForeignBytes` +// pointer is only guaranteed valid for the duration of +// `Data.withUnsafeBytes`. Callers must run the full FFI call inside +// the closure body. +fileprivate enum FfiConverterByRefBytes: FfiConverter { + typealias SwiftType = Data + typealias FfiType = ForeignBytes + + static func lower(_ value: Data, _ body: (ForeignBytes) throws -> R) rethrows -> R { + return try value.withUnsafeBytes { rawBuf in + try body(ForeignBytes(rawBufferPointer: rawBuf)) + } + } + + static func lower(_ value: Data) -> ForeignBytes { + fatalError("ByRef bytes cannot use the plain lower: returning ForeignBytes escapes the Data.withUnsafeBytes scope. Use the scope-bound lower(_:_body:) overload instead.") + } + + static func lift(_ value: ForeignBytes) throws -> Data { + fatalError("ByRef bytes cannot be lifted: zero-copy &[u8] only flows foreign->Rust") + } + + static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data { + fatalError("ByRef bytes cannot be read from a buffer: zero-copy &[u8] is only supported in argument position, not nested in records/options/etc.") + } + + static func write(_ value: Data, into buf: inout [UInt8]) { + fatalError("ByRef bytes cannot be written to a buffer: zero-copy &[u8] is only supported in argument position, not nested in records/options/etc.") + } +} + +// For every type used in the interface, we provide helper methods for conveniently +// lifting and lowering that type from C-compatible data, and for reading and writing +// values of that type in a buffer. + +// Helper classes/extensions that don't change. +// Someday, this will be in a library of its own. + +fileprivate extension Data { + init(rustBuffer: RustBuffer) { + self.init( + bytesNoCopy: rustBuffer.data!, + count: Int(rustBuffer.len), + deallocator: .none + ) + } +} + +// Define reader functionality. Normally this would be defined in a class or +// struct, but we use standalone functions instead in order to make external +// types work. +// +// With external types, one swift source file needs to be able to call the read +// method on another source file's FfiConverter, but then what visibility +// should Reader have? +// - If Reader is fileprivate, then this means the read() must also +// be fileprivate, which doesn't work with external types. +// - If Reader is internal/public, we'll get compile errors since both source +// files will try define the same type. +// +// Instead, the read() method and these helper functions input a tuple of data + +fileprivate func createReader(data: Data) -> (data: Data, offset: Data.Index) { + (data: data, offset: 0) +} + +// Reads an integer at the current offset, in big-endian order, and advances +// the offset on success. Throws if reading the integer would move the +// offset past the end of the buffer. +fileprivate func readInt(_ reader: inout (data: Data, offset: Data.Index)) throws -> T { + let range = reader.offset...size + guard reader.data.count >= range.upperBound else { + throw UniffiInternalError.bufferOverflow + } + if T.self == UInt8.self { + let value = reader.data[reader.offset] + reader.offset += 1 + return value as! T + } + var value: T = 0 + let _ = withUnsafeMutableBytes(of: &value, { reader.data.copyBytes(to: $0, from: range)}) + reader.offset = range.upperBound + return value.bigEndian +} + +// Reads an arbitrary number of bytes, to be used to read +// raw bytes, this is useful when lifting strings +fileprivate func readBytes(_ reader: inout (data: Data, offset: Data.Index), count: Int) throws -> Array { + let range = reader.offset..<(reader.offset+count) + guard reader.data.count >= range.upperBound else { + throw UniffiInternalError.bufferOverflow + } + var value = [UInt8](repeating: 0, count: count) + value.withUnsafeMutableBufferPointer({ buffer in + reader.data.copyBytes(to: buffer, from: range) + }) + reader.offset = range.upperBound + return value +} + +// Reads a float at the current offset. +fileprivate func readFloat(_ reader: inout (data: Data, offset: Data.Index)) throws -> Float { + return Float(bitPattern: try readInt(&reader)) +} + +// Reads a float at the current offset. +fileprivate func readDouble(_ reader: inout (data: Data, offset: Data.Index)) throws -> Double { + return Double(bitPattern: try readInt(&reader)) +} + +// Indicates if the offset has reached the end of the buffer. +fileprivate func hasRemaining(_ reader: (data: Data, offset: Data.Index)) -> Bool { + return reader.offset < reader.data.count +} + +// Define writer functionality. Normally this would be defined in a class or +// struct, but we use standalone functions instead in order to make external +// types work. See the above discussion on Readers for details. + +fileprivate func createWriter() -> [UInt8] { + return [] +} + +fileprivate func writeBytes(_ writer: inout [UInt8], _ byteArr: S) where S: Sequence, S.Element == UInt8 { + writer.append(contentsOf: byteArr) +} + +// Writes an integer in big-endian order. +// +// Warning: make sure what you are trying to write +// is in the correct type! +fileprivate func writeInt(_ writer: inout [UInt8], _ value: T) { + var value = value.bigEndian + withUnsafeBytes(of: &value) { writer.append(contentsOf: $0) } +} + +fileprivate func writeFloat(_ writer: inout [UInt8], _ value: Float) { + writeInt(&writer, value.bitPattern) +} + +fileprivate func writeDouble(_ writer: inout [UInt8], _ value: Double) { + writeInt(&writer, value.bitPattern) +} + +// Protocol for types that transfer other types across the FFI. This is +// analogous to the Rust trait of the same name. +fileprivate protocol FfiConverter { + associatedtype FfiType + associatedtype SwiftType + + static func lift(_ value: FfiType) throws -> SwiftType + static func lower(_ value: SwiftType) -> FfiType + static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType + static func write(_ value: SwiftType, into buf: inout [UInt8]) +} + +// Types conforming to `Primitive` pass themselves directly over the FFI. +fileprivate protocol FfiConverterPrimitive: FfiConverter where FfiType == SwiftType { } + +extension FfiConverterPrimitive { +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lift(_ value: FfiType) throws -> SwiftType { + return value + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lower(_ value: SwiftType) -> FfiType { + return value + } +} + +// Types conforming to `FfiConverterRustBuffer` lift and lower into a `RustBuffer`. +// Used for complex types where it's hard to write a custom lift/lower. +fileprivate protocol FfiConverterRustBuffer: FfiConverter where FfiType == RustBuffer {} + +extension FfiConverterRustBuffer { +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lift(_ buf: RustBuffer) throws -> SwiftType { + var reader = createReader(data: Data(rustBuffer: buf)) + let value = try read(from: &reader) + if hasRemaining(reader) { + throw UniffiInternalError.incompleteData + } + buf.deallocate() + return value + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public static func lower(_ value: SwiftType) -> RustBuffer { + var writer = createWriter() + write(value, into: &writer) + return RustBuffer(bytes: writer) + } +} +// An error type for FFI errors. These errors occur at the UniFFI level, not +// the library level. +fileprivate enum UniffiInternalError: LocalizedError { + case bufferOverflow + case incompleteData + case unexpectedOptionalTag + case unexpectedEnumCase + case unexpectedNullPointer + case unexpectedRustCallStatusCode + case unexpectedRustCallError + case unexpectedStaleHandle + case rustPanic(_ message: String) + + public var errorDescription: String? { + switch self { + case .bufferOverflow: return "Reading the requested value would read past the end of the buffer" + case .incompleteData: return "The buffer still has data after lifting its containing value" + case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1" + case .unexpectedEnumCase: return "Raw enum value doesn't match any cases" + case .unexpectedNullPointer: return "Raw pointer value was null" + case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" + case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" + case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" + case let .rustPanic(message): return message + } + } +} + +fileprivate extension NSLock { + func withLock(f: () throws -> T) rethrows -> T { + self.lock() + defer { self.unlock() } + return try f() + } +} + +fileprivate let CALL_SUCCESS: Int8 = 0 +fileprivate let CALL_ERROR: Int8 = 1 +fileprivate let CALL_UNEXPECTED_ERROR: Int8 = 2 +fileprivate let CALL_CANCELLED: Int8 = 3 + +fileprivate extension RustCallStatus { + init() { + self.init( + code: CALL_SUCCESS, + errorBuf: RustBuffer.init( + capacity: 0, + len: 0, + data: nil + ) + ) + } +} + +private func rustCall(_ callback: (UnsafeMutablePointer) -> T) throws -> T { + let neverThrow: ((RustBuffer) throws -> Never)? = nil + return try makeRustCall(callback, errorHandler: neverThrow) +} + +private func rustCallWithError( + _ errorHandler: @escaping (RustBuffer) throws -> E, + _ callback: (UnsafeMutablePointer) -> T) throws -> T { + try makeRustCall(callback, errorHandler: errorHandler) +} + +private func makeRustCall( + _ callback: (UnsafeMutablePointer) -> T, + errorHandler: ((RustBuffer) throws -> E)? +) throws -> T { + uniffiEnsureMobileApiInitialized() + var callStatus = RustCallStatus.init() + let returnedVal = callback(&callStatus) + try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) + return returnedVal +} + +private func uniffiCheckCallStatus( + callStatus: RustCallStatus, + errorHandler: ((RustBuffer) throws -> E)? +) throws { + switch callStatus.code { + case CALL_SUCCESS: + return + + case CALL_ERROR: + if let errorHandler = errorHandler { + throw try errorHandler(callStatus.errorBuf) + } else { + callStatus.errorBuf.deallocate() + throw UniffiInternalError.unexpectedRustCallError + } + + case CALL_UNEXPECTED_ERROR: + // When the rust code sees a panic, it tries to construct a RustBuffer + // with the message. But if that code panics, then it just sends back + // an empty buffer. + if callStatus.errorBuf.len > 0 { + throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf)) + } else { + callStatus.errorBuf.deallocate() + throw UniffiInternalError.rustPanic("Rust panic") + } + + case CALL_CANCELLED: + fatalError("Cancellation not supported yet") + + default: + throw UniffiInternalError.unexpectedRustCallStatusCode + } +} + +private func uniffiTraitInterfaceCall( + callStatus: UnsafeMutablePointer, + makeCall: () throws -> T, + writeReturn: (T) -> () +) { + do { + try writeReturn(makeCall()) + } catch let error { + callStatus.pointee.code = CALL_UNEXPECTED_ERROR + callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + } +} + +private func uniffiTraitInterfaceCallWithError( + callStatus: UnsafeMutablePointer, + makeCall: () throws -> T, + writeReturn: (T) -> (), + lowerError: (E) -> RustBuffer +) { + do { + try writeReturn(makeCall()) + } catch let error as E { + callStatus.pointee.code = CALL_ERROR + callStatus.pointee.errorBuf = lowerError(error) + } catch { + callStatus.pointee.code = CALL_UNEXPECTED_ERROR + callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + } +} +// Initial value and increment amount for handles. +// These ensure that SWIFT handles always have the lowest bit set +fileprivate let UNIFFI_HANDLEMAP_INITIAL: UInt64 = 1 +fileprivate let UNIFFI_HANDLEMAP_DELTA: UInt64 = 2 + +fileprivate final class UniffiHandleMap: @unchecked Sendable { + // All mutation happens with this lock held, which is why we implement @unchecked Sendable. + private let lock = NSLock() + private var map: [UInt64: T] = [:] + private var currentHandle: UInt64 = UNIFFI_HANDLEMAP_INITIAL + + func insert(obj: T) -> UInt64 { + lock.withLock { + return doInsert(obj) + } + } + + // Low-level insert function, this assumes `lock` is held. + private func doInsert(_ obj: T) -> UInt64 { + let handle = currentHandle + currentHandle += UNIFFI_HANDLEMAP_DELTA + map[handle] = obj + return handle + } + + func get(handle: UInt64) throws -> T { + try lock.withLock { + guard let obj = map[handle] else { + throw UniffiInternalError.unexpectedStaleHandle + } + return obj + } + } + + func clone(handle: UInt64) throws -> UInt64 { + try lock.withLock { + guard let obj = map[handle] else { + throw UniffiInternalError.unexpectedStaleHandle + } + return doInsert(obj) + } + } + + @discardableResult + func remove(handle: UInt64) throws -> T { + try lock.withLock { + guard let obj = map.removeValue(forKey: handle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return obj + } + } + + var count: Int { + get { + map.count + } + } +} + + +// Public interface members begin here. + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterUInt32: FfiConverterPrimitive { + typealias FfiType = UInt32 + typealias SwiftType = UInt32 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt32 { + return try lift(readInt(&buf)) + } + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterInt32: FfiConverterPrimitive { + typealias FfiType = Int32 + typealias SwiftType = Int32 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Int32 { + return try lift(readInt(&buf)) + } + + public static func write(_ value: Int32, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterUInt64: FfiConverterPrimitive { + typealias FfiType = UInt64 + typealias SwiftType = UInt64 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt64 { + return try lift(readInt(&buf)) + } + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterInt64: FfiConverterPrimitive { + typealias FfiType = Int64 + typealias SwiftType = Int64 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Int64 { + return try lift(readInt(&buf)) + } + + public static func write(_ value: Int64, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterFloat: FfiConverterPrimitive { + typealias FfiType = Float + typealias SwiftType = Float + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Float { + return try lift(readFloat(&buf)) + } + + public static func write(_ value: Float, into buf: inout [UInt8]) { + writeFloat(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterDouble: FfiConverterPrimitive { + typealias FfiType = Double + typealias SwiftType = Double + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Double { + return try lift(readDouble(&buf)) + } + + public static func write(_ value: Double, into buf: inout [UInt8]) { + writeDouble(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterBool : FfiConverter { + typealias FfiType = Int8 + typealias SwiftType = Bool + + public static func lift(_ value: Int8) throws -> Bool { + return value != 0 + } + + public static func lower(_ value: Bool) -> Int8 { + return value ? 1 : 0 + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool { + return try lift(readInt(&buf)) + } + + public static func write(_ value: Bool, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterString: FfiConverter { + typealias SwiftType = String + typealias FfiType = RustBuffer + + public static func lift(_ value: RustBuffer) throws -> String { + defer { + value.deallocate() + } + if value.data == nil { + return String() + } + let bytes = UnsafeBufferPointer(start: value.data!, count: Int(value.len)) + // Use Swift's native UTF-8 decoder; `String(bytes:encoding:.utf8)` goes + // through Foundation's NSString and silently strips a leading U+FEFF BOM. + // Invalid UTF-8 substitutes U+FFFD instead of trapping (unreachable + // given Rust's `String` invariant). + return String(decoding: bytes, as: UTF8.self) + } + + public static func lower(_ value: String) -> RustBuffer { + return value.utf8CString.withUnsafeBufferPointer { ptr in + // The swift string gives us int8_t, we want uint8_t. + ptr.withMemoryRebound(to: UInt8.self) { ptr in + // The swift string gives us a trailing null byte, we don't want it. + let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1)) + return RustBuffer.from(buf) + } + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> String { + let len: Int32 = try readInt(&buf) + // See `lift` above for why we avoid Foundation's NSString-backed decoder here. + return String(decoding: try readBytes(&buf, count: Int(len)), as: UTF8.self) + } + + public static func write(_ value: String, into buf: inout [UInt8]) { + let len = Int32(value.utf8.count) + writeInt(&buf, len) + writeBytes(&buf, value.utf8) + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterData: FfiConverterRustBuffer { + typealias SwiftType = Data + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Data { + let len: Int32 = try readInt(&buf) + return Data(try readBytes(&buf, count: Int(len))) + } + + public static func write(_ value: Data, into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + writeBytes(&buf, value) + } +} + + + + +/** + * A running engine. + */ +public protocol AnalyzerProtocol: AnyObject, Sendable { + + /** + * Analyses the position reached from `start_fen` by `moves` (UCI), with `lines` + * lines, until [`Analyzer::stop`] or the next call. Returns the search's number: + * only snapshots with it belong to this position. + */ + func analyze(startFen: String, moves: [String], lines: UInt32) throws -> UInt64 + + /** + * Waits up to `timeout_ms` for the engine; returns the analysis of the current + * search when it has changed, `None` otherwise. Fails once the engine has stopped. + */ + func poll(timeoutMs: UInt32) throws -> Analysis? + + /** + * Quits the engine (and kills it if it does not leave in time). + */ + func quit() + + /** + * Stops the search (its last lines stay valid for its position). + */ + func stop() + +} +/** + * A running engine. + */ +open class Analyzer: AnalyzerProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_analyzer(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_analyzer(handle, $0) } + } + + + /** + * Starts the engine at `path` with its network `eval_file`. Blocks for the + * handshake (seconds at most): call it off the main thread. + */ +public static func start(path: String, evalFile: String, threads: UInt32, hashMb: UInt32)throws -> Analyzer { + return try FfiConverterTypeAnalyzer_lift(try rustCallWithError(FfiConverterTypeEngineFailure_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_analyzer_start( + FfiConverterString.lower(path), + FfiConverterString.lower(evalFile), + FfiConverterUInt32.lower(threads), + FfiConverterUInt32.lower(hashMb),uniffiCallStatus + ) +}) +} + + + + /** + * Analyses the position reached from `start_fen` by `moves` (UCI), with `lines` + * lines, until [`Analyzer::stop`] or the next call. Returns the search's number: + * only snapshots with it belong to this position. + */ +open func analyze(startFen: String, moves: [String], lines: UInt32)throws -> UInt64 { + return try FfiConverterUInt64.lift(try rustCallWithError(FfiConverterTypeEngineFailure_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_analyzer_analyze( + self.uniffiCloneHandle(), + FfiConverterString.lower(startFen), + FfiConverterSequenceString.lower(moves), + FfiConverterUInt32.lower(lines),uniffiCallStatus + ) +}) +} + + /** + * Waits up to `timeout_ms` for the engine; returns the analysis of the current + * search when it has changed, `None` otherwise. Fails once the engine has stopped. + */ +open func poll(timeoutMs: UInt32)throws -> Analysis? { + return try FfiConverterOptionTypeAnalysis.lift(try rustCallWithError(FfiConverterTypeEngineFailure_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_analyzer_poll( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(timeoutMs),uniffiCallStatus + ) +}) +} + + /** + * Quits the engine (and kills it if it does not leave in time). + */ +open func quit() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_analyzer_quit( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + /** + * Stops the search (its last lines stay valid for its position). + */ +open func stop() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_analyzer_stop( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeAnalyzer: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = Analyzer + + public static func lift(_ handle: UInt64) throws -> Analyzer { + return Analyzer(unsafeFromHandle: handle) + } + + public static func lower(_ value: Analyzer) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Analyzer { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: Analyzer, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAnalyzer_lift(_ handle: UInt64) throws -> Analyzer { + return try FfiConverterTypeAnalyzer.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAnalyzer_lower(_ value: Analyzer) -> UInt64 { + return FfiConverterTypeAnalyzer.lower(value) +} + + + + + + +/** + * An open database. + */ +public protocol DatabaseProtocol: AnyObject, Sendable { + + /** + * The numbers of the games whose players, event, site, date or opening code (ECO) + * contain every word of `text` (case does not matter); all games for an empty text. + */ + func find(text: String) -> [UInt32] + + /** + * What the database was read from ("PGN", "ChessBase", "zip", …). + */ + func format() -> String + + /** + * The game `index`, ready to show. + */ + func game(index: UInt32) throws -> GameData + + func isEmpty() -> Bool + + /** + * The number of games. + */ + func len() -> UInt32 + + /** + * These games (from [`Database::find`]) from the most recent to the oldest, by the + * time they were played (`UTCDate` and `UTCTime` when there, else `Date`); games of + * the same time keep the newer place in the file first. For downloaded databases, + * where both sites' games are appended oldest first. + */ + func newestFirst(indices: [UInt32]) -> [UInt32] + + /** + * Remarks about the conversion, one line each. + */ + func notes() -> [String] + + /** + * The game `index` as PGN text, as it is in the file (to copy or share). + */ + func pgn(index: UInt32) -> String? + + /** + * The analysis of the game `index` (its report), with earlier results from the + * cache folder `cache_dir` ("" for none) or from `[%eval]` comments of the game. + */ + func review(index: UInt32, cacheDir: String) throws -> GameReview + + /** + * Up to `count` lines of the game list from `start` on. + */ + func rows(start: UInt32, count: UInt32) -> [GameRow] + + /** + * The rows of these games (from [`Database::find`]), in this order. + */ + func rowsOf(indices: [UInt32]) -> [GameRow] + + /** + * The game `index`, to change (moves, variations, its data) and save. + */ + func session(index: UInt32) throws -> GameSession + + /** + * Starts preparation for an exact player and colour at `query_fen` (empty means + * the usual initial position). Only the first main-line occurrence in each game + * counts; transpositions count and variations in the database do not. The thread + * is bounded to one active request per database: a new request cancels the old one. + */ + func preparePosition(playerId: UInt32, white: Bool, queryFen: String) throws -> PrepSearch + + /** + * Exact-name suggestions, `count` at most 200. An empty query lists all named + * players alphabetically; a non-empty one keeps the catalogue's prefix/games order. + */ + func suggestPlayers(query: String, start: UInt32, count: UInt32) -> PlayerSuggestions + +} +/** + * An open database. + */ +open class Database: DatabaseProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_database(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_database(handle, $0) } + } + + + + + /** + * The numbers of the games whose players, event, site, date or opening code (ECO) + * contain every word of `text` (case does not matter); all games for an empty text. + */ +open func find(text: String) -> [UInt32] { + return try! FfiConverterSequenceUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_find( + self.uniffiCloneHandle(), + FfiConverterString.lower(text),uniffiCallStatus + ) +}) +} + + /** + * What the database was read from ("PGN", "ChessBase", "zip", …). + */ +open func format() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_format( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The game `index`, ready to show. + */ +open func game(index: UInt32)throws -> GameData { + return try FfiConverterTypeGameData_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_game( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(index),uniffiCallStatus + ) +}) +} + +open func isEmpty() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_is_empty( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The number of games. + */ +open func len() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_len( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * These games (from [`Database::find`]) from the most recent to the oldest, by the + * time they were played (`UTCDate` and `UTCTime` when there, else `Date`); games of + * the same time keep the newer place in the file first. For downloaded databases, + * where both sites' games are appended oldest first. + */ +open func newestFirst(indices: [UInt32]) -> [UInt32] { + return try! FfiConverterSequenceUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_newest_first( + self.uniffiCloneHandle(), + FfiConverterSequenceUInt32.lower(indices),uniffiCallStatus + ) +}) +} + + /** + * Remarks about the conversion, one line each. + */ +open func notes() -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_notes( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The game `index` as PGN text, as it is in the file (to copy or share). + */ +open func pgn(index: UInt32) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_pgn( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(index),uniffiCallStatus + ) +}) +} + + /** + * The analysis of the game `index` (its report), with earlier results from the + * cache folder `cache_dir` ("" for none) or from `[%eval]` comments of the game. + */ +open func review(index: UInt32, cacheDir: String)throws -> GameReview { + return try FfiConverterTypeGameReview_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_review( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(index), + FfiConverterString.lower(cacheDir),uniffiCallStatus + ) +}) +} + + /** + * Up to `count` lines of the game list from `start` on. + */ +open func rows(start: UInt32, count: UInt32) -> [GameRow] { + return try! FfiConverterSequenceTypeGameRow.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_rows( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(start), + FfiConverterUInt32.lower(count),uniffiCallStatus + ) +}) +} + + /** + * The rows of these games (from [`Database::find`]), in this order. + */ +open func rowsOf(indices: [UInt32]) -> [GameRow] { + return try! FfiConverterSequenceTypeGameRow.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_rows_of( + self.uniffiCloneHandle(), + FfiConverterSequenceUInt32.lower(indices),uniffiCallStatus + ) +}) +} + + /** + * The game `index`, to change (moves, variations, its data) and save. + */ +open func session(index: UInt32)throws -> GameSession { + return try FfiConverterTypeGameSession_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_session( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(index),uniffiCallStatus + ) +}) +} + + /** + * Starts preparation for an exact player and colour at `query_fen` (empty means + * the usual initial position). Only the first main-line occurrence in each game + * counts; transpositions count and variations in the database do not. The thread + * is bounded to one active request per database: a new request cancels the old one. + */ +open func preparePosition(playerId: UInt32, white: Bool, queryFen: String)throws -> PrepSearch { + return try FfiConverterTypePrepSearch_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_prepare_position( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(playerId), + FfiConverterBool.lower(white), + FfiConverterString.lower(queryFen),uniffiCallStatus + ) +}) +} + + /** + * Exact-name suggestions, `count` at most 200. An empty query lists all named + * players alphabetically; a non-empty one keeps the catalogue's prefix/games order. + */ +open func suggestPlayers(query: String, start: UInt32, count: UInt32) -> PlayerSuggestions { + return try! FfiConverterTypePlayerSuggestions_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_database_suggest_players( + self.uniffiCloneHandle(), + FfiConverterString.lower(query), + FfiConverterUInt32.lower(start), + FfiConverterUInt32.lower(count),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeDatabase: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = Database + + public static func lift(_ handle: UInt64) throws -> Database { + return Database(unsafeFromHandle: handle) + } + + public static func lower(_ value: Database) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Database { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: Database, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeDatabase_lift(_ handle: UInt64) throws -> Database { + return try FfiConverterTypeDatabase.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeDatabase_lower(_ value: Database) -> UInt64 { + return FfiConverterTypeDatabase.lower(value) +} + + + + + + +/** + * The analysis of one game. + */ +public protocol GameReviewProtocol: AnyObject, Sendable { + + /** + * Stops the engine; what it has evaluated is kept (and cached). + */ + func cancel() + + /** + * Starts the engine at `path` (with its network `eval_file`, if not empty) on the + * positions without an evaluation, or on all of them when `full` (or when the + * analysis is stale). The search is the fixed one of every game analysis, the same + * as on the desktop. Returns false when there is nothing to analyse. Returns at + * once: the engine starts on its own thread. + */ + func start(path: String, evalFile: String, full: Bool) -> Bool + + /** + * The state now, with what the engine has said since the last call. + */ + func state() -> ReviewState + +} +/** + * The analysis of one game. + */ +open class GameReview: GameReviewProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_gamereview(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_gamereview(handle, $0) } + } + + + + + /** + * Stops the engine; what it has evaluated is kept (and cached). + */ +open func cancel() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamereview_cancel( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + /** + * Starts the engine at `path` (with its network `eval_file`, if not empty) on the + * positions without an evaluation, or on all of them when `full` (or when the + * analysis is stale). The search is the fixed one of every game analysis, the same + * as on the desktop. Returns false when there is nothing to analyse. Returns at + * once: the engine starts on its own thread. + */ +open func start(path: String, evalFile: String, full: Bool) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamereview_start( + self.uniffiCloneHandle(), + FfiConverterString.lower(path), + FfiConverterString.lower(evalFile), + FfiConverterBool.lower(full),uniffiCallStatus + ) +}) +} + + /** + * The state now, with what the engine has said since the last call. + */ +open func state() -> ReviewState { + return try! FfiConverterTypeReviewState_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamereview_state( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGameReview: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = GameReview + + public static func lift(_ handle: UInt64) throws -> GameReview { + return GameReview(unsafeFromHandle: handle) + } + + public static func lower(_ value: GameReview) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GameReview { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: GameReview, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameReview_lift(_ handle: UInt64) throws -> GameReview { + return try FfiConverterTypeGameReview.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameReview_lower(_ value: GameReview) -> UInt64 { + return FfiConverterTypeGameReview.lower(value) +} + + + + + + +/** + * A game that can be changed. + */ +public protocol GameSessionProtocol: AnyObject, Sendable { + + /** + * How the game stands at the move at place `at` (its line from the start counts + * for repetitions); none while it goes on. + */ + func ending(at: UInt32) -> GameEnding? + + /** + * Adds `text` to the comments after the move at place `at` (its symbols kept). + */ + func addComment(at: UInt32, text: String) throws -> Edited + + /** + * Adds a line of moves (an engine's) from place `at`, as `play` does each move. + */ + func addLine(at: UInt32, uci: [String]) throws -> Edited + + func canRedo() -> Bool + + func canUndo() -> Bool + + /** + * The whole game, ready to show. + */ + func data() -> GameData + + /** + * Removes the move at place `at` with all that follows it; shows its parent. + */ + func deleteFrom(at: UInt32) throws -> Edited + + /** + * Changed since it was opened or last saved. + */ + func isModified() -> Bool + + /** + * The legal moves in the position at place `at`, in UCI ("e2e4", "e7e8q"); none + * after a null move's position cannot go on, at checkmate or stalemate. + */ + func legalMoves(at: UInt32) -> [String] + + /** + * Makes the line of the move at place `at` the main one at its branch. + */ + func makeMain(at: UInt32) throws -> Edited + + func markSaved() + + /** + * The game as PGN, for saving or sharing. + */ + func pgn() -> String + + /** + * Plays `uci` from the node at place `at`: the existing continuation when there is + * one (nothing changes), else a new move — the main line where the line ends, a + * variation elsewhere. One undo step. + */ + func play(at: UInt32, uci: String) throws -> Edited + + /** + * A new game of the moves from the start to the move at place `at` (to play on from + * there, android-play.md §31.6): the same start position, no tags but those of the + * position. Refused on a null move on the way (a position the board cannot reach). + */ + func playFrom(at: UInt32) throws -> GameSession + + func redo() -> Edited? + + /** + * The analysis of the game as it is now (its report), with earlier results from + * the cache folder `cache_dir` ("" for none). + */ + func review(cacheDir: String) -> GameReview + + /** + * Sets the game's tags (an empty value removes the tag; one of the Seven Tag Roster + * becomes "?") and its result ("1-0", "0-1", "1/2-1/2", "*"). + */ + func setData(tags: [Tag], result: String) + + /** + * Takes the last change back; `None` when there is none. + */ + func undo() -> Edited? + + /** + * A training of the line from the start to the move at place `at` (none: no move + * there, or a null move on the way). + */ + func trainer(at: UInt32) -> Trainer? + + /** + * How many times the line up to the move at place `at` was trained. + */ + func trainingRuns(at: UInt32) -> UInt32? + +} +/** + * A game that can be changed. + */ +open class GameSession: GameSessionProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_gamesession(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_gamesession(handle, $0) } + } + + + /** + * The first game of a PGN text. + */ +public static func fromPgn(pgn: String)throws -> GameSession { + return try FfiConverterTypeGameSession_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_gamesession_from_pgn( + FfiConverterString.lower(pgn),uniffiCallStatus + ) +}) +} + + /** + * A new game from the start position, dated today (`date`: "2026.10.26"). + */ +public static func newGame(date: String) -> GameSession { + return try! FfiConverterTypeGameSession_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_gamesession_new_game( + FfiConverterString.lower(date),uniffiCallStatus + ) +}) +} + + + + /** + * How the game stands at the move at place `at` (its line from the start counts + * for repetitions); none while it goes on. + */ +open func ending(at: UInt32) -> GameEnding? { + return try! FfiConverterOptionTypeGameEnding.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_ending( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + + /** + * Adds `text` to the comments after the move at place `at` (its symbols kept). + */ +open func addComment(at: UInt32, text: String)throws -> Edited { + return try FfiConverterTypeEdited_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_add_comment( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at), + FfiConverterString.lower(text),uniffiCallStatus + ) +}) +} + + /** + * Adds a line of moves (an engine's) from place `at`, as `play` does each move. + */ +open func addLine(at: UInt32, uci: [String])throws -> Edited { + return try FfiConverterTypeEdited_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_add_line( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at), + FfiConverterSequenceString.lower(uci),uniffiCallStatus + ) +}) +} + +open func canRedo() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_can_redo( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + +open func canUndo() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_can_undo( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The whole game, ready to show. + */ +open func data() -> GameData { + return try! FfiConverterTypeGameData_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_data( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * Removes the move at place `at` with all that follows it; shows its parent. + */ +open func deleteFrom(at: UInt32)throws -> Edited { + return try FfiConverterTypeEdited_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_delete_from( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + + /** + * Changed since it was opened or last saved. + */ +open func isModified() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_is_modified( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The legal moves in the position at place `at`, in UCI ("e2e4", "e7e8q"); none + * after a null move's position cannot go on, at checkmate or stalemate. + */ +open func legalMoves(at: UInt32) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_legal_moves( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + + /** + * Makes the line of the move at place `at` the main one at its branch. + */ +open func makeMain(at: UInt32)throws -> Edited { + return try FfiConverterTypeEdited_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_make_main( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + +open func markSaved() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_mark_saved( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + /** + * The game as PGN, for saving or sharing. + */ +open func pgn() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_pgn( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * Plays `uci` from the node at place `at`: the existing continuation when there is + * one (nothing changes), else a new move — the main line where the line ends, a + * variation elsewhere. One undo step. + */ +open func play(at: UInt32, uci: String)throws -> Edited { + return try FfiConverterTypeEdited_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_play( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at), + FfiConverterString.lower(uci),uniffiCallStatus + ) +}) +} + + /** + * A new game of the moves from the start to the move at place `at` (to play on from + * there, android-play.md §31.6): the same start position, no tags but those of the + * position. Refused on a null move on the way (a position the board cannot reach). + */ +open func playFrom(at: UInt32)throws -> GameSession { + return try FfiConverterTypeGameSession_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_play_from( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + +open func redo() -> Edited? { + return try! FfiConverterOptionTypeEdited.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_redo( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The analysis of the game as it is now (its report), with earlier results from + * the cache folder `cache_dir` ("" for none). + */ +open func review(cacheDir: String) -> GameReview { + return try! FfiConverterTypeGameReview_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_review( + self.uniffiCloneHandle(), + FfiConverterString.lower(cacheDir),uniffiCallStatus + ) +}) +} + + /** + * Sets the game's tags (an empty value removes the tag; one of the Seven Tag Roster + * becomes "?") and its result ("1-0", "0-1", "1/2-1/2", "*"). + */ +open func setData(tags: [Tag], result: String) {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_set_data( + self.uniffiCloneHandle(), + FfiConverterSequenceTypeTag.lower(tags), + FfiConverterString.lower(result),uniffiCallStatus + ) +} +} + + /** + * Takes the last change back; `None` when there is none. + */ +open func undo() -> Edited? { + return try! FfiConverterOptionTypeEdited.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_undo( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * A training of the line from the start to the move at place `at` (none: no move + * there, or a null move on the way). + */ +open func trainer(at: UInt32) -> Trainer? { + return try! FfiConverterOptionTypeTrainer.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_trainer( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + + /** + * How many times the line up to the move at place `at` was trained. + */ +open func trainingRuns(at: UInt32) -> UInt32? { + return try! FfiConverterOptionUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_gamesession_training_runs( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGameSession: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = GameSession + + public static func lift(_ handle: UInt64) throws -> GameSession { + return GameSession(unsafeFromHandle: handle) + } + + public static func lower(_ value: GameSession) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GameSession { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: GameSession, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameSession_lift(_ handle: UInt64) throws -> GameSession { + return try FfiConverterTypeGameSession.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameSession_lower(_ value: GameSession) -> UInt64 { + return FfiConverterTypeGameSession.lower(value) +} + + + + + + +/** + * Maia, loaded once for a game. + */ +public protocol MaiaPlayerProtocol: AnyObject, Sendable { + + /** + * Maia's move (UCI) in the position at place `at` of the game, playing at + * `strength` against a player rated `opponent` (her own strength when unknown). + * `random` is in [0, 1). None when the game is over there. + */ + func choose(game: GameSession, at: UInt32, strength: UInt32, opponent: UInt32?, random: Float) -> String? + +} +/** + * Maia, loaded once for a game. + */ +open class MaiaPlayer: MaiaPlayerProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_maiaplayer(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_maiaplayer(handle, $0) } + } + + + /** + * Reads the weights (`maia3-5m.pt`). + */ +public static func load(path: String)throws -> MaiaPlayer { + return try FfiConverterTypeMaiaPlayer_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_maiaplayer_load( + FfiConverterString.lower(path),uniffiCallStatus + ) +}) +} + + + + /** + * Maia's move (UCI) in the position at place `at` of the game, playing at + * `strength` against a player rated `opponent` (her own strength when unknown). + * `random` is in [0, 1). None when the game is over there. + */ +open func choose(game: GameSession, at: UInt32, strength: UInt32, opponent: UInt32?, random: Float) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_maiaplayer_choose( + self.uniffiCloneHandle(), + FfiConverterTypeGameSession_lower(game), + FfiConverterUInt32.lower(at), + FfiConverterUInt32.lower(strength), + FfiConverterOptionUInt32.lower(opponent), + FfiConverterFloat.lower(random),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMaiaPlayer: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = MaiaPlayer + + public static func lift(_ handle: UInt64) throws -> MaiaPlayer { + return MaiaPlayer(unsafeFromHandle: handle) + } + + public static func lower(_ value: MaiaPlayer) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MaiaPlayer { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: MaiaPlayer, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMaiaPlayer_lift(_ handle: UInt64) throws -> MaiaPlayer { + return try FfiConverterTypeMaiaPlayer.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMaiaPlayer_lower(_ value: MaiaPlayer) -> UInt64 { + return FfiConverterTypeMaiaPlayer.lower(value) +} + + + + + + +/** + * A download of accounts into one database. + */ +public protocol OnlineDownloadProtocol: AnyObject, Sendable { + + /** + * Stops it soon; what was fetched is kept. + */ + func cancel() + + func state() -> DownloadState + +} +/** + * A download of accounts into one database. + */ +open class OnlineDownload: OnlineDownloadProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_onlinedownload(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_onlinedownload(handle, $0) } + } + + + /** + * Starts fetching the games of `accounts` new since the last time into the database + * at `path` (created when it is not there). Returns at once. + */ +public static func start(accounts: [OnlineAccount], path: String) -> OnlineDownload { + return try! FfiConverterTypeOnlineDownload_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_onlinedownload_start( + FfiConverterSequenceTypeOnlineAccount.lower(accounts), + FfiConverterString.lower(path),uniffiCallStatus + ) +}) +} + + + + /** + * Stops it soon; what was fetched is kept. + */ +open func cancel() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_onlinedownload_cancel( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + +open func state() -> DownloadState { + return try! FfiConverterTypeDownloadState_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_onlinedownload_state( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeOnlineDownload: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = OnlineDownload + + public static func lift(_ handle: UInt64) throws -> OnlineDownload { + return OnlineDownload(unsafeFromHandle: handle) + } + + public static func lower(_ value: OnlineDownload) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnlineDownload { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: OnlineDownload, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineDownload_lift(_ handle: UInt64) throws -> OnlineDownload { + return try FfiConverterTypeOnlineDownload.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineDownload_lower(_ value: OnlineDownload) -> UInt64 { + return FfiConverterTypeOnlineDownload.lower(value) +} + + + + + + +/** + * One running or finished position search. Dropping it requests cancellation. + */ +public protocol PrepSearchProtocol: AnyObject, Sendable { + + /** + * Stops soon; an old worker cannot publish its result afterwards. + */ + func cancel() + + func state() -> PrepState + +} +/** + * One running or finished position search. Dropping it requests cancellation. + */ +open class PrepSearch: PrepSearchProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_prepsearch(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_prepsearch(handle, $0) } + } + + + + + /** + * Stops soon; an old worker cannot publish its result afterwards. + */ +open func cancel() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_prepsearch_cancel( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + +open func state() -> PrepState { + return try! FfiConverterTypePrepState_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_prepsearch_state( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePrepSearch: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = PrepSearch + + public static func lift(_ handle: UInt64) throws -> PrepSearch { + return PrepSearch(unsafeFromHandle: handle) + } + + public static func lower(_ value: PrepSearch) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepSearch { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: PrepSearch, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepSearch_lift(_ handle: UInt64) throws -> PrepSearch { + return try FfiConverterTypePrepSearch.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepSearch_lower(_ value: PrepSearch) -> UInt64 { + return FfiConverterTypePrepSearch.lower(value) +} + + + + + + +/** + * Stockfish judging the positions where Maia is to move (unseen by the user), for her + * resignation; one for the whole game. + */ +public protocol ResignJudgeProtocol: AnyObject, Sendable { + + /** + * Judges the position at place `at` of the game (Maia to move there). + */ + func ask(game: GameSession, at: UInt32) + + /** + * Drops the request in flight (its position is gone). + */ + func forget() + + /** + * Moves were taken back: the scores of Maia's turns gone are forgotten. + */ + func forgetScores() + + /** + * Whether the position asked last is hopeless for Maia, once the answer came. + */ + func hopeless() -> Bool? + + /** + * A draw may be offered now (not right after a refusal). + */ + func mayOfferDraw() -> Bool + + /** + * The user offers a draw: whether Maia accepts (the shared rule, `play::accepts_draw`). + */ + func offerDraw() -> Bool + +} +/** + * Stockfish judging the positions where Maia is to move (unseen by the user), for her + * resignation; one for the whole game. + */ +open class ResignJudge: ResignJudgeProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_resignjudge(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_resignjudge(handle, $0) } + } + + + /** + * The engine at `path` with its network `eval_file`. + */ +public static func start(path: String, evalFile: String) -> ResignJudge { + return try! FfiConverterTypeResignJudge_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_resignjudge_start( + FfiConverterString.lower(path), + FfiConverterString.lower(evalFile),uniffiCallStatus + ) +}) +} + + + + /** + * Judges the position at place `at` of the game (Maia to move there). + */ +open func ask(game: GameSession, at: UInt32) {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_resignjudge_ask( + self.uniffiCloneHandle(), + FfiConverterTypeGameSession_lower(game), + FfiConverterUInt32.lower(at),uniffiCallStatus + ) +} +} + + /** + * Drops the request in flight (its position is gone). + */ +open func forget() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_resignjudge_forget( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + /** + * Moves were taken back: the scores of Maia's turns gone are forgotten. + */ +open func forgetScores() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_resignjudge_forget_scores( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + /** + * Whether the position asked last is hopeless for Maia, once the answer came. + */ +open func hopeless() -> Bool? { + return try! FfiConverterOptionBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_resignjudge_hopeless( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * A draw may be offered now (not right after a refusal). + */ +open func mayOfferDraw() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_resignjudge_may_offer_draw( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The user offers a draw: whether Maia accepts (the shared rule, `play::accepts_draw`). + */ +open func offerDraw() -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_resignjudge_offer_draw( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeResignJudge: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = ResignJudge + + public static func lift(_ handle: UInt64) throws -> ResignJudge { + return ResignJudge(unsafeFromHandle: handle) + } + + public static func lower(_ value: ResignJudge) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ResignJudge { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: ResignJudge, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeResignJudge_lift(_ handle: UInt64) throws -> ResignJudge { + return try FfiConverterTypeResignJudge.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeResignJudge_lower(_ value: ResignJudge) -> UInt64 { + return FfiConverterTypeResignJudge.lower(value) +} + + + + + + +/** + * Rodent IV playing one game (a UCI child process, the shared crate's player). + */ +public protocol RodentPlayerProtocol: AnyObject, Sendable { + + /** + * Rodent's move (UCI) in the position at place `at` of the game, given after + * `pause_ms` (it thinks meanwhile). Blocks: called off the main thread. None when + * the game is over there, a newer request or `forget` passed it over, or Rodent + * failed. + */ + func choose(game: GameSession, at: UInt32, pauseMs: UInt64) -> String? + + /** + * Why Rodent does not play, if it does not. + */ + func failure() -> RodentFailure? + + /** + * Drops the request in flight (its position is gone): its `choose` returns none. + */ + func forget() + +} +/** + * Rodent IV playing one game (a UCI child process, the shared crate's player). + */ +open class RodentPlayer: RodentPlayerProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_rodentplayer(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_rodentplayer(handle, $0) } + } + + + /** + * The engine at `exe` with its personalities and books in `home`, playing + * `style_id` at `strength` (its UCI_Elo), with its opening book when `use_book`. + * It starts in the background: a failure is told by [`RodentPlayer::failure`]. + */ +public static func start(exe: String, home: String, styleId: String, strength: UInt32, useBook: Bool) -> RodentPlayer { + return try! FfiConverterTypeRodentPlayer_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_constructor_rodentplayer_start( + FfiConverterString.lower(exe), + FfiConverterString.lower(home), + FfiConverterString.lower(styleId), + FfiConverterUInt32.lower(strength), + FfiConverterBool.lower(useBook),uniffiCallStatus + ) +}) +} + + + + /** + * Rodent's move (UCI) in the position at place `at` of the game, given after + * `pause_ms` (it thinks meanwhile). Blocks: called off the main thread. None when + * the game is over there, a newer request or `forget` passed it over, or Rodent + * failed. + */ +open func choose(game: GameSession, at: UInt32, pauseMs: UInt64) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_rodentplayer_choose( + self.uniffiCloneHandle(), + FfiConverterTypeGameSession_lower(game), + FfiConverterUInt32.lower(at), + FfiConverterUInt64.lower(pauseMs),uniffiCallStatus + ) +}) +} + + /** + * Why Rodent does not play, if it does not. + */ +open func failure() -> RodentFailure? { + return try! FfiConverterOptionTypeRodentFailure.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_rodentplayer_failure( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * Drops the request in flight (its position is gone): its `choose` returns none. + */ +open func forget() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_rodentplayer_forget( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeRodentPlayer: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = RodentPlayer + + public static func lift(_ handle: UInt64) throws -> RodentPlayer { + return RodentPlayer(unsafeFromHandle: handle) + } + + public static func lower(_ value: RodentPlayer) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RodentPlayer { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: RodentPlayer, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentPlayer_lift(_ handle: UInt64) throws -> RodentPlayer { + return try FfiConverterTypeRodentPlayer.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentPlayer_lower(_ value: RodentPlayer) -> UInt64 { + return FfiConverterTypeRodentPlayer.lower(value) +} + + + + + + +/** + * A training of one line. + */ +public protocol TrainerProtocol: AnyObject, Sendable { + + /** + * The same line again from the start. + */ + func again() + + /** + * «Wijk aan Zee 2024», when the game says so. + */ + func event() -> String? + + /** + * The position after a wrong `uci` made after `ply` half-moves (shown a moment). + */ + func fenAfter(ply: UInt32, uci: String) -> String? + + /** + * «Carlsen — Caruana», when the game names its players. + */ + func game() -> String? + + /** + * Judges `uci` made after `ply` half-moves. + */ + func judge(ply: UInt32, uci: String) -> TrainVerdict + + /** + * The legal moves after `ply` half-moves (UCI). + */ + func legalMoves(ply: UInt32) -> [String] + + /** + * The line's move on half-move `ply` in UCI: its piece where a pawn promotes (the + * phone promotes to a queen otherwise, android-play.md §29.4). + */ + func promotionAt(ply: UInt32) -> String? + + /** + * Shows the move of half-move `ply` (the run is then «with a hint»). + */ + func show(ply: UInt32) + + /** + * The run after `ply` half-moves. + */ + func state(ply: UInt32) -> TrainState + + /** + * The line's last move («12…Rd8», SAN in Latin letters). + */ + func upTo() -> String + +} +/** + * A training of one line. + */ +open class Trainer: TrainerProtocol, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_mobile_api_fn_clone_trainer(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_mobile_api_fn_free_trainer(handle, $0) } + } + + + + + /** + * The same line again from the start. + */ +open func again() {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_again( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + /** + * «Wijk aan Zee 2024», when the game says so. + */ +open func event() -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_event( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * The position after a wrong `uci` made after `ply` half-moves (shown a moment). + */ +open func fenAfter(ply: UInt32, uci: String) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_fen_after( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(ply), + FfiConverterString.lower(uci),uniffiCallStatus + ) +}) +} + + /** + * «Carlsen — Caruana», when the game names its players. + */ +open func game() -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_game( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + /** + * Judges `uci` made after `ply` half-moves. + */ +open func judge(ply: UInt32, uci: String) -> TrainVerdict { + return try! FfiConverterTypeTrainVerdict_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_judge( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(ply), + FfiConverterString.lower(uci),uniffiCallStatus + ) +}) +} + + /** + * The legal moves after `ply` half-moves (UCI). + */ +open func legalMoves(ply: UInt32) -> [String] { + return try! FfiConverterSequenceString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_legal_moves( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(ply),uniffiCallStatus + ) +}) +} + + /** + * The line's move on half-move `ply` in UCI: its piece where a pawn promotes (the + * phone promotes to a queen otherwise, android-play.md §29.4). + */ +open func promotionAt(ply: UInt32) -> String? { + return try! FfiConverterOptionString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_promotion_at( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(ply),uniffiCallStatus + ) +}) +} + + /** + * Shows the move of half-move `ply` (the run is then «with a hint»). + */ +open func show(ply: UInt32) {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_show( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(ply),uniffiCallStatus + ) +} +} + + /** + * The run after `ply` half-moves. + */ +open func state(ply: UInt32) -> TrainState { + return try! FfiConverterTypeTrainState_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_state( + self.uniffiCloneHandle(), + FfiConverterUInt32.lower(ply),uniffiCallStatus + ) +}) +} + + /** + * The line's last move («12…Rd8», SAN in Latin letters). + */ +open func upTo() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_method_trainer_up_to( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + + +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeTrainer: FfiConverter { + typealias FfiType = UInt64 + typealias SwiftType = Trainer + + public static func lift(_ handle: UInt64) throws -> Trainer { + return Trainer(unsafeFromHandle: handle) + } + + public static func lower(_ value: Trainer) -> UInt64 { + return value.uniffiCloneHandle() + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Trainer { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: Trainer, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainer_lift(_ handle: UInt64) throws -> Trainer { + return try FfiConverterTypeTrainer.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainer_lower(_ value: Trainer) -> UInt64 { + return FfiConverterTypeTrainer.lower(value) +} + + + + +/** + * What the engine says about the position of `search`. + */ +public struct Analysis: Equatable, Hashable { + public var search: UInt64 + public var depth: UInt32 + public var nodesPerSecond: UInt64 + /** + * Ordered by `multipv`. + */ + public var lines: [EngineLine] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(search: UInt64, depth: UInt32, nodesPerSecond: UInt64, + /** + * Ordered by `multipv`. + */lines: [EngineLine]) { + self.search = search + self.depth = depth + self.nodesPerSecond = nodesPerSecond + self.lines = lines + } + + + + +} + +#if compiler(>=6) +extension Analysis: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeAnalysis: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Analysis { + return + try Analysis( + search: FfiConverterUInt64.read(from: &buf), + depth: FfiConverterUInt32.read(from: &buf), + nodesPerSecond: FfiConverterUInt64.read(from: &buf), + lines: FfiConverterSequenceTypeEngineLine.read(from: &buf) + ) + } + + public static func write(_ value: Analysis, into buf: inout [UInt8]) { + FfiConverterUInt64.write(value.search, into: &buf) + FfiConverterUInt32.write(value.depth, into: &buf) + FfiConverterUInt64.write(value.nodesPerSecond, into: &buf) + FfiConverterSequenceTypeEngineLine.write(value.lines, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAnalysis_lift(_ buf: RustBuffer) throws -> Analysis { + return try FfiConverterTypeAnalysis.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAnalysis_lower(_ value: Analysis) -> RustBuffer { + return FfiConverterTypeAnalysis.lower(value) +} + + +/** + * An APK of a release. + */ +public struct ApkFile: Equatable, Hashable { + public var name: String + public var url: String + public var size: UInt64 + /** + * From the release's `SHA256SUMS.txt`, lowercase hex. + */ + public var sha256: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(name: String, url: String, size: UInt64, + /** + * From the release's `SHA256SUMS.txt`, lowercase hex. + */sha256: String) { + self.name = name + self.url = url + self.size = size + self.sha256 = sha256 + } + + + + +} + +#if compiler(>=6) +extension ApkFile: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeApkFile: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ApkFile { + return + try ApkFile( + name: FfiConverterString.read(from: &buf), + url: FfiConverterString.read(from: &buf), + size: FfiConverterUInt64.read(from: &buf), + sha256: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: ApkFile, into buf: inout [UInt8]) { + FfiConverterString.write(value.name, into: &buf) + FfiConverterString.write(value.url, into: &buf) + FfiConverterUInt64.write(value.size, into: &buf) + FfiConverterString.write(value.sha256, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeApkFile_lift(_ buf: RustBuffer) throws -> ApkFile { + return try FfiConverterTypeApkFile.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeApkFile_lower(_ value: ApkFile) -> RustBuffer { + return FfiConverterTypeApkFile.lower(value) +} + + +/** + * A release newer than this app. + */ +public struct AppRelease: Equatable, Hashable { + public var version: String + /** + * Its page: what is new in it. + */ + public var page: String + /** + * The build without the engine's network (the network already in the app stays). + */ + public var light: ApkFile? + /** + * The build with the network inside. + */ + public var full: ApkFile? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(version: String, + /** + * Its page: what is new in it. + */page: String, + /** + * The build without the engine's network (the network already in the app stays). + */light: ApkFile?, + /** + * The build with the network inside. + */full: ApkFile?) { + self.version = version + self.page = page + self.light = light + self.full = full + } + + + + +} + +#if compiler(>=6) +extension AppRelease: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeAppRelease: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppRelease { + return + try AppRelease( + version: FfiConverterString.read(from: &buf), + page: FfiConverterString.read(from: &buf), + light: FfiConverterOptionTypeApkFile.read(from: &buf), + full: FfiConverterOptionTypeApkFile.read(from: &buf) + ) + } + + public static func write(_ value: AppRelease, into buf: inout [UInt8]) { + FfiConverterString.write(value.version, into: &buf) + FfiConverterString.write(value.page, into: &buf) + FfiConverterOptionTypeApkFile.write(value.light, into: &buf) + FfiConverterOptionTypeApkFile.write(value.full, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAppRelease_lift(_ buf: RustBuffer) throws -> AppRelease { + return try FfiConverterTypeAppRelease.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAppRelease_lower(_ value: AppRelease) -> RustBuffer { + return FfiConverterTypeAppRelease.lower(value) +} + + +/** + * How a download stands. + */ +public struct DownloadState: Equatable, Hashable { + public var running: Bool + /** + * The account being fetched (an index into the download's accounts). + */ + public var account: UInt32 + /** + * Games of that account so far. + */ + public var accountGames: UInt64 + /** + * Games added by this download so far. + */ + public var added: UInt64 + /** + * Chess.com: months done of all. + */ + public var monthsDone: UInt32 + public var monthsTotal: UInt32 + /** + * When it has ended: the games added and in the database now; stopped by the user. + */ + public var total: UInt64? + public var cancelled: Bool + public var failure: OnlineFailure? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(running: Bool, + /** + * The account being fetched (an index into the download's accounts). + */account: UInt32, + /** + * Games of that account so far. + */accountGames: UInt64, + /** + * Games added by this download so far. + */added: UInt64, + /** + * Chess.com: months done of all. + */monthsDone: UInt32, monthsTotal: UInt32, + /** + * When it has ended: the games added and in the database now; stopped by the user. + */total: UInt64?, cancelled: Bool, failure: OnlineFailure?) { + self.running = running + self.account = account + self.accountGames = accountGames + self.added = added + self.monthsDone = monthsDone + self.monthsTotal = monthsTotal + self.total = total + self.cancelled = cancelled + self.failure = failure + } + + + + +} + +#if compiler(>=6) +extension DownloadState: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeDownloadState: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DownloadState { + return + try DownloadState( + running: FfiConverterBool.read(from: &buf), + account: FfiConverterUInt32.read(from: &buf), + accountGames: FfiConverterUInt64.read(from: &buf), + added: FfiConverterUInt64.read(from: &buf), + monthsDone: FfiConverterUInt32.read(from: &buf), + monthsTotal: FfiConverterUInt32.read(from: &buf), + total: FfiConverterOptionUInt64.read(from: &buf), + cancelled: FfiConverterBool.read(from: &buf), + failure: FfiConverterOptionTypeOnlineFailure.read(from: &buf) + ) + } + + public static func write(_ value: DownloadState, into buf: inout [UInt8]) { + FfiConverterBool.write(value.running, into: &buf) + FfiConverterUInt32.write(value.account, into: &buf) + FfiConverterUInt64.write(value.accountGames, into: &buf) + FfiConverterUInt64.write(value.added, into: &buf) + FfiConverterUInt32.write(value.monthsDone, into: &buf) + FfiConverterUInt32.write(value.monthsTotal, into: &buf) + FfiConverterOptionUInt64.write(value.total, into: &buf) + FfiConverterBool.write(value.cancelled, into: &buf) + FfiConverterOptionTypeOnlineFailure.write(value.failure, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeDownloadState_lift(_ buf: RustBuffer) throws -> DownloadState { + return try FfiConverterTypeDownloadState.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeDownloadState_lower(_ value: DownloadState) -> RustBuffer { + return FfiConverterTypeDownloadState.lower(value) +} + + +/** + * A game after a change: all of it again (the ids are places in `data.nodes`, which a + * change may move) and the node to show. + */ +public struct Edited: Equatable, Hashable { + public var data: GameData + public var cursor: UInt32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(data: GameData, cursor: UInt32) { + self.data = data + self.cursor = cursor + } + + + + +} + +#if compiler(>=6) +extension Edited: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeEdited: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Edited { + return + try Edited( + data: FfiConverterTypeGameData.read(from: &buf), + cursor: FfiConverterUInt32.read(from: &buf) + ) + } + + public static func write(_ value: Edited, into buf: inout [UInt8]) { + FfiConverterTypeGameData.write(value.data, into: &buf) + FfiConverterUInt32.write(value.cursor, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeEdited_lift(_ buf: RustBuffer) throws -> Edited { + return try FfiConverterTypeEdited.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeEdited_lower(_ value: Edited) -> RustBuffer { + return FfiConverterTypeEdited.lower(value) +} + + +/** + * One line of the analysis, from White's point of view. + */ +public struct EngineLine: Equatable, Hashable { + /** + * 1 for the best line. + */ + public var multipv: UInt32 + /** + * "+0.45", "−1.20", "0.00", "#3" (White mates), "#−2" (Black mates). + */ + public var eval: String + /** + * Centipawns for White, when the score is not a mate. + */ + public var cp: Int32? + /** + * Moves to mate: positive when White mates, negative when Black mates. + */ + public var mate: Int32? + /** + * The line in SAN with move numbers: "14.Nd5 Bxd5 15.exd5". + */ + public var text: String + /** + * The squares of its first move, for an arrow on the board. + */ + public var fromSquare: String? + public var toSquare: String? + /** + * The line move by move, to show it on the board without touching the game. + */ + public var steps: [LineStep] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * 1 for the best line. + */multipv: UInt32, + /** + * "+0.45", "−1.20", "0.00", "#3" (White mates), "#−2" (Black mates). + */eval: String, + /** + * Centipawns for White, when the score is not a mate. + */cp: Int32?, + /** + * Moves to mate: positive when White mates, negative when Black mates. + */mate: Int32?, + /** + * The line in SAN with move numbers: "14.Nd5 Bxd5 15.exd5". + */text: String, + /** + * The squares of its first move, for an arrow on the board. + */fromSquare: String?, toSquare: String?, + /** + * The line move by move, to show it on the board without touching the game. + */steps: [LineStep]) { + self.multipv = multipv + self.eval = eval + self.cp = cp + self.mate = mate + self.text = text + self.fromSquare = fromSquare + self.toSquare = toSquare + self.steps = steps + } + + + + +} + +#if compiler(>=6) +extension EngineLine: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeEngineLine: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> EngineLine { + return + try EngineLine( + multipv: FfiConverterUInt32.read(from: &buf), + eval: FfiConverterString.read(from: &buf), + cp: FfiConverterOptionInt32.read(from: &buf), + mate: FfiConverterOptionInt32.read(from: &buf), + text: FfiConverterString.read(from: &buf), + fromSquare: FfiConverterOptionString.read(from: &buf), + toSquare: FfiConverterOptionString.read(from: &buf), + steps: FfiConverterSequenceTypeLineStep.read(from: &buf) + ) + } + + public static func write(_ value: EngineLine, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.multipv, into: &buf) + FfiConverterString.write(value.eval, into: &buf) + FfiConverterOptionInt32.write(value.cp, into: &buf) + FfiConverterOptionInt32.write(value.mate, into: &buf) + FfiConverterString.write(value.text, into: &buf) + FfiConverterOptionString.write(value.fromSquare, into: &buf) + FfiConverterOptionString.write(value.toSquare, into: &buf) + FfiConverterSequenceTypeLineStep.write(value.steps, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeEngineLine_lift(_ buf: RustBuffer) throws -> EngineLine { + return try FfiConverterTypeEngineLine.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeEngineLine_lower(_ value: EngineLine) -> RustBuffer { + return FfiConverterTypeEngineLine.lower(value) +} + + +/** + * A file of a ChessBase database folder: its name and descriptor (taken over). + */ +public struct FolderFile: Equatable, Hashable { + public var name: String + public var fd: Int32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(name: String, fd: Int32) { + self.name = name + self.fd = fd + } + + + + +} + +#if compiler(>=6) +extension FolderFile: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeFolderFile: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FolderFile { + return + try FolderFile( + name: FfiConverterString.read(from: &buf), + fd: FfiConverterInt32.read(from: &buf) + ) + } + + public static func write(_ value: FolderFile, into buf: inout [UInt8]) { + FfiConverterString.write(value.name, into: &buf) + FfiConverterInt32.write(value.fd, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFolderFile_lift(_ buf: RustBuffer) throws -> FolderFile { + return try FfiConverterTypeFolderFile.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeFolderFile_lower(_ value: FolderFile) -> RustBuffer { + return FfiConverterTypeFolderFile.lower(value) +} + + +/** + * A game ready to show. + */ +public struct GameData: Equatable, Hashable { + public var tags: [Tag] + public var result: String + /** + * Every node: `nodes[0]` is the root; a node's id is its place in this list. + */ + public var nodes: [MoveNode] + /** + * Problems found reading the game, one line each. + */ + public var notes: [String] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(tags: [Tag], result: String, + /** + * Every node: `nodes[0]` is the root; a node's id is its place in this list. + */nodes: [MoveNode], + /** + * Problems found reading the game, one line each. + */notes: [String]) { + self.tags = tags + self.result = result + self.nodes = nodes + self.notes = notes + } + + + + +} + +#if compiler(>=6) +extension GameData: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGameData: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GameData { + return + try GameData( + tags: FfiConverterSequenceTypeTag.read(from: &buf), + result: FfiConverterString.read(from: &buf), + nodes: FfiConverterSequenceTypeMoveNode.read(from: &buf), + notes: FfiConverterSequenceString.read(from: &buf) + ) + } + + public static func write(_ value: GameData, into buf: inout [UInt8]) { + FfiConverterSequenceTypeTag.write(value.tags, into: &buf) + FfiConverterString.write(value.result, into: &buf) + FfiConverterSequenceTypeMoveNode.write(value.nodes, into: &buf) + FfiConverterSequenceString.write(value.notes, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameData_lift(_ buf: RustBuffer) throws -> GameData { + return try FfiConverterTypeGameData.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameData_lower(_ value: GameData) -> RustBuffer { + return FfiConverterTypeGameData.lower(value) +} + + +/** + * One line of the game list. + */ +public struct GameRow: Equatable, Hashable { + /** + * The game's number in the database (0-based), for [`Database::game`]. + */ + public var index: UInt32 + public var white: String + public var black: String + /** + * "1-0", "0-1", "1/2-1/2" or "*". + */ + public var result: String + /** + * As in PGN: "1858.??.??". + */ + public var date: String + public var event: String + public var eco: String + public var whiteElo: String + public var blackElo: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * The game's number in the database (0-based), for [`Database::game`]. + */index: UInt32, white: String, black: String, + /** + * "1-0", "0-1", "1/2-1/2" or "*". + */result: String, + /** + * As in PGN: "1858.??.??". + */date: String, event: String, eco: String, whiteElo: String, blackElo: String) { + self.index = index + self.white = white + self.black = black + self.result = result + self.date = date + self.event = event + self.eco = eco + self.whiteElo = whiteElo + self.blackElo = blackElo + } + + + + +} + +#if compiler(>=6) +extension GameRow: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGameRow: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GameRow { + return + try GameRow( + index: FfiConverterUInt32.read(from: &buf), + white: FfiConverterString.read(from: &buf), + black: FfiConverterString.read(from: &buf), + result: FfiConverterString.read(from: &buf), + date: FfiConverterString.read(from: &buf), + event: FfiConverterString.read(from: &buf), + eco: FfiConverterString.read(from: &buf), + whiteElo: FfiConverterString.read(from: &buf), + blackElo: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: GameRow, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.index, into: &buf) + FfiConverterString.write(value.white, into: &buf) + FfiConverterString.write(value.black, into: &buf) + FfiConverterString.write(value.result, into: &buf) + FfiConverterString.write(value.date, into: &buf) + FfiConverterString.write(value.event, into: &buf) + FfiConverterString.write(value.eco, into: &buf) + FfiConverterString.write(value.whiteElo, into: &buf) + FfiConverterString.write(value.blackElo, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameRow_lift(_ buf: RustBuffer) throws -> GameRow { + return try FfiConverterTypeGameRow.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameRow_lower(_ value: GameRow) -> RustBuffer { + return FfiConverterTypeGameRow.lower(value) +} + + +/** + * A move of an engine line and the position after it. + */ +public struct LineStep: Equatable, Hashable { + /** + * "14.Nd5", "14…Bxd5". + */ + public var label: String + public var fen: String + public var fromSquare: String + public var toSquare: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * "14.Nd5", "14…Bxd5". + */label: String, fen: String, fromSquare: String, toSquare: String) { + self.label = label + self.fen = fen + self.fromSquare = fromSquare + self.toSquare = toSquare + } + + + + +} + +#if compiler(>=6) +extension LineStep: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeLineStep: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LineStep { + return + try LineStep( + label: FfiConverterString.read(from: &buf), + fen: FfiConverterString.read(from: &buf), + fromSquare: FfiConverterString.read(from: &buf), + toSquare: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: LineStep, into buf: inout [UInt8]) { + FfiConverterString.write(value.label, into: &buf) + FfiConverterString.write(value.fen, into: &buf) + FfiConverterString.write(value.fromSquare, into: &buf) + FfiConverterString.write(value.toSquare, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeLineStep_lift(_ buf: RustBuffer) throws -> LineStep { + return try FfiConverterTypeLineStep.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeLineStep_lower(_ value: LineStep) -> RustBuffer { + return FfiConverterTypeLineStep.lower(value) +} + + +/** + * An arrow (`to` set) or a marked square of a comment, in a comment color: + * 'R', 'G', 'B', 'Y' or another letter. + */ +public struct Mark: Equatable, Hashable { + public var color: String + public var from: String + public var to: String? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(color: String, from: String, to: String?) { + self.color = color + self.from = from + self.to = to + } + + + + +} + +#if compiler(>=6) +extension Mark: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMark: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Mark { + return + try Mark( + color: FfiConverterString.read(from: &buf), + from: FfiConverterString.read(from: &buf), + to: FfiConverterOptionString.read(from: &buf) + ) + } + + public static func write(_ value: Mark, into buf: inout [UInt8]) { + FfiConverterString.write(value.color, into: &buf) + FfiConverterString.write(value.from, into: &buf) + FfiConverterOptionString.write(value.to, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMark_lift(_ buf: RustBuffer) throws -> Mark { + return try FfiConverterTypeMark.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMark_lower(_ value: Mark) -> RustBuffer { + return FfiConverterTypeMark.lower(value) +} + + +/** + * A position in the game: the root (the start position) or the one after a move. + */ +public struct MoveNode: Equatable, Hashable { + /** + * The node's id (the root is 0); `children` and `parent` refer to these. + */ + public var id: UInt32 + public var parent: UInt32? + /** + * The moves from here: the main line first, then the variations. + */ + public var children: [UInt32] + /** + * SAN of the move that led here ("" for the root), always Latin letters. + */ + public var san: String + /** + * The move's number and side: 12 and true for "12.Nf3", 12 and false for "12…Nf6". + */ + public var moveNumber: UInt32 + public var white: Bool + /** + * Numeric annotation glyphs ($1 = "!") and their symbols ("!", "+-", …). + */ + public var nags: Data + public var nagSymbols: String + /** + * Comments as shown: board commands left out, lines reflowed. + */ + public var commentBefore: String + public var commentAfter: String + /** + * The position here, and the squares of the move that led to it (for highlighting). + */ + public var fen: String + public var fromSquare: String? + public var toSquare: String? + /** + * A null move ("--") of a study. + */ + public var nullMove: Bool + /** + * The move in UCI notation, for the engine's history; empty for the root and a + * null move (after which the engine gets the position as a FEN). + */ + public var uci: String + /** + * Arrows (`[%cal]`) and marked squares (`[%csl]`) of the comments after the move. + */ + public var marks: [Mark] + /** + * "checkmate" or "stalemate" when the game cannot go on from here; "" otherwise. + */ + public var end: String + /** + * On the main line of the game (not inside a variation). + */ + public var mainLine: Bool + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * The node's id (the root is 0); `children` and `parent` refer to these. + */id: UInt32, parent: UInt32?, + /** + * The moves from here: the main line first, then the variations. + */children: [UInt32], + /** + * SAN of the move that led here ("" for the root), always Latin letters. + */san: String, + /** + * The move's number and side: 12 and true for "12.Nf3", 12 and false for "12…Nf6". + */moveNumber: UInt32, white: Bool, + /** + * Numeric annotation glyphs ($1 = "!") and their symbols ("!", "+-", …). + */nags: Data, nagSymbols: String, + /** + * Comments as shown: board commands left out, lines reflowed. + */commentBefore: String, commentAfter: String, + /** + * The position here, and the squares of the move that led to it (for highlighting). + */fen: String, fromSquare: String?, toSquare: String?, + /** + * A null move ("--") of a study. + */nullMove: Bool, + /** + * The move in UCI notation, for the engine's history; empty for the root and a + * null move (after which the engine gets the position as a FEN). + */uci: String, + /** + * Arrows (`[%cal]`) and marked squares (`[%csl]`) of the comments after the move. + */marks: [Mark], + /** + * "checkmate" or "stalemate" when the game cannot go on from here; "" otherwise. + */end: String, + /** + * On the main line of the game (not inside a variation). + */mainLine: Bool) { + self.id = id + self.parent = parent + self.children = children + self.san = san + self.moveNumber = moveNumber + self.white = white + self.nags = nags + self.nagSymbols = nagSymbols + self.commentBefore = commentBefore + self.commentAfter = commentAfter + self.fen = fen + self.fromSquare = fromSquare + self.toSquare = toSquare + self.nullMove = nullMove + self.uci = uci + self.marks = marks + self.end = end + self.mainLine = mainLine + } + + + + +} + +#if compiler(>=6) +extension MoveNode: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMoveNode: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MoveNode { + return + try MoveNode( + id: FfiConverterUInt32.read(from: &buf), + parent: FfiConverterOptionUInt32.read(from: &buf), + children: FfiConverterSequenceUInt32.read(from: &buf), + san: FfiConverterString.read(from: &buf), + moveNumber: FfiConverterUInt32.read(from: &buf), + white: FfiConverterBool.read(from: &buf), + nags: FfiConverterData.read(from: &buf), + nagSymbols: FfiConverterString.read(from: &buf), + commentBefore: FfiConverterString.read(from: &buf), + commentAfter: FfiConverterString.read(from: &buf), + fen: FfiConverterString.read(from: &buf), + fromSquare: FfiConverterOptionString.read(from: &buf), + toSquare: FfiConverterOptionString.read(from: &buf), + nullMove: FfiConverterBool.read(from: &buf), + uci: FfiConverterString.read(from: &buf), + marks: FfiConverterSequenceTypeMark.read(from: &buf), + end: FfiConverterString.read(from: &buf), + mainLine: FfiConverterBool.read(from: &buf) + ) + } + + public static func write(_ value: MoveNode, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.id, into: &buf) + FfiConverterOptionUInt32.write(value.parent, into: &buf) + FfiConverterSequenceUInt32.write(value.children, into: &buf) + FfiConverterString.write(value.san, into: &buf) + FfiConverterUInt32.write(value.moveNumber, into: &buf) + FfiConverterBool.write(value.white, into: &buf) + FfiConverterData.write(value.nags, into: &buf) + FfiConverterString.write(value.nagSymbols, into: &buf) + FfiConverterString.write(value.commentBefore, into: &buf) + FfiConverterString.write(value.commentAfter, into: &buf) + FfiConverterString.write(value.fen, into: &buf) + FfiConverterOptionString.write(value.fromSquare, into: &buf) + FfiConverterOptionString.write(value.toSquare, into: &buf) + FfiConverterBool.write(value.nullMove, into: &buf) + FfiConverterString.write(value.uci, into: &buf) + FfiConverterSequenceTypeMark.write(value.marks, into: &buf) + FfiConverterString.write(value.end, into: &buf) + FfiConverterBool.write(value.mainLine, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMoveNode_lift(_ buf: RustBuffer) throws -> MoveNode { + return try FfiConverterTypeMoveNode.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMoveNode_lower(_ value: MoveNode) -> RustBuffer { + return FfiConverterTypeMoveNode.lower(value) +} + + +/** + * An account on a site. + */ +public struct OnlineAccount: Equatable, Hashable { + public var site: Site + /** + * As the site spells it. + */ + public var username: String + /** + * Lichess: the games of the account (of all kinds, so at most this many). + */ + public var games: UInt64? + /** + * Chess.com: the months with games. + */ + public var months: UInt32? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(site: Site, + /** + * As the site spells it. + */username: String, + /** + * Lichess: the games of the account (of all kinds, so at most this many). + */games: UInt64?, + /** + * Chess.com: the months with games. + */months: UInt32?) { + self.site = site + self.username = username + self.games = games + self.months = months + } + + + + +} + +#if compiler(>=6) +extension OnlineAccount: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeOnlineAccount: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnlineAccount { + return + try OnlineAccount( + site: FfiConverterTypeSite.read(from: &buf), + username: FfiConverterString.read(from: &buf), + games: FfiConverterOptionUInt64.read(from: &buf), + months: FfiConverterOptionUInt32.read(from: &buf) + ) + } + + public static func write(_ value: OnlineAccount, into buf: inout [UInt8]) { + FfiConverterTypeSite.write(value.site, into: &buf) + FfiConverterString.write(value.username, into: &buf) + FfiConverterOptionUInt64.write(value.games, into: &buf) + FfiConverterOptionUInt32.write(value.months, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineAccount_lift(_ buf: RustBuffer) throws -> OnlineAccount { + return try FfiConverterTypeOnlineAccount.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineAccount_lower(_ value: OnlineAccount) -> RustBuffer { + return FfiConverterTypeOnlineAccount.lower(value) +} + + +/** + * What a downloaded database holds. + */ +public struct OnlineDatabase: Equatable, Hashable { + public var accounts: [OnlineAccount] + /** + * Games written into it. + */ + public var games: UInt64 + /** + * When the last download finished (Unix seconds); none while it never finished. + */ + public var updated: Int64? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(accounts: [OnlineAccount], + /** + * Games written into it. + */games: UInt64, + /** + * When the last download finished (Unix seconds); none while it never finished. + */updated: Int64?) { + self.accounts = accounts + self.games = games + self.updated = updated + } + + + + +} + +#if compiler(>=6) +extension OnlineDatabase: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeOnlineDatabase: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnlineDatabase { + return + try OnlineDatabase( + accounts: FfiConverterSequenceTypeOnlineAccount.read(from: &buf), + games: FfiConverterUInt64.read(from: &buf), + updated: FfiConverterOptionInt64.read(from: &buf) + ) + } + + public static func write(_ value: OnlineDatabase, into buf: inout [UInt8]) { + FfiConverterSequenceTypeOnlineAccount.write(value.accounts, into: &buf) + FfiConverterUInt64.write(value.games, into: &buf) + FfiConverterOptionInt64.write(value.updated, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineDatabase_lift(_ buf: RustBuffer) throws -> OnlineDatabase { + return try FfiConverterTypeOnlineDatabase.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineDatabase_lower(_ value: OnlineDatabase) -> RustBuffer { + return FfiConverterTypeOnlineDatabase.lower(value) +} + + +/** + * A problem, the site it came from (when known), and the technical text. + */ +public struct OnlineFailure: Equatable, Hashable { + public var problem: OnlineProblem + public var site: Site? + public var detail: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(problem: OnlineProblem, site: Site?, detail: String) { + self.problem = problem + self.site = site + self.detail = detail + } + + + + +} + +#if compiler(>=6) +extension OnlineFailure: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeOnlineFailure: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnlineFailure { + return + try OnlineFailure( + problem: FfiConverterTypeOnlineProblem.read(from: &buf), + site: FfiConverterOptionTypeSite.read(from: &buf), + detail: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: OnlineFailure, into buf: inout [UInt8]) { + FfiConverterTypeOnlineProblem.write(value.problem, into: &buf) + FfiConverterOptionTypeSite.write(value.site, into: &buf) + FfiConverterString.write(value.detail, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineFailure_lift(_ buf: RustBuffer) throws -> OnlineFailure { + return try FfiConverterTypeOnlineFailure.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineFailure_lower(_ value: OnlineFailure) -> RustBuffer { + return FfiConverterTypeOnlineFailure.lower(value) +} + + +/** + * Accounts and the database file they are downloaded into. + */ +public struct OnlineTarget: Equatable, Hashable { + public var accounts: [OnlineAccount] + public var path: String + /** + * The file is there already (its new games are fetched). + */ + public var exists: Bool + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(accounts: [OnlineAccount], path: String, + /** + * The file is there already (its new games are fetched). + */exists: Bool) { + self.accounts = accounts + self.path = path + self.exists = exists + } + + + + +} + +#if compiler(>=6) +extension OnlineTarget: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeOnlineTarget: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnlineTarget { + return + try OnlineTarget( + accounts: FfiConverterSequenceTypeOnlineAccount.read(from: &buf), + path: FfiConverterString.read(from: &buf), + exists: FfiConverterBool.read(from: &buf) + ) + } + + public static func write(_ value: OnlineTarget, into buf: inout [UInt8]) { + FfiConverterSequenceTypeOnlineAccount.write(value.accounts, into: &buf) + FfiConverterString.write(value.path, into: &buf) + FfiConverterBool.write(value.exists, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineTarget_lift(_ buf: RustBuffer) throws -> OnlineTarget { + return try FfiConverterTypeOnlineTarget.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineTarget_lower(_ value: OnlineTarget) -> RustBuffer { + return FfiConverterTypeOnlineTarget.lower(value) +} + + +/** + * One exact player name from the database catalogue. + */ +public struct PlayerSuggestion: Equatable, Hashable { + /** + * Stable within this open database; used by [`Database::prepare_position`]. + */ + public var id: UInt32 + public var name: String + /** + * Distinct games. A game with this name on both sides counts once here. + */ + public var games: UInt32 + public var whiteGames: UInt32 + public var blackGames: UInt32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * Stable within this open database; used by [`Database::prepare_position`]. + */id: UInt32, name: String, + /** + * Distinct games. A game with this name on both sides counts once here. + */games: UInt32, whiteGames: UInt32, blackGames: UInt32) { + self.id = id + self.name = name + self.games = games + self.whiteGames = whiteGames + self.blackGames = blackGames + } + + + + +} + +#if compiler(>=6) +extension PlayerSuggestion: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePlayerSuggestion: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PlayerSuggestion { + return + try PlayerSuggestion( + id: FfiConverterUInt32.read(from: &buf), + name: FfiConverterString.read(from: &buf), + games: FfiConverterUInt32.read(from: &buf), + whiteGames: FfiConverterUInt32.read(from: &buf), + blackGames: FfiConverterUInt32.read(from: &buf) + ) + } + + public static func write(_ value: PlayerSuggestion, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.id, into: &buf) + FfiConverterString.write(value.name, into: &buf) + FfiConverterUInt32.write(value.games, into: &buf) + FfiConverterUInt32.write(value.whiteGames, into: &buf) + FfiConverterUInt32.write(value.blackGames, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePlayerSuggestion_lift(_ buf: RustBuffer) throws -> PlayerSuggestion { + return try FfiConverterTypePlayerSuggestion.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePlayerSuggestion_lower(_ value: PlayerSuggestion) -> RustBuffer { + return FfiConverterTypePlayerSuggestion.lower(value) +} + + +/** + * A page of [`PlayerSuggestion`] and the total number of matching names. + */ +public struct PlayerSuggestions: Equatable, Hashable { + public var players: [PlayerSuggestion] + public var total: UInt32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(players: [PlayerSuggestion], total: UInt32) { + self.players = players + self.total = total + } + + + + +} + +#if compiler(>=6) +extension PlayerSuggestions: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePlayerSuggestions: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PlayerSuggestions { + return + try PlayerSuggestions( + players: FfiConverterSequenceTypePlayerSuggestion.read(from: &buf), + total: FfiConverterUInt32.read(from: &buf) + ) + } + + public static func write(_ value: PlayerSuggestions, into buf: inout [UInt8]) { + FfiConverterSequenceTypePlayerSuggestion.write(value.players, into: &buf) + FfiConverterUInt32.write(value.total, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePlayerSuggestions_lift(_ buf: RustBuffer) throws -> PlayerSuggestions { + return try FfiConverterTypePlayerSuggestions.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePlayerSuggestions_lower(_ value: PlayerSuggestions) -> RustBuffer { + return FfiConverterTypePlayerSuggestions.lower(value) +} + + +/** + * A move played next, with the selected player's results (not the mover's). + */ +public struct PrepContinuation: Equatable, Hashable { + public var uci: String + public var san: String + public var count: UInt32 + public var wins: UInt32 + public var draws: UInt32 + public var losses: UInt32 + /** + * Games with `Result "*"` (or another unknown result); not a loss. + */ + public var unknown: UInt32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(uci: String, san: String, count: UInt32, wins: UInt32, draws: UInt32, losses: UInt32, + /** + * Games with `Result "*"` (or another unknown result); not a loss. + */unknown: UInt32) { + self.uci = uci + self.san = san + self.count = count + self.wins = wins + self.draws = draws + self.losses = losses + self.unknown = unknown + } + + + + +} + +#if compiler(>=6) +extension PrepContinuation: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePrepContinuation: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepContinuation { + return + try PrepContinuation( + uci: FfiConverterString.read(from: &buf), + san: FfiConverterString.read(from: &buf), + count: FfiConverterUInt32.read(from: &buf), + wins: FfiConverterUInt32.read(from: &buf), + draws: FfiConverterUInt32.read(from: &buf), + losses: FfiConverterUInt32.read(from: &buf), + unknown: FfiConverterUInt32.read(from: &buf) + ) + } + + public static func write(_ value: PrepContinuation, into buf: inout [UInt8]) { + FfiConverterString.write(value.uci, into: &buf) + FfiConverterString.write(value.san, into: &buf) + FfiConverterUInt32.write(value.count, into: &buf) + FfiConverterUInt32.write(value.wins, into: &buf) + FfiConverterUInt32.write(value.draws, into: &buf) + FfiConverterUInt32.write(value.losses, into: &buf) + FfiConverterUInt32.write(value.unknown, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepContinuation_lift(_ buf: RustBuffer) throws -> PrepContinuation { + return try FfiConverterTypePrepContinuation.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepContinuation_lower(_ value: PrepContinuation) -> RustBuffer { + return FfiConverterTypePrepContinuation.lower(value) +} + + +/** + * One matching game. `ply` opens its first main-line occurrence of the position. + */ +public struct PrepMatch: Equatable, Hashable { + public var index: UInt32 + public var ply: UInt32 + public var row: GameRow + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(index: UInt32, ply: UInt32, row: GameRow) { + self.index = index + self.ply = ply + self.row = row + } + + + + +} + +#if compiler(>=6) +extension PrepMatch: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePrepMatch: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepMatch { + return + try PrepMatch( + index: FfiConverterUInt32.read(from: &buf), + ply: FfiConverterUInt32.read(from: &buf), + row: FfiConverterTypeGameRow.read(from: &buf) + ) + } + + public static func write(_ value: PrepMatch, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.index, into: &buf) + FfiConverterUInt32.write(value.ply, into: &buf) + FfiConverterTypeGameRow.write(value.row, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepMatch_lift(_ buf: RustBuffer) throws -> PrepMatch { + return try FfiConverterTypePrepMatch.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepMatch_lower(_ value: PrepMatch) -> RustBuffer { + return FfiConverterTypePrepMatch.lower(value) +} + + +/** + * Continuations and results at one position. + */ +public struct PrepResult: Equatable, Hashable { + /** + * Matching games, each counted once at its first main-line occurrence. + */ + public var games: UInt32 + public var wins: UInt32 + public var draws: UInt32 + public var losses: UInt32 + public var unknown: UInt32 + /** + * Whether the selected player (rather than their opponents) moves here. + */ + public var playerToMove: Bool + /** + * By count descending, then SAN ascending. + */ + public var continuations: [PrepContinuation] + public var ended: UInt32 + /** + * A teaching null move or a continuation that is not a normal legal move. + */ + public var noNormalContinuation: UInt32 + /** + * At most 100 rows in record order; `matches_total` is the unpaginated count. + */ + public var matches: [PrepMatch] + public var matchesTotal: UInt32 + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * Matching games, each counted once at its first main-line occurrence. + */games: UInt32, wins: UInt32, draws: UInt32, losses: UInt32, unknown: UInt32, + /** + * Whether the selected player (rather than their opponents) moves here. + */playerToMove: Bool, + /** + * By count descending, then SAN ascending. + */continuations: [PrepContinuation], ended: UInt32, + /** + * A teaching null move or a continuation that is not a normal legal move. + */noNormalContinuation: UInt32, + /** + * At most 100 rows in record order; `matches_total` is the unpaginated count. + */matches: [PrepMatch], matchesTotal: UInt32) { + self.games = games + self.wins = wins + self.draws = draws + self.losses = losses + self.unknown = unknown + self.playerToMove = playerToMove + self.continuations = continuations + self.ended = ended + self.noNormalContinuation = noNormalContinuation + self.matches = matches + self.matchesTotal = matchesTotal + } + + + + +} + +#if compiler(>=6) +extension PrepResult: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePrepResult: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepResult { + return + try PrepResult( + games: FfiConverterUInt32.read(from: &buf), + wins: FfiConverterUInt32.read(from: &buf), + draws: FfiConverterUInt32.read(from: &buf), + losses: FfiConverterUInt32.read(from: &buf), + unknown: FfiConverterUInt32.read(from: &buf), + playerToMove: FfiConverterBool.read(from: &buf), + continuations: FfiConverterSequenceTypePrepContinuation.read(from: &buf), + ended: FfiConverterUInt32.read(from: &buf), + noNormalContinuation: FfiConverterUInt32.read(from: &buf), + matches: FfiConverterSequenceTypePrepMatch.read(from: &buf), + matchesTotal: FfiConverterUInt32.read(from: &buf) + ) + } + + public static func write(_ value: PrepResult, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.games, into: &buf) + FfiConverterUInt32.write(value.wins, into: &buf) + FfiConverterUInt32.write(value.draws, into: &buf) + FfiConverterUInt32.write(value.losses, into: &buf) + FfiConverterUInt32.write(value.unknown, into: &buf) + FfiConverterBool.write(value.playerToMove, into: &buf) + FfiConverterSequenceTypePrepContinuation.write(value.continuations, into: &buf) + FfiConverterUInt32.write(value.ended, into: &buf) + FfiConverterUInt32.write(value.noNormalContinuation, into: &buf) + FfiConverterSequenceTypePrepMatch.write(value.matches, into: &buf) + FfiConverterUInt32.write(value.matchesTotal, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepResult_lift(_ buf: RustBuffer) throws -> PrepResult { + return try FfiConverterTypePrepResult.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepResult_lower(_ value: PrepResult) -> RustBuffer { + return FfiConverterTypePrepResult.lower(value) +} + + +/** + * A snapshot of a preparation worker. + */ +public struct PrepState: Equatable, Hashable { + public var phase: PrepPhase + /** + * Progress inside the current phase (`total == 0` means not applicable). + */ + public var done: UInt32 + public var total: UInt32 + public var running: Bool + public var result: PrepResult? + /** + * Empty except for `Failed` and `NoMemory`. + */ + public var failure: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(phase: PrepPhase, + /** + * Progress inside the current phase (`total == 0` means not applicable). + */done: UInt32, total: UInt32, running: Bool, result: PrepResult?, + /** + * Empty except for `Failed` and `NoMemory`. + */failure: String) { + self.phase = phase + self.done = done + self.total = total + self.running = running + self.result = result + self.failure = failure + } + + + + +} + +#if compiler(>=6) +extension PrepState: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePrepState: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepState { + return + try PrepState( + phase: FfiConverterTypePrepPhase.read(from: &buf), + done: FfiConverterUInt32.read(from: &buf), + total: FfiConverterUInt32.read(from: &buf), + running: FfiConverterBool.read(from: &buf), + result: FfiConverterOptionTypePrepResult.read(from: &buf), + failure: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: PrepState, into buf: inout [UInt8]) { + FfiConverterTypePrepPhase.write(value.phase, into: &buf) + FfiConverterUInt32.write(value.done, into: &buf) + FfiConverterUInt32.write(value.total, into: &buf) + FfiConverterBool.write(value.running, into: &buf) + FfiConverterOptionTypePrepResult.write(value.result, into: &buf) + FfiConverterString.write(value.failure, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepState_lift(_ buf: RustBuffer) throws -> PrepState { + return try FfiConverterTypePrepState.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepState_lower(_ value: PrepState) -> RustBuffer { + return FfiConverterTypePrepState.lower(value) +} + + +/** + * A marked move of the main line: an inaccuracy, mistake or blunder, or a great or + * brilliant move (these have no better line and no reply). + */ +public struct ReviewMove: Equatable, Hashable { + /** + * The node of the move. + */ + public var node: UInt32 + public var judgement: MoveJudgement + /** + * White made the move. + */ + public var white: Bool + /** + * The engine's line from the position before the move (its first move was + * better), to show on the board; `None` when the evaluation came from the PGN. + */ + public var best: EngineLine? + /** + * The better move with its number, Latin letters: "23…Nf6" ("" when unknown). + */ + public var bestLabel: String + /** + * How the opponent punishes the move: the engine's reply, for an arrow. + */ + public var replyFrom: String? + public var replyTo: String? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * The node of the move. + */node: UInt32, judgement: MoveJudgement, + /** + * White made the move. + */white: Bool, + /** + * The engine's line from the position before the move (its first move was + * better), to show on the board; `None` when the evaluation came from the PGN. + */best: EngineLine?, + /** + * The better move with its number, Latin letters: "23…Nf6" ("" when unknown). + */bestLabel: String, + /** + * How the opponent punishes the move: the engine's reply, for an arrow. + */replyFrom: String?, replyTo: String?) { + self.node = node + self.judgement = judgement + self.white = white + self.best = best + self.bestLabel = bestLabel + self.replyFrom = replyFrom + self.replyTo = replyTo + } + + + + +} + +#if compiler(>=6) +extension ReviewMove: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeReviewMove: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ReviewMove { + return + try ReviewMove( + node: FfiConverterUInt32.read(from: &buf), + judgement: FfiConverterTypeMoveJudgement.read(from: &buf), + white: FfiConverterBool.read(from: &buf), + best: FfiConverterOptionTypeEngineLine.read(from: &buf), + bestLabel: FfiConverterString.read(from: &buf), + replyFrom: FfiConverterOptionString.read(from: &buf), + replyTo: FfiConverterOptionString.read(from: &buf) + ) + } + + public static func write(_ value: ReviewMove, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.node, into: &buf) + FfiConverterTypeMoveJudgement.write(value.judgement, into: &buf) + FfiConverterBool.write(value.white, into: &buf) + FfiConverterOptionTypeEngineLine.write(value.best, into: &buf) + FfiConverterString.write(value.bestLabel, into: &buf) + FfiConverterOptionString.write(value.replyFrom, into: &buf) + FfiConverterOptionString.write(value.replyTo, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReviewMove_lift(_ buf: RustBuffer) throws -> ReviewMove { + return try FfiConverterTypeReviewMove.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReviewMove_lower(_ value: ReviewMove) -> RustBuffer { + return FfiConverterTypeReviewMove.lower(value) +} + + +/** + * A position of the main line: the start, then the one after each move. + */ +public struct ReviewPoint: Equatable, Hashable { + /** + * The node (of [`crate::GameData`]) of this position. + */ + public var node: UInt32 + /** + * White's chance of winning, 0..100, when the position is evaluated. + */ + public var whiteWin: Float? + /** + * "+0.35", "−1.20", "#3", "#−2", "1-0" ("" while not evaluated). + */ + public var eval: String + /** + * The judgement of the move that led here. + */ + public var judgement: MoveJudgement? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * The node (of [`crate::GameData`]) of this position. + */node: UInt32, + /** + * White's chance of winning, 0..100, when the position is evaluated. + */whiteWin: Float?, + /** + * "+0.35", "−1.20", "#3", "#−2", "1-0" ("" while not evaluated). + */eval: String, + /** + * The judgement of the move that led here. + */judgement: MoveJudgement?) { + self.node = node + self.whiteWin = whiteWin + self.eval = eval + self.judgement = judgement + } + + + + +} + +#if compiler(>=6) +extension ReviewPoint: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeReviewPoint: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ReviewPoint { + return + try ReviewPoint( + node: FfiConverterUInt32.read(from: &buf), + whiteWin: FfiConverterOptionFloat.read(from: &buf), + eval: FfiConverterString.read(from: &buf), + judgement: FfiConverterOptionTypeMoveJudgement.read(from: &buf) + ) + } + + public static func write(_ value: ReviewPoint, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.node, into: &buf) + FfiConverterOptionFloat.write(value.whiteWin, into: &buf) + FfiConverterString.write(value.eval, into: &buf) + FfiConverterOptionTypeMoveJudgement.write(value.judgement, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReviewPoint_lift(_ buf: RustBuffer) throws -> ReviewPoint { + return try FfiConverterTypeReviewPoint.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReviewPoint_lower(_ value: ReviewPoint) -> RustBuffer { + return FfiConverterTypeReviewPoint.lower(value) +} + + +/** + * Everything about the analysis of the game at this moment. + */ +public struct ReviewState: Equatable, Hashable { + /** + * The engine job is running. + */ + public var running: Bool + /** + * Positions evaluated by this run, of `total`. + */ + public var done: UInt32 + public var total: UInt32 + /** + * Why the last run stopped early (the engine crashed, did not start). + */ + public var failure: String? + /** + * Some evaluations exist (from the engine, the cache or the PGN). + */ + public var hasData: Bool + /** + * The engine's name; "PGN" when the evaluations come from `[%eval]` comments. + */ + public var engine: String + /** + * Nodes per position; 0 for evaluations from the PGN. + */ + public var nodes: UInt64 + /** + * The evaluations come from another engine search than today's fixed one (an + * analysis made before it): shown, but "update" makes them all again. + */ + public var stale: Bool + /** + * Positions of the main line without an evaluation. + */ + public var missing: UInt32 + /** + * Evaluated positions still waiting for the second search of !! and ! (an analysis + * from before them): "fill in" does it. + */ + public var secondsMissing: UInt32 + /** + * Positions a full analysis looks at (for the time estimate). + */ + public var positions: UInt32 + /** + * Engine searches a full analysis is expected to make (for the time estimate: a + * second search for moves that could be brilliant or great). + */ + public var searches: UInt32 + /** + * The speed of one engine process in the last run (0 when unknown). + */ + public var npsPerProcess: UInt64 + /** + * The start position and the position after every main-line move. + */ + public var points: [ReviewPoint] + /** + * Where the middlegame and the endgame begin, as indices of `points`. + */ + public var middlegame: UInt32? + public var endgame: UInt32? + public var white: SideReview + public var black: SideReview + /** + * The marked moves, in the order of the game. + */ + public var moves: [ReviewMove] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * The engine job is running. + */running: Bool, + /** + * Positions evaluated by this run, of `total`. + */done: UInt32, total: UInt32, + /** + * Why the last run stopped early (the engine crashed, did not start). + */failure: String?, + /** + * Some evaluations exist (from the engine, the cache or the PGN). + */hasData: Bool, + /** + * The engine's name; "PGN" when the evaluations come from `[%eval]` comments. + */engine: String, + /** + * Nodes per position; 0 for evaluations from the PGN. + */nodes: UInt64, + /** + * The evaluations come from another engine search than today's fixed one (an + * analysis made before it): shown, but "update" makes them all again. + */stale: Bool, + /** + * Positions of the main line without an evaluation. + */missing: UInt32, + /** + * Evaluated positions still waiting for the second search of !! and ! (an analysis + * from before them): "fill in" does it. + */secondsMissing: UInt32, + /** + * Positions a full analysis looks at (for the time estimate). + */positions: UInt32, + /** + * Engine searches a full analysis is expected to make (for the time estimate: a + * second search for moves that could be brilliant or great). + */searches: UInt32, + /** + * The speed of one engine process in the last run (0 when unknown). + */npsPerProcess: UInt64, + /** + * The start position and the position after every main-line move. + */points: [ReviewPoint], + /** + * Where the middlegame and the endgame begin, as indices of `points`. + */middlegame: UInt32?, endgame: UInt32?, white: SideReview, black: SideReview, + /** + * The marked moves, in the order of the game. + */moves: [ReviewMove]) { + self.running = running + self.done = done + self.total = total + self.failure = failure + self.hasData = hasData + self.engine = engine + self.nodes = nodes + self.stale = stale + self.missing = missing + self.secondsMissing = secondsMissing + self.positions = positions + self.searches = searches + self.npsPerProcess = npsPerProcess + self.points = points + self.middlegame = middlegame + self.endgame = endgame + self.white = white + self.black = black + self.moves = moves + } + + + + +} + +#if compiler(>=6) +extension ReviewState: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeReviewState: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ReviewState { + return + try ReviewState( + running: FfiConverterBool.read(from: &buf), + done: FfiConverterUInt32.read(from: &buf), + total: FfiConverterUInt32.read(from: &buf), + failure: FfiConverterOptionString.read(from: &buf), + hasData: FfiConverterBool.read(from: &buf), + engine: FfiConverterString.read(from: &buf), + nodes: FfiConverterUInt64.read(from: &buf), + stale: FfiConverterBool.read(from: &buf), + missing: FfiConverterUInt32.read(from: &buf), + secondsMissing: FfiConverterUInt32.read(from: &buf), + positions: FfiConverterUInt32.read(from: &buf), + searches: FfiConverterUInt32.read(from: &buf), + npsPerProcess: FfiConverterUInt64.read(from: &buf), + points: FfiConverterSequenceTypeReviewPoint.read(from: &buf), + middlegame: FfiConverterOptionUInt32.read(from: &buf), + endgame: FfiConverterOptionUInt32.read(from: &buf), + white: FfiConverterTypeSideReview.read(from: &buf), + black: FfiConverterTypeSideReview.read(from: &buf), + moves: FfiConverterSequenceTypeReviewMove.read(from: &buf) + ) + } + + public static func write(_ value: ReviewState, into buf: inout [UInt8]) { + FfiConverterBool.write(value.running, into: &buf) + FfiConverterUInt32.write(value.done, into: &buf) + FfiConverterUInt32.write(value.total, into: &buf) + FfiConverterOptionString.write(value.failure, into: &buf) + FfiConverterBool.write(value.hasData, into: &buf) + FfiConverterString.write(value.engine, into: &buf) + FfiConverterUInt64.write(value.nodes, into: &buf) + FfiConverterBool.write(value.stale, into: &buf) + FfiConverterUInt32.write(value.missing, into: &buf) + FfiConverterUInt32.write(value.secondsMissing, into: &buf) + FfiConverterUInt32.write(value.positions, into: &buf) + FfiConverterUInt32.write(value.searches, into: &buf) + FfiConverterUInt64.write(value.npsPerProcess, into: &buf) + FfiConverterSequenceTypeReviewPoint.write(value.points, into: &buf) + FfiConverterOptionUInt32.write(value.middlegame, into: &buf) + FfiConverterOptionUInt32.write(value.endgame, into: &buf) + FfiConverterTypeSideReview.write(value.white, into: &buf) + FfiConverterTypeSideReview.write(value.black, into: &buf) + FfiConverterSequenceTypeReviewMove.write(value.moves, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReviewState_lift(_ buf: RustBuffer) throws -> ReviewState { + return try FfiConverterTypeReviewState.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReviewState_lower(_ value: ReviewState) -> RustBuffer { + return FfiConverterTypeReviewState.lower(value) +} + + +/** + * A file of the book pack: where it comes from, where it goes (under the engine's + * home), its size and SHA-256. + */ +public struct RodentBook: Equatable, Hashable { + public var url: String + public var local: String + public var size: UInt64 + public var sha256: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(url: String, local: String, size: UInt64, sha256: String) { + self.url = url + self.local = local + self.size = size + self.sha256 = sha256 + } + + + + +} + +#if compiler(>=6) +extension RodentBook: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeRodentBook: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RodentBook { + return + try RodentBook( + url: FfiConverterString.read(from: &buf), + local: FfiConverterString.read(from: &buf), + size: FfiConverterUInt64.read(from: &buf), + sha256: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: RodentBook, into buf: inout [UInt8]) { + FfiConverterString.write(value.url, into: &buf) + FfiConverterString.write(value.local, into: &buf) + FfiConverterUInt64.write(value.size, into: &buf) + FfiConverterString.write(value.sha256, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentBook_lift(_ buf: RustBuffer) throws -> RodentBook { + return try FfiConverterTypeRodentBook.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentBook_lower(_ value: RodentBook) -> RustBuffer { + return FfiConverterTypeRodentBook.lower(value) +} + + +/** + * A character of Rodent IV: its id, its English name (for PGN), its title and what it + * does (English: the app shows its own translations), a great player or not. + */ +public struct RodentStyle: Equatable, Hashable { + public var id: String + public var name: String + public var title: String + public var about: String + public var player: Bool + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(id: String, name: String, title: String, about: String, player: Bool) { + self.id = id + self.name = name + self.title = title + self.about = about + self.player = player + } + + + + +} + +#if compiler(>=6) +extension RodentStyle: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeRodentStyle: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RodentStyle { + return + try RodentStyle( + id: FfiConverterString.read(from: &buf), + name: FfiConverterString.read(from: &buf), + title: FfiConverterString.read(from: &buf), + about: FfiConverterString.read(from: &buf), + player: FfiConverterBool.read(from: &buf) + ) + } + + public static func write(_ value: RodentStyle, into buf: inout [UInt8]) { + FfiConverterString.write(value.id, into: &buf) + FfiConverterString.write(value.name, into: &buf) + FfiConverterString.write(value.title, into: &buf) + FfiConverterString.write(value.about, into: &buf) + FfiConverterBool.write(value.player, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentStyle_lift(_ buf: RustBuffer) throws -> RodentStyle { + return try FfiConverterTypeRodentStyle.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentStyle_lower(_ value: RodentStyle) -> RustBuffer { + return FfiConverterTypeRodentStyle.lower(value) +} + + +/** + * One player's numbers. + */ +public struct SideReview: Equatable, Hashable { + public var inaccuracies: UInt32 + public var mistakes: UInt32 + public var blunders: UInt32 + public var great: UInt32 + public var brilliant: UInt32 + /** + * Average centipawn loss. + */ + public var acpl: UInt32? + /** + * Accuracy 0..100 (only when every position is evaluated). + */ + public var accuracy: Double? + public var opening: Double? + public var middlegame: Double? + public var endgame: Double? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(inaccuracies: UInt32, mistakes: UInt32, blunders: UInt32, great: UInt32, brilliant: UInt32, + /** + * Average centipawn loss. + */acpl: UInt32?, + /** + * Accuracy 0..100 (only when every position is evaluated). + */accuracy: Double?, opening: Double?, middlegame: Double?, endgame: Double?) { + self.inaccuracies = inaccuracies + self.mistakes = mistakes + self.blunders = blunders + self.great = great + self.brilliant = brilliant + self.acpl = acpl + self.accuracy = accuracy + self.opening = opening + self.middlegame = middlegame + self.endgame = endgame + } + + + + +} + +#if compiler(>=6) +extension SideReview: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSideReview: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SideReview { + return + try SideReview( + inaccuracies: FfiConverterUInt32.read(from: &buf), + mistakes: FfiConverterUInt32.read(from: &buf), + blunders: FfiConverterUInt32.read(from: &buf), + great: FfiConverterUInt32.read(from: &buf), + brilliant: FfiConverterUInt32.read(from: &buf), + acpl: FfiConverterOptionUInt32.read(from: &buf), + accuracy: FfiConverterOptionDouble.read(from: &buf), + opening: FfiConverterOptionDouble.read(from: &buf), + middlegame: FfiConverterOptionDouble.read(from: &buf), + endgame: FfiConverterOptionDouble.read(from: &buf) + ) + } + + public static func write(_ value: SideReview, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.inaccuracies, into: &buf) + FfiConverterUInt32.write(value.mistakes, into: &buf) + FfiConverterUInt32.write(value.blunders, into: &buf) + FfiConverterUInt32.write(value.great, into: &buf) + FfiConverterUInt32.write(value.brilliant, into: &buf) + FfiConverterOptionUInt32.write(value.acpl, into: &buf) + FfiConverterOptionDouble.write(value.accuracy, into: &buf) + FfiConverterOptionDouble.write(value.opening, into: &buf) + FfiConverterOptionDouble.write(value.middlegame, into: &buf) + FfiConverterOptionDouble.write(value.endgame, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSideReview_lift(_ buf: RustBuffer) throws -> SideReview { + return try FfiConverterTypeSideReview.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSideReview_lower(_ value: SideReview) -> RustBuffer { + return FfiConverterTypeSideReview.lower(value) +} + + +/** + * A PGN tag. + */ +public struct Tag: Equatable, Hashable { + public var name: String + public var value: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(name: String, value: String) { + self.name = name + self.value = value + } + + + + +} + +#if compiler(>=6) +extension Tag: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeTag: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Tag { + return + try Tag( + name: FfiConverterString.read(from: &buf), + value: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: Tag, into buf: inout [UInt8]) { + FfiConverterString.write(value.name, into: &buf) + FfiConverterString.write(value.value, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTag_lift(_ buf: RustBuffer) throws -> Tag { + return try FfiConverterTypeTag.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTag_lower(_ value: Tag) -> RustBuffer { + return FfiConverterTypeTag.lower(value) +} + + +/** + * The state of the run after `ply` half-moves. + */ +public struct TrainState: Equatable, Hashable { + /** + * The position now, and the move that led here (none at the start). + */ + public var fen: String + public var fromSquare: String? + public var toSquare: String? + /** + * The moves played so far, in SAN (Latin letters). + */ + public var played: [String] + /** + * Half-moves in the line. + */ + public var length: UInt32 + public var mistakesHere: UInt32 + public var mistakes: UInt32 + /** + * The user may ask to see this move; it is shown now (from, to). + */ + public var mayShow: Bool + public var hint: [String]? + public var hinted: Bool + public var done: Bool + public var before: TrainStats + public var after: TrainStats? + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init( + /** + * The position now, and the move that led here (none at the start). + */fen: String, fromSquare: String?, toSquare: String?, + /** + * The moves played so far, in SAN (Latin letters). + */played: [String], + /** + * Half-moves in the line. + */length: UInt32, mistakesHere: UInt32, mistakes: UInt32, + /** + * The user may ask to see this move; it is shown now (from, to). + */mayShow: Bool, hint: [String]?, hinted: Bool, done: Bool, before: TrainStats, after: TrainStats?) { + self.fen = fen + self.fromSquare = fromSquare + self.toSquare = toSquare + self.played = played + self.length = length + self.mistakesHere = mistakesHere + self.mistakes = mistakes + self.mayShow = mayShow + self.hint = hint + self.hinted = hinted + self.done = done + self.before = before + self.after = after + } + + + + +} + +#if compiler(>=6) +extension TrainState: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeTrainState: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrainState { + return + try TrainState( + fen: FfiConverterString.read(from: &buf), + fromSquare: FfiConverterOptionString.read(from: &buf), + toSquare: FfiConverterOptionString.read(from: &buf), + played: FfiConverterSequenceString.read(from: &buf), + length: FfiConverterUInt32.read(from: &buf), + mistakesHere: FfiConverterUInt32.read(from: &buf), + mistakes: FfiConverterUInt32.read(from: &buf), + mayShow: FfiConverterBool.read(from: &buf), + hint: FfiConverterOptionSequenceString.read(from: &buf), + hinted: FfiConverterBool.read(from: &buf), + done: FfiConverterBool.read(from: &buf), + before: FfiConverterTypeTrainStats.read(from: &buf), + after: FfiConverterOptionTypeTrainStats.read(from: &buf) + ) + } + + public static func write(_ value: TrainState, into buf: inout [UInt8]) { + FfiConverterString.write(value.fen, into: &buf) + FfiConverterOptionString.write(value.fromSquare, into: &buf) + FfiConverterOptionString.write(value.toSquare, into: &buf) + FfiConverterSequenceString.write(value.played, into: &buf) + FfiConverterUInt32.write(value.length, into: &buf) + FfiConverterUInt32.write(value.mistakesHere, into: &buf) + FfiConverterUInt32.write(value.mistakes, into: &buf) + FfiConverterBool.write(value.mayShow, into: &buf) + FfiConverterOptionSequenceString.write(value.hint, into: &buf) + FfiConverterBool.write(value.hinted, into: &buf) + FfiConverterBool.write(value.done, into: &buf) + FfiConverterTypeTrainStats.write(value.before, into: &buf) + FfiConverterOptionTypeTrainStats.write(value.after, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainState_lift(_ buf: RustBuffer) throws -> TrainState { + return try FfiConverterTypeTrainState.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainState_lower(_ value: TrainState) -> RustBuffer { + return FfiConverterTypeTrainState.lower(value) +} + + +/** + * The runs of a line so far. + */ +public struct TrainStats: Equatable, Hashable { + public var runs: UInt32 + public var last: UInt32? + public var best: UInt32? + public var cleanStreak: UInt32 + /** + * The last runs, oldest first: their mistakes and whether the move was shown. + */ + public var recentMistakes: [UInt32] + public var recentHinted: [Bool] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(runs: UInt32, last: UInt32?, best: UInt32?, cleanStreak: UInt32, + /** + * The last runs, oldest first: their mistakes and whether the move was shown. + */recentMistakes: [UInt32], recentHinted: [Bool]) { + self.runs = runs + self.last = last + self.best = best + self.cleanStreak = cleanStreak + self.recentMistakes = recentMistakes + self.recentHinted = recentHinted + } + + + + +} + +#if compiler(>=6) +extension TrainStats: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeTrainStats: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrainStats { + return + try TrainStats( + runs: FfiConverterUInt32.read(from: &buf), + last: FfiConverterOptionUInt32.read(from: &buf), + best: FfiConverterOptionUInt32.read(from: &buf), + cleanStreak: FfiConverterUInt32.read(from: &buf), + recentMistakes: FfiConverterSequenceUInt32.read(from: &buf), + recentHinted: FfiConverterSequenceBool.read(from: &buf) + ) + } + + public static func write(_ value: TrainStats, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.runs, into: &buf) + FfiConverterOptionUInt32.write(value.last, into: &buf) + FfiConverterOptionUInt32.write(value.best, into: &buf) + FfiConverterUInt32.write(value.cleanStreak, into: &buf) + FfiConverterSequenceUInt32.write(value.recentMistakes, into: &buf) + FfiConverterSequenceBool.write(value.recentHinted, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainStats_lift(_ buf: RustBuffer) throws -> TrainStats { + return try FfiConverterTypeTrainStats.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainStats_lower(_ value: TrainStats) -> RustBuffer { + return FfiConverterTypeTrainStats.lower(value) +} + + +/** + * What looking a nickname up on a site gave. + */ + +public enum AccountLookup: Equatable, Hashable { + + case found(account: OnlineAccount + ) + case notFound + case failed(failure: OnlineFailure + ) + + + + + +} + +#if compiler(>=6) +extension AccountLookup: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeAccountLookup: FfiConverterRustBuffer { + typealias SwiftType = AccountLookup + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountLookup { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .found(account: try FfiConverterTypeOnlineAccount.read(from: &buf) + ) + + case 2: return .notFound + + case 3: return .failed(failure: try FfiConverterTypeOnlineFailure.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: AccountLookup, into buf: inout [UInt8]) { + switch value { + + + case let .found(account): + writeInt(&buf, Int32(1)) + FfiConverterTypeOnlineAccount.write(account, into: &buf) + + + case .notFound: + writeInt(&buf, Int32(2)) + + + case let .failed(failure): + writeInt(&buf, Int32(3)) + FfiConverterTypeOnlineFailure.write(failure, into: &buf) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAccountLookup_lift(_ buf: RustBuffer) throws -> AccountLookup { + return try FfiConverterTypeAccountLookup.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeAccountLookup_lower(_ value: AccountLookup) -> RustBuffer { + return FfiConverterTypeAccountLookup.lower(value) +} + + + +/** + * What went wrong opening or reading a database, in words for the user (the Kotlin + * side shows them as they are, or picks its own text by kind). + */ +public +enum ApiError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError { + + + + /** + * The file could not be read. + */ + case Io(detail: String + ) + /** + * A known format that cannot be read (password, ChessBase 2CBH). + */ + case Unsupported(detail: String + ) + /** + * The file is damaged or not a database. + */ + case Corrupt(detail: String + ) + /** + * An archive without a database inside. + */ + case Empty + /** + * No game with this number. + */ + case NoGame(index: UInt32 + ) + /** + * No move at this place of the game's list. + */ + case NoNode(place: UInt32 + ) + /** + * A change of the game that cannot be made (an illegal move, …). + */ + case Edit(detail: String + ) + + + + + + + public var errorDescription: String? { + String(reflecting: self) + } + +} + +#if compiler(>=6) +extension ApiError: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeApiError: FfiConverterRustBuffer { + typealias SwiftType = ApiError + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ApiError { + let variant: Int32 = try readInt(&buf) + switch variant { + + + + + case 1: return .Io( + detail: try FfiConverterString.read(from: &buf) + ) + case 2: return .Unsupported( + detail: try FfiConverterString.read(from: &buf) + ) + case 3: return .Corrupt( + detail: try FfiConverterString.read(from: &buf) + ) + case 4: return .Empty + case 5: return .NoGame( + index: try FfiConverterUInt32.read(from: &buf) + ) + case 6: return .NoNode( + place: try FfiConverterUInt32.read(from: &buf) + ) + case 7: return .Edit( + detail: try FfiConverterString.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: ApiError, into buf: inout [UInt8]) { + switch value { + + + + + + case let .Io(detail): + writeInt(&buf, Int32(1)) + FfiConverterString.write(detail, into: &buf) + + + case let .Unsupported(detail): + writeInt(&buf, Int32(2)) + FfiConverterString.write(detail, into: &buf) + + + case let .Corrupt(detail): + writeInt(&buf, Int32(3)) + FfiConverterString.write(detail, into: &buf) + + + case .Empty: + writeInt(&buf, Int32(4)) + + + case let .NoGame(index): + writeInt(&buf, Int32(5)) + FfiConverterUInt32.write(index, into: &buf) + + + case let .NoNode(place): + writeInt(&buf, Int32(6)) + FfiConverterUInt32.write(place, into: &buf) + + + case let .Edit(detail): + writeInt(&buf, Int32(7)) + FfiConverterString.write(detail, into: &buf) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeApiError_lift(_ buf: RustBuffer) throws -> ApiError { + return try FfiConverterTypeApiError.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeApiError_lower(_ value: ApiError) -> RustBuffer { + return FfiConverterTypeApiError.lower(value) +} + + +/** + * Why the engine cannot serve. + */ +public +enum EngineFailure: Swift.Error, Equatable, Hashable, Foundation.LocalizedError { + + + + /** + * The engine did not start or did not answer the handshake. + */ + case Start(detail: String + ) + /** + * The position cannot be sent (a bad FEN or move). + */ + case Input(detail: String + ) + /** + * The engine has stopped (it crashed, hung and was killed, or was quit). + */ + case Stopped(detail: String + ) + + + + + + + public var errorDescription: String? { + String(reflecting: self) + } + +} + +#if compiler(>=6) +extension EngineFailure: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeEngineFailure: FfiConverterRustBuffer { + typealias SwiftType = EngineFailure + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> EngineFailure { + let variant: Int32 = try readInt(&buf) + switch variant { + + + + + case 1: return .Start( + detail: try FfiConverterString.read(from: &buf) + ) + case 2: return .Input( + detail: try FfiConverterString.read(from: &buf) + ) + case 3: return .Stopped( + detail: try FfiConverterString.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: EngineFailure, into buf: inout [UInt8]) { + switch value { + + + + + + case let .Start(detail): + writeInt(&buf, Int32(1)) + FfiConverterString.write(detail, into: &buf) + + + case let .Input(detail): + writeInt(&buf, Int32(2)) + FfiConverterString.write(detail, into: &buf) + + + case let .Stopped(detail): + writeInt(&buf, Int32(3)) + FfiConverterString.write(detail, into: &buf) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeEngineFailure_lift(_ buf: RustBuffer) throws -> EngineFailure { + return try FfiConverterTypeEngineFailure.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeEngineFailure_lower(_ value: EngineFailure) -> RustBuffer { + return FfiConverterTypeEngineFailure.lower(value) +} + + +/** + * How a game stands at a position: over or not. + */ + +public enum GameEnding: Equatable, Hashable { + + /** + * The side named won by mate. + */ + case checkmate(whiteWon: Bool + ) + case stalemate + case insufficientMaterial + case threefold + case fiftyMoves + + + + + +} + +#if compiler(>=6) +extension GameEnding: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeGameEnding: FfiConverterRustBuffer { + typealias SwiftType = GameEnding + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GameEnding { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .checkmate(whiteWon: try FfiConverterBool.read(from: &buf) + ) + + case 2: return .stalemate + + case 3: return .insufficientMaterial + + case 4: return .threefold + + case 5: return .fiftyMoves + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: GameEnding, into buf: inout [UInt8]) { + switch value { + + + case let .checkmate(whiteWon): + writeInt(&buf, Int32(1)) + FfiConverterBool.write(whiteWon, into: &buf) + + + case .stalemate: + writeInt(&buf, Int32(2)) + + + case .insufficientMaterial: + writeInt(&buf, Int32(3)) + + + case .threefold: + writeInt(&buf, Int32(4)) + + + case .fiftyMoves: + writeInt(&buf, Int32(5)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameEnding_lift(_ buf: RustBuffer) throws -> GameEnding { + return try FfiConverterTypeGameEnding.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeGameEnding_lower(_ value: GameEnding) -> RustBuffer { + return FfiConverterTypeGameEnding.lower(value) +} + + + +/** + * How bad a move was, or that it was of note. + */ + +public enum MoveJudgement: Equatable, Hashable { + + case inaccuracy + case mistake + case blunder + /** + * The only good move, or one that turned the game (!). + */ + case great + /** + * A sound sacrifice of a piece (!!). + */ + case brilliant + + + + + +} + +#if compiler(>=6) +extension MoveJudgement: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMoveJudgement: FfiConverterRustBuffer { + typealias SwiftType = MoveJudgement + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MoveJudgement { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .inaccuracy + + case 2: return .mistake + + case 3: return .blunder + + case 4: return .great + + case 5: return .brilliant + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MoveJudgement, into buf: inout [UInt8]) { + switch value { + + + case .inaccuracy: + writeInt(&buf, Int32(1)) + + + case .mistake: + writeInt(&buf, Int32(2)) + + + case .blunder: + writeInt(&buf, Int32(3)) + + + case .great: + writeInt(&buf, Int32(4)) + + + case .brilliant: + writeInt(&buf, Int32(5)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMoveJudgement_lift(_ buf: RustBuffer) throws -> MoveJudgement { + return try FfiConverterTypeMoveJudgement.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMoveJudgement_lower(_ value: MoveJudgement) -> RustBuffer { + return FfiConverterTypeMoveJudgement.lower(value) +} + + + +/** + * What went wrong talking to a site. + */ + +public enum OnlineProblem: Equatable, Hashable { + + /** + * No answer (offline, a timeout). + */ + case network + /** + * The site asks for a pause: too many requests. + */ + case rateLimited + /** + * An answer this version does not understand (the site changed). + */ + case unexpected + /** + * The database could not be written (the phone is full). + */ + case disk + /** + * The database is being downloaded already. + */ + case busy + + + + + +} + +#if compiler(>=6) +extension OnlineProblem: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeOnlineProblem: FfiConverterRustBuffer { + typealias SwiftType = OnlineProblem + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnlineProblem { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .network + + case 2: return .rateLimited + + case 3: return .unexpected + + case 4: return .disk + + case 5: return .busy + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: OnlineProblem, into buf: inout [UInt8]) { + switch value { + + + case .network: + writeInt(&buf, Int32(1)) + + + case .rateLimited: + writeInt(&buf, Int32(2)) + + + case .unexpected: + writeInt(&buf, Int32(3)) + + + case .disk: + writeInt(&buf, Int32(4)) + + + case .busy: + writeInt(&buf, Int32(5)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineProblem_lift(_ buf: RustBuffer) throws -> OnlineProblem { + return try FfiConverterTypeOnlineProblem.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeOnlineProblem_lower(_ value: OnlineProblem) -> RustBuffer { + return FfiConverterTypeOnlineProblem.lower(value) +} + + + +/** + * The phase of a [`PrepSearch`]. Terminal phases are `Ready`, `Cancelled`, + * `NoMemory` and `Failed`. + */ + +public enum PrepPhase: Equatable, Hashable { + + case games + case index + case search + case ready + case cancelled + case noMemory + case failed + + + + + +} + +#if compiler(>=6) +extension PrepPhase: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypePrepPhase: FfiConverterRustBuffer { + typealias SwiftType = PrepPhase + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PrepPhase { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .games + + case 2: return .index + + case 3: return .search + + case 4: return .ready + + case 5: return .cancelled + + case 6: return .noMemory + + case 7: return .failed + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: PrepPhase, into buf: inout [UInt8]) { + switch value { + + + case .games: + writeInt(&buf, Int32(1)) + + + case .index: + writeInt(&buf, Int32(2)) + + + case .search: + writeInt(&buf, Int32(3)) + + + case .ready: + writeInt(&buf, Int32(4)) + + + case .cancelled: + writeInt(&buf, Int32(5)) + + + case .noMemory: + writeInt(&buf, Int32(6)) + + + case .failed: + writeInt(&buf, Int32(7)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepPhase_lift(_ buf: RustBuffer) throws -> PrepPhase { + return try FfiConverterTypePrepPhase.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypePrepPhase_lower(_ value: PrepPhase) -> RustBuffer { + return FfiConverterTypePrepPhase.lower(value) +} + + + + +public enum ReleaseCheck: Equatable, Hashable { + + /** + * This app is the latest release (or newer: a build from the sources), or the newer + * release has nothing for Android (a desktop-only one). + */ + case upToDate(latest: String + ) + case newer(release: AppRelease + ) + /** + * A newer release whose light APK cannot be checked: no `SHA256SUMS.txt`, or no sum + * for the file in it. + */ + case unverifiable(release: AppRelease + ) + /** + * No answer: `detail` for the log. + */ + case failed(detail: String + ) + + + + + +} + +#if compiler(>=6) +extension ReleaseCheck: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeReleaseCheck: FfiConverterRustBuffer { + typealias SwiftType = ReleaseCheck + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ReleaseCheck { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .upToDate(latest: try FfiConverterString.read(from: &buf) + ) + + case 2: return .newer(release: try FfiConverterTypeAppRelease.read(from: &buf) + ) + + case 3: return .unverifiable(release: try FfiConverterTypeAppRelease.read(from: &buf) + ) + + case 4: return .failed(detail: try FfiConverterString.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: ReleaseCheck, into buf: inout [UInt8]) { + switch value { + + + case let .upToDate(latest): + writeInt(&buf, Int32(1)) + FfiConverterString.write(latest, into: &buf) + + + case let .newer(release): + writeInt(&buf, Int32(2)) + FfiConverterTypeAppRelease.write(release, into: &buf) + + + case let .unverifiable(release): + writeInt(&buf, Int32(3)) + FfiConverterTypeAppRelease.write(release, into: &buf) + + + case let .failed(detail): + writeInt(&buf, Int32(4)) + FfiConverterString.write(detail, into: &buf) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReleaseCheck_lift(_ buf: RustBuffer) throws -> ReleaseCheck { + return try FfiConverterTypeReleaseCheck.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeReleaseCheck_lower(_ value: ReleaseCheck) -> RustBuffer { + return FfiConverterTypeReleaseCheck.lower(value) +} + + + +/** + * Who plays against the user. + */ + +public enum Rival: Equatable, Hashable { + + case maia + /** + * Rodent IV in a style of its list (`iv_tal`…). + */ + case rodent(styleId: String + ) + + + + + +} + +#if compiler(>=6) +extension Rival: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeRival: FfiConverterRustBuffer { + typealias SwiftType = Rival + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Rival { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .maia + + case 2: return .rodent(styleId: try FfiConverterString.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: Rival, into buf: inout [UInt8]) { + switch value { + + + case .maia: + writeInt(&buf, Int32(1)) + + + case let .rodent(styleId): + writeInt(&buf, Int32(2)) + FfiConverterString.write(styleId, into: &buf) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRival_lift(_ buf: RustBuffer) throws -> Rival { + return try FfiConverterTypeRival.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRival_lower(_ value: Rival) -> RustBuffer { + return FfiConverterTypeRival.lower(value) +} + + + +/** + * Why Rodent does not play: it did not start (the engine's words), or it stopped + * during the game (android-rodent.md §6.6). + */ + +public enum RodentFailure: Equatable, Hashable { + + case didNotStart(detail: String + ) + case stopped + + + + + +} + +#if compiler(>=6) +extension RodentFailure: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeRodentFailure: FfiConverterRustBuffer { + typealias SwiftType = RodentFailure + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RodentFailure { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .didNotStart(detail: try FfiConverterString.read(from: &buf) + ) + + case 2: return .stopped + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: RodentFailure, into buf: inout [UInt8]) { + switch value { + + + case let .didNotStart(detail): + writeInt(&buf, Int32(1)) + FfiConverterString.write(detail, into: &buf) + + + case .stopped: + writeInt(&buf, Int32(2)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentFailure_lift(_ buf: RustBuffer) throws -> RodentFailure { + return try FfiConverterTypeRodentFailure.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeRodentFailure_lower(_ value: RodentFailure) -> RustBuffer { + return FfiConverterTypeRodentFailure.lower(value) +} + + + +/** + * A site. + */ + +public enum Site: Equatable, Hashable { + + case lichess + case chessCom + + + + + +} + +#if compiler(>=6) +extension Site: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeSite: FfiConverterRustBuffer { + typealias SwiftType = Site + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Site { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .lichess + + case 2: return .chessCom + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: Site, into buf: inout [UInt8]) { + switch value { + + + case .lichess: + writeInt(&buf, Int32(1)) + + + case .chessCom: + writeInt(&buf, Int32(2)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSite_lift(_ buf: RustBuffer) throws -> Site { + return try FfiConverterTypeSite.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeSite_lower(_ value: Site) -> RustBuffer { + return FfiConverterTypeSite.lower(value) +} + + + +/** + * What a move made was. + */ + +public enum TrainVerdict: Equatable, Hashable { + + case right + case finished + case wrong + case done + + + + + +} + +#if compiler(>=6) +extension TrainVerdict: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeTrainVerdict: FfiConverterRustBuffer { + typealias SwiftType = TrainVerdict + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrainVerdict { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .right + + case 2: return .finished + + case 3: return .wrong + + case 4: return .done + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: TrainVerdict, into buf: inout [UInt8]) { + switch value { + + + case .right: + writeInt(&buf, Int32(1)) + + + case .finished: + writeInt(&buf, Int32(2)) + + + case .wrong: + writeInt(&buf, Int32(3)) + + + case .done: + writeInt(&buf, Int32(4)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainVerdict_lift(_ buf: RustBuffer) throws -> TrainVerdict { + return try FfiConverterTypeTrainVerdict.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeTrainVerdict_lower(_ value: TrainVerdict) -> RustBuffer { + return FfiConverterTypeTrainVerdict.lower(value) +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionUInt32: FfiConverterRustBuffer { + typealias SwiftType = UInt32? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterUInt32.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterUInt32.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionInt32: FfiConverterRustBuffer { + typealias SwiftType = Int32? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterInt32.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterInt32.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionUInt64: FfiConverterRustBuffer { + typealias SwiftType = UInt64? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterUInt64.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterUInt64.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionInt64: FfiConverterRustBuffer { + typealias SwiftType = Int64? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterInt64.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterInt64.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionFloat: FfiConverterRustBuffer { + typealias SwiftType = Float? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterFloat.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterFloat.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionDouble: FfiConverterRustBuffer { + typealias SwiftType = Double? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterDouble.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterDouble.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionBool: FfiConverterRustBuffer { + typealias SwiftType = Bool? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterBool.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterBool.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionString: FfiConverterRustBuffer { + typealias SwiftType = String? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterString.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterString.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeTrainer: FfiConverterRustBuffer { + typealias SwiftType = Trainer? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeTrainer.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeTrainer.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeAnalysis: FfiConverterRustBuffer { + typealias SwiftType = Analysis? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeAnalysis.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeAnalysis.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeApkFile: FfiConverterRustBuffer { + typealias SwiftType = ApkFile? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeApkFile.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeApkFile.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeEdited: FfiConverterRustBuffer { + typealias SwiftType = Edited? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeEdited.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeEdited.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeEngineLine: FfiConverterRustBuffer { + typealias SwiftType = EngineLine? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeEngineLine.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeEngineLine.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeOnlineDatabase: FfiConverterRustBuffer { + typealias SwiftType = OnlineDatabase? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeOnlineDatabase.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeOnlineDatabase.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeOnlineFailure: FfiConverterRustBuffer { + typealias SwiftType = OnlineFailure? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeOnlineFailure.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeOnlineFailure.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypePrepResult: FfiConverterRustBuffer { + typealias SwiftType = PrepResult? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypePrepResult.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypePrepResult.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeTrainStats: FfiConverterRustBuffer { + typealias SwiftType = TrainStats? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeTrainStats.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeTrainStats.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeGameEnding: FfiConverterRustBuffer { + typealias SwiftType = GameEnding? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeGameEnding.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeGameEnding.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeMoveJudgement: FfiConverterRustBuffer { + typealias SwiftType = MoveJudgement? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeMoveJudgement.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeMoveJudgement.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeRodentFailure: FfiConverterRustBuffer { + typealias SwiftType = RodentFailure? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeRodentFailure.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeRodentFailure.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionTypeSite: FfiConverterRustBuffer { + typealias SwiftType = Site? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeSite.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeSite.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterOptionSequenceString: FfiConverterRustBuffer { + typealias SwiftType = [String]? + + public static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterSequenceString.write(value, into: &buf) + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterSequenceString.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceUInt32: FfiConverterRustBuffer { + typealias SwiftType = [UInt32] + + public static func write(_ value: [UInt32], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterUInt32.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [UInt32] { + let len: Int32 = try readInt(&buf) + var seq = [UInt32]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterUInt32.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceBool: FfiConverterRustBuffer { + typealias SwiftType = [Bool] + + public static func write(_ value: [Bool], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterBool.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Bool] { + let len: Int32 = try readInt(&buf) + var seq = [Bool]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterBool.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceString: FfiConverterRustBuffer { + typealias SwiftType = [String] + + public static func write(_ value: [String], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterString.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String] { + let len: Int32 = try readInt(&buf) + var seq = [String]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterString.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeEngineLine: FfiConverterRustBuffer { + typealias SwiftType = [EngineLine] + + public static func write(_ value: [EngineLine], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeEngineLine.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [EngineLine] { + let len: Int32 = try readInt(&buf) + var seq = [EngineLine]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeEngineLine.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeFolderFile: FfiConverterRustBuffer { + typealias SwiftType = [FolderFile] + + public static func write(_ value: [FolderFile], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeFolderFile.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [FolderFile] { + let len: Int32 = try readInt(&buf) + var seq = [FolderFile]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeFolderFile.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeGameRow: FfiConverterRustBuffer { + typealias SwiftType = [GameRow] + + public static func write(_ value: [GameRow], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeGameRow.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [GameRow] { + let len: Int32 = try readInt(&buf) + var seq = [GameRow]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeGameRow.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeLineStep: FfiConverterRustBuffer { + typealias SwiftType = [LineStep] + + public static func write(_ value: [LineStep], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeLineStep.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [LineStep] { + let len: Int32 = try readInt(&buf) + var seq = [LineStep]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeLineStep.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeMark: FfiConverterRustBuffer { + typealias SwiftType = [Mark] + + public static func write(_ value: [Mark], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeMark.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Mark] { + let len: Int32 = try readInt(&buf) + var seq = [Mark]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeMark.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeMoveNode: FfiConverterRustBuffer { + typealias SwiftType = [MoveNode] + + public static func write(_ value: [MoveNode], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeMoveNode.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [MoveNode] { + let len: Int32 = try readInt(&buf) + var seq = [MoveNode]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeMoveNode.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeOnlineAccount: FfiConverterRustBuffer { + typealias SwiftType = [OnlineAccount] + + public static func write(_ value: [OnlineAccount], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeOnlineAccount.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [OnlineAccount] { + let len: Int32 = try readInt(&buf) + var seq = [OnlineAccount]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeOnlineAccount.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeOnlineTarget: FfiConverterRustBuffer { + typealias SwiftType = [OnlineTarget] + + public static func write(_ value: [OnlineTarget], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeOnlineTarget.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [OnlineTarget] { + let len: Int32 = try readInt(&buf) + var seq = [OnlineTarget]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeOnlineTarget.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypePlayerSuggestion: FfiConverterRustBuffer { + typealias SwiftType = [PlayerSuggestion] + + public static func write(_ value: [PlayerSuggestion], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypePlayerSuggestion.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [PlayerSuggestion] { + let len: Int32 = try readInt(&buf) + var seq = [PlayerSuggestion]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypePlayerSuggestion.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypePrepContinuation: FfiConverterRustBuffer { + typealias SwiftType = [PrepContinuation] + + public static func write(_ value: [PrepContinuation], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypePrepContinuation.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [PrepContinuation] { + let len: Int32 = try readInt(&buf) + var seq = [PrepContinuation]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypePrepContinuation.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypePrepMatch: FfiConverterRustBuffer { + typealias SwiftType = [PrepMatch] + + public static func write(_ value: [PrepMatch], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypePrepMatch.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [PrepMatch] { + let len: Int32 = try readInt(&buf) + var seq = [PrepMatch]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypePrepMatch.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeReviewMove: FfiConverterRustBuffer { + typealias SwiftType = [ReviewMove] + + public static func write(_ value: [ReviewMove], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeReviewMove.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [ReviewMove] { + let len: Int32 = try readInt(&buf) + var seq = [ReviewMove]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeReviewMove.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeReviewPoint: FfiConverterRustBuffer { + typealias SwiftType = [ReviewPoint] + + public static func write(_ value: [ReviewPoint], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeReviewPoint.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [ReviewPoint] { + let len: Int32 = try readInt(&buf) + var seq = [ReviewPoint]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeReviewPoint.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeRodentBook: FfiConverterRustBuffer { + typealias SwiftType = [RodentBook] + + public static func write(_ value: [RodentBook], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeRodentBook.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RodentBook] { + let len: Int32 = try readInt(&buf) + var seq = [RodentBook]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeRodentBook.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeRodentStyle: FfiConverterRustBuffer { + typealias SwiftType = [RodentStyle] + + public static func write(_ value: [RodentStyle], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeRodentStyle.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RodentStyle] { + let len: Int32 = try readInt(&buf) + var seq = [RodentStyle]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeRodentStyle.read(from: &buf)) + } + return seq + } +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +fileprivate struct FfiConverterSequenceTypeTag: FfiConverterRustBuffer { + typealias SwiftType = [Tag] + + public static func write(_ value: [Tag], into buf: inout [UInt8]) { + let len = Int32(value.count) + writeInt(&buf, len) + for item in value { + FfiConverterTypeTag.write(item, into: &buf) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Tag] { + let len: Int32 = try readInt(&buf) + var seq = [Tag]() + seq.reserveCapacity(Int(len)) + for _ in 0 ..< len { + seq.append(try FfiConverterTypeTag.read(from: &buf)) + } + return seq + } +} +/** + * Opens a database file given as its content. + */ +public func openBytes(name: String, bytes: Data)throws -> Database { + return try FfiConverterTypeDatabase_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_open_bytes( + FfiConverterString.lower(name), + FfiConverterData.lower(bytes),uniffiCallStatus + ) +}) +} +/** + * Opens the ChessBase database `cbh_name` from the files of its folder (the `.cbh` + * and the files beside it with the same name; others are closed unread). + */ +public func openChessbase(cbhName: String, files: [FolderFile])throws -> Database { + return try FfiConverterTypeDatabase_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_open_chessbase( + FfiConverterString.lower(cbhName), + FfiConverterSequenceTypeFolderFile.lower(files),uniffiCallStatus + ) +}) +} +/** + * Opens a database file (PGN, `.zip`, `.7z`, `.cbv`) from a file descriptor; the + * descriptor is taken over and closed (on Android: `ParcelFileDescriptor.detachFd()`). + * `name` is the file's name, for its extension. + */ +public func openFile(name: String, fd: Int32)throws -> Database { + return try FfiConverterTypeDatabase_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_open_file( + FfiConverterString.lower(name), + FfiConverterInt32.lower(fd),uniffiCallStatus + ) +}) +} +/** + * Opens a database by its path (tests, tools; the app uses descriptors). + */ +public func openPath(path: String)throws -> Database { + return try FfiConverterTypeDatabase_lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_open_path( + FfiConverterString.lower(path),uniffiCallStatus + ) +}) +} +/** + * Deletes a downloaded database and the files beside it (its state). + */ +public func deleteOnlineDatabase(path: String) {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_delete_online_database( + FfiConverterString.lower(path),uniffiCallStatus + ) +} +} +/** + * Looks the nickname up on the site (blocks: it asks the site). + */ +public func findAccount(site: Site, nick: String) -> AccountLookup { + return try! FfiConverterTypeAccountLookup_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_find_account( + FfiConverterTypeSite_lower(site), + FfiConverterString.lower(nick),uniffiCallStatus + ) +}) +} +/** + * The state of the database at `path`, when it is a downloaded one. + */ +public func onlineDatabase(path: String) -> OnlineDatabase? { + return try! FfiConverterOptionTypeOnlineDatabase.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_online_database( + FfiConverterString.lower(path),uniffiCallStatus + ) +}) +} +/** + * Where the found accounts go in `dir`: all into one database (`together`) or each into + * its own; a database already holding them is kept. + */ +public func onlineTargets(dir: String, accounts: [OnlineAccount], together: Bool) -> [OnlineTarget] { + return try! FfiConverterSequenceTypeOnlineTarget.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_online_targets( + FfiConverterString.lower(dir), + FfiConverterSequenceTypeOnlineAccount.lower(accounts), + FfiConverterBool.lower(together),uniffiCallStatus + ) +}) +} +/** + * A nickname both sites could have: 2–30 letters, digits, `_` or `-`. + */ +public func validNickname(nick: String) -> Bool { + return try! FfiConverterBool.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_valid_nickname( + FfiConverterString.lower(nick),uniffiCallStatus + ) +}) +} +/** + * The tags of a game against the computer on the phone (no clocks): `event` in the + * app's language; the user plays White when `user_white`. + */ +public func computerGameTags(event: String, userWhite: Bool, userName: String, rival: Rival, strength: UInt32) -> [Tag] { + return try! FfiConverterSequenceTypeTag.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_computer_game_tags( + FfiConverterString.lower(event), + FfiConverterBool.lower(userWhite), + FfiConverterString.lower(userName), + FfiConverterTypeRival_lower(rival), + FfiConverterUInt32.lower(strength),uniffiCallStatus + ) +}) +} +/** + * Maia's turns in a row with her position hopeless before she offers to resign. + */ +public func hopelessTurns() -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_hopeless_turns(uniffiCallStatus + ) +}) +} +/** + * The strengths Maia plays on her own scale, as on the desktop: (weakest, strongest). + */ +public func maiaRange() -> [UInt32] { + return try! FfiConverterSequenceUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_maia_range(uniffiCallStatus + ) +}) +} +/** + * How long the computer "thinks" before its move `ply` of an untimed game + * (milliseconds): as a person would, quicker with one legal move. + */ +public func movePauseMs(ply: UInt32, onlyMove: Bool) -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_move_pause_ms( + FfiConverterUInt32.lower(ply), + FfiConverterBool.lower(onlyMove),uniffiCallStatus + ) +}) +} +/** + * The opponent as the app shows it, without the style: «Maia 1500», «Rodent IV 1800». + */ +public func rivalLabel(rival: Rival, strength: UInt32) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_rival_label( + FfiConverterTypeRival_lower(rival), + FfiConverterUInt32.lower(strength),uniffiCallStatus + ) +}) +} +/** + * The opponent as the game's record names it: «Maia 1500», «Rodent IV 1800 (Tal)». + */ +public func rivalName(rival: Rival, strength: UInt32) -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_rival_name( + FfiConverterTypeRival_lower(rival), + FfiConverterUInt32.lower(strength),uniffiCallStatus + ) +}) +} +/** + * The opening books Rodent IV's characters open, downloaded as one pack + * (android-rodent.md §5). + */ +public func rodentBookPack() -> [RodentBook] { + return try! FfiConverterSequenceTypeRodentBook.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_rodent_book_pack(uniffiCallStatus + ) +}) +} +/** + * The strengths Rodent IV plays (its UCI_Elo): (weakest, strongest). + */ +public func rodentRange() -> [UInt32] { + return try! FfiConverterSequenceUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_rodent_range(uniffiCallStatus + ) +}) +} +/** + * Rodent IV's characters (the desktop's list; Rodent V is not on the phone). + */ +public func rodentStyles() -> [RodentStyle] { + return try! FfiConverterSequenceTypeRodentStyle.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_rodent_styles(uniffiCallStatus + ) +}) +} +/** + * The version of Rodent IV's files (the authors' commit): the personalities copied out + * of the APK are copied again when it changes. + */ +public func rodentVersion() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_rodent_version(uniffiCallStatus + ) +}) +} +/** + * Seconds `searches` engine searches of the game analysis take at `nps_per_process` + * nodes per second of one engine process (measured before, or a guess), in this + * phone's engine processes. + */ +public func reviewEstimateSecs(searches: UInt32, npsPerProcess: UInt64) -> UInt32 { + return try! FfiConverterUInt32.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_review_estimate_secs( + FfiConverterUInt32.lower(searches), + FfiConverterUInt64.lower(npsPerProcess),uniffiCallStatus + ) +}) +} +/** + * Makes a new empty own database at `path` (refused when the file exists). + */ +public func ownCreate(path: String)throws {try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_own_create( + FfiConverterString.lower(path),uniffiCallStatus + ) +} +} +/** + * Removes game `index` from the own database at `path`. + */ +public func ownRemove(path: String, index: UInt32)throws {try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_own_remove( + FfiConverterString.lower(path), + FfiConverterUInt32.lower(index),uniffiCallStatus + ) +} +} +/** + * Saves the game `pgn` into the own database at `path`: as game `index` (replacing + * it), or added at the end when `index` is `None`. Returns the game's number. + */ +public func ownSave(path: String, index: UInt32?, pgn: String)throws -> UInt32 { + return try FfiConverterUInt32.lift(try rustCallWithError(FfiConverterTypeApiError_lift) { + uniffiCallStatus in + uniffi_mobile_api_fn_func_own_save( + FfiConverterString.lower(path), + FfiConverterOptionUInt32.lower(index), + FfiConverterString.lower(pgn),uniffiCallStatus + ) +}) +} +/** + * Where the runs are kept (`training.json` in the app's files). + */ +public func trainerSetFile(path: String) {try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_trainer_set_file( + FfiConverterString.lower(path),uniffiCallStatus + ) +} +} +/** + * Asks `api` (a test server) for the latest release; a newer one comes with its APKs. + */ +public func checkRelease(api: String) -> ReleaseCheck { + return try! FfiConverterTypeReleaseCheck_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_check_release( + FfiConverterString.lower(api),uniffiCallStatus + ) +}) +} +/** + * Asks the site for the latest release, counting this installation for the day (its + * random `install` id and `platform`: "android" or "android-noengine"); without the + * site, GitHub. A newer release comes with its APKs. + */ +public func checkReleaseCounted(install: String, platform: String) -> ReleaseCheck { + return try! FfiConverterTypeReleaseCheck_lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_check_release_counted( + FfiConverterString.lower(install), + FfiConverterString.lower(platform),uniffiCallStatus + ) +}) +} +/** + * GitHub's answer for the latest release (a debug build may ask a test server). + */ +public func releaseApi() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffiCallStatus in + uniffi_mobile_api_fn_func_release_api(uniffiCallStatus + ) +}) +} + +private enum InitializationResult { + case ok + case contractVersionMismatch + case apiChecksumMismatch +} +// Use a global variable to perform the versioning checks. Swift ensures that +// the code inside is only computed once. +private let initializationResult: InitializationResult = { + // Get the bindings contract version from our ComponentInterface + let bindings_contract_version = 30 + // Get the scaffolding contract version by calling the into the dylib + let scaffolding_contract_version = ffi_mobile_api_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version { + return InitializationResult.contractVersionMismatch + } + if (uniffi_mobile_api_checksum_func_open_bytes() != 45696) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_open_chessbase() != 34293) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_open_file() != 41660) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_open_path() != 3159) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_delete_online_database() != 10827) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_find_account() != 34245) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_online_database() != 14641) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_online_targets() != 17914) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_valid_nickname() != 20440) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_computer_game_tags() != 13978) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_hopeless_turns() != 4716) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_maia_range() != 8445) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_move_pause_ms() != 46916) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_rival_label() != 1851) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_rival_name() != 50702) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_rodent_book_pack() != 6165) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_rodent_range() != 30309) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_rodent_styles() != 6717) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_rodent_version() != 17337) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_review_estimate_secs() != 59010) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_own_create() != 43565) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_own_remove() != 39994) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_own_save() != 29490) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_trainer_set_file() != 24709) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_check_release() != 17738) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_check_release_counted() != 54959) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_func_release_api() != 51397) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_find() != 41701) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_format() != 62190) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_game() != 13948) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_is_empty() != 3355) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_len() != 39534) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_newest_first() != 25840) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_notes() != 8568) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_pgn() != 14) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_review() != 20396) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_rows() != 55855) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_rows_of() != 22834) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_session() != 13281) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_prepare_position() != 11767) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_database_suggest_players() != 46681) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_analyzer_analyze() != 34144) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_analyzer_poll() != 45771) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_analyzer_quit() != 45344) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_analyzer_stop() != 50787) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_onlinedownload_cancel() != 32278) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_onlinedownload_state() != 46119) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_maiaplayer_choose() != 14997) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_resignjudge_ask() != 1694) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_resignjudge_forget() != 52931) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_resignjudge_forget_scores() != 9173) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_resignjudge_hopeless() != 5608) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_resignjudge_may_offer_draw() != 60609) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_resignjudge_offer_draw() != 17768) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_rodentplayer_choose() != 22740) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_rodentplayer_failure() != 64959) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_rodentplayer_forget() != 65358) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_prepsearch_cancel() != 5927) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_prepsearch_state() != 37530) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamereview_cancel() != 25049) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamereview_start() != 54716) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamereview_state() != 48523) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_ending() != 17995) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_add_comment() != 41399) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_add_line() != 61827) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_can_redo() != 7738) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_can_undo() != 32279) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_data() != 35662) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_delete_from() != 34708) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_is_modified() != 910) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_legal_moves() != 48605) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_make_main() != 45389) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_mark_saved() != 12000) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_pgn() != 56097) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_play() != 3894) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_play_from() != 7019) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_redo() != 42738) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_review() != 55508) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_set_data() != 43756) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_undo() != 49960) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_trainer() != 14323) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_gamesession_training_runs() != 31571) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_again() != 43209) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_event() != 16815) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_fen_after() != 21411) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_game() != 8370) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_judge() != 41333) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_legal_moves() != 28204) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_promotion_at() != 23166) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_show() != 12978) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_state() != 11667) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_method_trainer_up_to() != 28864) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_analyzer_start() != 48571) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_onlinedownload_start() != 6799) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_maiaplayer_load() != 29545) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_resignjudge_start() != 7151) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_rodentplayer_start() != 41669) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_gamesession_from_pgn() != 23248) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mobile_api_checksum_constructor_gamesession_new_game() != 14475) { + return InitializationResult.apiChecksumMismatch + } + + return InitializationResult.ok +}() + +// Make the ensure init function public so that other modules which have external type references to +// our types can call it. +public func uniffiEnsureMobileApiInitialized() { + switch initializationResult { + case .ok: + break + case .contractVersionMismatch: + fatalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + case .apiChecksumMismatch: + fatalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } +} + +// swiftlint:enable all \ No newline at end of file diff --git a/iosApp/Generated/MobileAPI/MobileAPIFFI.h b/iosApp/Generated/MobileAPI/MobileAPIFFI.h new file mode 100644 index 0000000..fff367b --- /dev/null +++ b/iosApp/Generated/MobileAPI/MobileAPIFFI.h @@ -0,0 +1,1708 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +#pragma once + +#include +#include +#include + +// The following structs are used to implement the lowest level +// of the FFI, and thus useful to multiple uniffied crates. +// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. +#ifdef UNIFFI_SHARED_H + // We also try to prevent mixing versions of shared uniffi header structs. + // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 + #ifndef UNIFFI_SHARED_HEADER_V4 + #error Combining helper code from multiple versions of uniffi is not supported + #endif // ndef UNIFFI_SHARED_HEADER_V4 +#else +#define UNIFFI_SHARED_H +#define UNIFFI_SHARED_HEADER_V4 +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ + +typedef struct RustBuffer +{ + uint64_t capacity; + uint64_t len; + uint8_t *_Nullable data; +} RustBuffer; + +typedef struct ForeignBytes +{ + int32_t len; + const uint8_t *_Nullable data; +} ForeignBytes; + +// Error definitions +typedef struct RustCallStatus { + int8_t code; + RustBuffer errorBuf; +} RustCallStatus; + +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ +#endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK +typedef void (*UniffiForeignFutureDroppedCallback)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE +typedef uint64_t (*UniffiCallbackInterfaceClone)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT +typedef struct UniffiForeignFutureDroppedCallbackStruct { + uint64_t handle; + UniffiForeignFutureDroppedCallback _Nonnull free; +} UniffiForeignFutureDroppedCallbackStruct; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 +typedef struct UniffiForeignFutureResultU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureResultU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 +typedef struct UniffiForeignFutureResultI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureResultI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 +typedef struct UniffiForeignFutureResultU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureResultU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 +typedef struct UniffiForeignFutureResultI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureResultI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 +typedef struct UniffiForeignFutureResultU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureResultU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 +typedef struct UniffiForeignFutureResultI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureResultI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 +typedef struct UniffiForeignFutureResultU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureResultU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 +typedef struct UniffiForeignFutureResultI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureResultI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 +typedef struct UniffiForeignFutureResultF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureResultF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 +typedef struct UniffiForeignFutureResultF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureResultF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER +typedef struct UniffiForeignFutureResultRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultRustBuffer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureResultRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID +typedef struct UniffiForeignFutureResultVoid { + RustCallStatus callStatus; +} UniffiForeignFutureResultVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureResultVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_DATABASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_DATABASE +uint64_t uniffi_mobile_api_fn_clone_database(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_DATABASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_DATABASE +void uniffi_mobile_api_fn_free_database(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_FIND +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_FIND +RustBuffer uniffi_mobile_api_fn_method_database_find(uint64_t ptr, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_FORMAT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_FORMAT +RustBuffer uniffi_mobile_api_fn_method_database_format(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_GAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_GAME +RustBuffer uniffi_mobile_api_fn_method_database_game(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_IS_EMPTY +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_IS_EMPTY +int8_t uniffi_mobile_api_fn_method_database_is_empty(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_LEN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_LEN +uint32_t uniffi_mobile_api_fn_method_database_len(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_NEWEST_FIRST +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_NEWEST_FIRST +RustBuffer uniffi_mobile_api_fn_method_database_newest_first(uint64_t ptr, RustBuffer indices, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_NOTES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_NOTES +RustBuffer uniffi_mobile_api_fn_method_database_notes(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_PGN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_PGN +RustBuffer uniffi_mobile_api_fn_method_database_pgn(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_REVIEW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_REVIEW +uint64_t uniffi_mobile_api_fn_method_database_review(uint64_t ptr, uint32_t index, RustBuffer cache_dir, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_ROWS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_ROWS +RustBuffer uniffi_mobile_api_fn_method_database_rows(uint64_t ptr, uint32_t start, uint32_t count, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_ROWS_OF +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_ROWS_OF +RustBuffer uniffi_mobile_api_fn_method_database_rows_of(uint64_t ptr, RustBuffer indices, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_SESSION +uint64_t uniffi_mobile_api_fn_method_database_session(uint64_t ptr, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_PREPARE_POSITION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_PREPARE_POSITION +uint64_t uniffi_mobile_api_fn_method_database_prepare_position(uint64_t ptr, uint32_t player_id, int8_t white, RustBuffer query_fen, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_SUGGEST_PLAYERS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_DATABASE_SUGGEST_PLAYERS +RustBuffer uniffi_mobile_api_fn_method_database_suggest_players(uint64_t ptr, RustBuffer query, uint32_t start, uint32_t count, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_ANALYZER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_ANALYZER +uint64_t uniffi_mobile_api_fn_clone_analyzer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_ANALYZER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_ANALYZER +void uniffi_mobile_api_fn_free_analyzer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_ANALYZER_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_ANALYZER_START +uint64_t uniffi_mobile_api_fn_constructor_analyzer_start(RustBuffer path, RustBuffer eval_file, uint32_t threads, uint32_t hash_mb, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_ANALYZE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_ANALYZE +uint64_t uniffi_mobile_api_fn_method_analyzer_analyze(uint64_t ptr, RustBuffer start_fen, RustBuffer moves, uint32_t lines, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_POLL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_POLL +RustBuffer uniffi_mobile_api_fn_method_analyzer_poll(uint64_t ptr, uint32_t timeout_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_QUIT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_QUIT +void uniffi_mobile_api_fn_method_analyzer_quit(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_STOP +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ANALYZER_STOP +void uniffi_mobile_api_fn_method_analyzer_stop(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_ONLINEDOWNLOAD +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_ONLINEDOWNLOAD +uint64_t uniffi_mobile_api_fn_clone_onlinedownload(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_ONLINEDOWNLOAD +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_ONLINEDOWNLOAD +void uniffi_mobile_api_fn_free_onlinedownload(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_ONLINEDOWNLOAD_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_ONLINEDOWNLOAD_START +uint64_t uniffi_mobile_api_fn_constructor_onlinedownload_start(RustBuffer accounts, RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ONLINEDOWNLOAD_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ONLINEDOWNLOAD_CANCEL +void uniffi_mobile_api_fn_method_onlinedownload_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ONLINEDOWNLOAD_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_ONLINEDOWNLOAD_STATE +RustBuffer uniffi_mobile_api_fn_method_onlinedownload_state(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_MAIAPLAYER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_MAIAPLAYER +uint64_t uniffi_mobile_api_fn_clone_maiaplayer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_MAIAPLAYER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_MAIAPLAYER +void uniffi_mobile_api_fn_free_maiaplayer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_MAIAPLAYER_LOAD +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_MAIAPLAYER_LOAD +uint64_t uniffi_mobile_api_fn_constructor_maiaplayer_load(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_MAIAPLAYER_CHOOSE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_MAIAPLAYER_CHOOSE +RustBuffer uniffi_mobile_api_fn_method_maiaplayer_choose(uint64_t ptr, uint64_t game, uint32_t at, uint32_t strength, RustBuffer opponent, float random, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_RESIGNJUDGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_RESIGNJUDGE +uint64_t uniffi_mobile_api_fn_clone_resignjudge(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_RESIGNJUDGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_RESIGNJUDGE +void uniffi_mobile_api_fn_free_resignjudge(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_RESIGNJUDGE_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_RESIGNJUDGE_START +uint64_t uniffi_mobile_api_fn_constructor_resignjudge_start(RustBuffer path, RustBuffer eval_file, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_ASK +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_ASK +void uniffi_mobile_api_fn_method_resignjudge_ask(uint64_t ptr, uint64_t game, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_FORGET +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_FORGET +void uniffi_mobile_api_fn_method_resignjudge_forget(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_FORGET_SCORES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_FORGET_SCORES +void uniffi_mobile_api_fn_method_resignjudge_forget_scores(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_HOPELESS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_HOPELESS +RustBuffer uniffi_mobile_api_fn_method_resignjudge_hopeless(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_MAY_OFFER_DRAW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_MAY_OFFER_DRAW +int8_t uniffi_mobile_api_fn_method_resignjudge_may_offer_draw(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_OFFER_DRAW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RESIGNJUDGE_OFFER_DRAW +int8_t uniffi_mobile_api_fn_method_resignjudge_offer_draw(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_RODENTPLAYER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_RODENTPLAYER +uint64_t uniffi_mobile_api_fn_clone_rodentplayer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_RODENTPLAYER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_RODENTPLAYER +void uniffi_mobile_api_fn_free_rodentplayer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_RODENTPLAYER_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_RODENTPLAYER_START +uint64_t uniffi_mobile_api_fn_constructor_rodentplayer_start(RustBuffer exe, RustBuffer home, RustBuffer style_id, uint32_t strength, int8_t use_book, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RODENTPLAYER_CHOOSE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RODENTPLAYER_CHOOSE +RustBuffer uniffi_mobile_api_fn_method_rodentplayer_choose(uint64_t ptr, uint64_t game, uint32_t at, uint64_t pause_ms, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RODENTPLAYER_FAILURE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RODENTPLAYER_FAILURE +RustBuffer uniffi_mobile_api_fn_method_rodentplayer_failure(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RODENTPLAYER_FORGET +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_RODENTPLAYER_FORGET +void uniffi_mobile_api_fn_method_rodentplayer_forget(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_PREPSEARCH +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_PREPSEARCH +uint64_t uniffi_mobile_api_fn_clone_prepsearch(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_PREPSEARCH +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_PREPSEARCH +void uniffi_mobile_api_fn_free_prepsearch(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_PREPSEARCH_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_PREPSEARCH_CANCEL +void uniffi_mobile_api_fn_method_prepsearch_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_PREPSEARCH_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_PREPSEARCH_STATE +RustBuffer uniffi_mobile_api_fn_method_prepsearch_state(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_GAMEREVIEW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_GAMEREVIEW +uint64_t uniffi_mobile_api_fn_clone_gamereview(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_GAMEREVIEW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_GAMEREVIEW +void uniffi_mobile_api_fn_free_gamereview(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMEREVIEW_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMEREVIEW_CANCEL +void uniffi_mobile_api_fn_method_gamereview_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMEREVIEW_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMEREVIEW_START +int8_t uniffi_mobile_api_fn_method_gamereview_start(uint64_t ptr, RustBuffer path, RustBuffer eval_file, int8_t full, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMEREVIEW_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMEREVIEW_STATE +RustBuffer uniffi_mobile_api_fn_method_gamereview_state(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_GAMESESSION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_GAMESESSION +uint64_t uniffi_mobile_api_fn_clone_gamesession(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_GAMESESSION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_GAMESESSION +void uniffi_mobile_api_fn_free_gamesession(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_GAMESESSION_FROM_PGN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_GAMESESSION_FROM_PGN +uint64_t uniffi_mobile_api_fn_constructor_gamesession_from_pgn(RustBuffer pgn, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_GAMESESSION_NEW_GAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CONSTRUCTOR_GAMESESSION_NEW_GAME +uint64_t uniffi_mobile_api_fn_constructor_gamesession_new_game(RustBuffer date, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_ENDING +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_ENDING +RustBuffer uniffi_mobile_api_fn_method_gamesession_ending(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_ADD_COMMENT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_ADD_COMMENT +RustBuffer uniffi_mobile_api_fn_method_gamesession_add_comment(uint64_t ptr, uint32_t at, RustBuffer text, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_ADD_LINE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_ADD_LINE +RustBuffer uniffi_mobile_api_fn_method_gamesession_add_line(uint64_t ptr, uint32_t at, RustBuffer uci, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_CAN_REDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_CAN_REDO +int8_t uniffi_mobile_api_fn_method_gamesession_can_redo(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_CAN_UNDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_CAN_UNDO +int8_t uniffi_mobile_api_fn_method_gamesession_can_undo(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_DATA +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_DATA +RustBuffer uniffi_mobile_api_fn_method_gamesession_data(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_DELETE_FROM +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_DELETE_FROM +RustBuffer uniffi_mobile_api_fn_method_gamesession_delete_from(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_IS_MODIFIED +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_IS_MODIFIED +int8_t uniffi_mobile_api_fn_method_gamesession_is_modified(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_LEGAL_MOVES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_LEGAL_MOVES +RustBuffer uniffi_mobile_api_fn_method_gamesession_legal_moves(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_MAKE_MAIN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_MAKE_MAIN +RustBuffer uniffi_mobile_api_fn_method_gamesession_make_main(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_MARK_SAVED +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_MARK_SAVED +void uniffi_mobile_api_fn_method_gamesession_mark_saved(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_PGN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_PGN +RustBuffer uniffi_mobile_api_fn_method_gamesession_pgn(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_PLAY +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_PLAY +RustBuffer uniffi_mobile_api_fn_method_gamesession_play(uint64_t ptr, uint32_t at, RustBuffer uci, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_PLAY_FROM +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_PLAY_FROM +uint64_t uniffi_mobile_api_fn_method_gamesession_play_from(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_REDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_REDO +RustBuffer uniffi_mobile_api_fn_method_gamesession_redo(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_REVIEW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_REVIEW +uint64_t uniffi_mobile_api_fn_method_gamesession_review(uint64_t ptr, RustBuffer cache_dir, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_SET_DATA +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_SET_DATA +void uniffi_mobile_api_fn_method_gamesession_set_data(uint64_t ptr, RustBuffer tags, RustBuffer result, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_UNDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_UNDO +RustBuffer uniffi_mobile_api_fn_method_gamesession_undo(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_TRAINER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_TRAINER +RustBuffer uniffi_mobile_api_fn_method_gamesession_trainer(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_TRAINING_RUNS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_GAMESESSION_TRAINING_RUNS +RustBuffer uniffi_mobile_api_fn_method_gamesession_training_runs(uint64_t ptr, uint32_t at, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_TRAINER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_CLONE_TRAINER +uint64_t uniffi_mobile_api_fn_clone_trainer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_TRAINER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FREE_TRAINER +void uniffi_mobile_api_fn_free_trainer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_AGAIN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_AGAIN +void uniffi_mobile_api_fn_method_trainer_again(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_EVENT +RustBuffer uniffi_mobile_api_fn_method_trainer_event(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_FEN_AFTER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_FEN_AFTER +RustBuffer uniffi_mobile_api_fn_method_trainer_fen_after(uint64_t ptr, uint32_t ply, RustBuffer uci, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_GAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_GAME +RustBuffer uniffi_mobile_api_fn_method_trainer_game(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_JUDGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_JUDGE +RustBuffer uniffi_mobile_api_fn_method_trainer_judge(uint64_t ptr, uint32_t ply, RustBuffer uci, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_LEGAL_MOVES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_LEGAL_MOVES +RustBuffer uniffi_mobile_api_fn_method_trainer_legal_moves(uint64_t ptr, uint32_t ply, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_PROMOTION_AT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_PROMOTION_AT +RustBuffer uniffi_mobile_api_fn_method_trainer_promotion_at(uint64_t ptr, uint32_t ply, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_SHOW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_SHOW +void uniffi_mobile_api_fn_method_trainer_show(uint64_t ptr, uint32_t ply, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_STATE +RustBuffer uniffi_mobile_api_fn_method_trainer_state(uint64_t ptr, uint32_t ply, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_UP_TO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_METHOD_TRAINER_UP_TO +RustBuffer uniffi_mobile_api_fn_method_trainer_up_to(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_BYTES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_BYTES +uint64_t uniffi_mobile_api_fn_func_open_bytes(RustBuffer name, RustBuffer bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_CHESSBASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_CHESSBASE +uint64_t uniffi_mobile_api_fn_func_open_chessbase(RustBuffer cbh_name, RustBuffer files, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_FILE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_FILE +uint64_t uniffi_mobile_api_fn_func_open_file(RustBuffer name, int32_t fd, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_PATH +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OPEN_PATH +uint64_t uniffi_mobile_api_fn_func_open_path(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_DELETE_ONLINE_DATABASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_DELETE_ONLINE_DATABASE +void uniffi_mobile_api_fn_func_delete_online_database(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_FIND_ACCOUNT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_FIND_ACCOUNT +RustBuffer uniffi_mobile_api_fn_func_find_account(RustBuffer site, RustBuffer nick, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_ONLINE_DATABASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_ONLINE_DATABASE +RustBuffer uniffi_mobile_api_fn_func_online_database(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_ONLINE_TARGETS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_ONLINE_TARGETS +RustBuffer uniffi_mobile_api_fn_func_online_targets(RustBuffer dir, RustBuffer accounts, int8_t together, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_VALID_NICKNAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_VALID_NICKNAME +int8_t uniffi_mobile_api_fn_func_valid_nickname(RustBuffer nick, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_COMPUTER_GAME_TAGS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_COMPUTER_GAME_TAGS +RustBuffer uniffi_mobile_api_fn_func_computer_game_tags(RustBuffer event, int8_t user_white, RustBuffer user_name, RustBuffer rival, uint32_t strength, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_HOPELESS_TURNS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_HOPELESS_TURNS +uint32_t uniffi_mobile_api_fn_func_hopeless_turns(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_MAIA_RANGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_MAIA_RANGE +RustBuffer uniffi_mobile_api_fn_func_maia_range(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_MOVE_PAUSE_MS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_MOVE_PAUSE_MS +uint64_t uniffi_mobile_api_fn_func_move_pause_ms(uint32_t ply, int8_t only_move, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RIVAL_LABEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RIVAL_LABEL +RustBuffer uniffi_mobile_api_fn_func_rival_label(RustBuffer rival, uint32_t strength, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RIVAL_NAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RIVAL_NAME +RustBuffer uniffi_mobile_api_fn_func_rival_name(RustBuffer rival, uint32_t strength, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_BOOK_PACK +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_BOOK_PACK +RustBuffer uniffi_mobile_api_fn_func_rodent_book_pack(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_RANGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_RANGE +RustBuffer uniffi_mobile_api_fn_func_rodent_range(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_STYLES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_STYLES +RustBuffer uniffi_mobile_api_fn_func_rodent_styles(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_VERSION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RODENT_VERSION +RustBuffer uniffi_mobile_api_fn_func_rodent_version(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_REVIEW_ESTIMATE_SECS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_REVIEW_ESTIMATE_SECS +uint32_t uniffi_mobile_api_fn_func_review_estimate_secs(uint32_t searches, uint64_t nps_per_process, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OWN_CREATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OWN_CREATE +void uniffi_mobile_api_fn_func_own_create(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OWN_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OWN_REMOVE +void uniffi_mobile_api_fn_func_own_remove(RustBuffer path, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OWN_SAVE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_OWN_SAVE +uint32_t uniffi_mobile_api_fn_func_own_save(RustBuffer path, RustBuffer index, RustBuffer pgn, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_TRAINER_SET_FILE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_TRAINER_SET_FILE +void uniffi_mobile_api_fn_func_trainer_set_file(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_CHECK_RELEASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_CHECK_RELEASE +RustBuffer uniffi_mobile_api_fn_func_check_release(RustBuffer api, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_CHECK_RELEASE_COUNTED +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_CHECK_RELEASE_COUNTED +RustBuffer uniffi_mobile_api_fn_func_check_release_counted(RustBuffer install, RustBuffer platform, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RELEASE_API +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_FN_FUNC_RELEASE_API +RustBuffer uniffi_mobile_api_fn_func_release_api(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_ALLOC +RustBuffer ffi_mobile_api_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_FROM_BYTES +RustBuffer ffi_mobile_api_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_FREE +void ffi_mobile_api_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUSTBUFFER_RESERVE +RustBuffer ffi_mobile_api_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U8 +void ffi_mobile_api_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U8 +void ffi_mobile_api_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U8 +void ffi_mobile_api_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_mobile_api_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I8 +void ffi_mobile_api_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I8 +void ffi_mobile_api_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I8 +void ffi_mobile_api_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_mobile_api_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U16 +void ffi_mobile_api_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U16 +void ffi_mobile_api_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U16 +void ffi_mobile_api_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_mobile_api_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I16 +void ffi_mobile_api_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I16 +void ffi_mobile_api_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I16 +void ffi_mobile_api_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_mobile_api_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U32 +void ffi_mobile_api_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U32 +void ffi_mobile_api_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U32 +void ffi_mobile_api_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_mobile_api_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I32 +void ffi_mobile_api_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I32 +void ffi_mobile_api_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I32 +void ffi_mobile_api_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_mobile_api_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_U64 +void ffi_mobile_api_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_U64 +void ffi_mobile_api_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_U64 +void ffi_mobile_api_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_mobile_api_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_I64 +void ffi_mobile_api_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_I64 +void ffi_mobile_api_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_I64 +void ffi_mobile_api_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_mobile_api_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_F32 +void ffi_mobile_api_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_F32 +void ffi_mobile_api_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_F32 +void ffi_mobile_api_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_F32 +float ffi_mobile_api_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_F64 +void ffi_mobile_api_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_F64 +void ffi_mobile_api_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_F64 +void ffi_mobile_api_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_F64 +double ffi_mobile_api_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_mobile_api_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_mobile_api_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_mobile_api_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_mobile_api_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_POLL_VOID +void ffi_mobile_api_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_CANCEL_VOID +void ffi_mobile_api_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_FREE_VOID +void ffi_mobile_api_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_MOBILE_API_RUST_FUTURE_COMPLETE_VOID +void ffi_mobile_api_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_BYTES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_BYTES +uint16_t uniffi_mobile_api_checksum_func_open_bytes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_CHESSBASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_CHESSBASE +uint16_t uniffi_mobile_api_checksum_func_open_chessbase(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_FILE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_FILE +uint16_t uniffi_mobile_api_checksum_func_open_file(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_PATH +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OPEN_PATH +uint16_t uniffi_mobile_api_checksum_func_open_path(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_DELETE_ONLINE_DATABASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_DELETE_ONLINE_DATABASE +uint16_t uniffi_mobile_api_checksum_func_delete_online_database(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_FIND_ACCOUNT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_FIND_ACCOUNT +uint16_t uniffi_mobile_api_checksum_func_find_account(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_ONLINE_DATABASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_ONLINE_DATABASE +uint16_t uniffi_mobile_api_checksum_func_online_database(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_ONLINE_TARGETS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_ONLINE_TARGETS +uint16_t uniffi_mobile_api_checksum_func_online_targets(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_VALID_NICKNAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_VALID_NICKNAME +uint16_t uniffi_mobile_api_checksum_func_valid_nickname(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_COMPUTER_GAME_TAGS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_COMPUTER_GAME_TAGS +uint16_t uniffi_mobile_api_checksum_func_computer_game_tags(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_HOPELESS_TURNS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_HOPELESS_TURNS +uint16_t uniffi_mobile_api_checksum_func_hopeless_turns(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_MAIA_RANGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_MAIA_RANGE +uint16_t uniffi_mobile_api_checksum_func_maia_range(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_MOVE_PAUSE_MS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_MOVE_PAUSE_MS +uint16_t uniffi_mobile_api_checksum_func_move_pause_ms(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RIVAL_LABEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RIVAL_LABEL +uint16_t uniffi_mobile_api_checksum_func_rival_label(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RIVAL_NAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RIVAL_NAME +uint16_t uniffi_mobile_api_checksum_func_rival_name(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_BOOK_PACK +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_BOOK_PACK +uint16_t uniffi_mobile_api_checksum_func_rodent_book_pack(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_RANGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_RANGE +uint16_t uniffi_mobile_api_checksum_func_rodent_range(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_STYLES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_STYLES +uint16_t uniffi_mobile_api_checksum_func_rodent_styles(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_VERSION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RODENT_VERSION +uint16_t uniffi_mobile_api_checksum_func_rodent_version(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_REVIEW_ESTIMATE_SECS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_REVIEW_ESTIMATE_SECS +uint16_t uniffi_mobile_api_checksum_func_review_estimate_secs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OWN_CREATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OWN_CREATE +uint16_t uniffi_mobile_api_checksum_func_own_create(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OWN_REMOVE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OWN_REMOVE +uint16_t uniffi_mobile_api_checksum_func_own_remove(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OWN_SAVE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_OWN_SAVE +uint16_t uniffi_mobile_api_checksum_func_own_save(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_TRAINER_SET_FILE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_TRAINER_SET_FILE +uint16_t uniffi_mobile_api_checksum_func_trainer_set_file(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_CHECK_RELEASE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_CHECK_RELEASE +uint16_t uniffi_mobile_api_checksum_func_check_release(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_CHECK_RELEASE_COUNTED +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_CHECK_RELEASE_COUNTED +uint16_t uniffi_mobile_api_checksum_func_check_release_counted(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RELEASE_API +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_FUNC_RELEASE_API +uint16_t uniffi_mobile_api_checksum_func_release_api(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_FIND +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_FIND +uint16_t uniffi_mobile_api_checksum_method_database_find(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_FORMAT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_FORMAT +uint16_t uniffi_mobile_api_checksum_method_database_format(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_GAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_GAME +uint16_t uniffi_mobile_api_checksum_method_database_game(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_IS_EMPTY +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_IS_EMPTY +uint16_t uniffi_mobile_api_checksum_method_database_is_empty(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_LEN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_LEN +uint16_t uniffi_mobile_api_checksum_method_database_len(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_NEWEST_FIRST +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_NEWEST_FIRST +uint16_t uniffi_mobile_api_checksum_method_database_newest_first(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_NOTES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_NOTES +uint16_t uniffi_mobile_api_checksum_method_database_notes(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_PGN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_PGN +uint16_t uniffi_mobile_api_checksum_method_database_pgn(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_REVIEW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_REVIEW +uint16_t uniffi_mobile_api_checksum_method_database_review(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_ROWS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_ROWS +uint16_t uniffi_mobile_api_checksum_method_database_rows(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_ROWS_OF +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_ROWS_OF +uint16_t uniffi_mobile_api_checksum_method_database_rows_of(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_SESSION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_SESSION +uint16_t uniffi_mobile_api_checksum_method_database_session(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_PREPARE_POSITION +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_PREPARE_POSITION +uint16_t uniffi_mobile_api_checksum_method_database_prepare_position(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_SUGGEST_PLAYERS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_DATABASE_SUGGEST_PLAYERS +uint16_t uniffi_mobile_api_checksum_method_database_suggest_players(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_ANALYZE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_ANALYZE +uint16_t uniffi_mobile_api_checksum_method_analyzer_analyze(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_POLL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_POLL +uint16_t uniffi_mobile_api_checksum_method_analyzer_poll(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_QUIT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_QUIT +uint16_t uniffi_mobile_api_checksum_method_analyzer_quit(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_STOP +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ANALYZER_STOP +uint16_t uniffi_mobile_api_checksum_method_analyzer_stop(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ONLINEDOWNLOAD_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ONLINEDOWNLOAD_CANCEL +uint16_t uniffi_mobile_api_checksum_method_onlinedownload_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ONLINEDOWNLOAD_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_ONLINEDOWNLOAD_STATE +uint16_t uniffi_mobile_api_checksum_method_onlinedownload_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_MAIAPLAYER_CHOOSE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_MAIAPLAYER_CHOOSE +uint16_t uniffi_mobile_api_checksum_method_maiaplayer_choose(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_ASK +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_ASK +uint16_t uniffi_mobile_api_checksum_method_resignjudge_ask(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_FORGET +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_FORGET +uint16_t uniffi_mobile_api_checksum_method_resignjudge_forget(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_FORGET_SCORES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_FORGET_SCORES +uint16_t uniffi_mobile_api_checksum_method_resignjudge_forget_scores(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_HOPELESS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_HOPELESS +uint16_t uniffi_mobile_api_checksum_method_resignjudge_hopeless(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_MAY_OFFER_DRAW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_MAY_OFFER_DRAW +uint16_t uniffi_mobile_api_checksum_method_resignjudge_may_offer_draw(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_OFFER_DRAW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RESIGNJUDGE_OFFER_DRAW +uint16_t uniffi_mobile_api_checksum_method_resignjudge_offer_draw(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RODENTPLAYER_CHOOSE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RODENTPLAYER_CHOOSE +uint16_t uniffi_mobile_api_checksum_method_rodentplayer_choose(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RODENTPLAYER_FAILURE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RODENTPLAYER_FAILURE +uint16_t uniffi_mobile_api_checksum_method_rodentplayer_failure(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RODENTPLAYER_FORGET +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_RODENTPLAYER_FORGET +uint16_t uniffi_mobile_api_checksum_method_rodentplayer_forget(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_PREPSEARCH_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_PREPSEARCH_CANCEL +uint16_t uniffi_mobile_api_checksum_method_prepsearch_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_PREPSEARCH_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_PREPSEARCH_STATE +uint16_t uniffi_mobile_api_checksum_method_prepsearch_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMEREVIEW_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMEREVIEW_CANCEL +uint16_t uniffi_mobile_api_checksum_method_gamereview_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMEREVIEW_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMEREVIEW_START +uint16_t uniffi_mobile_api_checksum_method_gamereview_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMEREVIEW_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMEREVIEW_STATE +uint16_t uniffi_mobile_api_checksum_method_gamereview_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_ENDING +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_ENDING +uint16_t uniffi_mobile_api_checksum_method_gamesession_ending(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_ADD_COMMENT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_ADD_COMMENT +uint16_t uniffi_mobile_api_checksum_method_gamesession_add_comment(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_ADD_LINE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_ADD_LINE +uint16_t uniffi_mobile_api_checksum_method_gamesession_add_line(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_CAN_REDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_CAN_REDO +uint16_t uniffi_mobile_api_checksum_method_gamesession_can_redo(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_CAN_UNDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_CAN_UNDO +uint16_t uniffi_mobile_api_checksum_method_gamesession_can_undo(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_DATA +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_DATA +uint16_t uniffi_mobile_api_checksum_method_gamesession_data(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_DELETE_FROM +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_DELETE_FROM +uint16_t uniffi_mobile_api_checksum_method_gamesession_delete_from(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_IS_MODIFIED +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_IS_MODIFIED +uint16_t uniffi_mobile_api_checksum_method_gamesession_is_modified(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_LEGAL_MOVES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_LEGAL_MOVES +uint16_t uniffi_mobile_api_checksum_method_gamesession_legal_moves(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_MAKE_MAIN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_MAKE_MAIN +uint16_t uniffi_mobile_api_checksum_method_gamesession_make_main(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_MARK_SAVED +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_MARK_SAVED +uint16_t uniffi_mobile_api_checksum_method_gamesession_mark_saved(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_PGN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_PGN +uint16_t uniffi_mobile_api_checksum_method_gamesession_pgn(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_PLAY +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_PLAY +uint16_t uniffi_mobile_api_checksum_method_gamesession_play(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_PLAY_FROM +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_PLAY_FROM +uint16_t uniffi_mobile_api_checksum_method_gamesession_play_from(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_REDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_REDO +uint16_t uniffi_mobile_api_checksum_method_gamesession_redo(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_REVIEW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_REVIEW +uint16_t uniffi_mobile_api_checksum_method_gamesession_review(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_SET_DATA +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_SET_DATA +uint16_t uniffi_mobile_api_checksum_method_gamesession_set_data(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_UNDO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_UNDO +uint16_t uniffi_mobile_api_checksum_method_gamesession_undo(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_TRAINER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_TRAINER +uint16_t uniffi_mobile_api_checksum_method_gamesession_trainer(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_TRAINING_RUNS +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_GAMESESSION_TRAINING_RUNS +uint16_t uniffi_mobile_api_checksum_method_gamesession_training_runs(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_AGAIN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_AGAIN +uint16_t uniffi_mobile_api_checksum_method_trainer_again(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_EVENT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_EVENT +uint16_t uniffi_mobile_api_checksum_method_trainer_event(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_FEN_AFTER +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_FEN_AFTER +uint16_t uniffi_mobile_api_checksum_method_trainer_fen_after(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_GAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_GAME +uint16_t uniffi_mobile_api_checksum_method_trainer_game(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_JUDGE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_JUDGE +uint16_t uniffi_mobile_api_checksum_method_trainer_judge(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_LEGAL_MOVES +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_LEGAL_MOVES +uint16_t uniffi_mobile_api_checksum_method_trainer_legal_moves(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_PROMOTION_AT +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_PROMOTION_AT +uint16_t uniffi_mobile_api_checksum_method_trainer_promotion_at(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_SHOW +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_SHOW +uint16_t uniffi_mobile_api_checksum_method_trainer_show(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_STATE +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_STATE +uint16_t uniffi_mobile_api_checksum_method_trainer_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_UP_TO +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_METHOD_TRAINER_UP_TO +uint16_t uniffi_mobile_api_checksum_method_trainer_up_to(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_ANALYZER_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_ANALYZER_START +uint16_t uniffi_mobile_api_checksum_constructor_analyzer_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_ONLINEDOWNLOAD_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_ONLINEDOWNLOAD_START +uint16_t uniffi_mobile_api_checksum_constructor_onlinedownload_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_MAIAPLAYER_LOAD +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_MAIAPLAYER_LOAD +uint16_t uniffi_mobile_api_checksum_constructor_maiaplayer_load(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_RESIGNJUDGE_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_RESIGNJUDGE_START +uint16_t uniffi_mobile_api_checksum_constructor_resignjudge_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_RODENTPLAYER_START +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_RODENTPLAYER_START +uint16_t uniffi_mobile_api_checksum_constructor_rodentplayer_start(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_GAMESESSION_FROM_PGN +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_GAMESESSION_FROM_PGN +uint16_t uniffi_mobile_api_checksum_constructor_gamesession_from_pgn(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_GAMESESSION_NEW_GAME +#define UNIFFI_FFIDEF_UNIFFI_MOBILE_API_CHECKSUM_CONSTRUCTOR_GAMESESSION_NEW_GAME +uint16_t uniffi_mobile_api_checksum_constructor_gamesession_new_game(void + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_MOBILE_API_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_MOBILE_API_UNIFFI_CONTRACT_VERSION +uint32_t ffi_mobile_api_uniffi_contract_version(void + +); +#endif + diff --git a/iosApp/Generated/MobileAPI/MobileAPIFFI.modulemap b/iosApp/Generated/MobileAPI/MobileAPIFFI.modulemap new file mode 100644 index 0000000..07713c2 --- /dev/null +++ b/iosApp/Generated/MobileAPI/MobileAPIFFI.modulemap @@ -0,0 +1,9 @@ +module MobileAPIFFI { + header "MobileAPIFFI.h" + export * + use "Darwin" + use "_Builtin_stdbool" + use "_Builtin_stdint" + link framework "CoreFoundation" + link framework "IOKit" +} \ No newline at end of file diff --git a/iosApp/Generated/MobileAPI/module.modulemap b/iosApp/Generated/MobileAPI/module.modulemap new file mode 100644 index 0000000..07713c2 --- /dev/null +++ b/iosApp/Generated/MobileAPI/module.modulemap @@ -0,0 +1,9 @@ +module MobileAPIFFI { + header "MobileAPIFFI.h" + export * + use "Darwin" + use "_Builtin_stdbool" + use "_Builtin_stdint" + link framework "CoreFoundation" + link framework "IOKit" +} \ No newline at end of file diff --git a/iosApp/README.md b/iosApp/README.md new file mode 100644 index 0000000..6943edb --- /dev/null +++ b/iosApp/README.md @@ -0,0 +1,81 @@ +# ChessPenguin для iPhone + +Первый вертикальный срез нативного приложения: SwiftUI, iOS 16+, только iPhone и портретная ориентация. Интерфейс повторяет основной путь Android: **Базы → Партии → Партия**. + +Что работает: + +- встроенная, неизменённая `examples/classics.pgn` открывается общим Rust `mobile-api` через UniFFI (`open_bytes` → `rows` → `game`); +- список партий со страницами по 100 записей, сведения об игроках/результате/ECO и VoiceOver для всей строки; +- доска по FEN каждого узла, последний ход, стрелки/круги из комментариев, NAG-badge и индикация мата/пата; +- основная нотация, комментарии и полное дерево вариантов с кликабельными `MoveNode.id`, включая вложенные RAV; +- предыдущий/следующий ход; долгое нажатие — в начало/конец активной линии; +- аппаратные ←/→, Shift+←/→, F и Escape; +- переход к соседней партии и переворот доски Green; +- английский и русский `Localizable.strings` + правила множественного числа. + +Намеренно вне первого среза: импорт пользовательских файлов, поиск, настройки, iPad, landscape, редактор, игра, движок и Stockfish. + +## Требования + +Для приложения и XCFramework нужны **macOS, Xcode 15 или новее с iOS SDK**, Xcode Command Line Tools, Rust 1.97+ через `rustup`, Cargo и [XcodeGen](https://github.com/yonaskolb/XcodeGen) 2.x: + +```sh +brew install xcodegen +``` + +Никаких Swift Package/CocoaPods-зависимостей и отдельно скачиваемых движков нет. Rust-зависимости фиксируются общим `Cargo.lock` (`--locked`). Файл `project.yml` — исходник проекта; `.xcodeproj` генерируется и не хранится в репозитории. + +## Сборка на macOS + +Из каталога `iosApp`: + +```sh +./scripts/build-bindings.sh +xcodegen generate +open ChessPenguin.xcodeproj +``` + +Затем выбрать схему **ChessPenguin** и iPhone Simulator с iOS 16+ (Cmd+R). Скрипт: + +1. собирает host-библиотеку `mobile-api` и генерирует `Generated/MobileAPI/MobileAPI.swift`, C header и module map существующим `uniffi-bindgen`; +2. добавляет Rust targets и выполняет `cargo check` для `aarch64-apple-ios`, `aarch64-apple-ios-sim`, `x86_64-apple-ios`; +3. выпускает staticlib для устройства и обоих вариантов симулятора, объединяет симуляторные архивы через `lipo`; +4. создаёт `Frameworks/MobileAPI.xcframework` через `xcodebuild -create-xcframework`. + +Для сокращённой сборки на Apple Silicon можно задать: + +```sh +CP_IOS_TARGETS="aarch64-apple-ios aarch64-apple-ios-sim" ./scripts/build-bindings.sh +``` + +Проверка из командной строки без подписи: + +```sh +xcodebuild -project ChessPenguin.xcodeproj -scheme ChessPenguin \ + -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' \ + CODE_SIGNING_ALLOWED=NO build +``` + +`ChessPenguinTests` содержит XCTest для гонки загрузки, страниц, полного дерева нотации, flip/FEN, marks/NAG/end, keyboard mapping и accessibility. Запуск на конкретном Simulator: + +```sh +xcodebuild test -project ChessPenguin.xcodeproj -scheme ChessPenguin \ + -destination 'platform=iOS Simulator,name=iPhone 16' \ + CODE_SIGNING_ALLOWED=NO +``` + +Имя доступного Simulator подставить из `xcrun simctl list devices`. Эти тесты не запускались на Linux. + +После изменения Rust API повторить `build-bindings.sh`, после изменения `project.yml` — `xcodegen generate`. + +## Linux + +На Linux скрипт **только** собирает host `mobile-api` и проверяет фактическую генерацию Swift UniFFI. Он завершается до Rust iOS targets, `lipo` и `xcodebuild`; XCFramework, iOS-сборка и Simulator на Linux не имитируются. Даже отдельный `cargo check --target aarch64-apple-ios` на Linux останавливается в build script `ring`: cc-rs вызывает Apple `xcrun` и ищет iOS SDK. Для полноценной проверки нужен macOS по командам выше. + +Сгенерированные Swift/header/module map оставлены в `Generated/MobileAPI` для чтения и структурной проверки; их не редактируют вручную. XCFramework не хранится в Git. + +## Ресурсы + +- `ChessPenguin/Resources/classics.pgn` — байтовая копия `examples/classics.pgn`; приложение только читает её. +- `ChessPenguin/Resources/Pieces.xcassets` — PNG-рендеры исходных cburnett SVG из `apps/desktop/assets/pieces/cburnett`; авторство и лицензия — `Resources/THIRD_PARTY_NOTICES.txt` и корневой `THIRD_PARTY_NOTICES.md`. +- Цвета тёмной темы и доски повторяют `androidApp/.../theme/Color.kt` и `data/BoardStyle.kt`. diff --git a/iosApp/project.yml b/iosApp/project.yml new file mode 100644 index 0000000..c7744c1 --- /dev/null +++ b/iosApp/project.yml @@ -0,0 +1,48 @@ +name: ChessPenguin +options: + deploymentTarget: + iOS: "16.0" +settings: + base: + SWIFT_VERSION: "5.0" + IPHONEOS_DEPLOYMENT_TARGET: "16.0" + ENABLE_BITCODE: NO +targets: + ChessPenguin: + type: application + platform: iOS + sources: + - path: ChessPenguin + - path: Generated/MobileAPI/MobileAPI.swift + dependencies: + - framework: Frameworks/MobileAPI.xcframework + embed: false + settings: + base: + PRODUCT_BUNDLE_IDENTIFIER: io.github.vrubelroman.chesspenguin.ios + PRODUCT_NAME: ChessPenguin + MARKETING_VERSION: 2.5.2 + CURRENT_PROJECT_VERSION: 1 + TARGETED_DEVICE_FAMILY: "1" + GENERATE_INFOPLIST_FILE: YES + INFOPLIST_KEY_UILaunchScreen_Generation: YES + INFOPLIST_KEY_UIUserInterfaceStyle: Dark + INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait + SWIFT_INCLUDE_PATHS: "$(inherited) $(SRCROOT)/Generated/MobileAPI" + scheme: + gatherCoverageData: NO + testTargets: + - ChessPenguinTests + ChessPenguinTests: + type: bundle.unit-test + platform: iOS + sources: + - path: ChessPenguinTests + dependencies: + - target: ChessPenguin + settings: + base: + PRODUCT_BUNDLE_IDENTIFIER: io.github.vrubelroman.chesspenguin.ios.tests + TEST_HOST: "$(BUILT_PRODUCTS_DIR)/ChessPenguin.app/ChessPenguin" + BUNDLE_LOADER: "$(TEST_HOST)" + SWIFT_INCLUDE_PATHS: "$(inherited) $(SRCROOT)/Generated/MobileAPI" diff --git a/iosApp/scripts/build-bindings.sh b/iosApp/scripts/build-bindings.sh new file mode 100755 index 0000000..da885cb --- /dev/null +++ b/iosApp/scripts/build-bindings.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +IOS="$ROOT/iosApp" +GENERATED="$IOS/Generated/MobileAPI" +TARGET_DIR="${CARGO_TARGET_DIR:-$ROOT/target}" +HOST_OS="$(uname -s)" + +case "$HOST_OS" in + Darwin) HOST_LIB="$TARGET_DIR/debug/libmobile_api.dylib" ;; + Linux) HOST_LIB="$TARGET_DIR/debug/libmobile_api.so" ;; + *) + printf 'Unsupported host for binding generation: %s\n' "$HOST_OS" >&2 + exit 1 + ;; +esac + +mkdir -p "$GENERATED" +cd "$ROOT" + +# UniFFI reads metadata from the host library; no iOS artifact is used for this step. +cargo build --locked -p mobile-api --lib +cargo run -q --locked -p mobile-api --features bindgen --bin uniffi-bindgen -- \ + generate --no-format --language swift \ + --library "$HOST_LIB" --out-dir "$GENERATED" + +# Swift/Clang discovers this fixed name through SWIFT_INCLUDE_PATHS. +cp "$GENERATED/MobileAPIFFI.modulemap" "$GENERATED/module.modulemap" +printf 'Swift UniFFI bindings: %s\n' "$GENERATED" + +if [[ "$HOST_OS" != "Darwin" ]]; then + printf '%s\n' 'Host is not macOS: skipped iOS targets and XCFramework (no iOS build was attempted).' + exit 0 +fi + +for tool in rustup xcrun xcodebuild lipo; do + if ! command -v "$tool" >/dev/null 2>&1; then + printf 'Required tool is missing: %s\n' "$tool" >&2 + exit 1 + fi +done + +# Override for a quicker local build, for example: +# CP_IOS_TARGETS="aarch64-apple-ios aarch64-apple-ios-sim" ./scripts/build-bindings.sh +read -r -a TARGETS <<< "${CP_IOS_TARGETS:-aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios}" +if [[ "${#TARGETS[@]}" -eq 0 ]]; then + printf '%s\n' 'CP_IOS_TARGETS must not be empty' >&2 + exit 1 +fi + +export IPHONEOS_DEPLOYMENT_TARGET="${IPHONEOS_DEPLOYMENT_TARGET:-16.0}" +DEVICE_LIB="" +SIM_LIBS=() +for target in "${TARGETS[@]}"; do + case "$target" in + aarch64-apple-ios|aarch64-apple-ios-sim|x86_64-apple-ios) ;; + *) printf 'Unsupported iOS target: %s\n' "$target" >&2; exit 1 ;; + esac + rustup target add "$target" + cargo check --locked -p mobile-api --target "$target" + # The shared Cargo manifest keeps Android's cdylib. This per-target rustc invocation + # additionally emits the self-contained static archive required by XCFramework. + cargo rustc --locked --release -p mobile-api --lib --target "$target" --crate-type staticlib + library="$TARGET_DIR/$target/release/libmobile_api.a" + if [[ ! -f "$library" ]]; then + printf 'Expected static library was not produced: %s\n' "$library" >&2 + exit 1 + fi + if [[ "$target" == "aarch64-apple-ios" ]]; then + DEVICE_LIB="$library" + else + SIM_LIBS+=("$library") + fi +done + +if [[ -z "$DEVICE_LIB" || "${#SIM_LIBS[@]}" -eq 0 ]]; then + printf '%s\n' 'Need aarch64-apple-ios and at least one simulator target for an XCFramework.' >&2 + exit 1 +fi + +WORK="$TARGET_DIR/ios-xcframework" +HEADERS="$WORK/Headers" +mkdir -p "$HEADERS" "$WORK/simulator" +cp "$GENERATED/MobileAPIFFI.h" "$GENERATED/module.modulemap" "$HEADERS/" +SIM_LIB="$WORK/simulator/libmobile_api.a" +lipo -create "${SIM_LIBS[@]}" -output "$SIM_LIB" + +XCFRAMEWORK="$IOS/Frameworks/MobileAPI.xcframework" +rm -rf "$XCFRAMEWORK" +xcodebuild -create-xcframework \ + -library "$DEVICE_LIB" -headers "$HEADERS" \ + -library "$SIM_LIB" -headers "$HEADERS" \ + -output "$XCFRAMEWORK" +printf 'XCFramework: %s\n' "$XCFRAMEWORK"