From 6c6e6164299221d1bba910db0836e87637e9b8ef Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Fri, 19 Jun 2026 16:07:38 +0200 Subject: [PATCH 1/2] Upgrade dependencies --- .github/ISSUE_TEMPLATE/config.yml | 16 +- .github/ISSUE_TEMPLATE/documentation.yml | 66 +- .github/ISSUE_TEMPLATE/enhancement.yml | 66 +- .github/ISSUE_TEMPLATE/feature_request.yml | 66 +- .github/dependabot.yml | 22 +- .github/workflows/build.yml | 2 +- .../workflows/calibreapp-image-actions.yml | 52 +- .github/workflows/compress-images.yml | 56 +- .github/workflows/deploy.yml | 2 +- .github/workflows/release.yml | 514 +- .github/workflows/servers.yml | 114 +- .gitignore | 12 +- BRANDING_LICENSE | 852 +- CODE_OF_CONDUCT.md | 256 +- LICENSE | 1322 +- api/.gitignore | 6 +- api/LICENSE | 402 +- api/README.md | 6 +- api/analysis_options.yaml | 60 +- api/build.yaml | 8 +- api/lib/event.dart | 14 +- api/lib/helpers.dart | 4 +- api/lib/models.dart | 42 +- api/lib/services.dart | 8 +- api/lib/setonix_api.dart | 14 +- api/lib/src/event/client.dart | 402 +- api/lib/src/event/event.dart | 62 +- api/lib/src/event/event.mapper.dart | 14780 ++++++++-------- api/lib/src/event/local.dart | 12 +- api/lib/src/event/process/client.dart | 914 +- api/lib/src/event/process/server.dart | 1136 +- api/lib/src/event/server.dart | 562 +- api/lib/src/event/state.mapper.dart | 1006 +- api/lib/src/helpers/crypto.dart | 50 +- api/lib/src/helpers/equality.dart | 100 +- api/lib/src/helpers/equality.mapper.dart | 254 +- api/lib/src/models/background.dart | 36 +- api/lib/src/models/background.mapper.dart | 404 +- api/lib/src/models/cell.mapper.dart | 2416 +-- api/lib/src/models/chat.dart | 34 +- api/lib/src/models/chat.mapper.dart | 300 +- api/lib/src/models/deck.dart | 72 +- api/lib/src/models/deck.mapper.dart | 1004 +- api/lib/src/models/definition.dart | 104 +- api/lib/src/models/definition.mapper.dart | 1486 +- api/lib/src/models/dialog.dart | 474 +- api/lib/src/models/dialog.mapper.dart | 4168 ++--- api/lib/src/models/info.dart | 102 +- api/lib/src/models/info.mapper.dart | 940 +- api/lib/src/models/kick.dart | 84 +- api/lib/src/models/kick.mapper.dart | 458 +- api/lib/src/models/meta.dart | 176 +- api/lib/src/models/meta.mapper.dart | 1224 +- api/lib/src/models/table.mapper.dart | 364 +- api/lib/src/models/toolbar.dart | 48 +- api/lib/src/models/toolbar.mapper.dart | 614 +- api/lib/src/models/translation.dart | 268 +- api/lib/src/models/translation.mapper.dart | 2582 +-- api/lib/src/models/vector.dart | 250 +- api/lib/src/models/vector.mapper.dart | 838 +- api/lib/src/models/visual.dart | 36 +- api/lib/src/models/visual.mapper.dart | 172 +- api/lib/src/models/waypoint.dart | 26 +- api/lib/src/models/waypoint.mapper.dart | 298 +- api/lib/src/services/asset.dart | 118 +- api/lib/src/services/challenge.dart | 62 +- api/lib/src/services/user.dart | 352 +- api/lib/src/services/user.mapper.dart | 396 +- api/pubspec.lock | 12 +- api/pubspec.yaml | 2 +- app/.gitignore | 96 +- app/.metadata | 90 +- app/DmgSetup.json | 28 +- app/README.md | 6 +- app/SetonixSetup.iss | 138 +- app/analysis_options.yaml | 82 +- app/android/.gitignore | 28 +- app/android/Gemfile | 10 +- app/android/Gemfile.lock | 24 +- app/android/app/src/debug/AndroidManifest.xml | 14 +- app/android/app/src/main/AndroidManifest.xml | 112 +- .../dev/linwood/setonix/MainActivity.kt | 10 +- .../res/drawable-v21/launch_background.xml | 24 +- .../res/drawable/ic_launcher_monochrome.xml | 78 +- .../main/res/drawable/launch_background.xml | 24 +- .../res/mipmap-anydpi-v26/ic_launcher.xml | 12 +- .../mipmap-anydpi-v26/ic_launcher_round.xml | 8 +- .../app/src/main/res/values-night/styles.xml | 36 +- .../res/values/ic_launcher_background.xml | 6 +- .../app/src/main/res/values/styles.xml | 36 +- .../app/src/profile/AndroidManifest.xml | 14 +- app/android/build.gradle.kts | 80 +- app/android/fastlane/Appfile | 4 +- app/android/fastlane/Fastfile | 70 +- app/android/fastlane/README.md | 96 +- app/android/fastlane/Screengrabfile | 28 +- .../gradle/wrapper/gradle-wrapper.properties | 16 +- app/android/settings.gradle.kts | 48 +- app/assets/fonts/Comfortaa-LICENSE.txt | 186 +- app/assets/fonts/Roboto-LICENSE.txt | 404 +- app/assets/setonix.tiled-project | 28 +- app/devtools_options.yaml | 2 +- app/images/logo.svg | 184 +- app/ios/.gitignore | 68 +- app/ios/Flutter/AppFrameworkInfo.plist | 52 +- app/ios/Flutter/Debug.xcconfig | 2 +- app/ios/Flutter/Release.xcconfig | 2 +- app/ios/Runner.xcodeproj/project.pbxproj | 1232 +- .../contents.xcworkspacedata | 14 +- .../xcshareddata/IDEWorkspaceChecks.plist | 16 +- .../xcshareddata/WorkspaceSettings.xcsettings | 16 +- .../xcshareddata/xcschemes/Runner.xcscheme | 196 +- .../contents.xcworkspacedata | 14 +- .../xcshareddata/IDEWorkspaceChecks.plist | 16 +- .../xcshareddata/WorkspaceSettings.xcsettings | 16 +- app/ios/Runner/AppDelegate.swift | 26 +- .../AppIcon.appiconset/Contents.json | 244 +- .../LaunchImage.imageset/Contents.json | 46 +- .../LaunchImage.imageset/README.md | 8 +- .../Runner/Base.lproj/LaunchScreen.storyboard | 74 +- app/ios/Runner/Base.lproj/Main.storyboard | 52 +- app/ios/Runner/Info.plist | 98 +- app/ios/Runner/Runner-Bridging-Header.h | 2 +- app/ios/RunnerTests/RunnerTests.swift | 24 +- app/l10n.yaml | 10 +- app/lib/api/open.dart | 330 +- app/lib/api/save.dart | 30 +- app/lib/api/settings.dart | 74 +- app/lib/api/storage.dart | 30 +- app/lib/bloc/editor.dart | 154 +- app/lib/bloc/world/local.dart | 144 +- app/lib/board/focus.dart | 76 +- app/lib/board/game.dart | 484 +- app/lib/board/hand/board.dart | 68 +- app/lib/board/hand/deck.dart | 130 +- app/lib/board/hand/figure.dart | 98 +- app/lib/board/hand/object.dart | 190 +- app/lib/board/hand/tile.dart | 100 +- app/lib/helpers/asset.dart | 282 +- app/lib/helpers/drag.dart | 184 +- app/lib/helpers/scroll.dart | 198 +- app/lib/helpers/secondary.dart | 64 +- app/lib/helpers/string.dart | 12 +- app/lib/helpers/vector.dart | 34 +- app/lib/helpers/visualizer.dart | 36 +- app/lib/pages/editor/backgrounds.dart | 334 +- app/lib/pages/editor/boards.dart | 354 +- app/lib/pages/editor/decks.dart | 982 +- app/lib/pages/editor/figures.dart | 722 +- app/lib/pages/editor/general.dart | 194 +- app/lib/pages/editor/mode_dialog.dart | 930 +- app/lib/pages/editor/modes.dart | 160 +- app/lib/pages/editor/scripts.dart | 292 +- app/lib/pages/editor/shell.dart | 450 +- app/lib/pages/editor/textures.dart | 476 +- app/lib/pages/game/auth.dart | 336 +- app/lib/pages/game/chat.dart | 302 +- app/lib/pages/game/dialog.dart | 614 +- app/lib/pages/game/filter.dart | 146 +- app/lib/pages/game/info.dart | 108 +- app/lib/pages/game/multiplayer/dialog.dart | 68 +- app/lib/pages/game/multiplayer/start.dart | 298 +- app/lib/pages/game/multiplayer/view.dart | 282 +- app/lib/pages/game/note.dart | 276 +- app/lib/pages/game/notes.dart | 256 +- app/lib/pages/game/team.dart | 280 +- app/lib/pages/game/waypoint.dart | 156 +- app/lib/pages/home/accounts.dart | 350 +- app/lib/pages/home/background.dart | 240 +- app/lib/pages/packs/editor.dart | 454 +- app/lib/pages/packs/installed.dart | 398 +- app/lib/pages/packs/world.dart | 114 +- app/lib/pages/settings/data.dart | 272 +- app/lib/pages/settings/general.dart | 670 +- app/lib/pages/settings/home.dart | 312 +- app/lib/pages/settings/input.dart | 138 +- app/lib/pages/settings/intro.dart | 140 +- app/lib/pages/settings/personalization.dart | 546 +- app/lib/pages/settings/servers.dart | 254 +- app/lib/services/file_system.dart | 638 +- app/lib/setup.dart | 6 +- app/lib/setup_io.dart | 58 +- app/lib/setup_web.dart | 18 +- app/lib/theme.dart | 128 +- app/lib/widgets/search.dart | 236 +- app/lib/widgets/two_child_row_layout.dart | 66 +- app/linux/.gitignore | 2 +- app/linux/CMakeLists.txt | 306 +- .../applications/dev.linwood.setonix.desktop | 16 +- app/linux/flutter/CMakeLists.txt | 176 +- app/linux/main.cc | 12 +- app/linux/my_application.cc | 248 +- app/linux/my_application.h | 36 +- app/linux/rpm/linwood-setonix.desktop | 16 +- app/linux/rpm/linwood-setonix.spec | 86 +- app/macos/.gitignore | 14 +- app/macos/Flutter/Flutter-Debug.xcconfig | 2 +- app/macos/Flutter/Flutter-Release.xcconfig | 2 +- app/macos/Runner.xcodeproj/project.pbxproj | 1410 +- .../xcshareddata/IDEWorkspaceChecks.plist | 16 +- .../xcshareddata/xcschemes/Runner.xcscheme | 196 +- .../contents.xcworkspacedata | 14 +- .../xcshareddata/IDEWorkspaceChecks.plist | 16 +- app/macos/Runner/AppDelegate.swift | 18 +- .../AppIcon.appiconset/Contents.json | 136 +- app/macos/Runner/Base.lproj/MainMenu.xib | 686 +- app/macos/Runner/Configs/AppInfo.xcconfig | 28 +- app/macos/Runner/Configs/Debug.xcconfig | 4 +- app/macos/Runner/Configs/Release.xcconfig | 4 +- app/macos/Runner/Configs/Warnings.xcconfig | 26 +- app/macos/Runner/DebugProfile.entitlements | 24 +- app/macos/Runner/Info.plist | 64 +- app/macos/Runner/MainFlutterWindow.swift | 30 +- app/macos/Runner/Release.entitlements | 16 +- app/macos/RunnerTests/RunnerTests.swift | 24 +- app/pack/backgrounds/cards.json | 6 +- app/pack/backgrounds/grid.json | 8 +- app/pack/boards/chess.json | 12 +- app/pack/decks/chess.json | 340 +- app/pack/decks/chips.json | 78 +- app/pack/decks/dices.json | 18 +- app/pack/decks/doko.json | 408 +- app/pack/decks/doko9.json | 488 +- app/pack/decks/full.json | 558 +- app/pack/decks/poker.json | 528 +- app/pack/decks/skat.json | 328 +- app/pack/figures/cards.json | 726 +- app/pack/figures/chess_black.json | 78 +- app/pack/figures/chess_white.json | 78 +- app/pack/figures/chips.json | 88 +- app/pack/figures/d6.json | 80 +- app/pack/pack.json | 12 +- app/pubspec.lock | 44 +- app/pubspec.yaml | 8 +- app/scripts/build-rpm.sh | 148 +- app/scripts/start.bat | 4 +- app/scripts/start.sh | 4 +- app/snapcraft.yaml | 182 +- app/test/widget_test.dart | 32 +- app/web/index.html | 90 +- app/web/manifest.json | 922 +- app/windows/.gitignore | 34 +- app/windows/CMakeLists.txt | 216 +- app/windows/flutter/CMakeLists.txt | 218 +- app/windows/runner/CMakeLists.txt | 80 +- app/windows/runner/flutter_window.cpp | 142 +- app/windows/runner/flutter_window.h | 66 +- app/windows/runner/main.cpp | 86 +- app/windows/runner/resource.h | 32 +- app/windows/runner/runner.exe.manifest | 40 +- app/windows/runner/utils.cpp | 130 +- app/windows/runner/utils.h | 38 +- app/windows/runner/win32_window.cpp | 576 +- app/windows/runner/win32_window.h | 204 +- docs/.gitignore | 42 +- docs/README.md | 88 +- docs/package.json | 9 +- docs/pnpm-lock.yaml | 1102 +- docs/public/fonts/Inter/OFL.txt | 186 +- docs/public/img/docs.svg | 238 +- docs/public/img/logo.svg | 184 +- docs/src/components/ContentPanel.astro | 16 +- docs/src/components/DownloadButton.astro | 68 +- docs/src/components/Footer.astro | 124 +- docs/src/components/Head.astro | 26 +- docs/src/content.config.ts | 14 +- docs/src/content/docs/changelog.mdx | 22 +- docs/src/content/docs/community/branding.mdx | 122 +- .../docs/community/code-of-conduct.mdx | 22 +- .../content/docs/community/contributing.mdx | 22 +- docs/src/content/docs/community/faq.md | 52 +- docs/src/content/docs/community/index.md | 44 +- docs/src/content/docs/community/nightly.md | 34 +- docs/src/content/docs/community/versions.mdx | 22 +- docs/src/content/docs/docs/v1/intro.mdx | 58 +- docs/src/content/docs/docs/v1/packs/meta.mdx | 46 +- .../content/docs/docs/v1/packs/overview.mdx | 102 +- docs/src/content/docs/docs/v1/server.md | 200 +- docs/src/content/docs/downloads/android.mdx | 74 +- docs/src/content/docs/downloads/index.mdx | 58 +- docs/src/content/docs/downloads/ios.mdx | 98 +- docs/src/content/docs/downloads/linux.mdx | 72 +- docs/src/content/docs/downloads/macos.mdx | 44 +- .../content/docs/downloads/post-windows.mdx | 44 +- .../src/content/docs/downloads/selfhosting.md | 46 +- docs/src/content/docs/downloads/thank-you.mdx | 20 +- docs/src/content/docs/downloads/web.mdx | 54 +- docs/src/content/docs/downloads/windows.mdx | 52 +- docs/src/content/docs/index.mdx | 88 +- docs/src/content/docs/privacypolicy.md | 142 +- docs/src/env.d.ts | 10 +- docs/src/pages/meta.json.ts | 112 +- docs/src/scripts/pwa.ts | 24 +- docs/src/styles/custom.scss | 318 +- docs/src/styles/linwood-style.scss | 256 +- docs/tsconfig.json | 22 +- docs/webmanifest.json | 66 +- metadata/en-US/changelogs/1.txt | 2 +- metadata/en-US/changelogs/10.txt | 44 +- metadata/en-US/changelogs/11.txt | 36 +- metadata/en-US/changelogs/2.txt | 2 +- metadata/en-US/changelogs/3.txt | 20 +- metadata/en-US/changelogs/4.txt | 20 +- metadata/en-US/changelogs/5.txt | 34 +- metadata/en-US/changelogs/6.txt | 28 +- metadata/en-US/changelogs/7.txt | 24 +- metadata/en-US/changelogs/8.txt | 14 +- metadata/en-US/changelogs/9.txt | 20 +- metadata/en-US/full_description.txt | 20 +- plugin/.gitignore | 88 +- plugin/README.md | 6 +- plugin/analysis_options.yaml | 14 +- plugin/build.yaml | 8 +- plugin/definitions/setonix.d.luau | 290 +- plugin/flutter_rust_bridge.yaml | 8 +- plugin/hook/build.dart | 22 +- plugin/lib/events.dart | 10 +- plugin/lib/native.dart | 70 +- plugin/lib/src/events/model.dart | 352 +- plugin/lib/src/events/model.mapper.dart | 298 +- plugin/lib/src/events/system.dart | 192 +- plugin/lib/src/rust/api/luau.dart | 68 +- plugin/lib/src/rust/api/simple.dart | 20 +- plugin/lib/src/rust/lib.dart | 20 +- plugin/pubspec.lock | 28 +- plugin/pubspec.yaml | 2 +- plugin/rust/.gitignore | 32 +- plugin/rust/Cargo.lock | 65 +- plugin/rust/src/api/simple.rs | 6 +- plugin/rust/src/lib.rs | 4 +- rust-toolchain.toml | 34 +- server/LICENSE | 402 +- server/README.md | 132 +- server/analysis_options.yaml | 60 +- server/bin/setonix_server.dart | 10 +- server/build.yaml | 8 +- server/example/dialog.dart | 150 +- server/example/duplicate.dart | 66 +- server/example/join.dart | 74 +- server/lib/events.dart | 8 +- server/lib/setonix_server.dart | 36 +- server/lib/src/asset.dart | 204 +- server/lib/src/asset.mapper.dart | 304 +- server/lib/src/programs/kick.dart | 78 +- server/lib/src/programs/packs.dart | 56 +- server/lib/src/programs/players.dart | 50 +- server/lib/src/programs/reset.dart | 52 +- server/lib/src/programs/save.dart | 34 +- server/lib/src/programs/say.dart | 38 +- server/lib/src/programs/scripts.dart | 56 +- server/lib/src/programs/stop.dart | 30 +- server/lib/src/programs/whitelist.dart | 142 +- server/lib/src/services/user/file.dart | 260 +- server/lib/src/services/user/migrations.dart | 28 +- server/lib/src/services/user/remote.dart | 188 +- server/lib/src/user.dart | 2 +- server/pubspec.lock | 36 +- servers/.gitignore | 48 +- servers/package.json | 4 +- servers/pnpm-lock.yaml | 254 +- servers/public/favicon.svg | 184 +- servers/src/assets/astro.svg | 2 +- servers/src/assets/background.svg | 2 +- servers/src/data/servers.json | 4 +- servers/src/pages/data.json.ts | 48 +- servers/tsconfig.json | 10 +- tools/.gitignore | 102 +- tools/analysis_options.yaml | 58 +- tools/broadcast_client.dart | 38 +- tools/broadcast_server.dart | 44 +- tools/generate.dart | 26 +- tools/local_server.dart | 100 +- tools/pubspec.yaml | 38 +- tools/set_version.dart | 312 +- 374 files changed, 42052 insertions(+), 42030 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index dc54fd7b..63f61f66 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ -blank_issues_enabled: false -contact_links: - - name: Linwood Matrix - url: https://go.linwood.dev/discord - about: Please ask and answer questions here. Synced with discord. - - name: Linwood Discord - url: https://go.linwood.dev/discord - about: Please ask and answer questions here. Synced with matrix. +blank_issues_enabled: false +contact_links: + - name: Linwood Matrix + url: https://go.linwood.dev/discord + about: Please ask and answer questions here. Synced with discord. + - name: Linwood Discord + url: https://go.linwood.dev/discord + about: Please ask and answer questions here. Synced with matrix. diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml index 61e9d857..21f897c7 100644 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -1,33 +1,33 @@ -name: Documentation request -description: Related to the documentation -title: "[Documentation request]: " -labels: ["documentation", "triage"] -assignees: - - CodeDoctorDE -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this documentation request! - - type: input - id: related-to-problem - attributes: - label: To which page is your issue related? - - type: textarea - id: description - attributes: - label: Describe your documentation request! - validations: - required: true - - type: textarea - id: context - attributes: - label: Additional context - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/LinwoodDev/Setonix/blob/develop/CODE_OF_CONDUCT.md) - options: - - label: I agree to follow this project's Code of Conduct - required: true +name: Documentation request +description: Related to the documentation +title: "[Documentation request]: " +labels: ["documentation", "triage"] +assignees: + - CodeDoctorDE +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this documentation request! + - type: input + id: related-to-problem + attributes: + label: To which page is your issue related? + - type: textarea + id: description + attributes: + label: Describe your documentation request! + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional context + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/LinwoodDev/Setonix/blob/develop/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 9be57abc..fe2f1861 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -1,33 +1,33 @@ -name: Enhancement -description: Suggest an enhancement to an existing feature -title: "[Enhancement]: " -labels: ["enhancement", "triage"] -assignees: - - CodeDoctorDE -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this request for enhancements! - - type: input - id: feature - attributes: - label: Which feature is your request related to? - - type: textarea - id: description - attributes: - label: Describe your request for enhancements! - validations: - required: true - - type: textarea - id: context - attributes: - label: Additional context - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/LinwoodDev/Setonix/blob/develop/CODE_OF_CONDUCT.md) - options: - - label: I agree to follow this project's Code of Conduct - required: true +name: Enhancement +description: Suggest an enhancement to an existing feature +title: "[Enhancement]: " +labels: ["enhancement", "triage"] +assignees: + - CodeDoctorDE +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this request for enhancements! + - type: input + id: feature + attributes: + label: Which feature is your request related to? + - type: textarea + id: description + attributes: + label: Describe your request for enhancements! + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional context + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/LinwoodDev/Setonix/blob/develop/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index c4efe5e2..3f88a172 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,33 +1,33 @@ -name: Feature request -description: Suggest a new feature -title: "[Feature request]: " -labels: ["feature-request", "triage"] -assignees: - - CodeDoctorDE -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this feature request! - - type: textarea - id: related-to-problem - attributes: - label: Is your feature request related to a problem? Please describe - - type: textarea - id: description - attributes: - label: Describe your feature request! - validations: - required: true - - type: textarea - id: context - attributes: - label: Additional context - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/LinwoodDev/Setonix/blob/develop/CODE_OF_CONDUCT.md) - options: - - label: I agree to follow this project's Code of Conduct - required: true +name: Feature request +description: Suggest a new feature +title: "[Feature request]: " +labels: ["feature-request", "triage"] +assignees: + - CodeDoctorDE +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + - type: textarea + id: related-to-problem + attributes: + label: Is your feature request related to a problem? Please describe + - type: textarea + id: description + attributes: + label: Describe your feature request! + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional context + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/LinwoodDev/Setonix/blob/develop/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 90e05c40..c44e8261 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,11 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b9ef0a8..a369338f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -496,7 +496,7 @@ jobs: - name: Setup node uses: actions/setup-node@v6 with: - node-version: 24 + node-version: 26 - name: Install appdmg run: | python3 -m pip install setuptools diff --git a/.github/workflows/calibreapp-image-actions.yml b/.github/workflows/calibreapp-image-actions.yml index dc5305dd..8a20257e 100644 --- a/.github/workflows/calibreapp-image-actions.yml +++ b/.github/workflows/calibreapp-image-actions.yml @@ -1,26 +1,26 @@ -name: Compress Images Pull Request -on: - pull_request: - # Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed. - # See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference. - paths: - - '**.jpg' - - '**.jpeg' - - '**.png' - - '**.webp' -jobs: - build: - # Only run on Pull Requests within the same repository, and not from forks. - if: github.event.pull_request.head.repo.full_name == github.repository - name: calibreapp/image-actions - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v6 - - - name: Compress Images - uses: calibreapp/image-actions@main - with: - # The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories. - # See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +name: Compress Images Pull Request +on: + pull_request: + # Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed. + # See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for reference. + paths: + - '**.jpg' + - '**.jpeg' + - '**.png' + - '**.webp' +jobs: + build: + # Only run on Pull Requests within the same repository, and not from forks. + if: github.event.pull_request.head.repo.full_name == github.repository + name: calibreapp/image-actions + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v6 + + - name: Compress Images + uses: calibreapp/image-actions@main + with: + # The `GITHUB_TOKEN` is automatically generated by GitHub and scoped only to the repository that is currently running the action. By default, the action can’t update Pull Requests initiated from forked repositories. + # See https://docs.github.com/en/actions/reference/authentication-in-a-workflow and https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/compress-images.yml b/.github/workflows/compress-images.yml index a7735eb9..3175cfd9 100644 --- a/.github/workflows/compress-images.yml +++ b/.github/workflows/compress-images.yml @@ -1,28 +1,28 @@ -# Compress images on demand (workflow_dispatch), and at 11pm every Sunday (schedule). -# Open a Pull Request if any images can be compressed. -name: Compress Images -on: - workflow_dispatch: - schedule: - - cron: '00 23 * * 0' -jobs: - build: - name: calibreapp/image-actions - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v6 - - name: Compress Images - id: calibre - uses: calibreapp/image-actions@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - compressOnly: true - - name: Create New Pull Request If Needed - if: steps.calibre.outputs.markdown != '' - uses: peter-evans/create-pull-request@v8 - with: - title: Compressed Images Nightly - branch-suffix: timestamp - commit-message: Compressed Images - body: ${{ steps.calibre.outputs.markdown }} +# Compress images on demand (workflow_dispatch), and at 11pm every Sunday (schedule). +# Open a Pull Request if any images can be compressed. +name: Compress Images +on: + workflow_dispatch: + schedule: + - cron: '00 23 * * 0' +jobs: + build: + name: calibreapp/image-actions + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v6 + - name: Compress Images + id: calibre + uses: calibreapp/image-actions@main + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + compressOnly: true + - name: Create New Pull Request If Needed + if: steps.calibre.outputs.markdown != '' + uses: peter-evans/create-pull-request@v8 + with: + title: Compressed Images Nightly + branch-suffix: timestamp + commit-message: Compressed Images + body: ${{ steps.calibre.outputs.markdown }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 95dee03b..51cc9715 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 24 + node-version: 26 cache: "pnpm" cache-dependency-path: docs/pnpm-lock.yaml - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53d3b0a5..c617556f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,257 +1,257 @@ -name: Release - -on: - workflow_dispatch: - inputs: - next_version: - default: "0.0.0" - description: "The next version to be released" - required: false - stable: - default: false - description: "Is this version stable?" - type: boolean - required: false - -jobs: - update-changelog: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v6 - with: - token: ${{ secrets.CI_PAT }} - fetch-depth: 0 - - uses: subosito/flutter-action@v2.23.0 - with: - flutter-version-file: app/pubspec.yaml - cache: true - - name: Setup git - id: setup - run: | - SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" - [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] - SETONIX_VERSION="${BASH_REMATCH[1]}" - echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV - SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" - echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV - git config --global user.email "ci@linwood.dev" - git config --global user.name "Linwood CI" - - name: Update changelog - run: | - git fetch - git pull origin - dart pub get -C tools - dart run tools/set_version.dart --build-number keep ${{ env.SETONIX_VERSION }} --changelog - git add . - git commit -m "Add changelog of v${{ env.SETONIX_VERSION }}" - git push origin - - name: Merge in develop - if: ${{ github.ref == 'refs/heads/main' }} - run: | - git fetch - git checkout develop - git pull origin develop - git merge main --strategy-option ours - git push origin develop - release: - runs-on: ubuntu-24.04 - needs: - - update-changelog - outputs: - version: ${{ steps.setup.outputs.SETONIX_VERSION }} - build_number: ${{ steps.setup.outputs.SETONIX_BUILD_NUMBER }} - steps: - - uses: actions/checkout@v6 - with: - token: ${{ secrets.CI_PAT }} - ref: ${{ github.ref }} - fetch-depth: 0 - - uses: subosito/flutter-action@v2.23.0 - with: - flutter-version-file: app/pubspec.yaml - cache: true - - name: Setup git - id: setup - shell: bash - run: | - SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" - [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] - SETONIX_VERSION="${BASH_REMATCH[1]}" - echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV - echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_OUTPUT - SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" - echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV - echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_OUTPUT - git config --global user.email "ci@linwood.dev" - git config --global user.name "Linwood CI" - - name: Create tag - run: | - SETONIX_VERSION="${{ env.SETONIX_VERSION }}" - git tag -fa v${{ env.SETONIX_VERSION }} -m "Release ${SETONIX_VERSION}" - git push origin v${SETONIX_VERSION} -f - - name: Create release - uses: softprops/action-gh-release@v3 - with: - prerelease: ${{ github.event.inputs.stable != 'true' }} - tag_name: v${{ env.SETONIX_VERSION }} - name: v${{ env.SETONIX_VERSION }} - token: ${{ secrets.CI_PAT }} - body_path: metadata/en-US/changelogs/${{ env.SETONIX_BUILD_NUMBER }}.txt - - name: Retag stable - if: ${{ github.event.inputs.stable == 'true' || github.ref == 'refs/heads/main' }} - run: | - git tag -fa stable -m "Find all stable releases here" - git push origin stable -f - - name: Retag nightly - if: ${{ github.event.inputs.stable != 'true' && github.ref == 'refs/heads/develop' }} - run: | - git tag -fa nightly -m "Find all nightly releases here" - git push origin nightly -f - - name: Merge in main - if: ${{ github.ref == 'refs/heads/develop' && github.event.inputs.stable == 'true' }} - run: | - git fetch - git checkout main - git pull origin main - git merge develop --strategy-option ours - git push origin main - set-next-version: - runs-on: ubuntu-24.04 - needs: - - update-changelog - - release - steps: - - uses: actions/checkout@v6 - with: - token: ${{ secrets.CI_PAT }} - fetch-depth: 0 - - uses: subosito/flutter-action@v2.23.0 - with: - flutter-version-file: app/pubspec.yaml - cache: true - - name: Setup git - id: setup - run: | - SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" - [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] - SETONIX_VERSION="${BASH_REMATCH[1]}" - echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV - SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" - echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV - git config --global user.email "ci@linwood.dev" - git config --global user.name "Linwood CI" - - name: Set next version - run: | - git fetch - git pull origin - dart pub get -C tools - dart run tools/set_version.dart --build-number increment ${{ github.event.inputs.next_version }} --no-changelog - git add . - git commit -m "Update Version to ${{ github.event.inputs.next_version }}" - git push origin - - name: Merge develop - if: ${{ github.ref == 'refs/heads/main' }} - run: | - git fetch - git checkout develop - git pull origin develop - git merge main --strategy-option ours - git push origin develop - bump-version: - runs-on: ubuntu-24.04 - needs: - - update-changelog - - release - - set-next-version - steps: - - name: Checkout main - if: ${{ github.ref == 'refs/heads/develop' }} - uses: actions/checkout@v6 - with: - token: ${{ secrets.CI_PAT }} - fetch-depth: 0 - ref: main - - name: Checkout develop - if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/checkout@v6 - with: - token: ${{ secrets.CI_PAT }} - fetch-depth: 0 - ref: develop - - name: Setup git - id: setup - run: | - SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" - [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] - SETONIX_VERSION="${BASH_REMATCH[1]}" - echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV - SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" - echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV - git config --global user.email "ci@linwood.dev" - git config --global user.name "Linwood CI" - - uses: subosito/flutter-action@v2.23.0 - with: - flutter-version-file: app/pubspec.yaml - cache: true - - name: Bump version - run: | - git fetch - git pull origin - dart pub get -C tools - dart run tools/set_version.dart --build-number increment ${{ env.SETONIX_VERSION }} --no-changelog - git add . - git commit -m "Bump version" - git push origin - - name: Update develop - if: ${{ github.ref == 'refs/heads/develop' }} - run: | - git fetch - git checkout develop - git pull origin - git merge main --strategy-option ours - git push origin develop - notify: - runs-on: ubuntu-24.04 - needs: [release] - steps: - - uses: actions/checkout@v6 - with: - token: ${{ secrets.CI_PAT }} - - name: Get information - shell: bash - run: | - SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" - [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] - SETONIX_VERSION="${BASH_REMATCH[1]}" - echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV - SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" - echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV - echo 'SETONIX_CHANGELOG<> $GITHUB_ENV - cat metadata/en-US/changelogs/${SETONIX_BUILD_NUMBER}.txt >> $GITHUB_ENV - echo '' >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v7.0.0 - if: ${{ github.event.inputs.stable == 'true' || github.ref == 'refs/heads/main' }} - with: - webhook-url: ${{ secrets.WEBHOOK_URL }} - embed-title: ${{ env.SETONIX_VERSION }} - embed-description: ${{ env.SETONIX_CHANGELOG }} - embed-url: https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }} - content: | - Version ${{ env.SETONIX_VERSION }} released! - Download it here: https://setonix.world/downloads - https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }} - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v7.0.0 - if: ${{ github.event.inputs.stable == 'false' && github.ref == 'refs/heads/develop' }} - with: - webhook-url: ${{ secrets.WEBHOOK_URL }} - embed-title: ${{ env.SETONIX_VERSION }} - embed-description: ${{ env.SETONIX_CHANGELOG }} - embed-url: https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }} - content: | - Pre-release version ${{ env.SETONIX_VERSION }} released! - Download it here: https://setonix.world/downloads - Please note that this is a pre-release version and is not intended for production use. - Read more about it here: https://setonix.world/nightly +name: Release + +on: + workflow_dispatch: + inputs: + next_version: + default: "0.0.0" + description: "The next version to be released" + required: false + stable: + default: false + description: "Is this version stable?" + type: boolean + required: false + +jobs: + update-changelog: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + with: + token: ${{ secrets.CI_PAT }} + fetch-depth: 0 + - uses: subosito/flutter-action@v2.23.0 + with: + flutter-version-file: app/pubspec.yaml + cache: true + - name: Setup git + id: setup + run: | + SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" + [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] + SETONIX_VERSION="${BASH_REMATCH[1]}" + echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV + SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" + echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV + git config --global user.email "ci@linwood.dev" + git config --global user.name "Linwood CI" + - name: Update changelog + run: | + git fetch + git pull origin + dart pub get -C tools + dart run tools/set_version.dart --build-number keep ${{ env.SETONIX_VERSION }} --changelog + git add . + git commit -m "Add changelog of v${{ env.SETONIX_VERSION }}" + git push origin + - name: Merge in develop + if: ${{ github.ref == 'refs/heads/main' }} + run: | + git fetch + git checkout develop + git pull origin develop + git merge main --strategy-option ours + git push origin develop + release: + runs-on: ubuntu-24.04 + needs: + - update-changelog + outputs: + version: ${{ steps.setup.outputs.SETONIX_VERSION }} + build_number: ${{ steps.setup.outputs.SETONIX_BUILD_NUMBER }} + steps: + - uses: actions/checkout@v6 + with: + token: ${{ secrets.CI_PAT }} + ref: ${{ github.ref }} + fetch-depth: 0 + - uses: subosito/flutter-action@v2.23.0 + with: + flutter-version-file: app/pubspec.yaml + cache: true + - name: Setup git + id: setup + shell: bash + run: | + SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" + [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] + SETONIX_VERSION="${BASH_REMATCH[1]}" + echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV + echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_OUTPUT + SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" + echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV + echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_OUTPUT + git config --global user.email "ci@linwood.dev" + git config --global user.name "Linwood CI" + - name: Create tag + run: | + SETONIX_VERSION="${{ env.SETONIX_VERSION }}" + git tag -fa v${{ env.SETONIX_VERSION }} -m "Release ${SETONIX_VERSION}" + git push origin v${SETONIX_VERSION} -f + - name: Create release + uses: softprops/action-gh-release@v3 + with: + prerelease: ${{ github.event.inputs.stable != 'true' }} + tag_name: v${{ env.SETONIX_VERSION }} + name: v${{ env.SETONIX_VERSION }} + token: ${{ secrets.CI_PAT }} + body_path: metadata/en-US/changelogs/${{ env.SETONIX_BUILD_NUMBER }}.txt + - name: Retag stable + if: ${{ github.event.inputs.stable == 'true' || github.ref == 'refs/heads/main' }} + run: | + git tag -fa stable -m "Find all stable releases here" + git push origin stable -f + - name: Retag nightly + if: ${{ github.event.inputs.stable != 'true' && github.ref == 'refs/heads/develop' }} + run: | + git tag -fa nightly -m "Find all nightly releases here" + git push origin nightly -f + - name: Merge in main + if: ${{ github.ref == 'refs/heads/develop' && github.event.inputs.stable == 'true' }} + run: | + git fetch + git checkout main + git pull origin main + git merge develop --strategy-option ours + git push origin main + set-next-version: + runs-on: ubuntu-24.04 + needs: + - update-changelog + - release + steps: + - uses: actions/checkout@v6 + with: + token: ${{ secrets.CI_PAT }} + fetch-depth: 0 + - uses: subosito/flutter-action@v2.23.0 + with: + flutter-version-file: app/pubspec.yaml + cache: true + - name: Setup git + id: setup + run: | + SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" + [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] + SETONIX_VERSION="${BASH_REMATCH[1]}" + echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV + SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" + echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV + git config --global user.email "ci@linwood.dev" + git config --global user.name "Linwood CI" + - name: Set next version + run: | + git fetch + git pull origin + dart pub get -C tools + dart run tools/set_version.dart --build-number increment ${{ github.event.inputs.next_version }} --no-changelog + git add . + git commit -m "Update Version to ${{ github.event.inputs.next_version }}" + git push origin + - name: Merge develop + if: ${{ github.ref == 'refs/heads/main' }} + run: | + git fetch + git checkout develop + git pull origin develop + git merge main --strategy-option ours + git push origin develop + bump-version: + runs-on: ubuntu-24.04 + needs: + - update-changelog + - release + - set-next-version + steps: + - name: Checkout main + if: ${{ github.ref == 'refs/heads/develop' }} + uses: actions/checkout@v6 + with: + token: ${{ secrets.CI_PAT }} + fetch-depth: 0 + ref: main + - name: Checkout develop + if: ${{ github.ref == 'refs/heads/main' }} + uses: actions/checkout@v6 + with: + token: ${{ secrets.CI_PAT }} + fetch-depth: 0 + ref: develop + - name: Setup git + id: setup + run: | + SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" + [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] + SETONIX_VERSION="${BASH_REMATCH[1]}" + echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV + SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" + echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV + git config --global user.email "ci@linwood.dev" + git config --global user.name "Linwood CI" + - uses: subosito/flutter-action@v2.23.0 + with: + flutter-version-file: app/pubspec.yaml + cache: true + - name: Bump version + run: | + git fetch + git pull origin + dart pub get -C tools + dart run tools/set_version.dart --build-number increment ${{ env.SETONIX_VERSION }} --no-changelog + git add . + git commit -m "Bump version" + git push origin + - name: Update develop + if: ${{ github.ref == 'refs/heads/develop' }} + run: | + git fetch + git checkout develop + git pull origin + git merge main --strategy-option ours + git push origin develop + notify: + runs-on: ubuntu-24.04 + needs: [release] + steps: + - uses: actions/checkout@v6 + with: + token: ${{ secrets.CI_PAT }} + - name: Get information + shell: bash + run: | + SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" + [[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] + SETONIX_VERSION="${BASH_REMATCH[1]}" + echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV + SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}" + echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV + echo 'SETONIX_CHANGELOG<> $GITHUB_ENV + cat metadata/en-US/changelogs/${SETONIX_BUILD_NUMBER}.txt >> $GITHUB_ENV + echo '' >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + - name: Discord Webhook Action + uses: tsickert/discord-webhook@v7.0.0 + if: ${{ github.event.inputs.stable == 'true' || github.ref == 'refs/heads/main' }} + with: + webhook-url: ${{ secrets.WEBHOOK_URL }} + embed-title: ${{ env.SETONIX_VERSION }} + embed-description: ${{ env.SETONIX_CHANGELOG }} + embed-url: https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }} + content: | + Version ${{ env.SETONIX_VERSION }} released! + Download it here: https://setonix.world/downloads + https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }} + - name: Discord Webhook Action + uses: tsickert/discord-webhook@v7.0.0 + if: ${{ github.event.inputs.stable == 'false' && github.ref == 'refs/heads/develop' }} + with: + webhook-url: ${{ secrets.WEBHOOK_URL }} + embed-title: ${{ env.SETONIX_VERSION }} + embed-description: ${{ env.SETONIX_CHANGELOG }} + embed-url: https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }} + content: | + Pre-release version ${{ env.SETONIX_VERSION }} released! + Download it here: https://setonix.world/downloads + Please note that this is a pre-release version and is not intended for production use. + Read more about it here: https://setonix.world/nightly diff --git a/.github/workflows/servers.yml b/.github/workflows/servers.yml index 405b89fb..bfb97623 100644 --- a/.github/workflows/servers.yml +++ b/.github/workflows/servers.yml @@ -1,57 +1,57 @@ -on: - workflow_dispatch: - push: - branches: - - develop - paths: - - 'servers/**' -name: Deploy Server List -jobs: - build-servers: - runs-on: ubuntu-latest - defaults: - run: - working-directory: servers - steps: - - uses: actions/checkout@v6 - - name: Skip job if no changes - run: echo "No changes detected in servers directory. Skipping build." - - name: Install pnpm - uses: pnpm/action-setup@v6 - with: - package_json_file: docs/package.json - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 24 - cache: "pnpm" - cache-dependency-path: docs/pnpm-lock.yaml - - name: Install dependencies - run: pnpm install - - name: Build - run: pnpm build - - name: Setup SSH Agent - if: github.ref == 'refs/heads/develop' - uses: webfactory/ssh-agent@v0.10.0 - with: - ssh-private-key: ${{ secrets.SFTP_KEY }} - - name: Add SSH Known Hosts - if: github.ref == 'refs/heads/develop' - run: | - mkdir -p ~/.ssh - echo "${{ secrets.SFTP_KNOWN_HOSTS }}" > ~/.ssh/known_hosts - - - name: Deploy SSR build via rsync - if: github.ref == 'refs/heads/develop' - run: | - rsync -avz --delete ./ ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/var/www/servers.setonix - - - name: Restart SSR application - if: github.ref == 'refs/heads/develop' - run: | - ssh ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }} << 'EOF' - export REMOTE_URLS=${{ secrets.REMOTE_URLS }} - pm2 stop setonix-servers || true - cd /var/www/servers.setonix - PORT=${{ secrets.SERVERS_PORT }} pm2 start dist/server/entry.mjs --name setonix-servers --update-env - EOF +on: + workflow_dispatch: + push: + branches: + - develop + paths: + - 'servers/**' +name: Deploy Server List +jobs: + build-servers: + runs-on: ubuntu-latest + defaults: + run: + working-directory: servers + steps: + - uses: actions/checkout@v6 + - name: Skip job if no changes + run: echo "No changes detected in servers directory. Skipping build." + - name: Install pnpm + uses: pnpm/action-setup@v6 + with: + package_json_file: docs/package.json + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 26 + cache: "pnpm" + cache-dependency-path: docs/pnpm-lock.yaml + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + - name: Setup SSH Agent + if: github.ref == 'refs/heads/develop' + uses: webfactory/ssh-agent@v0.10.0 + with: + ssh-private-key: ${{ secrets.SFTP_KEY }} + - name: Add SSH Known Hosts + if: github.ref == 'refs/heads/develop' + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SFTP_KNOWN_HOSTS }}" > ~/.ssh/known_hosts + + - name: Deploy SSR build via rsync + if: github.ref == 'refs/heads/develop' + run: | + rsync -avz --delete ./ ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/var/www/servers.setonix + + - name: Restart SSR application + if: github.ref == 'refs/heads/develop' + run: | + ssh ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }} << 'EOF' + export REMOTE_URLS=${{ secrets.REMOTE_URLS }} + pm2 stop setonix-servers || true + cd /var/www/servers.setonix + PORT=${{ secrets.SERVERS_PORT }} pm2 start dist/server/entry.mjs --name setonix-servers --update-env + EOF diff --git a/.gitignore b/.gitignore index 2681aaaa..1c7bd4d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -*.iml -*.ipr -*.iws -.idea/ -.vscode/ -target/ +*.iml +*.ipr +*.iws +.idea/ +.vscode/ +target/ diff --git a/BRANDING_LICENSE b/BRANDING_LICENSE index 539c039e..f016e3db 100644 --- a/BRANDING_LICENSE +++ b/BRANDING_LICENSE @@ -1,427 +1,427 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - including for purposes of Section 3(b); and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - +Attribution-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-ShareAlike 4.0 International Public +License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-ShareAlike 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public licenses. +Notwithstanding, Creative Commons may elect to apply one of its public +licenses to material it publishes and in those instances will be +considered the “Licensor.” The text of the Creative Commons public +licenses is dedicated to the public domain under the CC0 Public Domain +Dedication. Except for the limited purpose of indicating that material +is shared under a Creative Commons public license or as otherwise +permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the public +licenses. + Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ee0cc10f..d1e49709 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,128 +1,128 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -codeofconduct@linwood.dev. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +codeofconduct@linwood.dev. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/LICENSE b/LICENSE index 0ad25db4..ada1a817 100644 --- a/LICENSE +++ b/LICENSE @@ -1,661 +1,661 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/api/.gitignore b/api/.gitignore index 3a857904..7cdc70d1 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -1,3 +1,3 @@ -# https://dart.dev/guides/libraries/private-files -# Created by `dart pub` -.dart_tool/ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ diff --git a/api/LICENSE b/api/LICENSE index 7a4a3ea2..9b5e4019 100644 --- a/api/LICENSE +++ b/api/LICENSE @@ -1,202 +1,202 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and limitations under the License. \ No newline at end of file diff --git a/api/README.md b/api/README.md index db77e825..1a94e5cd 100644 --- a/api/README.md +++ b/api/README.md @@ -1,3 +1,3 @@ -# Setonix API - -Read more [here](../README.md). +# Setonix API + +Read more [here](../README.md). diff --git a/api/analysis_options.yaml b/api/analysis_options.yaml index dee8927a..2be5f100 100644 --- a/api/analysis_options.yaml +++ b/api/analysis_options.yaml @@ -1,30 +1,30 @@ -# This file configures the static analysis results for your project (errors, -# warnings, and lints). -# -# This enables the 'recommended' set of lints from `package:lints`. -# This set helps identify many issues that may lead to problems when running -# or consuming Dart code, and enforces writing Dart using a single, idiomatic -# style and format. -# -# If you want a smaller set of lints you can change this to specify -# 'package:lints/core.yaml'. These are just the most critical lints -# (the recommended set includes the core lints). -# The core lints are also what is used by pub.dev for scoring packages. - -include: package:lints/recommended.yaml - -# Uncomment the following section to specify additional rules. - -# linter: -# rules: -# - camel_case_types - -# analyzer: -# exclude: -# - path/to/excluded/files/** - -# For more information about the core and recommended set of lints, see -# https://dart.dev/go/core-lints - -# For additional information about configuring this file, see -# https://dart.dev/guides/language/analysis-options +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/api/build.yaml b/api/build.yaml index f6aa65e2..cb9dcd92 100644 --- a/api/build.yaml +++ b/api/build.yaml @@ -1,4 +1,4 @@ -global_options: - dart_mappable_builder: - options: - useNodoc: true +global_options: + dart_mappable_builder: + options: + useNodoc: true diff --git a/api/lib/event.dart b/api/lib/event.dart index cb2d6211..475ab9cd 100644 --- a/api/lib/event.dart +++ b/api/lib/event.dart @@ -1,7 +1,7 @@ -library; - -export 'models.dart'; -export 'src/event/event.dart'; -export 'src/event/state.dart'; -export 'src/event/process/client.dart'; -export 'src/event/process/server.dart'; +library; + +export 'models.dart'; +export 'src/event/event.dart'; +export 'src/event/state.dart'; +export 'src/event/process/client.dart'; +export 'src/event/process/server.dart'; diff --git a/api/lib/helpers.dart b/api/lib/helpers.dart index e9e3d7d6..a3a4e01d 100644 --- a/api/lib/helpers.dart +++ b/api/lib/helpers.dart @@ -1,2 +1,2 @@ -export 'src/helpers/crypto.dart'; -export 'src/helpers/equality.dart'; +export 'src/helpers/crypto.dart'; +export 'src/helpers/equality.dart'; diff --git a/api/lib/models.dart b/api/lib/models.dart index bf89257e..995e1559 100644 --- a/api/lib/models.dart +++ b/api/lib/models.dart @@ -1,21 +1,21 @@ -export 'src/helpers/equality.dart'; - -export 'src/models/background.dart'; -export 'src/models/cell.dart'; -export 'src/models/chat.dart'; -export 'src/models/config.dart'; -export 'src/models/data.dart'; -export 'src/models/deck.dart'; -export 'src/models/definition.dart'; -export 'src/models/dialog.dart'; -export 'src/models/info.dart'; -export 'src/models/kick.dart'; -export 'src/models/meta.dart'; -export 'src/models/mode.dart'; -export 'src/models/server.dart'; -export 'src/models/table.dart'; -export 'src/models/toolbar.dart'; -export 'src/models/translation.dart'; -export 'src/models/vector.dart'; -export 'src/models/visual.dart'; -export 'src/models/waypoint.dart'; +export 'src/helpers/equality.dart'; + +export 'src/models/background.dart'; +export 'src/models/cell.dart'; +export 'src/models/chat.dart'; +export 'src/models/config.dart'; +export 'src/models/data.dart'; +export 'src/models/deck.dart'; +export 'src/models/definition.dart'; +export 'src/models/dialog.dart'; +export 'src/models/info.dart'; +export 'src/models/kick.dart'; +export 'src/models/meta.dart'; +export 'src/models/mode.dart'; +export 'src/models/server.dart'; +export 'src/models/table.dart'; +export 'src/models/toolbar.dart'; +export 'src/models/translation.dart'; +export 'src/models/vector.dart'; +export 'src/models/visual.dart'; +export 'src/models/waypoint.dart'; diff --git a/api/lib/services.dart b/api/lib/services.dart index 469c9a86..22a102d5 100644 --- a/api/lib/services.dart +++ b/api/lib/services.dart @@ -1,4 +1,4 @@ -export 'src/services/asset.dart'; -export 'src/services/challenge.dart'; -export 'src/services/network.dart'; -export 'src/services/user.dart'; +export 'src/services/asset.dart'; +export 'src/services/challenge.dart'; +export 'src/services/network.dart'; +export 'src/services/user.dart'; diff --git a/api/lib/setonix_api.dart b/api/lib/setonix_api.dart index 9f87654b..a3b70ebb 100644 --- a/api/lib/setonix_api.dart +++ b/api/lib/setonix_api.dart @@ -1,7 +1,7 @@ -/// The Linwood Setonix API -library; - -export 'helpers.dart'; -export 'models.dart'; -export 'event.dart'; -export 'services.dart'; +/// The Linwood Setonix API +library; + +export 'helpers.dart'; +export 'models.dart'; +export 'event.dart'; +export 'services.dart'; diff --git a/api/lib/src/event/client.dart b/api/lib/src/event/client.dart index c8fbff14..1d51314e 100644 --- a/api/lib/src/event/client.dart +++ b/api/lib/src/event/client.dart @@ -1,201 +1,201 @@ -part of 'event.dart'; - -/// Events that will be send by the client -/// Naming convention: present tense + Request -@MappableClass() -sealed class ClientWorldEvent extends WorldEvent - with ClientWorldEventMappable {} - -@MappableClass() -final class TeamJoinRequest extends ClientWorldEvent - with TeamJoinRequestMappable { - final String team; - - TeamJoinRequest(this.team); -} - -@MappableClass() -final class TeamLeaveRequest extends ClientWorldEvent - with TeamLeaveRequestMappable { - final String team; - - TeamLeaveRequest(this.team); -} - -@MappableClass() -final class CellRollRequest extends ClientWorldEvent - with CellRollRequestMappable { - final GlobalVectorDefinition cell; - final int? object; - - CellRollRequest(this.cell, {this.object}); - - GameObject? getObject(WorldState state) { - if (object == null) return null; - final table = state.getTableOrDefault(cell.table); - final cellObjects = table.getCell(cell.position); - return cellObjects.objects.elementAtOrNull(object!); - } -} - -@MappableClass() -final class ShuffleCellRequest extends ClientWorldEvent - with ShuffleCellRequestMappable { - final GlobalVectorDefinition cell; - - ShuffleCellRequest(this.cell); -} - -@MappableClass() -final class PacksChangeRequest extends ClientWorldEvent - with PacksChangeRequestMappable { - final List packs; - - PacksChangeRequest(this.packs); -} - -@MappableClass() -final class MessageRequest extends ClientWorldEvent - with MessageRequestMappable { - final String message; - - MessageRequest(this.message); -} - -@MappableClass() -final class BoardsSpawnRequest extends ClientWorldEvent - with BoardsSpawnRequestMappable { - final String table; - final Map> assets; - - BoardsSpawnRequest(this.table, [this.assets = const {}]); - BoardsSpawnRequest.single(GlobalVectorDefinition cell, ItemLocation asset) - : table = cell.table, - assets = { - cell.position: [asset], - }; - BoardsSpawnRequest.fromLocal( - this.table, - VectorDefinition cell, - ItemLocation asset, - ) : assets = { - cell: [asset], - }; - - BoardsSpawnRequest boards(VectorDefinition cell, List assets) => - copyWith( - assets: { - ...this.assets, - cell: [...this.assets[cell] ?? [], ...assets], - }, - ); - - BoardsSpawnRequest board(VectorDefinition cell, ItemLocation asset) => - boards(cell, [asset]); - - bool inBounds(VectorDefinition start, VectorDefinition end) { - for (final entry in assets.entries) { - if (!entry.key.inBounds(start, end)) return false; - } - return true; - } -} - -@MappableClass() -final class BoardRemoveRequest extends ClientWorldEvent - with BoardRemoveRequestMappable { - final GlobalVectorDefinition position; - final int index; - - BoardRemoveRequest(this.position, this.index); - - BoardTile? getTile(WorldState state) { - final table = state.getTableOrDefault(position.table); - final cell = table.getCell(position.position); - return cell.tiles.elementAtOrNull(index); - } -} - -@MappableClass() -final class BoardMoveRequest extends ClientWorldEvent - with BoardMoveRequestMappable { - final String table; - final VectorDefinition from; - final VectorDefinition to; - final int index; - - BoardMoveRequest(this.table, this.from, this.to, this.index); - - BoardTile? getTile(WorldState state) { - final table = state.getTableOrDefault(this.table); - final cell = table.getCell(from); - return cell.tiles.elementAtOrNull(index); - } - - VectorDefinition delta() => to - from; -} - -@MappableClass() -final class DialogCloseRequest extends ClientWorldEvent - with DialogCloseRequestMappable { - final String id; - final GameDialogValue? value; - - DialogCloseRequest(this.id, this.value); -} - -@MappableClass() -final class ImagesRequest extends ClientWorldEvent with ImagesRequestMappable { - final List ids; - - ImagesRequest(this.ids); -} - -@MappableClass() -final class ModeChangeRequest extends ClientWorldEvent - with ModeChangeRequestMappable { - final ItemLocation? location; - - ModeChangeRequest(this.location); - ModeChangeRequest.plain() : location = null; -} - -@MappableClass(includeCustomMappers: [Base64Uint8ListHook()]) -final class AuthenticateRequest extends ClientWorldEvent - with AuthenticateRequestMappable { - final Uint8List signature; - final Uint8List publicKey; - - static final _generator = Ed25519(); - - AuthenticateRequest(this.signature, this.publicKey); - - static Future build( - AuthenticatedRequested request, - SetonixAccount account, - ) async { - final challenge = request.challenge; - final keyPair = account.keyPair; - final signature = await _generator.sign(challenge, keyPair: keyPair); - return AuthenticateRequest( - Uint8List.fromList(signature.bytes), - account.publicKey, - ); - } - - Future verify(Uint8List challenge) => _generator.verify( - challenge, - signature: Signature( - signature, - publicKey: SimplePublicKey(publicKey, type: KeyPairType.ed25519), - ), - ); -} - -@MappableClass() -final class ToolbarActionRequest extends ClientWorldEvent - with ToolbarActionRequestMappable { - final String actionId; - - ToolbarActionRequest(this.actionId); -} +part of 'event.dart'; + +/// Events that will be send by the client +/// Naming convention: present tense + Request +@MappableClass() +sealed class ClientWorldEvent extends WorldEvent + with ClientWorldEventMappable {} + +@MappableClass() +final class TeamJoinRequest extends ClientWorldEvent + with TeamJoinRequestMappable { + final String team; + + TeamJoinRequest(this.team); +} + +@MappableClass() +final class TeamLeaveRequest extends ClientWorldEvent + with TeamLeaveRequestMappable { + final String team; + + TeamLeaveRequest(this.team); +} + +@MappableClass() +final class CellRollRequest extends ClientWorldEvent + with CellRollRequestMappable { + final GlobalVectorDefinition cell; + final int? object; + + CellRollRequest(this.cell, {this.object}); + + GameObject? getObject(WorldState state) { + if (object == null) return null; + final table = state.getTableOrDefault(cell.table); + final cellObjects = table.getCell(cell.position); + return cellObjects.objects.elementAtOrNull(object!); + } +} + +@MappableClass() +final class ShuffleCellRequest extends ClientWorldEvent + with ShuffleCellRequestMappable { + final GlobalVectorDefinition cell; + + ShuffleCellRequest(this.cell); +} + +@MappableClass() +final class PacksChangeRequest extends ClientWorldEvent + with PacksChangeRequestMappable { + final List packs; + + PacksChangeRequest(this.packs); +} + +@MappableClass() +final class MessageRequest extends ClientWorldEvent + with MessageRequestMappable { + final String message; + + MessageRequest(this.message); +} + +@MappableClass() +final class BoardsSpawnRequest extends ClientWorldEvent + with BoardsSpawnRequestMappable { + final String table; + final Map> assets; + + BoardsSpawnRequest(this.table, [this.assets = const {}]); + BoardsSpawnRequest.single(GlobalVectorDefinition cell, ItemLocation asset) + : table = cell.table, + assets = { + cell.position: [asset], + }; + BoardsSpawnRequest.fromLocal( + this.table, + VectorDefinition cell, + ItemLocation asset, + ) : assets = { + cell: [asset], + }; + + BoardsSpawnRequest boards(VectorDefinition cell, List assets) => + copyWith( + assets: { + ...this.assets, + cell: [...this.assets[cell] ?? [], ...assets], + }, + ); + + BoardsSpawnRequest board(VectorDefinition cell, ItemLocation asset) => + boards(cell, [asset]); + + bool inBounds(VectorDefinition start, VectorDefinition end) { + for (final entry in assets.entries) { + if (!entry.key.inBounds(start, end)) return false; + } + return true; + } +} + +@MappableClass() +final class BoardRemoveRequest extends ClientWorldEvent + with BoardRemoveRequestMappable { + final GlobalVectorDefinition position; + final int index; + + BoardRemoveRequest(this.position, this.index); + + BoardTile? getTile(WorldState state) { + final table = state.getTableOrDefault(position.table); + final cell = table.getCell(position.position); + return cell.tiles.elementAtOrNull(index); + } +} + +@MappableClass() +final class BoardMoveRequest extends ClientWorldEvent + with BoardMoveRequestMappable { + final String table; + final VectorDefinition from; + final VectorDefinition to; + final int index; + + BoardMoveRequest(this.table, this.from, this.to, this.index); + + BoardTile? getTile(WorldState state) { + final table = state.getTableOrDefault(this.table); + final cell = table.getCell(from); + return cell.tiles.elementAtOrNull(index); + } + + VectorDefinition delta() => to - from; +} + +@MappableClass() +final class DialogCloseRequest extends ClientWorldEvent + with DialogCloseRequestMappable { + final String id; + final GameDialogValue? value; + + DialogCloseRequest(this.id, this.value); +} + +@MappableClass() +final class ImagesRequest extends ClientWorldEvent with ImagesRequestMappable { + final List ids; + + ImagesRequest(this.ids); +} + +@MappableClass() +final class ModeChangeRequest extends ClientWorldEvent + with ModeChangeRequestMappable { + final ItemLocation? location; + + ModeChangeRequest(this.location); + ModeChangeRequest.plain() : location = null; +} + +@MappableClass(includeCustomMappers: [Base64Uint8ListHook()]) +final class AuthenticateRequest extends ClientWorldEvent + with AuthenticateRequestMappable { + final Uint8List signature; + final Uint8List publicKey; + + static final _generator = Ed25519(); + + AuthenticateRequest(this.signature, this.publicKey); + + static Future build( + AuthenticatedRequested request, + SetonixAccount account, + ) async { + final challenge = request.challenge; + final keyPair = account.keyPair; + final signature = await _generator.sign(challenge, keyPair: keyPair); + return AuthenticateRequest( + Uint8List.fromList(signature.bytes), + account.publicKey, + ); + } + + Future verify(Uint8List challenge) => _generator.verify( + challenge, + signature: Signature( + signature, + publicKey: SimplePublicKey(publicKey, type: KeyPairType.ed25519), + ), + ); +} + +@MappableClass() +final class ToolbarActionRequest extends ClientWorldEvent + with ToolbarActionRequestMappable { + final String actionId; + + ToolbarActionRequest(this.actionId); +} diff --git a/api/lib/src/event/event.dart b/api/lib/src/event/event.dart index fff4ce7a..6f983308 100644 --- a/api/lib/src/event/event.dart +++ b/api/lib/src/event/event.dart @@ -1,31 +1,31 @@ -import 'dart:convert'; - -import 'package:cryptography_plus/cryptography_plus.dart'; -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:networker/networker.dart'; -import 'package:setonix_api/event.dart'; - -import 'dart:typed_data'; - -part 'event.mapper.dart'; - -part 'server.dart'; -part 'client.dart'; -part 'hybrid.dart'; -part 'local.dart'; - -const kDefaultPort = 28006; -const kBroadcastPort = 28007; - -@MappableClass(discriminatorKey: 'type') -sealed class WorldEvent with WorldEventMappable { - const WorldEvent(); -} - -/// Events that can be processed by the event management system -/// This can be a ServerWorldEvent or a LocalWorldEvent -@MappableClass(discriminatorKey: 'type') -sealed class PlayableWorldEvent extends WorldEvent - with PlayableWorldEventMappable { - const PlayableWorldEvent(); -} +import 'dart:convert'; + +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:networker/networker.dart'; +import 'package:setonix_api/event.dart'; + +import 'dart:typed_data'; + +part 'event.mapper.dart'; + +part 'server.dart'; +part 'client.dart'; +part 'hybrid.dart'; +part 'local.dart'; + +const kDefaultPort = 28006; +const kBroadcastPort = 28007; + +@MappableClass(discriminatorKey: 'type') +sealed class WorldEvent with WorldEventMappable { + const WorldEvent(); +} + +/// Events that can be processed by the event management system +/// This can be a ServerWorldEvent or a LocalWorldEvent +@MappableClass(discriminatorKey: 'type') +sealed class PlayableWorldEvent extends WorldEvent + with PlayableWorldEventMappable { + const PlayableWorldEvent(); +} diff --git a/api/lib/src/event/event.mapper.dart b/api/lib/src/event/event.mapper.dart index 9f2b5bc1..9cdb642b 100644 --- a/api/lib/src/event/event.mapper.dart +++ b/api/lib/src/event/event.mapper.dart @@ -1,7390 +1,7390 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'event.dart'; - -/// @nodoc -class WorldEventMapper extends ClassMapperBase { - WorldEventMapper._(); - - static WorldEventMapper? _instance; - static WorldEventMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WorldEventMapper._()); - PlayableWorldEventMapper.ensureInitialized(); - ClientWorldEventMapper.ensureInitialized(); - HybridWorldEventMapper.ensureInitialized(); - LocalWorldEventMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'WorldEvent'; - - @override - final MappableFields fields = const {}; - - static WorldEvent _instantiate(DecodingData data) { - throw MapperException.missingSubclass( - 'WorldEvent', - 'type', - '${data.value['type']}', - ); - } - - @override - final Function instantiate = _instantiate; - - static WorldEvent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static WorldEvent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin WorldEventMappable { - String toJson(); - Map toMap(); - WorldEventCopyWith get copyWith; -} - -/// @nodoc -abstract class WorldEventCopyWith<$R, $In extends WorldEvent, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call(); - WorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class PlayableWorldEventMapper extends SubClassMapperBase { - PlayableWorldEventMapper._(); - - static PlayableWorldEventMapper? _instance; - static PlayableWorldEventMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = PlayableWorldEventMapper._()); - WorldEventMapper.ensureInitialized().addSubMapper(_instance!); - ServerWorldEventMapper.ensureInitialized(); - LocalWorldEventMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'PlayableWorldEvent'; - - @override - final MappableFields fields = const {}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'PlayableWorldEvent'; - @override - late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); - - static PlayableWorldEvent _instantiate(DecodingData data) { - throw MapperException.missingSubclass( - 'PlayableWorldEvent', - 'type', - '${data.value['type']}', - ); - } - - @override - final Function instantiate = _instantiate; - - static PlayableWorldEvent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static PlayableWorldEvent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin PlayableWorldEventMappable { - String toJson(); - Map toMap(); - PlayableWorldEventCopyWith< - PlayableWorldEvent, - PlayableWorldEvent, - PlayableWorldEvent - > - get copyWith; -} - -/// @nodoc -abstract class PlayableWorldEventCopyWith< - $R, - $In extends PlayableWorldEvent, - $Out -> - implements WorldEventCopyWith<$R, $In, $Out> { - @override - $R call(); - PlayableWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class ServerWorldEventMapper extends SubClassMapperBase { - ServerWorldEventMapper._(); - - static ServerWorldEventMapper? _instance; - static ServerWorldEventMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ServerWorldEventMapper._()); - PlayableWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - WorldInitializedMapper.ensureInitialized(); - TeamJoinedMapper.ensureInitialized(); - TeamLeftMapper.ensureInitialized(); - ObjectsChangedMapper.ensureInitialized(); - CellShuffledMapper.ensureInitialized(); - MessageSentMapper.ensureInitialized(); - BoardTilesSpawnedMapper.ensureInitialized(); - BoardTilesChangedMapper.ensureInitialized(); - DialogOpenedMapper.ensureInitialized(); - DialogsClosedMapper.ensureInitialized(); - ImagesUpdatedMapper.ensureInitialized(); - ServerStateUpdatedMapper.ensureInitialized(); - AuthenticatedRequestedMapper.ensureInitialized(); - ToolbarUpdatedMapper.ensureInitialized(); - HybridWorldEventMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ServerWorldEvent'; - - @override - final MappableFields fields = const {}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ServerWorldEvent'; - @override - late final ClassMapperBase superMapper = - PlayableWorldEventMapper.ensureInitialized(); - - static ServerWorldEvent _instantiate(DecodingData data) { - throw MapperException.missingSubclass( - 'ServerWorldEvent', - 'type', - '${data.value['type']}', - ); - } - - @override - final Function instantiate = _instantiate; - - static ServerWorldEvent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ServerWorldEvent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ServerWorldEventMappable { - String toJson(); - Map toMap(); - ServerWorldEventCopyWith - get copyWith; -} - -/// @nodoc -abstract class ServerWorldEventCopyWith<$R, $In extends ServerWorldEvent, $Out> - implements PlayableWorldEventCopyWith<$R, $In, $Out> { - @override - $R call(); - ServerWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class WorldInitializedMapper extends SubClassMapperBase { - WorldInitializedMapper._(); - - static WorldInitializedMapper? _instance; - static WorldInitializedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WorldInitializedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GameTableMapper.ensureInitialized(); - GameInfoMapper.ensureInitialized(); - SignatureMetadataMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'WorldInitialized'; - - static GameTable? _$table(WorldInitialized v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - opt: true, - ); - static GameInfo? _$info(WorldInitialized v) => v.info; - static const Field _f$info = Field( - 'info', - _$info, - opt: true, - ); - static Map>? _$teamMembers(WorldInitialized v) => - v.teamMembers; - static const Field>> _f$teamMembers = - Field('teamMembers', _$teamMembers, opt: true); - static int? _$id(WorldInitialized v) => v.id; - static const Field _f$id = Field( - 'id', - _$id, - opt: true, - ); - static List? _$packsSignature(WorldInitialized v) => - v.packsSignature; - static const Field> - _f$packsSignature = Field('packsSignature', _$packsSignature, opt: true); - static bool _$clearUserInterface(WorldInitialized v) => v.clearUserInterface; - static const Field _f$clearUserInterface = Field( - 'clearUserInterface', - _$clearUserInterface, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #table: _f$table, - #info: _f$info, - #teamMembers: _f$teamMembers, - #id: _f$id, - #packsSignature: _f$packsSignature, - #clearUserInterface: _f$clearUserInterface, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'WorldInitialized'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static WorldInitialized _instantiate(DecodingData data) { - return WorldInitialized( - table: data.dec(_f$table), - info: data.dec(_f$info), - teamMembers: data.dec(_f$teamMembers), - id: data.dec(_f$id), - packsSignature: data.dec(_f$packsSignature), - clearUserInterface: data.dec(_f$clearUserInterface), - ); - } - - @override - final Function instantiate = _instantiate; - - static WorldInitialized fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static WorldInitialized fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin WorldInitializedMappable { - String toJson() { - return WorldInitializedMapper.ensureInitialized() - .encodeJson(this as WorldInitialized); - } - - Map toMap() { - return WorldInitializedMapper.ensureInitialized() - .encodeMap(this as WorldInitialized); - } - - WorldInitializedCopyWith - get copyWith => - _WorldInitializedCopyWithImpl( - this as WorldInitialized, - $identity, - $identity, - ); - @override - String toString() { - return WorldInitializedMapper.ensureInitialized().stringifyValue( - this as WorldInitialized, - ); - } - - @override - bool operator ==(Object other) { - return WorldInitializedMapper.ensureInitialized().equalsValue( - this as WorldInitialized, - other, - ); - } - - @override - int get hashCode { - return WorldInitializedMapper.ensureInitialized().hashValue( - this as WorldInitialized, - ); - } -} - -/// @nodoc -extension WorldInitializedValueCopy<$R, $Out> - on ObjectCopyWith<$R, WorldInitialized, $Out> { - WorldInitializedCopyWith<$R, WorldInitialized, $Out> - get $asWorldInitialized => - $base.as((v, t, t2) => _WorldInitializedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class WorldInitializedCopyWith<$R, $In extends WorldInitialized, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - GameTableCopyWith<$R, GameTable, GameTable>? get table; - GameInfoCopyWith<$R, GameInfo, GameInfo>? get info; - MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>>? - get teamMembers; - ListCopyWith< - $R, - SignatureMetadata, - SignatureMetadataCopyWith<$R, SignatureMetadata, SignatureMetadata> - >? - get packsSignature; - @override - $R call({ - GameTable? table, - GameInfo? info, - Map>? teamMembers, - int? id, - List? packsSignature, - bool? clearUserInterface, - }); - WorldInitializedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _WorldInitializedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, WorldInitialized, $Out> - implements WorldInitializedCopyWith<$R, WorldInitialized, $Out> { - _WorldInitializedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - WorldInitializedMapper.ensureInitialized(); - @override - GameTableCopyWith<$R, GameTable, GameTable>? get table => - $value.table?.copyWith.$chain((v) => call(table: v)); - @override - GameInfoCopyWith<$R, GameInfo, GameInfo>? get info => - $value.info?.copyWith.$chain((v) => call(info: v)); - @override - MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>>? - get teamMembers => $value.teamMembers != null - ? MapCopyWith( - $value.teamMembers!, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(teamMembers: v), - ) - : null; - @override - ListCopyWith< - $R, - SignatureMetadata, - SignatureMetadataCopyWith<$R, SignatureMetadata, SignatureMetadata> - >? - get packsSignature => $value.packsSignature != null - ? ListCopyWith( - $value.packsSignature!, - (v, t) => v.copyWith.$chain(t), - (v) => call(packsSignature: v), - ) - : null; - @override - $R call({ - Object? table = $none, - Object? info = $none, - Object? teamMembers = $none, - Object? id = $none, - Object? packsSignature = $none, - bool? clearUserInterface, - }) => $apply( - FieldCopyWithData({ - if (table != $none) #table: table, - if (info != $none) #info: info, - if (teamMembers != $none) #teamMembers: teamMembers, - if (id != $none) #id: id, - if (packsSignature != $none) #packsSignature: packsSignature, - if (clearUserInterface != null) #clearUserInterface: clearUserInterface, - }), - ); - @override - WorldInitialized $make(CopyWithData data) => WorldInitialized( - table: data.get(#table, or: $value.table), - info: data.get(#info, or: $value.info), - teamMembers: data.get(#teamMembers, or: $value.teamMembers), - id: data.get(#id, or: $value.id), - packsSignature: data.get(#packsSignature, or: $value.packsSignature), - clearUserInterface: data.get( - #clearUserInterface, - or: $value.clearUserInterface, - ), - ); - - @override - WorldInitializedCopyWith<$R2, WorldInitialized, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _WorldInitializedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TeamJoinedMapper extends SubClassMapperBase { - TeamJoinedMapper._(); - - static TeamJoinedMapper? _instance; - static TeamJoinedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamJoinedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TeamJoined'; - - static int _$user(TeamJoined v) => v.user; - static const Field _f$user = Field('user', _$user); - static String _$team(TeamJoined v) => v.team; - static const Field _f$team = Field('team', _$team); - - @override - final MappableFields fields = const { - #user: _f$user, - #team: _f$team, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TeamJoined'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static TeamJoined _instantiate(DecodingData data) { - return TeamJoined(data.dec(_f$user), data.dec(_f$team)); - } - - @override - final Function instantiate = _instantiate; - - static TeamJoined fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TeamJoined fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TeamJoinedMappable { - String toJson() { - return TeamJoinedMapper.ensureInitialized().encodeJson( - this as TeamJoined, - ); - } - - Map toMap() { - return TeamJoinedMapper.ensureInitialized().encodeMap( - this as TeamJoined, - ); - } - - TeamJoinedCopyWith get copyWith => - _TeamJoinedCopyWithImpl( - this as TeamJoined, - $identity, - $identity, - ); - @override - String toString() { - return TeamJoinedMapper.ensureInitialized().stringifyValue( - this as TeamJoined, - ); - } - - @override - bool operator ==(Object other) { - return TeamJoinedMapper.ensureInitialized().equalsValue( - this as TeamJoined, - other, - ); - } - - @override - int get hashCode { - return TeamJoinedMapper.ensureInitialized().hashValue(this as TeamJoined); - } -} - -/// @nodoc -extension TeamJoinedValueCopy<$R, $Out> - on ObjectCopyWith<$R, TeamJoined, $Out> { - TeamJoinedCopyWith<$R, TeamJoined, $Out> get $asTeamJoined => - $base.as((v, t, t2) => _TeamJoinedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TeamJoinedCopyWith<$R, $In extends TeamJoined, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({int? user, String? team}); - TeamJoinedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TeamJoinedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TeamJoined, $Out> - implements TeamJoinedCopyWith<$R, TeamJoined, $Out> { - _TeamJoinedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TeamJoinedMapper.ensureInitialized(); - @override - $R call({int? user, String? team}) => $apply( - FieldCopyWithData({ - if (user != null) #user: user, - if (team != null) #team: team, - }), - ); - @override - TeamJoined $make(CopyWithData data) => TeamJoined( - data.get(#user, or: $value.user), - data.get(#team, or: $value.team), - ); - - @override - TeamJoinedCopyWith<$R2, TeamJoined, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TeamJoinedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TeamLeftMapper extends SubClassMapperBase { - TeamLeftMapper._(); - - static TeamLeftMapper? _instance; - static TeamLeftMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamLeftMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TeamLeft'; - - static int _$user(TeamLeft v) => v.user; - static const Field _f$user = Field('user', _$user); - static String _$team(TeamLeft v) => v.team; - static const Field _f$team = Field('team', _$team); - - @override - final MappableFields fields = const { - #user: _f$user, - #team: _f$team, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TeamLeft'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static TeamLeft _instantiate(DecodingData data) { - return TeamLeft(data.dec(_f$user), data.dec(_f$team)); - } - - @override - final Function instantiate = _instantiate; - - static TeamLeft fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TeamLeft fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TeamLeftMappable { - String toJson() { - return TeamLeftMapper.ensureInitialized().encodeJson( - this as TeamLeft, - ); - } - - Map toMap() { - return TeamLeftMapper.ensureInitialized().encodeMap( - this as TeamLeft, - ); - } - - TeamLeftCopyWith get copyWith => - _TeamLeftCopyWithImpl( - this as TeamLeft, - $identity, - $identity, - ); - @override - String toString() { - return TeamLeftMapper.ensureInitialized().stringifyValue(this as TeamLeft); - } - - @override - bool operator ==(Object other) { - return TeamLeftMapper.ensureInitialized().equalsValue( - this as TeamLeft, - other, - ); - } - - @override - int get hashCode { - return TeamLeftMapper.ensureInitialized().hashValue(this as TeamLeft); - } -} - -/// @nodoc -extension TeamLeftValueCopy<$R, $Out> on ObjectCopyWith<$R, TeamLeft, $Out> { - TeamLeftCopyWith<$R, TeamLeft, $Out> get $asTeamLeft => - $base.as((v, t, t2) => _TeamLeftCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TeamLeftCopyWith<$R, $In extends TeamLeft, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({int? user, String? team}); - TeamLeftCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TeamLeftCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TeamLeft, $Out> - implements TeamLeftCopyWith<$R, TeamLeft, $Out> { - _TeamLeftCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TeamLeftMapper.ensureInitialized(); - @override - $R call({int? user, String? team}) => $apply( - FieldCopyWithData({ - if (user != null) #user: user, - if (team != null) #team: team, - }), - ); - @override - TeamLeft $make(CopyWithData data) => TeamLeft( - data.get(#user, or: $value.user), - data.get(#team, or: $value.team), - ); - - @override - TeamLeftCopyWith<$R2, TeamLeft, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TeamLeftCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ObjectsChangedMapper extends SubClassMapperBase { - ObjectsChangedMapper._(); - - static ObjectsChangedMapper? _instance; - static ObjectsChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ObjectsChangedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - GameObjectMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ObjectsChanged'; - - static GlobalVectorDefinition _$cell(ObjectsChanged v) => v.cell; - static const Field _f$cell = Field( - 'cell', - _$cell, - ); - static List _$objects(ObjectsChanged v) => v.objects; - static const Field> _f$objects = Field( - 'objects', - _$objects, - opt: true, - def: const [], - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #objects: _f$objects, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ObjectsChanged'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static ObjectsChanged _instantiate(DecodingData data) { - return ObjectsChanged(data.dec(_f$cell), data.dec(_f$objects)); - } - - @override - final Function instantiate = _instantiate; - - static ObjectsChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ObjectsChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ObjectsChangedMappable { - String toJson() { - return ObjectsChangedMapper.ensureInitialized().encodeJson( - this as ObjectsChanged, - ); - } - - Map toMap() { - return ObjectsChangedMapper.ensureInitialized().encodeMap( - this as ObjectsChanged, - ); - } - - ObjectsChangedCopyWith - get copyWith => _ObjectsChangedCopyWithImpl( - this as ObjectsChanged, - $identity, - $identity, - ); - @override - String toString() { - return ObjectsChangedMapper.ensureInitialized().stringifyValue( - this as ObjectsChanged, - ); - } - - @override - bool operator ==(Object other) { - return ObjectsChangedMapper.ensureInitialized().equalsValue( - this as ObjectsChanged, - other, - ); - } - - @override - int get hashCode { - return ObjectsChangedMapper.ensureInitialized().hashValue( - this as ObjectsChanged, - ); - } -} - -/// @nodoc -extension ObjectsChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ObjectsChanged, $Out> { - ObjectsChangedCopyWith<$R, ObjectsChanged, $Out> get $asObjectsChanged => - $base.as((v, t, t2) => _ObjectsChangedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ObjectsChangedCopyWith<$R, $In extends ObjectsChanged, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> - get objects; - @override - $R call({GlobalVectorDefinition? cell, List? objects}); - ObjectsChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ObjectsChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ObjectsChanged, $Out> - implements ObjectsChangedCopyWith<$R, ObjectsChanged, $Out> { - _ObjectsChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ObjectsChangedMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> - get objects => ListCopyWith( - $value.objects, - (v, t) => v.copyWith.$chain(t), - (v) => call(objects: v), - ); - @override - $R call({GlobalVectorDefinition? cell, List? objects}) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (objects != null) #objects: objects, - }), - ); - @override - ObjectsChanged $make(CopyWithData data) => ObjectsChanged( - data.get(#cell, or: $value.cell), - data.get(#objects, or: $value.objects), - ); - - @override - ObjectsChangedCopyWith<$R2, ObjectsChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ObjectsChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class CellShuffledMapper extends SubClassMapperBase { - CellShuffledMapper._(); - - static CellShuffledMapper? _instance; - static CellShuffledMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = CellShuffledMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'CellShuffled'; - - static GlobalVectorDefinition _$cell(CellShuffled v) => v.cell; - static const Field _f$cell = Field( - 'cell', - _$cell, - ); - static List _$positions(CellShuffled v) => v.positions; - static const Field> _f$positions = Field( - 'positions', - _$positions, - opt: true, - def: const [], - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #positions: _f$positions, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'CellShuffled'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static CellShuffled _instantiate(DecodingData data) { - return CellShuffled(data.dec(_f$cell), data.dec(_f$positions)); - } - - @override - final Function instantiate = _instantiate; - - static CellShuffled fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static CellShuffled fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin CellShuffledMappable { - String toJson() { - return CellShuffledMapper.ensureInitialized().encodeJson( - this as CellShuffled, - ); - } - - Map toMap() { - return CellShuffledMapper.ensureInitialized().encodeMap( - this as CellShuffled, - ); - } - - CellShuffledCopyWith get copyWith => - _CellShuffledCopyWithImpl( - this as CellShuffled, - $identity, - $identity, - ); - @override - String toString() { - return CellShuffledMapper.ensureInitialized().stringifyValue( - this as CellShuffled, - ); - } - - @override - bool operator ==(Object other) { - return CellShuffledMapper.ensureInitialized().equalsValue( - this as CellShuffled, - other, - ); - } - - @override - int get hashCode { - return CellShuffledMapper.ensureInitialized().hashValue( - this as CellShuffled, - ); - } -} - -/// @nodoc -extension CellShuffledValueCopy<$R, $Out> - on ObjectCopyWith<$R, CellShuffled, $Out> { - CellShuffledCopyWith<$R, CellShuffled, $Out> get $asCellShuffled => - $base.as((v, t, t2) => _CellShuffledCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class CellShuffledCopyWith<$R, $In extends CellShuffled, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get positions; - @override - $R call({GlobalVectorDefinition? cell, List? positions}); - CellShuffledCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _CellShuffledCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, CellShuffled, $Out> - implements CellShuffledCopyWith<$R, CellShuffled, $Out> { - _CellShuffledCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - CellShuffledMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get positions => - ListCopyWith( - $value.positions, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(positions: v), - ); - @override - $R call({GlobalVectorDefinition? cell, List? positions}) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (positions != null) #positions: positions, - }), - ); - @override - CellShuffled $make(CopyWithData data) => CellShuffled( - data.get(#cell, or: $value.cell), - data.get(#positions, or: $value.positions), - ); - - @override - CellShuffledCopyWith<$R2, CellShuffled, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _CellShuffledCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class MessageSentMapper extends SubClassMapperBase { - MessageSentMapper._(); - - static MessageSentMapper? _instance; - static MessageSentMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = MessageSentMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'MessageSent'; - - static int _$user(MessageSent v) => v.user; - static const Field _f$user = Field('user', _$user); - static String _$message(MessageSent v) => v.message; - static const Field _f$message = Field( - 'message', - _$message, - ); - - @override - final MappableFields fields = const { - #user: _f$user, - #message: _f$message, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'MessageSent'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static MessageSent _instantiate(DecodingData data) { - return MessageSent(data.dec(_f$user), data.dec(_f$message)); - } - - @override - final Function instantiate = _instantiate; - - static MessageSent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static MessageSent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin MessageSentMappable { - String toJson() { - return MessageSentMapper.ensureInitialized().encodeJson( - this as MessageSent, - ); - } - - Map toMap() { - return MessageSentMapper.ensureInitialized().encodeMap( - this as MessageSent, - ); - } - - MessageSentCopyWith get copyWith => - _MessageSentCopyWithImpl( - this as MessageSent, - $identity, - $identity, - ); - @override - String toString() { - return MessageSentMapper.ensureInitialized().stringifyValue( - this as MessageSent, - ); - } - - @override - bool operator ==(Object other) { - return MessageSentMapper.ensureInitialized().equalsValue( - this as MessageSent, - other, - ); - } - - @override - int get hashCode { - return MessageSentMapper.ensureInitialized().hashValue(this as MessageSent); - } -} - -/// @nodoc -extension MessageSentValueCopy<$R, $Out> - on ObjectCopyWith<$R, MessageSent, $Out> { - MessageSentCopyWith<$R, MessageSent, $Out> get $asMessageSent => - $base.as((v, t, t2) => _MessageSentCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class MessageSentCopyWith<$R, $In extends MessageSent, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({int? user, String? message}); - MessageSentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _MessageSentCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, MessageSent, $Out> - implements MessageSentCopyWith<$R, MessageSent, $Out> { - _MessageSentCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - MessageSentMapper.ensureInitialized(); - @override - $R call({int? user, String? message}) => $apply( - FieldCopyWithData({ - if (user != null) #user: user, - if (message != null) #message: message, - }), - ); - @override - MessageSent $make(CopyWithData data) => MessageSent( - data.get(#user, or: $value.user), - data.get(#message, or: $value.message), - ); - - @override - MessageSentCopyWith<$R2, MessageSent, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _MessageSentCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardTilesSpawnedMapper extends SubClassMapperBase { - BoardTilesSpawnedMapper._(); - - static BoardTilesSpawnedMapper? _instance; - static BoardTilesSpawnedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardTilesSpawnedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - BoardTileMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardTilesSpawned'; - - static String _$table(BoardTilesSpawned v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - ); - static Map> _$tiles(BoardTilesSpawned v) => - v.tiles; - static const Field>> - _f$tiles = Field('tiles', _$tiles, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #table: _f$table, - #tiles: _f$tiles, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'BoardTilesSpawned'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static BoardTilesSpawned _instantiate(DecodingData data) { - return BoardTilesSpawned(data.dec(_f$table), data.dec(_f$tiles)); - } - - @override - final Function instantiate = _instantiate; - - static BoardTilesSpawned fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardTilesSpawned fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardTilesSpawnedMappable { - String toJson() { - return BoardTilesSpawnedMapper.ensureInitialized() - .encodeJson(this as BoardTilesSpawned); - } - - Map toMap() { - return BoardTilesSpawnedMapper.ensureInitialized() - .encodeMap(this as BoardTilesSpawned); - } - - BoardTilesSpawnedCopyWith< - BoardTilesSpawned, - BoardTilesSpawned, - BoardTilesSpawned - > - get copyWith => - _BoardTilesSpawnedCopyWithImpl( - this as BoardTilesSpawned, - $identity, - $identity, - ); - @override - String toString() { - return BoardTilesSpawnedMapper.ensureInitialized().stringifyValue( - this as BoardTilesSpawned, - ); - } - - @override - bool operator ==(Object other) { - return BoardTilesSpawnedMapper.ensureInitialized().equalsValue( - this as BoardTilesSpawned, - other, - ); - } - - @override - int get hashCode { - return BoardTilesSpawnedMapper.ensureInitialized().hashValue( - this as BoardTilesSpawned, - ); - } -} - -/// @nodoc -extension BoardTilesSpawnedValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardTilesSpawned, $Out> { - BoardTilesSpawnedCopyWith<$R, BoardTilesSpawned, $Out> - get $asBoardTilesSpawned => $base.as( - (v, t, t2) => _BoardTilesSpawnedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BoardTilesSpawnedCopyWith< - $R, - $In extends BoardTilesSpawned, - $Out -> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get tiles; - @override - $R call({String? table, Map>? tiles}); - BoardTilesSpawnedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardTilesSpawnedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardTilesSpawned, $Out> - implements BoardTilesSpawnedCopyWith<$R, BoardTilesSpawned, $Out> { - _BoardTilesSpawnedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardTilesSpawnedMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get tiles => MapCopyWith( - $value.tiles, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(tiles: v), - ); - @override - $R call({String? table, Map>? tiles}) => - $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (tiles != null) #tiles: tiles, - }), - ); - @override - BoardTilesSpawned $make(CopyWithData data) => BoardTilesSpawned( - data.get(#table, or: $value.table), - data.get(#tiles, or: $value.tiles), - ); - - @override - BoardTilesSpawnedCopyWith<$R2, BoardTilesSpawned, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardTilesSpawnedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardTilesChangedMapper extends SubClassMapperBase { - BoardTilesChangedMapper._(); - - static BoardTilesChangedMapper? _instance; - static BoardTilesChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardTilesChangedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - BoardTileMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardTilesChanged'; - - static String _$table(BoardTilesChanged v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - ); - static Map> _$tiles(BoardTilesChanged v) => - v.tiles; - static const Field>> - _f$tiles = Field('tiles', _$tiles, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #table: _f$table, - #tiles: _f$tiles, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'BoardTilesChanged'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static BoardTilesChanged _instantiate(DecodingData data) { - return BoardTilesChanged(data.dec(_f$table), data.dec(_f$tiles)); - } - - @override - final Function instantiate = _instantiate; - - static BoardTilesChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardTilesChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardTilesChangedMappable { - String toJson() { - return BoardTilesChangedMapper.ensureInitialized() - .encodeJson(this as BoardTilesChanged); - } - - Map toMap() { - return BoardTilesChangedMapper.ensureInitialized() - .encodeMap(this as BoardTilesChanged); - } - - BoardTilesChangedCopyWith< - BoardTilesChanged, - BoardTilesChanged, - BoardTilesChanged - > - get copyWith => - _BoardTilesChangedCopyWithImpl( - this as BoardTilesChanged, - $identity, - $identity, - ); - @override - String toString() { - return BoardTilesChangedMapper.ensureInitialized().stringifyValue( - this as BoardTilesChanged, - ); - } - - @override - bool operator ==(Object other) { - return BoardTilesChangedMapper.ensureInitialized().equalsValue( - this as BoardTilesChanged, - other, - ); - } - - @override - int get hashCode { - return BoardTilesChangedMapper.ensureInitialized().hashValue( - this as BoardTilesChanged, - ); - } -} - -/// @nodoc -extension BoardTilesChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardTilesChanged, $Out> { - BoardTilesChangedCopyWith<$R, BoardTilesChanged, $Out> - get $asBoardTilesChanged => $base.as( - (v, t, t2) => _BoardTilesChangedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BoardTilesChangedCopyWith< - $R, - $In extends BoardTilesChanged, - $Out -> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get tiles; - @override - $R call({String? table, Map>? tiles}); - BoardTilesChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardTilesChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardTilesChanged, $Out> - implements BoardTilesChangedCopyWith<$R, BoardTilesChanged, $Out> { - _BoardTilesChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardTilesChangedMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get tiles => MapCopyWith( - $value.tiles, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(tiles: v), - ); - @override - $R call({String? table, Map>? tiles}) => - $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (tiles != null) #tiles: tiles, - }), - ); - @override - BoardTilesChanged $make(CopyWithData data) => BoardTilesChanged( - data.get(#table, or: $value.table), - data.get(#tiles, or: $value.tiles), - ); - - @override - BoardTilesChangedCopyWith<$R2, BoardTilesChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardTilesChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DialogOpenedMapper extends SubClassMapperBase { - DialogOpenedMapper._(); - - static DialogOpenedMapper? _instance; - static DialogOpenedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DialogOpenedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GameDialogMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'DialogOpened'; - - static GameDialog _$dialog(DialogOpened v) => v.dialog; - static const Field _f$dialog = Field( - 'dialog', - _$dialog, - ); - static bool _$closeOthers(DialogOpened v) => v.closeOthers; - static const Field _f$closeOthers = Field( - 'closeOthers', - _$closeOthers, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #dialog: _f$dialog, - #closeOthers: _f$closeOthers, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'DialogOpened'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static DialogOpened _instantiate(DecodingData data) { - return DialogOpened( - data.dec(_f$dialog), - closeOthers: data.dec(_f$closeOthers), - ); - } - - @override - final Function instantiate = _instantiate; - - static DialogOpened fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DialogOpened fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DialogOpenedMappable { - String toJson() { - return DialogOpenedMapper.ensureInitialized().encodeJson( - this as DialogOpened, - ); - } - - Map toMap() { - return DialogOpenedMapper.ensureInitialized().encodeMap( - this as DialogOpened, - ); - } - - DialogOpenedCopyWith get copyWith => - _DialogOpenedCopyWithImpl( - this as DialogOpened, - $identity, - $identity, - ); - @override - String toString() { - return DialogOpenedMapper.ensureInitialized().stringifyValue( - this as DialogOpened, - ); - } - - @override - bool operator ==(Object other) { - return DialogOpenedMapper.ensureInitialized().equalsValue( - this as DialogOpened, - other, - ); - } - - @override - int get hashCode { - return DialogOpenedMapper.ensureInitialized().hashValue( - this as DialogOpened, - ); - } -} - -/// @nodoc -extension DialogOpenedValueCopy<$R, $Out> - on ObjectCopyWith<$R, DialogOpened, $Out> { - DialogOpenedCopyWith<$R, DialogOpened, $Out> get $asDialogOpened => - $base.as((v, t, t2) => _DialogOpenedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class DialogOpenedCopyWith<$R, $In extends DialogOpened, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - GameDialogCopyWith<$R, GameDialog, GameDialog> get dialog; - @override - $R call({GameDialog? dialog, bool? closeOthers}); - DialogOpenedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _DialogOpenedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DialogOpened, $Out> - implements DialogOpenedCopyWith<$R, DialogOpened, $Out> { - _DialogOpenedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - DialogOpenedMapper.ensureInitialized(); - @override - GameDialogCopyWith<$R, GameDialog, GameDialog> get dialog => - $value.dialog.copyWith.$chain((v) => call(dialog: v)); - @override - $R call({GameDialog? dialog, bool? closeOthers}) => $apply( - FieldCopyWithData({ - if (dialog != null) #dialog: dialog, - if (closeOthers != null) #closeOthers: closeOthers, - }), - ); - @override - DialogOpened $make(CopyWithData data) => DialogOpened( - data.get(#dialog, or: $value.dialog), - closeOthers: data.get(#closeOthers, or: $value.closeOthers), - ); - - @override - DialogOpenedCopyWith<$R2, DialogOpened, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _DialogOpenedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DialogsClosedMapper extends SubClassMapperBase { - DialogsClosedMapper._(); - - static DialogsClosedMapper? _instance; - static DialogsClosedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DialogsClosedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'DialogsClosed'; - - static List? _$ids(DialogsClosed v) => v.ids; - static const Field> _f$ids = Field('ids', _$ids); - - @override - final MappableFields fields = const {#ids: _f$ids}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'DialogsClosed'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static DialogsClosed _instantiate(DecodingData data) { - return DialogsClosed(data.dec(_f$ids)); - } - - @override - final Function instantiate = _instantiate; - - static DialogsClosed fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DialogsClosed fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DialogsClosedMappable { - String toJson() { - return DialogsClosedMapper.ensureInitialized().encodeJson( - this as DialogsClosed, - ); - } - - Map toMap() { - return DialogsClosedMapper.ensureInitialized().encodeMap( - this as DialogsClosed, - ); - } - - DialogsClosedCopyWith - get copyWith => _DialogsClosedCopyWithImpl( - this as DialogsClosed, - $identity, - $identity, - ); - @override - String toString() { - return DialogsClosedMapper.ensureInitialized().stringifyValue( - this as DialogsClosed, - ); - } - - @override - bool operator ==(Object other) { - return DialogsClosedMapper.ensureInitialized().equalsValue( - this as DialogsClosed, - other, - ); - } - - @override - int get hashCode { - return DialogsClosedMapper.ensureInitialized().hashValue( - this as DialogsClosed, - ); - } -} - -/// @nodoc -extension DialogsClosedValueCopy<$R, $Out> - on ObjectCopyWith<$R, DialogsClosed, $Out> { - DialogsClosedCopyWith<$R, DialogsClosed, $Out> get $asDialogsClosed => - $base.as((v, t, t2) => _DialogsClosedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class DialogsClosedCopyWith<$R, $In extends DialogsClosed, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>>? get ids; - @override - $R call({List? ids}); - DialogsClosedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _DialogsClosedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DialogsClosed, $Out> - implements DialogsClosedCopyWith<$R, DialogsClosed, $Out> { - _DialogsClosedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - DialogsClosedMapper.ensureInitialized(); - @override - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>>? get ids => - $value.ids != null - ? ListCopyWith( - $value.ids!, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(ids: v), - ) - : null; - @override - $R call({Object? ids = $none}) => - $apply(FieldCopyWithData({if (ids != $none) #ids: ids})); - @override - DialogsClosed $make(CopyWithData data) => - DialogsClosed(data.get(#ids, or: $value.ids)); - - @override - DialogsClosedCopyWith<$R2, DialogsClosed, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _DialogsClosedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ImagesUpdatedMapper extends SubClassMapperBase { - ImagesUpdatedMapper._(); - - static ImagesUpdatedMapper? _instance; - static ImagesUpdatedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ImagesUpdatedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - MapperContainer.globals.useAll([Base64IdMapHook()]); - } - return _instance!; - } - - @override - final String id = 'ImagesUpdated'; - - static Map _$images(ImagesUpdated v) => v.images; - static const Field> _f$images = Field( - 'images', - _$images, - ); - - @override - final MappableFields fields = const {#images: _f$images}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ImagesUpdated'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static ImagesUpdated _instantiate(DecodingData data) { - return ImagesUpdated(data.dec(_f$images)); - } - - @override - final Function instantiate = _instantiate; - - static ImagesUpdated fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ImagesUpdated fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ImagesUpdatedMappable { - String toJson() { - return ImagesUpdatedMapper.ensureInitialized().encodeJson( - this as ImagesUpdated, - ); - } - - Map toMap() { - return ImagesUpdatedMapper.ensureInitialized().encodeMap( - this as ImagesUpdated, - ); - } - - ImagesUpdatedCopyWith - get copyWith => _ImagesUpdatedCopyWithImpl( - this as ImagesUpdated, - $identity, - $identity, - ); - @override - String toString() { - return ImagesUpdatedMapper.ensureInitialized().stringifyValue( - this as ImagesUpdated, - ); - } - - @override - bool operator ==(Object other) { - return ImagesUpdatedMapper.ensureInitialized().equalsValue( - this as ImagesUpdated, - other, - ); - } - - @override - int get hashCode { - return ImagesUpdatedMapper.ensureInitialized().hashValue( - this as ImagesUpdated, - ); - } -} - -/// @nodoc -extension ImagesUpdatedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ImagesUpdated, $Out> { - ImagesUpdatedCopyWith<$R, ImagesUpdated, $Out> get $asImagesUpdated => - $base.as((v, t, t2) => _ImagesUpdatedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ImagesUpdatedCopyWith<$R, $In extends ImagesUpdated, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> - get images; - @override - $R call({Map? images}); - ImagesUpdatedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _ImagesUpdatedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ImagesUpdated, $Out> - implements ImagesUpdatedCopyWith<$R, ImagesUpdated, $Out> { - _ImagesUpdatedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ImagesUpdatedMapper.ensureInitialized(); - @override - MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> - get images => MapCopyWith( - $value.images, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(images: v), - ); - @override - $R call({Map? images}) => - $apply(FieldCopyWithData({if (images != null) #images: images})); - @override - ImagesUpdated $make(CopyWithData data) => - ImagesUpdated(data.get(#images, or: $value.images)); - - @override - ImagesUpdatedCopyWith<$R2, ImagesUpdated, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ImagesUpdatedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ServerStateUpdatedMapper extends SubClassMapperBase { - ServerStateUpdatedMapper._(); - - static ServerStateUpdatedMapper? _instance; - static ServerStateUpdatedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ServerStateUpdatedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - ServerStateMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ServerStateUpdated'; - - static ServerState _$state(ServerStateUpdated v) => v.state; - static const Field _f$state = Field( - 'state', - _$state, - ); - - @override - final MappableFields fields = const {#state: _f$state}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ServerStateUpdated'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static ServerStateUpdated _instantiate(DecodingData data) { - return ServerStateUpdated(data.dec(_f$state)); - } - - @override - final Function instantiate = _instantiate; - - static ServerStateUpdated fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ServerStateUpdated fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ServerStateUpdatedMappable { - String toJson() { - return ServerStateUpdatedMapper.ensureInitialized() - .encodeJson(this as ServerStateUpdated); - } - - Map toMap() { - return ServerStateUpdatedMapper.ensureInitialized() - .encodeMap(this as ServerStateUpdated); - } - - ServerStateUpdatedCopyWith< - ServerStateUpdated, - ServerStateUpdated, - ServerStateUpdated - > - get copyWith => - _ServerStateUpdatedCopyWithImpl( - this as ServerStateUpdated, - $identity, - $identity, - ); - @override - String toString() { - return ServerStateUpdatedMapper.ensureInitialized().stringifyValue( - this as ServerStateUpdated, - ); - } - - @override - bool operator ==(Object other) { - return ServerStateUpdatedMapper.ensureInitialized().equalsValue( - this as ServerStateUpdated, - other, - ); - } - - @override - int get hashCode { - return ServerStateUpdatedMapper.ensureInitialized().hashValue( - this as ServerStateUpdated, - ); - } -} - -/// @nodoc -extension ServerStateUpdatedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ServerStateUpdated, $Out> { - ServerStateUpdatedCopyWith<$R, ServerStateUpdated, $Out> - get $asServerStateUpdated => $base.as( - (v, t, t2) => _ServerStateUpdatedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class ServerStateUpdatedCopyWith< - $R, - $In extends ServerStateUpdated, - $Out -> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - ServerStateCopyWith<$R, ServerState, ServerState> get state; - @override - $R call({ServerState? state}); - ServerStateUpdatedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ServerStateUpdatedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ServerStateUpdated, $Out> - implements ServerStateUpdatedCopyWith<$R, ServerStateUpdated, $Out> { - _ServerStateUpdatedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ServerStateUpdatedMapper.ensureInitialized(); - @override - ServerStateCopyWith<$R, ServerState, ServerState> get state => - $value.state.copyWith.$chain((v) => call(state: v)); - @override - $R call({ServerState? state}) => - $apply(FieldCopyWithData({if (state != null) #state: state})); - @override - ServerStateUpdated $make(CopyWithData data) => - ServerStateUpdated(data.get(#state, or: $value.state)); - - @override - ServerStateUpdatedCopyWith<$R2, ServerStateUpdated, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ServerStateUpdatedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class AuthenticatedRequestedMapper - extends SubClassMapperBase { - AuthenticatedRequestedMapper._(); - - static AuthenticatedRequestedMapper? _instance; - static AuthenticatedRequestedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = AuthenticatedRequestedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - MapperContainer.globals.useAll([Base64Uint8ListHook()]); - } - return _instance!; - } - - @override - final String id = 'AuthenticatedRequested'; - - static Uint8List _$challenge(AuthenticatedRequested v) => v.challenge; - static const Field _f$challenge = Field( - 'challenge', - _$challenge, - ); - static bool _$isRequired(AuthenticatedRequested v) => v.isRequired; - static const Field _f$isRequired = Field( - 'isRequired', - _$isRequired, - opt: true, - def: true, - ); - - @override - final MappableFields fields = const { - #challenge: _f$challenge, - #isRequired: _f$isRequired, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'AuthenticatedRequested'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static AuthenticatedRequested _instantiate(DecodingData data) { - return AuthenticatedRequested( - data.dec(_f$challenge), - isRequired: data.dec(_f$isRequired), - ); - } - - @override - final Function instantiate = _instantiate; - - static AuthenticatedRequested fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static AuthenticatedRequested fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin AuthenticatedRequestedMappable { - String toJson() { - return AuthenticatedRequestedMapper.ensureInitialized() - .encodeJson(this as AuthenticatedRequested); - } - - Map toMap() { - return AuthenticatedRequestedMapper.ensureInitialized() - .encodeMap(this as AuthenticatedRequested); - } - - AuthenticatedRequestedCopyWith< - AuthenticatedRequested, - AuthenticatedRequested, - AuthenticatedRequested - > - get copyWith => - _AuthenticatedRequestedCopyWithImpl< - AuthenticatedRequested, - AuthenticatedRequested - >(this as AuthenticatedRequested, $identity, $identity); - @override - String toString() { - return AuthenticatedRequestedMapper.ensureInitialized().stringifyValue( - this as AuthenticatedRequested, - ); - } - - @override - bool operator ==(Object other) { - return AuthenticatedRequestedMapper.ensureInitialized().equalsValue( - this as AuthenticatedRequested, - other, - ); - } - - @override - int get hashCode { - return AuthenticatedRequestedMapper.ensureInitialized().hashValue( - this as AuthenticatedRequested, - ); - } -} - -/// @nodoc -extension AuthenticatedRequestedValueCopy<$R, $Out> - on ObjectCopyWith<$R, AuthenticatedRequested, $Out> { - AuthenticatedRequestedCopyWith<$R, AuthenticatedRequested, $Out> - get $asAuthenticatedRequested => $base.as( - (v, t, t2) => _AuthenticatedRequestedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class AuthenticatedRequestedCopyWith< - $R, - $In extends AuthenticatedRequested, - $Out -> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({Uint8List? challenge, bool? isRequired}); - AuthenticatedRequestedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _AuthenticatedRequestedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, AuthenticatedRequested, $Out> - implements - AuthenticatedRequestedCopyWith<$R, AuthenticatedRequested, $Out> { - _AuthenticatedRequestedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - AuthenticatedRequestedMapper.ensureInitialized(); - @override - $R call({Uint8List? challenge, bool? isRequired}) => $apply( - FieldCopyWithData({ - if (challenge != null) #challenge: challenge, - if (isRequired != null) #isRequired: isRequired, - }), - ); - @override - AuthenticatedRequested $make(CopyWithData data) => AuthenticatedRequested( - data.get(#challenge, or: $value.challenge), - isRequired: data.get(#isRequired, or: $value.isRequired), - ); - - @override - AuthenticatedRequestedCopyWith<$R2, AuthenticatedRequested, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _AuthenticatedRequestedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ToolbarUpdatedMapper extends SubClassMapperBase { - ToolbarUpdatedMapper._(); - - static ToolbarUpdatedMapper? _instance; - static ToolbarUpdatedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ToolbarUpdatedMapper._()); - ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GameToolbarMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ToolbarUpdated'; - - static GameToolbar _$toolbar(ToolbarUpdated v) => v.toolbar; - static const Field _f$toolbar = Field( - 'toolbar', - _$toolbar, - ); - - @override - final MappableFields fields = const {#toolbar: _f$toolbar}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ToolbarUpdated'; - @override - late final ClassMapperBase superMapper = - ServerWorldEventMapper.ensureInitialized(); - - static ToolbarUpdated _instantiate(DecodingData data) { - return ToolbarUpdated(data.dec(_f$toolbar)); - } - - @override - final Function instantiate = _instantiate; - - static ToolbarUpdated fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ToolbarUpdated fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ToolbarUpdatedMappable { - String toJson() { - return ToolbarUpdatedMapper.ensureInitialized().encodeJson( - this as ToolbarUpdated, - ); - } - - Map toMap() { - return ToolbarUpdatedMapper.ensureInitialized().encodeMap( - this as ToolbarUpdated, - ); - } - - ToolbarUpdatedCopyWith - get copyWith => _ToolbarUpdatedCopyWithImpl( - this as ToolbarUpdated, - $identity, - $identity, - ); - @override - String toString() { - return ToolbarUpdatedMapper.ensureInitialized().stringifyValue( - this as ToolbarUpdated, - ); - } - - @override - bool operator ==(Object other) { - return ToolbarUpdatedMapper.ensureInitialized().equalsValue( - this as ToolbarUpdated, - other, - ); - } - - @override - int get hashCode { - return ToolbarUpdatedMapper.ensureInitialized().hashValue( - this as ToolbarUpdated, - ); - } -} - -/// @nodoc -extension ToolbarUpdatedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ToolbarUpdated, $Out> { - ToolbarUpdatedCopyWith<$R, ToolbarUpdated, $Out> get $asToolbarUpdated => - $base.as((v, t, t2) => _ToolbarUpdatedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ToolbarUpdatedCopyWith<$R, $In extends ToolbarUpdated, $Out> - implements ServerWorldEventCopyWith<$R, $In, $Out> { - GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar; - @override - $R call({GameToolbar? toolbar}); - ToolbarUpdatedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ToolbarUpdatedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ToolbarUpdated, $Out> - implements ToolbarUpdatedCopyWith<$R, ToolbarUpdated, $Out> { - _ToolbarUpdatedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ToolbarUpdatedMapper.ensureInitialized(); - @override - GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar => - $value.toolbar.copyWith.$chain((v) => call(toolbar: v)); - @override - $R call({GameToolbar? toolbar}) => - $apply(FieldCopyWithData({if (toolbar != null) #toolbar: toolbar})); - @override - ToolbarUpdated $make(CopyWithData data) => - ToolbarUpdated(data.get(#toolbar, or: $value.toolbar)); - - @override - ToolbarUpdatedCopyWith<$R2, ToolbarUpdated, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ToolbarUpdatedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ClientWorldEventMapper extends SubClassMapperBase { - ClientWorldEventMapper._(); - - static ClientWorldEventMapper? _instance; - static ClientWorldEventMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ClientWorldEventMapper._()); - WorldEventMapper.ensureInitialized().addSubMapper(_instance!); - TeamJoinRequestMapper.ensureInitialized(); - TeamLeaveRequestMapper.ensureInitialized(); - CellRollRequestMapper.ensureInitialized(); - ShuffleCellRequestMapper.ensureInitialized(); - PacksChangeRequestMapper.ensureInitialized(); - MessageRequestMapper.ensureInitialized(); - BoardsSpawnRequestMapper.ensureInitialized(); - BoardRemoveRequestMapper.ensureInitialized(); - BoardMoveRequestMapper.ensureInitialized(); - DialogCloseRequestMapper.ensureInitialized(); - ImagesRequestMapper.ensureInitialized(); - ModeChangeRequestMapper.ensureInitialized(); - AuthenticateRequestMapper.ensureInitialized(); - ToolbarActionRequestMapper.ensureInitialized(); - HybridWorldEventMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ClientWorldEvent'; - - @override - final MappableFields fields = const {}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ClientWorldEvent'; - @override - late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); - - static ClientWorldEvent _instantiate(DecodingData data) { - throw MapperException.missingSubclass( - 'ClientWorldEvent', - 'type', - '${data.value['type']}', - ); - } - - @override - final Function instantiate = _instantiate; - - static ClientWorldEvent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ClientWorldEvent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ClientWorldEventMappable { - String toJson(); - Map toMap(); - ClientWorldEventCopyWith - get copyWith; -} - -/// @nodoc -abstract class ClientWorldEventCopyWith<$R, $In extends ClientWorldEvent, $Out> - implements WorldEventCopyWith<$R, $In, $Out> { - @override - $R call(); - ClientWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class TeamJoinRequestMapper extends SubClassMapperBase { - TeamJoinRequestMapper._(); - - static TeamJoinRequestMapper? _instance; - static TeamJoinRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamJoinRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TeamJoinRequest'; - - static String _$team(TeamJoinRequest v) => v.team; - static const Field _f$team = Field('team', _$team); - - @override - final MappableFields fields = const {#team: _f$team}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TeamJoinRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static TeamJoinRequest _instantiate(DecodingData data) { - return TeamJoinRequest(data.dec(_f$team)); - } - - @override - final Function instantiate = _instantiate; - - static TeamJoinRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TeamJoinRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TeamJoinRequestMappable { - String toJson() { - return TeamJoinRequestMapper.ensureInitialized() - .encodeJson(this as TeamJoinRequest); - } - - Map toMap() { - return TeamJoinRequestMapper.ensureInitialized().encodeMap( - this as TeamJoinRequest, - ); - } - - TeamJoinRequestCopyWith - get copyWith => - _TeamJoinRequestCopyWithImpl( - this as TeamJoinRequest, - $identity, - $identity, - ); - @override - String toString() { - return TeamJoinRequestMapper.ensureInitialized().stringifyValue( - this as TeamJoinRequest, - ); - } - - @override - bool operator ==(Object other) { - return TeamJoinRequestMapper.ensureInitialized().equalsValue( - this as TeamJoinRequest, - other, - ); - } - - @override - int get hashCode { - return TeamJoinRequestMapper.ensureInitialized().hashValue( - this as TeamJoinRequest, - ); - } -} - -/// @nodoc -extension TeamJoinRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, TeamJoinRequest, $Out> { - TeamJoinRequestCopyWith<$R, TeamJoinRequest, $Out> get $asTeamJoinRequest => - $base.as((v, t, t2) => _TeamJoinRequestCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TeamJoinRequestCopyWith<$R, $In extends TeamJoinRequest, $Out> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? team}); - TeamJoinRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _TeamJoinRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TeamJoinRequest, $Out> - implements TeamJoinRequestCopyWith<$R, TeamJoinRequest, $Out> { - _TeamJoinRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TeamJoinRequestMapper.ensureInitialized(); - @override - $R call({String? team}) => - $apply(FieldCopyWithData({if (team != null) #team: team})); - @override - TeamJoinRequest $make(CopyWithData data) => - TeamJoinRequest(data.get(#team, or: $value.team)); - - @override - TeamJoinRequestCopyWith<$R2, TeamJoinRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TeamJoinRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TeamLeaveRequestMapper extends SubClassMapperBase { - TeamLeaveRequestMapper._(); - - static TeamLeaveRequestMapper? _instance; - static TeamLeaveRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamLeaveRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TeamLeaveRequest'; - - static String _$team(TeamLeaveRequest v) => v.team; - static const Field _f$team = Field('team', _$team); - - @override - final MappableFields fields = const {#team: _f$team}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TeamLeaveRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static TeamLeaveRequest _instantiate(DecodingData data) { - return TeamLeaveRequest(data.dec(_f$team)); - } - - @override - final Function instantiate = _instantiate; - - static TeamLeaveRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TeamLeaveRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TeamLeaveRequestMappable { - String toJson() { - return TeamLeaveRequestMapper.ensureInitialized() - .encodeJson(this as TeamLeaveRequest); - } - - Map toMap() { - return TeamLeaveRequestMapper.ensureInitialized() - .encodeMap(this as TeamLeaveRequest); - } - - TeamLeaveRequestCopyWith - get copyWith => - _TeamLeaveRequestCopyWithImpl( - this as TeamLeaveRequest, - $identity, - $identity, - ); - @override - String toString() { - return TeamLeaveRequestMapper.ensureInitialized().stringifyValue( - this as TeamLeaveRequest, - ); - } - - @override - bool operator ==(Object other) { - return TeamLeaveRequestMapper.ensureInitialized().equalsValue( - this as TeamLeaveRequest, - other, - ); - } - - @override - int get hashCode { - return TeamLeaveRequestMapper.ensureInitialized().hashValue( - this as TeamLeaveRequest, - ); - } -} - -/// @nodoc -extension TeamLeaveRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, TeamLeaveRequest, $Out> { - TeamLeaveRequestCopyWith<$R, TeamLeaveRequest, $Out> - get $asTeamLeaveRequest => - $base.as((v, t, t2) => _TeamLeaveRequestCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TeamLeaveRequestCopyWith<$R, $In extends TeamLeaveRequest, $Out> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? team}); - TeamLeaveRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _TeamLeaveRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TeamLeaveRequest, $Out> - implements TeamLeaveRequestCopyWith<$R, TeamLeaveRequest, $Out> { - _TeamLeaveRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TeamLeaveRequestMapper.ensureInitialized(); - @override - $R call({String? team}) => - $apply(FieldCopyWithData({if (team != null) #team: team})); - @override - TeamLeaveRequest $make(CopyWithData data) => - TeamLeaveRequest(data.get(#team, or: $value.team)); - - @override - TeamLeaveRequestCopyWith<$R2, TeamLeaveRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TeamLeaveRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class CellRollRequestMapper extends SubClassMapperBase { - CellRollRequestMapper._(); - - static CellRollRequestMapper? _instance; - static CellRollRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = CellRollRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'CellRollRequest'; - - static GlobalVectorDefinition _$cell(CellRollRequest v) => v.cell; - static const Field _f$cell = Field( - 'cell', - _$cell, - ); - static int? _$object(CellRollRequest v) => v.object; - static const Field _f$object = Field( - 'object', - _$object, - opt: true, - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #object: _f$object, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'CellRollRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static CellRollRequest _instantiate(DecodingData data) { - return CellRollRequest(data.dec(_f$cell), object: data.dec(_f$object)); - } - - @override - final Function instantiate = _instantiate; - - static CellRollRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static CellRollRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin CellRollRequestMappable { - String toJson() { - return CellRollRequestMapper.ensureInitialized() - .encodeJson(this as CellRollRequest); - } - - Map toMap() { - return CellRollRequestMapper.ensureInitialized().encodeMap( - this as CellRollRequest, - ); - } - - CellRollRequestCopyWith - get copyWith => - _CellRollRequestCopyWithImpl( - this as CellRollRequest, - $identity, - $identity, - ); - @override - String toString() { - return CellRollRequestMapper.ensureInitialized().stringifyValue( - this as CellRollRequest, - ); - } - - @override - bool operator ==(Object other) { - return CellRollRequestMapper.ensureInitialized().equalsValue( - this as CellRollRequest, - other, - ); - } - - @override - int get hashCode { - return CellRollRequestMapper.ensureInitialized().hashValue( - this as CellRollRequest, - ); - } -} - -/// @nodoc -extension CellRollRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, CellRollRequest, $Out> { - CellRollRequestCopyWith<$R, CellRollRequest, $Out> get $asCellRollRequest => - $base.as((v, t, t2) => _CellRollRequestCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class CellRollRequestCopyWith<$R, $In extends CellRollRequest, $Out> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - @override - $R call({GlobalVectorDefinition? cell, int? object}); - CellRollRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _CellRollRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, CellRollRequest, $Out> - implements CellRollRequestCopyWith<$R, CellRollRequest, $Out> { - _CellRollRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - CellRollRequestMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - $R call({GlobalVectorDefinition? cell, Object? object = $none}) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (object != $none) #object: object, - }), - ); - @override - CellRollRequest $make(CopyWithData data) => CellRollRequest( - data.get(#cell, or: $value.cell), - object: data.get(#object, or: $value.object), - ); - - @override - CellRollRequestCopyWith<$R2, CellRollRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _CellRollRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ShuffleCellRequestMapper extends SubClassMapperBase { - ShuffleCellRequestMapper._(); - - static ShuffleCellRequestMapper? _instance; - static ShuffleCellRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ShuffleCellRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ShuffleCellRequest'; - - static GlobalVectorDefinition _$cell(ShuffleCellRequest v) => v.cell; - static const Field _f$cell = - Field('cell', _$cell); - - @override - final MappableFields fields = const {#cell: _f$cell}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ShuffleCellRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static ShuffleCellRequest _instantiate(DecodingData data) { - return ShuffleCellRequest(data.dec(_f$cell)); - } - - @override - final Function instantiate = _instantiate; - - static ShuffleCellRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ShuffleCellRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ShuffleCellRequestMappable { - String toJson() { - return ShuffleCellRequestMapper.ensureInitialized() - .encodeJson(this as ShuffleCellRequest); - } - - Map toMap() { - return ShuffleCellRequestMapper.ensureInitialized() - .encodeMap(this as ShuffleCellRequest); - } - - ShuffleCellRequestCopyWith< - ShuffleCellRequest, - ShuffleCellRequest, - ShuffleCellRequest - > - get copyWith => - _ShuffleCellRequestCopyWithImpl( - this as ShuffleCellRequest, - $identity, - $identity, - ); - @override - String toString() { - return ShuffleCellRequestMapper.ensureInitialized().stringifyValue( - this as ShuffleCellRequest, - ); - } - - @override - bool operator ==(Object other) { - return ShuffleCellRequestMapper.ensureInitialized().equalsValue( - this as ShuffleCellRequest, - other, - ); - } - - @override - int get hashCode { - return ShuffleCellRequestMapper.ensureInitialized().hashValue( - this as ShuffleCellRequest, - ); - } -} - -/// @nodoc -extension ShuffleCellRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, ShuffleCellRequest, $Out> { - ShuffleCellRequestCopyWith<$R, ShuffleCellRequest, $Out> - get $asShuffleCellRequest => $base.as( - (v, t, t2) => _ShuffleCellRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class ShuffleCellRequestCopyWith< - $R, - $In extends ShuffleCellRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - @override - $R call({GlobalVectorDefinition? cell}); - ShuffleCellRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ShuffleCellRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ShuffleCellRequest, $Out> - implements ShuffleCellRequestCopyWith<$R, ShuffleCellRequest, $Out> { - _ShuffleCellRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ShuffleCellRequestMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - $R call({GlobalVectorDefinition? cell}) => - $apply(FieldCopyWithData({if (cell != null) #cell: cell})); - @override - ShuffleCellRequest $make(CopyWithData data) => - ShuffleCellRequest(data.get(#cell, or: $value.cell)); - - @override - ShuffleCellRequestCopyWith<$R2, ShuffleCellRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ShuffleCellRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class PacksChangeRequestMapper extends SubClassMapperBase { - PacksChangeRequestMapper._(); - - static PacksChangeRequestMapper? _instance; - static PacksChangeRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = PacksChangeRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'PacksChangeRequest'; - - static List _$packs(PacksChangeRequest v) => v.packs; - static const Field> _f$packs = Field( - 'packs', - _$packs, - ); - - @override - final MappableFields fields = const {#packs: _f$packs}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'PacksChangeRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static PacksChangeRequest _instantiate(DecodingData data) { - return PacksChangeRequest(data.dec(_f$packs)); - } - - @override - final Function instantiate = _instantiate; - - static PacksChangeRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static PacksChangeRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin PacksChangeRequestMappable { - String toJson() { - return PacksChangeRequestMapper.ensureInitialized() - .encodeJson(this as PacksChangeRequest); - } - - Map toMap() { - return PacksChangeRequestMapper.ensureInitialized() - .encodeMap(this as PacksChangeRequest); - } - - PacksChangeRequestCopyWith< - PacksChangeRequest, - PacksChangeRequest, - PacksChangeRequest - > - get copyWith => - _PacksChangeRequestCopyWithImpl( - this as PacksChangeRequest, - $identity, - $identity, - ); - @override - String toString() { - return PacksChangeRequestMapper.ensureInitialized().stringifyValue( - this as PacksChangeRequest, - ); - } - - @override - bool operator ==(Object other) { - return PacksChangeRequestMapper.ensureInitialized().equalsValue( - this as PacksChangeRequest, - other, - ); - } - - @override - int get hashCode { - return PacksChangeRequestMapper.ensureInitialized().hashValue( - this as PacksChangeRequest, - ); - } -} - -/// @nodoc -extension PacksChangeRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, PacksChangeRequest, $Out> { - PacksChangeRequestCopyWith<$R, PacksChangeRequest, $Out> - get $asPacksChangeRequest => $base.as( - (v, t, t2) => _PacksChangeRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class PacksChangeRequestCopyWith< - $R, - $In extends PacksChangeRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs; - @override - $R call({List? packs}); - PacksChangeRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _PacksChangeRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, PacksChangeRequest, $Out> - implements PacksChangeRequestCopyWith<$R, PacksChangeRequest, $Out> { - _PacksChangeRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - PacksChangeRequestMapper.ensureInitialized(); - @override - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs => - ListCopyWith( - $value.packs, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(packs: v), - ); - @override - $R call({List? packs}) => - $apply(FieldCopyWithData({if (packs != null) #packs: packs})); - @override - PacksChangeRequest $make(CopyWithData data) => - PacksChangeRequest(data.get(#packs, or: $value.packs)); - - @override - PacksChangeRequestCopyWith<$R2, PacksChangeRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _PacksChangeRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class MessageRequestMapper extends SubClassMapperBase { - MessageRequestMapper._(); - - static MessageRequestMapper? _instance; - static MessageRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = MessageRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'MessageRequest'; - - static String _$message(MessageRequest v) => v.message; - static const Field _f$message = Field( - 'message', - _$message, - ); - - @override - final MappableFields fields = const {#message: _f$message}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'MessageRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static MessageRequest _instantiate(DecodingData data) { - return MessageRequest(data.dec(_f$message)); - } - - @override - final Function instantiate = _instantiate; - - static MessageRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static MessageRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin MessageRequestMappable { - String toJson() { - return MessageRequestMapper.ensureInitialized().encodeJson( - this as MessageRequest, - ); - } - - Map toMap() { - return MessageRequestMapper.ensureInitialized().encodeMap( - this as MessageRequest, - ); - } - - MessageRequestCopyWith - get copyWith => _MessageRequestCopyWithImpl( - this as MessageRequest, - $identity, - $identity, - ); - @override - String toString() { - return MessageRequestMapper.ensureInitialized().stringifyValue( - this as MessageRequest, - ); - } - - @override - bool operator ==(Object other) { - return MessageRequestMapper.ensureInitialized().equalsValue( - this as MessageRequest, - other, - ); - } - - @override - int get hashCode { - return MessageRequestMapper.ensureInitialized().hashValue( - this as MessageRequest, - ); - } -} - -/// @nodoc -extension MessageRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, MessageRequest, $Out> { - MessageRequestCopyWith<$R, MessageRequest, $Out> get $asMessageRequest => - $base.as((v, t, t2) => _MessageRequestCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class MessageRequestCopyWith<$R, $In extends MessageRequest, $Out> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? message}); - MessageRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _MessageRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, MessageRequest, $Out> - implements MessageRequestCopyWith<$R, MessageRequest, $Out> { - _MessageRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - MessageRequestMapper.ensureInitialized(); - @override - $R call({String? message}) => - $apply(FieldCopyWithData({if (message != null) #message: message})); - @override - MessageRequest $make(CopyWithData data) => - MessageRequest(data.get(#message, or: $value.message)); - - @override - MessageRequestCopyWith<$R2, MessageRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _MessageRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardsSpawnRequestMapper extends SubClassMapperBase { - BoardsSpawnRequestMapper._(); - - static BoardsSpawnRequestMapper? _instance; - static BoardsSpawnRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardsSpawnRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - ItemLocationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardsSpawnRequest'; - - static String _$table(BoardsSpawnRequest v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - ); - static Map> _$assets( - BoardsSpawnRequest v, - ) => v.assets; - static const Field< - BoardsSpawnRequest, - Map> - > - _f$assets = Field('assets', _$assets, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #table: _f$table, - #assets: _f$assets, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'BoardsSpawnRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static BoardsSpawnRequest _instantiate(DecodingData data) { - return BoardsSpawnRequest(data.dec(_f$table), data.dec(_f$assets)); - } - - @override - final Function instantiate = _instantiate; - - static BoardsSpawnRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardsSpawnRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardsSpawnRequestMappable { - String toJson() { - return BoardsSpawnRequestMapper.ensureInitialized() - .encodeJson(this as BoardsSpawnRequest); - } - - Map toMap() { - return BoardsSpawnRequestMapper.ensureInitialized() - .encodeMap(this as BoardsSpawnRequest); - } - - BoardsSpawnRequestCopyWith< - BoardsSpawnRequest, - BoardsSpawnRequest, - BoardsSpawnRequest - > - get copyWith => - _BoardsSpawnRequestCopyWithImpl( - this as BoardsSpawnRequest, - $identity, - $identity, - ); - @override - String toString() { - return BoardsSpawnRequestMapper.ensureInitialized().stringifyValue( - this as BoardsSpawnRequest, - ); - } - - @override - bool operator ==(Object other) { - return BoardsSpawnRequestMapper.ensureInitialized().equalsValue( - this as BoardsSpawnRequest, - other, - ); - } - - @override - int get hashCode { - return BoardsSpawnRequestMapper.ensureInitialized().hashValue( - this as BoardsSpawnRequest, - ); - } -} - -/// @nodoc -extension BoardsSpawnRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardsSpawnRequest, $Out> { - BoardsSpawnRequestCopyWith<$R, BoardsSpawnRequest, $Out> - get $asBoardsSpawnRequest => $base.as( - (v, t, t2) => _BoardsSpawnRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BoardsSpawnRequestCopyWith< - $R, - $In extends BoardsSpawnRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get assets; - @override - $R call({String? table, Map>? assets}); - BoardsSpawnRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardsSpawnRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardsSpawnRequest, $Out> - implements BoardsSpawnRequestCopyWith<$R, BoardsSpawnRequest, $Out> { - _BoardsSpawnRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardsSpawnRequestMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get assets => MapCopyWith( - $value.assets, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(assets: v), - ); - @override - $R call({String? table, Map>? assets}) => - $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (assets != null) #assets: assets, - }), - ); - @override - BoardsSpawnRequest $make(CopyWithData data) => BoardsSpawnRequest( - data.get(#table, or: $value.table), - data.get(#assets, or: $value.assets), - ); - - @override - BoardsSpawnRequestCopyWith<$R2, BoardsSpawnRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardsSpawnRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardRemoveRequestMapper extends SubClassMapperBase { - BoardRemoveRequestMapper._(); - - static BoardRemoveRequestMapper? _instance; - static BoardRemoveRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardRemoveRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardRemoveRequest'; - - static GlobalVectorDefinition _$position(BoardRemoveRequest v) => v.position; - static const Field _f$position = - Field('position', _$position); - static int _$index(BoardRemoveRequest v) => v.index; - static const Field _f$index = Field( - 'index', - _$index, - ); - - @override - final MappableFields fields = const { - #position: _f$position, - #index: _f$index, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'BoardRemoveRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static BoardRemoveRequest _instantiate(DecodingData data) { - return BoardRemoveRequest(data.dec(_f$position), data.dec(_f$index)); - } - - @override - final Function instantiate = _instantiate; - - static BoardRemoveRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardRemoveRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardRemoveRequestMappable { - String toJson() { - return BoardRemoveRequestMapper.ensureInitialized() - .encodeJson(this as BoardRemoveRequest); - } - - Map toMap() { - return BoardRemoveRequestMapper.ensureInitialized() - .encodeMap(this as BoardRemoveRequest); - } - - BoardRemoveRequestCopyWith< - BoardRemoveRequest, - BoardRemoveRequest, - BoardRemoveRequest - > - get copyWith => - _BoardRemoveRequestCopyWithImpl( - this as BoardRemoveRequest, - $identity, - $identity, - ); - @override - String toString() { - return BoardRemoveRequestMapper.ensureInitialized().stringifyValue( - this as BoardRemoveRequest, - ); - } - - @override - bool operator ==(Object other) { - return BoardRemoveRequestMapper.ensureInitialized().equalsValue( - this as BoardRemoveRequest, - other, - ); - } - - @override - int get hashCode { - return BoardRemoveRequestMapper.ensureInitialized().hashValue( - this as BoardRemoveRequest, - ); - } -} - -/// @nodoc -extension BoardRemoveRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardRemoveRequest, $Out> { - BoardRemoveRequestCopyWith<$R, BoardRemoveRequest, $Out> - get $asBoardRemoveRequest => $base.as( - (v, t, t2) => _BoardRemoveRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BoardRemoveRequestCopyWith< - $R, - $In extends BoardRemoveRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get position; - @override - $R call({GlobalVectorDefinition? position, int? index}); - BoardRemoveRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardRemoveRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardRemoveRequest, $Out> - implements BoardRemoveRequestCopyWith<$R, BoardRemoveRequest, $Out> { - _BoardRemoveRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardRemoveRequestMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get position => $value.position.copyWith.$chain((v) => call(position: v)); - @override - $R call({GlobalVectorDefinition? position, int? index}) => $apply( - FieldCopyWithData({ - if (position != null) #position: position, - if (index != null) #index: index, - }), - ); - @override - BoardRemoveRequest $make(CopyWithData data) => BoardRemoveRequest( - data.get(#position, or: $value.position), - data.get(#index, or: $value.index), - ); - - @override - BoardRemoveRequestCopyWith<$R2, BoardRemoveRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardRemoveRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardMoveRequestMapper extends SubClassMapperBase { - BoardMoveRequestMapper._(); - - static BoardMoveRequestMapper? _instance; - static BoardMoveRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardMoveRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardMoveRequest'; - - static String _$table(BoardMoveRequest v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - ); - static VectorDefinition _$from(BoardMoveRequest v) => v.from; - static const Field _f$from = Field( - 'from', - _$from, - ); - static VectorDefinition _$to(BoardMoveRequest v) => v.to; - static const Field _f$to = Field( - 'to', - _$to, - ); - static int _$index(BoardMoveRequest v) => v.index; - static const Field _f$index = Field('index', _$index); - - @override - final MappableFields fields = const { - #table: _f$table, - #from: _f$from, - #to: _f$to, - #index: _f$index, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'BoardMoveRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static BoardMoveRequest _instantiate(DecodingData data) { - return BoardMoveRequest( - data.dec(_f$table), - data.dec(_f$from), - data.dec(_f$to), - data.dec(_f$index), - ); - } - - @override - final Function instantiate = _instantiate; - - static BoardMoveRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardMoveRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardMoveRequestMappable { - String toJson() { - return BoardMoveRequestMapper.ensureInitialized() - .encodeJson(this as BoardMoveRequest); - } - - Map toMap() { - return BoardMoveRequestMapper.ensureInitialized() - .encodeMap(this as BoardMoveRequest); - } - - BoardMoveRequestCopyWith - get copyWith => - _BoardMoveRequestCopyWithImpl( - this as BoardMoveRequest, - $identity, - $identity, - ); - @override - String toString() { - return BoardMoveRequestMapper.ensureInitialized().stringifyValue( - this as BoardMoveRequest, - ); - } - - @override - bool operator ==(Object other) { - return BoardMoveRequestMapper.ensureInitialized().equalsValue( - this as BoardMoveRequest, - other, - ); - } - - @override - int get hashCode { - return BoardMoveRequestMapper.ensureInitialized().hashValue( - this as BoardMoveRequest, - ); - } -} - -/// @nodoc -extension BoardMoveRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardMoveRequest, $Out> { - BoardMoveRequestCopyWith<$R, BoardMoveRequest, $Out> - get $asBoardMoveRequest => - $base.as((v, t, t2) => _BoardMoveRequestCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class BoardMoveRequestCopyWith<$R, $In extends BoardMoveRequest, $Out> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from; - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to; - @override - $R call({ - String? table, - VectorDefinition? from, - VectorDefinition? to, - int? index, - }); - BoardMoveRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardMoveRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardMoveRequest, $Out> - implements BoardMoveRequestCopyWith<$R, BoardMoveRequest, $Out> { - _BoardMoveRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardMoveRequestMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from => - $value.from.copyWith.$chain((v) => call(from: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to => - $value.to.copyWith.$chain((v) => call(to: v)); - @override - $R call({ - String? table, - VectorDefinition? from, - VectorDefinition? to, - int? index, - }) => $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (from != null) #from: from, - if (to != null) #to: to, - if (index != null) #index: index, - }), - ); - @override - BoardMoveRequest $make(CopyWithData data) => BoardMoveRequest( - data.get(#table, or: $value.table), - data.get(#from, or: $value.from), - data.get(#to, or: $value.to), - data.get(#index, or: $value.index), - ); - - @override - BoardMoveRequestCopyWith<$R2, BoardMoveRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardMoveRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DialogCloseRequestMapper extends SubClassMapperBase { - DialogCloseRequestMapper._(); - - static DialogCloseRequestMapper? _instance; - static DialogCloseRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DialogCloseRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GameDialogValueMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'DialogCloseRequest'; - - static String _$id(DialogCloseRequest v) => v.id; - static const Field _f$id = Field('id', _$id); - static GameDialogValue? _$value(DialogCloseRequest v) => v.value; - static const Field _f$value = Field( - 'value', - _$value, - ); - - @override - final MappableFields fields = const { - #id: _f$id, - #value: _f$value, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'DialogCloseRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static DialogCloseRequest _instantiate(DecodingData data) { - return DialogCloseRequest(data.dec(_f$id), data.dec(_f$value)); - } - - @override - final Function instantiate = _instantiate; - - static DialogCloseRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DialogCloseRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DialogCloseRequestMappable { - String toJson() { - return DialogCloseRequestMapper.ensureInitialized() - .encodeJson(this as DialogCloseRequest); - } - - Map toMap() { - return DialogCloseRequestMapper.ensureInitialized() - .encodeMap(this as DialogCloseRequest); - } - - DialogCloseRequestCopyWith< - DialogCloseRequest, - DialogCloseRequest, - DialogCloseRequest - > - get copyWith => - _DialogCloseRequestCopyWithImpl( - this as DialogCloseRequest, - $identity, - $identity, - ); - @override - String toString() { - return DialogCloseRequestMapper.ensureInitialized().stringifyValue( - this as DialogCloseRequest, - ); - } - - @override - bool operator ==(Object other) { - return DialogCloseRequestMapper.ensureInitialized().equalsValue( - this as DialogCloseRequest, - other, - ); - } - - @override - int get hashCode { - return DialogCloseRequestMapper.ensureInitialized().hashValue( - this as DialogCloseRequest, - ); - } -} - -/// @nodoc -extension DialogCloseRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, DialogCloseRequest, $Out> { - DialogCloseRequestCopyWith<$R, DialogCloseRequest, $Out> - get $asDialogCloseRequest => $base.as( - (v, t, t2) => _DialogCloseRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class DialogCloseRequestCopyWith< - $R, - $In extends DialogCloseRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - GameDialogValueCopyWith<$R, GameDialogValue, GameDialogValue>? get value; - @override - $R call({String? id, GameDialogValue? value}); - DialogCloseRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _DialogCloseRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DialogCloseRequest, $Out> - implements DialogCloseRequestCopyWith<$R, DialogCloseRequest, $Out> { - _DialogCloseRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - DialogCloseRequestMapper.ensureInitialized(); - @override - GameDialogValueCopyWith<$R, GameDialogValue, GameDialogValue>? get value => - $value.value?.copyWith.$chain((v) => call(value: v)); - @override - $R call({String? id, Object? value = $none}) => $apply( - FieldCopyWithData({ - if (id != null) #id: id, - if (value != $none) #value: value, - }), - ); - @override - DialogCloseRequest $make(CopyWithData data) => DialogCloseRequest( - data.get(#id, or: $value.id), - data.get(#value, or: $value.value), - ); - - @override - DialogCloseRequestCopyWith<$R2, DialogCloseRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _DialogCloseRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ImagesRequestMapper extends SubClassMapperBase { - ImagesRequestMapper._(); - - static ImagesRequestMapper? _instance; - static ImagesRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ImagesRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'ImagesRequest'; - - static List _$ids(ImagesRequest v) => v.ids; - static const Field> _f$ids = Field('ids', _$ids); - - @override - final MappableFields fields = const {#ids: _f$ids}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ImagesRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static ImagesRequest _instantiate(DecodingData data) { - return ImagesRequest(data.dec(_f$ids)); - } - - @override - final Function instantiate = _instantiate; - - static ImagesRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ImagesRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ImagesRequestMappable { - String toJson() { - return ImagesRequestMapper.ensureInitialized().encodeJson( - this as ImagesRequest, - ); - } - - Map toMap() { - return ImagesRequestMapper.ensureInitialized().encodeMap( - this as ImagesRequest, - ); - } - - ImagesRequestCopyWith - get copyWith => _ImagesRequestCopyWithImpl( - this as ImagesRequest, - $identity, - $identity, - ); - @override - String toString() { - return ImagesRequestMapper.ensureInitialized().stringifyValue( - this as ImagesRequest, - ); - } - - @override - bool operator ==(Object other) { - return ImagesRequestMapper.ensureInitialized().equalsValue( - this as ImagesRequest, - other, - ); - } - - @override - int get hashCode { - return ImagesRequestMapper.ensureInitialized().hashValue( - this as ImagesRequest, - ); - } -} - -/// @nodoc -extension ImagesRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, ImagesRequest, $Out> { - ImagesRequestCopyWith<$R, ImagesRequest, $Out> get $asImagesRequest => - $base.as((v, t, t2) => _ImagesRequestCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ImagesRequestCopyWith<$R, $In extends ImagesRequest, $Out> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get ids; - @override - $R call({List? ids}); - ImagesRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _ImagesRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ImagesRequest, $Out> - implements ImagesRequestCopyWith<$R, ImagesRequest, $Out> { - _ImagesRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ImagesRequestMapper.ensureInitialized(); - @override - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get ids => - ListCopyWith( - $value.ids, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(ids: v), - ); - @override - $R call({List? ids}) => - $apply(FieldCopyWithData({if (ids != null) #ids: ids})); - @override - ImagesRequest $make(CopyWithData data) => - ImagesRequest(data.get(#ids, or: $value.ids)); - - @override - ImagesRequestCopyWith<$R2, ImagesRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ImagesRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ModeChangeRequestMapper extends SubClassMapperBase { - ModeChangeRequestMapper._(); - - static ModeChangeRequestMapper? _instance; - static ModeChangeRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ModeChangeRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - ItemLocationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ModeChangeRequest'; - - static ItemLocation? _$location(ModeChangeRequest v) => v.location; - static const Field _f$location = Field( - 'location', - _$location, - ); - - @override - final MappableFields fields = const { - #location: _f$location, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ModeChangeRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static ModeChangeRequest _instantiate(DecodingData data) { - return ModeChangeRequest(data.dec(_f$location)); - } - - @override - final Function instantiate = _instantiate; - - static ModeChangeRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ModeChangeRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ModeChangeRequestMappable { - String toJson() { - return ModeChangeRequestMapper.ensureInitialized() - .encodeJson(this as ModeChangeRequest); - } - - Map toMap() { - return ModeChangeRequestMapper.ensureInitialized() - .encodeMap(this as ModeChangeRequest); - } - - ModeChangeRequestCopyWith< - ModeChangeRequest, - ModeChangeRequest, - ModeChangeRequest - > - get copyWith => - _ModeChangeRequestCopyWithImpl( - this as ModeChangeRequest, - $identity, - $identity, - ); - @override - String toString() { - return ModeChangeRequestMapper.ensureInitialized().stringifyValue( - this as ModeChangeRequest, - ); - } - - @override - bool operator ==(Object other) { - return ModeChangeRequestMapper.ensureInitialized().equalsValue( - this as ModeChangeRequest, - other, - ); - } - - @override - int get hashCode { - return ModeChangeRequestMapper.ensureInitialized().hashValue( - this as ModeChangeRequest, - ); - } -} - -/// @nodoc -extension ModeChangeRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, ModeChangeRequest, $Out> { - ModeChangeRequestCopyWith<$R, ModeChangeRequest, $Out> - get $asModeChangeRequest => $base.as( - (v, t, t2) => _ModeChangeRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class ModeChangeRequestCopyWith< - $R, - $In extends ModeChangeRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get location; - @override - $R call({ItemLocation? location}); - ModeChangeRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ModeChangeRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ModeChangeRequest, $Out> - implements ModeChangeRequestCopyWith<$R, ModeChangeRequest, $Out> { - _ModeChangeRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ModeChangeRequestMapper.ensureInitialized(); - @override - ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get location => - $value.location?.copyWith.$chain((v) => call(location: v)); - @override - $R call({Object? location = $none}) => - $apply(FieldCopyWithData({if (location != $none) #location: location})); - @override - ModeChangeRequest $make(CopyWithData data) => - ModeChangeRequest(data.get(#location, or: $value.location)); - - @override - ModeChangeRequestCopyWith<$R2, ModeChangeRequest, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ModeChangeRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class AuthenticateRequestMapper - extends SubClassMapperBase { - AuthenticateRequestMapper._(); - - static AuthenticateRequestMapper? _instance; - static AuthenticateRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = AuthenticateRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - MapperContainer.globals.useAll([Base64Uint8ListHook()]); - } - return _instance!; - } - - @override - final String id = 'AuthenticateRequest'; - - static Uint8List _$signature(AuthenticateRequest v) => v.signature; - static const Field _f$signature = Field( - 'signature', - _$signature, - ); - static Uint8List _$publicKey(AuthenticateRequest v) => v.publicKey; - static const Field _f$publicKey = Field( - 'publicKey', - _$publicKey, - ); - - @override - final MappableFields fields = const { - #signature: _f$signature, - #publicKey: _f$publicKey, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'AuthenticateRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static AuthenticateRequest _instantiate(DecodingData data) { - return AuthenticateRequest(data.dec(_f$signature), data.dec(_f$publicKey)); - } - - @override - final Function instantiate = _instantiate; - - static AuthenticateRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static AuthenticateRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin AuthenticateRequestMappable { - String toJson() { - return AuthenticateRequestMapper.ensureInitialized() - .encodeJson(this as AuthenticateRequest); - } - - Map toMap() { - return AuthenticateRequestMapper.ensureInitialized() - .encodeMap(this as AuthenticateRequest); - } - - AuthenticateRequestCopyWith< - AuthenticateRequest, - AuthenticateRequest, - AuthenticateRequest - > - get copyWith => - _AuthenticateRequestCopyWithImpl< - AuthenticateRequest, - AuthenticateRequest - >(this as AuthenticateRequest, $identity, $identity); - @override - String toString() { - return AuthenticateRequestMapper.ensureInitialized().stringifyValue( - this as AuthenticateRequest, - ); - } - - @override - bool operator ==(Object other) { - return AuthenticateRequestMapper.ensureInitialized().equalsValue( - this as AuthenticateRequest, - other, - ); - } - - @override - int get hashCode { - return AuthenticateRequestMapper.ensureInitialized().hashValue( - this as AuthenticateRequest, - ); - } -} - -/// @nodoc -extension AuthenticateRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, AuthenticateRequest, $Out> { - AuthenticateRequestCopyWith<$R, AuthenticateRequest, $Out> - get $asAuthenticateRequest => $base.as( - (v, t, t2) => _AuthenticateRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class AuthenticateRequestCopyWith< - $R, - $In extends AuthenticateRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({Uint8List? signature, Uint8List? publicKey}); - AuthenticateRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _AuthenticateRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, AuthenticateRequest, $Out> - implements AuthenticateRequestCopyWith<$R, AuthenticateRequest, $Out> { - _AuthenticateRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - AuthenticateRequestMapper.ensureInitialized(); - @override - $R call({Uint8List? signature, Uint8List? publicKey}) => $apply( - FieldCopyWithData({ - if (signature != null) #signature: signature, - if (publicKey != null) #publicKey: publicKey, - }), - ); - @override - AuthenticateRequest $make(CopyWithData data) => AuthenticateRequest( - data.get(#signature, or: $value.signature), - data.get(#publicKey, or: $value.publicKey), - ); - - @override - AuthenticateRequestCopyWith<$R2, AuthenticateRequest, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _AuthenticateRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ToolbarActionRequestMapper - extends SubClassMapperBase { - ToolbarActionRequestMapper._(); - - static ToolbarActionRequestMapper? _instance; - static ToolbarActionRequestMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ToolbarActionRequestMapper._()); - ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'ToolbarActionRequest'; - - static String _$actionId(ToolbarActionRequest v) => v.actionId; - static const Field _f$actionId = Field( - 'actionId', - _$actionId, - ); - - @override - final MappableFields fields = const { - #actionId: _f$actionId, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ToolbarActionRequest'; - @override - late final ClassMapperBase superMapper = - ClientWorldEventMapper.ensureInitialized(); - - static ToolbarActionRequest _instantiate(DecodingData data) { - return ToolbarActionRequest(data.dec(_f$actionId)); - } - - @override - final Function instantiate = _instantiate; - - static ToolbarActionRequest fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ToolbarActionRequest fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ToolbarActionRequestMappable { - String toJson() { - return ToolbarActionRequestMapper.ensureInitialized() - .encodeJson(this as ToolbarActionRequest); - } - - Map toMap() { - return ToolbarActionRequestMapper.ensureInitialized() - .encodeMap(this as ToolbarActionRequest); - } - - ToolbarActionRequestCopyWith< - ToolbarActionRequest, - ToolbarActionRequest, - ToolbarActionRequest - > - get copyWith => - _ToolbarActionRequestCopyWithImpl< - ToolbarActionRequest, - ToolbarActionRequest - >(this as ToolbarActionRequest, $identity, $identity); - @override - String toString() { - return ToolbarActionRequestMapper.ensureInitialized().stringifyValue( - this as ToolbarActionRequest, - ); - } - - @override - bool operator ==(Object other) { - return ToolbarActionRequestMapper.ensureInitialized().equalsValue( - this as ToolbarActionRequest, - other, - ); - } - - @override - int get hashCode { - return ToolbarActionRequestMapper.ensureInitialized().hashValue( - this as ToolbarActionRequest, - ); - } -} - -/// @nodoc -extension ToolbarActionRequestValueCopy<$R, $Out> - on ObjectCopyWith<$R, ToolbarActionRequest, $Out> { - ToolbarActionRequestCopyWith<$R, ToolbarActionRequest, $Out> - get $asToolbarActionRequest => $base.as( - (v, t, t2) => _ToolbarActionRequestCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class ToolbarActionRequestCopyWith< - $R, - $In extends ToolbarActionRequest, - $Out -> - implements ClientWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? actionId}); - ToolbarActionRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ToolbarActionRequestCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ToolbarActionRequest, $Out> - implements ToolbarActionRequestCopyWith<$R, ToolbarActionRequest, $Out> { - _ToolbarActionRequestCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ToolbarActionRequestMapper.ensureInitialized(); - @override - $R call({String? actionId}) => - $apply(FieldCopyWithData({if (actionId != null) #actionId: actionId})); - @override - ToolbarActionRequest $make(CopyWithData data) => - ToolbarActionRequest(data.get(#actionId, or: $value.actionId)); - - @override - ToolbarActionRequestCopyWith<$R2, ToolbarActionRequest, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _ToolbarActionRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class HybridWorldEventMapper extends SubClassMapperBase { - HybridWorldEventMapper._(); - - static HybridWorldEventMapper? _instance; - static HybridWorldEventMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = HybridWorldEventMapper._()); - WorldEventMapper.ensureInitialized().addSubMapper(_instance!); - CellSwitchedMapper.ensureInitialized(); - BackgroundChangedMapper.ensureInitialized(); - ObjectsSpawnedMapper.ensureInitialized(); - ObjectsMovedMapper.ensureInitialized(); - CellHideChangedMapper.ensureInitialized(); - ObjectIndexChangedMapper.ensureInitialized(); - TeamChangedMapper.ensureInitialized(); - TeamRemovedMapper.ensureInitialized(); - CellMergeStrategyChangedMapper.ensureInitialized(); - MetadataChangedMapper.ensureInitialized(); - ObjectsRemovedMapper.ensureInitialized(); - TableRenamedMapper.ensureInitialized(); - TableRemovedMapper.ensureInitialized(); - NoteChangedMapper.ensureInitialized(); - NoteRemovedMapper.ensureInitialized(); - WaypointChangedMapper.ensureInitialized(); - WaypointRemovedMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'HybridWorldEvent'; - - @override - final MappableFields fields = const {}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'HybridWorldEvent'; - @override - late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); - - static HybridWorldEvent _instantiate(DecodingData data) { - throw MapperException.missingSubclass( - 'HybridWorldEvent', - 'type', - '${data.value['type']}', - ); - } - - @override - final Function instantiate = _instantiate; - - static HybridWorldEvent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static HybridWorldEvent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin HybridWorldEventMappable { - String toJson(); - Map toMap(); - HybridWorldEventCopyWith - get copyWith; -} - -/// @nodoc -abstract class HybridWorldEventCopyWith<$R, $In extends HybridWorldEvent, $Out> - implements - WorldEventCopyWith<$R, $In, $Out>, - ClientWorldEventCopyWith<$R, $In, $Out>, - ServerWorldEventCopyWith<$R, $In, $Out> { - @override - $R call(); - HybridWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class CellSwitchedMapper extends SubClassMapperBase { - CellSwitchedMapper._(); - - static CellSwitchedMapper? _instance; - static CellSwitchedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = CellSwitchedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'CellSwitched'; - - static VectorDefinition? _$cell(CellSwitched v) => v.cell; - static const Field _f$cell = Field( - 'cell', - _$cell, - ); - static bool _$selected(CellSwitched v) => v.selected; - static const Field _f$selected = Field( - 'selected', - _$selected, - opt: true, - def: true, - ); - static bool _$teleport(CellSwitched v) => v.teleport; - static const Field _f$teleport = Field( - 'teleport', - _$teleport, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #selected: _f$selected, - #teleport: _f$teleport, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'CellSwitched'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static CellSwitched _instantiate(DecodingData data) { - return CellSwitched( - data.dec(_f$cell), - selected: data.dec(_f$selected), - teleport: data.dec(_f$teleport), - ); - } - - @override - final Function instantiate = _instantiate; - - static CellSwitched fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static CellSwitched fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin CellSwitchedMappable { - String toJson() { - return CellSwitchedMapper.ensureInitialized().encodeJson( - this as CellSwitched, - ); - } - - Map toMap() { - return CellSwitchedMapper.ensureInitialized().encodeMap( - this as CellSwitched, - ); - } - - CellSwitchedCopyWith get copyWith => - _CellSwitchedCopyWithImpl( - this as CellSwitched, - $identity, - $identity, - ); - @override - String toString() { - return CellSwitchedMapper.ensureInitialized().stringifyValue( - this as CellSwitched, - ); - } - - @override - bool operator ==(Object other) { - return CellSwitchedMapper.ensureInitialized().equalsValue( - this as CellSwitched, - other, - ); - } - - @override - int get hashCode { - return CellSwitchedMapper.ensureInitialized().hashValue( - this as CellSwitched, - ); - } -} - -/// @nodoc -extension CellSwitchedValueCopy<$R, $Out> - on ObjectCopyWith<$R, CellSwitched, $Out> { - CellSwitchedCopyWith<$R, CellSwitched, $Out> get $asCellSwitched => - $base.as((v, t, t2) => _CellSwitchedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class CellSwitchedCopyWith<$R, $In extends CellSwitched, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get cell; - @override - $R call({VectorDefinition? cell, bool? selected, bool? teleport}); - CellSwitchedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _CellSwitchedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, CellSwitched, $Out> - implements CellSwitchedCopyWith<$R, CellSwitched, $Out> { - _CellSwitchedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - CellSwitchedMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get cell => - $value.cell?.copyWith.$chain((v) => call(cell: v)); - @override - $R call({Object? cell = $none, bool? selected, bool? teleport}) => $apply( - FieldCopyWithData({ - if (cell != $none) #cell: cell, - if (selected != null) #selected: selected, - if (teleport != null) #teleport: teleport, - }), - ); - @override - CellSwitched $make(CopyWithData data) => CellSwitched( - data.get(#cell, or: $value.cell), - selected: data.get(#selected, or: $value.selected), - teleport: data.get(#teleport, or: $value.teleport), - ); - - @override - CellSwitchedCopyWith<$R2, CellSwitched, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _CellSwitchedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BackgroundChangedMapper extends SubClassMapperBase { - BackgroundChangedMapper._(); - - static BackgroundChangedMapper? _instance; - static BackgroundChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BackgroundChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - ItemLocationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BackgroundChanged'; - - static ItemLocation _$background(BackgroundChanged v) => v.background; - static const Field _f$background = Field( - 'background', - _$background, - ); - - @override - final MappableFields fields = const { - #background: _f$background, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'BackgroundChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static BackgroundChanged _instantiate(DecodingData data) { - return BackgroundChanged(data.dec(_f$background)); - } - - @override - final Function instantiate = _instantiate; - - static BackgroundChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BackgroundChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BackgroundChangedMappable { - String toJson() { - return BackgroundChangedMapper.ensureInitialized() - .encodeJson(this as BackgroundChanged); - } - - Map toMap() { - return BackgroundChangedMapper.ensureInitialized() - .encodeMap(this as BackgroundChanged); - } - - BackgroundChangedCopyWith< - BackgroundChanged, - BackgroundChanged, - BackgroundChanged - > - get copyWith => - _BackgroundChangedCopyWithImpl( - this as BackgroundChanged, - $identity, - $identity, - ); - @override - String toString() { - return BackgroundChangedMapper.ensureInitialized().stringifyValue( - this as BackgroundChanged, - ); - } - - @override - bool operator ==(Object other) { - return BackgroundChangedMapper.ensureInitialized().equalsValue( - this as BackgroundChanged, - other, - ); - } - - @override - int get hashCode { - return BackgroundChangedMapper.ensureInitialized().hashValue( - this as BackgroundChanged, - ); - } -} - -/// @nodoc -extension BackgroundChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, BackgroundChanged, $Out> { - BackgroundChangedCopyWith<$R, BackgroundChanged, $Out> - get $asBackgroundChanged => $base.as( - (v, t, t2) => _BackgroundChangedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BackgroundChangedCopyWith< - $R, - $In extends BackgroundChanged, - $Out -> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get background; - @override - $R call({ItemLocation? background}); - BackgroundChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BackgroundChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BackgroundChanged, $Out> - implements BackgroundChangedCopyWith<$R, BackgroundChanged, $Out> { - _BackgroundChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BackgroundChangedMapper.ensureInitialized(); - @override - ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get background => - $value.background.copyWith.$chain((v) => call(background: v)); - @override - $R call({ItemLocation? background}) => $apply( - FieldCopyWithData({if (background != null) #background: background}), - ); - @override - BackgroundChanged $make(CopyWithData data) => - BackgroundChanged(data.get(#background, or: $value.background)); - - @override - BackgroundChangedCopyWith<$R2, BackgroundChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BackgroundChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ObjectsSpawnedMapper extends SubClassMapperBase { - ObjectsSpawnedMapper._(); - - static ObjectsSpawnedMapper? _instance; - static ObjectsSpawnedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ObjectsSpawnedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - GameObjectMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ObjectsSpawned'; - - static String _$table(ObjectsSpawned v) => v.table; - static const Field _f$table = Field('table', _$table); - static Map> _$objects(ObjectsSpawned v) => - v.objects; - static const Field>> - _f$objects = Field('objects', _$objects, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #table: _f$table, - #objects: _f$objects, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ObjectsSpawned'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static ObjectsSpawned _instantiate(DecodingData data) { - return ObjectsSpawned(data.dec(_f$table), data.dec(_f$objects)); - } - - @override - final Function instantiate = _instantiate; - - static ObjectsSpawned fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ObjectsSpawned fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ObjectsSpawnedMappable { - String toJson() { - return ObjectsSpawnedMapper.ensureInitialized().encodeJson( - this as ObjectsSpawned, - ); - } - - Map toMap() { - return ObjectsSpawnedMapper.ensureInitialized().encodeMap( - this as ObjectsSpawned, - ); - } - - ObjectsSpawnedCopyWith - get copyWith => _ObjectsSpawnedCopyWithImpl( - this as ObjectsSpawned, - $identity, - $identity, - ); - @override - String toString() { - return ObjectsSpawnedMapper.ensureInitialized().stringifyValue( - this as ObjectsSpawned, - ); - } - - @override - bool operator ==(Object other) { - return ObjectsSpawnedMapper.ensureInitialized().equalsValue( - this as ObjectsSpawned, - other, - ); - } - - @override - int get hashCode { - return ObjectsSpawnedMapper.ensureInitialized().hashValue( - this as ObjectsSpawned, - ); - } -} - -/// @nodoc -extension ObjectsSpawnedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ObjectsSpawned, $Out> { - ObjectsSpawnedCopyWith<$R, ObjectsSpawned, $Out> get $asObjectsSpawned => - $base.as((v, t, t2) => _ObjectsSpawnedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ObjectsSpawnedCopyWith<$R, $In extends ObjectsSpawned, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get objects; - @override - $R call({String? table, Map>? objects}); - ObjectsSpawnedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ObjectsSpawnedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ObjectsSpawned, $Out> - implements ObjectsSpawnedCopyWith<$R, ObjectsSpawned, $Out> { - _ObjectsSpawnedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ObjectsSpawnedMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - VectorDefinition, - List, - ObjectCopyWith<$R, List, List> - > - get objects => MapCopyWith( - $value.objects, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(objects: v), - ); - @override - $R call({String? table, Map>? objects}) => - $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (objects != null) #objects: objects, - }), - ); - @override - ObjectsSpawned $make(CopyWithData data) => ObjectsSpawned( - data.get(#table, or: $value.table), - data.get(#objects, or: $value.objects), - ); - - @override - ObjectsSpawnedCopyWith<$R2, ObjectsSpawned, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ObjectsSpawnedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ObjectsMovedMapper extends SubClassMapperBase { - ObjectsMovedMapper._(); - - static ObjectsMovedMapper? _instance; - static ObjectsMovedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ObjectsMovedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ObjectsMoved'; - - static String _$table(ObjectsMoved v) => v.table; - static const Field _f$table = Field('table', _$table); - static List _$objects(ObjectsMoved v) => v.objects; - static const Field> _f$objects = Field( - 'objects', - _$objects, - ); - static VectorDefinition _$from(ObjectsMoved v) => v.from; - static const Field _f$from = Field( - 'from', - _$from, - ); - static VectorDefinition _$to(ObjectsMoved v) => v.to; - static const Field _f$to = Field('to', _$to); - - @override - final MappableFields fields = const { - #table: _f$table, - #objects: _f$objects, - #from: _f$from, - #to: _f$to, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ObjectsMoved'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static ObjectsMoved _instantiate(DecodingData data) { - return ObjectsMoved( - data.dec(_f$table), - data.dec(_f$objects), - data.dec(_f$from), - data.dec(_f$to), - ); - } - - @override - final Function instantiate = _instantiate; - - static ObjectsMoved fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ObjectsMoved fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ObjectsMovedMappable { - String toJson() { - return ObjectsMovedMapper.ensureInitialized().encodeJson( - this as ObjectsMoved, - ); - } - - Map toMap() { - return ObjectsMovedMapper.ensureInitialized().encodeMap( - this as ObjectsMoved, - ); - } - - ObjectsMovedCopyWith get copyWith => - _ObjectsMovedCopyWithImpl( - this as ObjectsMoved, - $identity, - $identity, - ); - @override - String toString() { - return ObjectsMovedMapper.ensureInitialized().stringifyValue( - this as ObjectsMoved, - ); - } - - @override - bool operator ==(Object other) { - return ObjectsMovedMapper.ensureInitialized().equalsValue( - this as ObjectsMoved, - other, - ); - } - - @override - int get hashCode { - return ObjectsMovedMapper.ensureInitialized().hashValue( - this as ObjectsMoved, - ); - } -} - -/// @nodoc -extension ObjectsMovedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ObjectsMoved, $Out> { - ObjectsMovedCopyWith<$R, ObjectsMoved, $Out> get $asObjectsMoved => - $base.as((v, t, t2) => _ObjectsMovedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ObjectsMovedCopyWith<$R, $In extends ObjectsMoved, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get objects; - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from; - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to; - @override - $R call({ - String? table, - List? objects, - VectorDefinition? from, - VectorDefinition? to, - }); - ObjectsMovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _ObjectsMovedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ObjectsMoved, $Out> - implements ObjectsMovedCopyWith<$R, ObjectsMoved, $Out> { - _ObjectsMovedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ObjectsMovedMapper.ensureInitialized(); - @override - ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get objects => - ListCopyWith( - $value.objects, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(objects: v), - ); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from => - $value.from.copyWith.$chain((v) => call(from: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to => - $value.to.copyWith.$chain((v) => call(to: v)); - @override - $R call({ - String? table, - List? objects, - VectorDefinition? from, - VectorDefinition? to, - }) => $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (objects != null) #objects: objects, - if (from != null) #from: from, - if (to != null) #to: to, - }), - ); - @override - ObjectsMoved $make(CopyWithData data) => ObjectsMoved( - data.get(#table, or: $value.table), - data.get(#objects, or: $value.objects), - data.get(#from, or: $value.from), - data.get(#to, or: $value.to), - ); - - @override - ObjectsMovedCopyWith<$R2, ObjectsMoved, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ObjectsMovedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class CellHideChangedMapper extends SubClassMapperBase { - CellHideChangedMapper._(); - - static CellHideChangedMapper? _instance; - static CellHideChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = CellHideChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'CellHideChanged'; - - static GlobalVectorDefinition _$cell(CellHideChanged v) => v.cell; - static const Field _f$cell = Field( - 'cell', - _$cell, - ); - static int? _$object(CellHideChanged v) => v.object; - static const Field _f$object = Field( - 'object', - _$object, - opt: true, - ); - static bool? _$hide(CellHideChanged v) => v.hide; - static const Field _f$hide = Field( - 'hide', - _$hide, - opt: true, - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #object: _f$object, - #hide: _f$hide, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'CellHideChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static CellHideChanged _instantiate(DecodingData data) { - return CellHideChanged( - data.dec(_f$cell), - object: data.dec(_f$object), - hide: data.dec(_f$hide), - ); - } - - @override - final Function instantiate = _instantiate; - - static CellHideChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static CellHideChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin CellHideChangedMappable { - String toJson() { - return CellHideChangedMapper.ensureInitialized() - .encodeJson(this as CellHideChanged); - } - - Map toMap() { - return CellHideChangedMapper.ensureInitialized().encodeMap( - this as CellHideChanged, - ); - } - - CellHideChangedCopyWith - get copyWith => - _CellHideChangedCopyWithImpl( - this as CellHideChanged, - $identity, - $identity, - ); - @override - String toString() { - return CellHideChangedMapper.ensureInitialized().stringifyValue( - this as CellHideChanged, - ); - } - - @override - bool operator ==(Object other) { - return CellHideChangedMapper.ensureInitialized().equalsValue( - this as CellHideChanged, - other, - ); - } - - @override - int get hashCode { - return CellHideChangedMapper.ensureInitialized().hashValue( - this as CellHideChanged, - ); - } -} - -/// @nodoc -extension CellHideChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, CellHideChanged, $Out> { - CellHideChangedCopyWith<$R, CellHideChanged, $Out> get $asCellHideChanged => - $base.as((v, t, t2) => _CellHideChangedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class CellHideChangedCopyWith<$R, $In extends CellHideChanged, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - @override - $R call({GlobalVectorDefinition? cell, int? object, bool? hide}); - CellHideChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _CellHideChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, CellHideChanged, $Out> - implements CellHideChangedCopyWith<$R, CellHideChanged, $Out> { - _CellHideChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - CellHideChangedMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - $R call({ - GlobalVectorDefinition? cell, - Object? object = $none, - Object? hide = $none, - }) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (object != $none) #object: object, - if (hide != $none) #hide: hide, - }), - ); - @override - CellHideChanged $make(CopyWithData data) => CellHideChanged( - data.get(#cell, or: $value.cell), - object: data.get(#object, or: $value.object), - hide: data.get(#hide, or: $value.hide), - ); - - @override - CellHideChangedCopyWith<$R2, CellHideChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _CellHideChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ObjectIndexChangedMapper extends SubClassMapperBase { - ObjectIndexChangedMapper._(); - - static ObjectIndexChangedMapper? _instance; - static ObjectIndexChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ObjectIndexChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ObjectIndexChanged'; - - static GlobalVectorDefinition _$cell(ObjectIndexChanged v) => v.cell; - static const Field _f$cell = - Field('cell', _$cell); - static int _$object(ObjectIndexChanged v) => v.object; - static const Field _f$object = Field( - 'object', - _$object, - ); - static int _$index(ObjectIndexChanged v) => v.index; - static const Field _f$index = Field( - 'index', - _$index, - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #object: _f$object, - #index: _f$index, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ObjectIndexChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static ObjectIndexChanged _instantiate(DecodingData data) { - return ObjectIndexChanged( - data.dec(_f$cell), - data.dec(_f$object), - data.dec(_f$index), - ); - } - - @override - final Function instantiate = _instantiate; - - static ObjectIndexChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ObjectIndexChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ObjectIndexChangedMappable { - String toJson() { - return ObjectIndexChangedMapper.ensureInitialized() - .encodeJson(this as ObjectIndexChanged); - } - - Map toMap() { - return ObjectIndexChangedMapper.ensureInitialized() - .encodeMap(this as ObjectIndexChanged); - } - - ObjectIndexChangedCopyWith< - ObjectIndexChanged, - ObjectIndexChanged, - ObjectIndexChanged - > - get copyWith => - _ObjectIndexChangedCopyWithImpl( - this as ObjectIndexChanged, - $identity, - $identity, - ); - @override - String toString() { - return ObjectIndexChangedMapper.ensureInitialized().stringifyValue( - this as ObjectIndexChanged, - ); - } - - @override - bool operator ==(Object other) { - return ObjectIndexChangedMapper.ensureInitialized().equalsValue( - this as ObjectIndexChanged, - other, - ); - } - - @override - int get hashCode { - return ObjectIndexChangedMapper.ensureInitialized().hashValue( - this as ObjectIndexChanged, - ); - } -} - -/// @nodoc -extension ObjectIndexChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ObjectIndexChanged, $Out> { - ObjectIndexChangedCopyWith<$R, ObjectIndexChanged, $Out> - get $asObjectIndexChanged => $base.as( - (v, t, t2) => _ObjectIndexChangedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class ObjectIndexChangedCopyWith< - $R, - $In extends ObjectIndexChanged, - $Out -> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - @override - $R call({GlobalVectorDefinition? cell, int? object, int? index}); - ObjectIndexChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ObjectIndexChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ObjectIndexChanged, $Out> - implements ObjectIndexChangedCopyWith<$R, ObjectIndexChanged, $Out> { - _ObjectIndexChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ObjectIndexChangedMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - $R call({GlobalVectorDefinition? cell, int? object, int? index}) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (object != null) #object: object, - if (index != null) #index: index, - }), - ); - @override - ObjectIndexChanged $make(CopyWithData data) => ObjectIndexChanged( - data.get(#cell, or: $value.cell), - data.get(#object, or: $value.object), - data.get(#index, or: $value.index), - ); - - @override - ObjectIndexChangedCopyWith<$R2, ObjectIndexChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ObjectIndexChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TeamChangedMapper extends SubClassMapperBase { - TeamChangedMapper._(); - - static TeamChangedMapper? _instance; - static TeamChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GameTeamMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'TeamChanged'; - - static String _$name(TeamChanged v) => v.name; - static const Field _f$name = Field('name', _$name); - static String? _$newName(TeamChanged v) => v.newName; - static const Field _f$newName = Field( - 'newName', - _$newName, - ); - static GameTeam _$team(TeamChanged v) => v.team; - static const Field _f$team = Field('team', _$team); - - @override - final MappableFields fields = const { - #name: _f$name, - #newName: _f$newName, - #team: _f$team, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TeamChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static TeamChanged _instantiate(DecodingData data) { - return TeamChanged.rename( - data.dec(_f$name), - data.dec(_f$newName), - data.dec(_f$team), - ); - } - - @override - final Function instantiate = _instantiate; - - static TeamChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TeamChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TeamChangedMappable { - String toJson() { - return TeamChangedMapper.ensureInitialized().encodeJson( - this as TeamChanged, - ); - } - - Map toMap() { - return TeamChangedMapper.ensureInitialized().encodeMap( - this as TeamChanged, - ); - } - - TeamChangedCopyWith get copyWith => - _TeamChangedCopyWithImpl( - this as TeamChanged, - $identity, - $identity, - ); - @override - String toString() { - return TeamChangedMapper.ensureInitialized().stringifyValue( - this as TeamChanged, - ); - } - - @override - bool operator ==(Object other) { - return TeamChangedMapper.ensureInitialized().equalsValue( - this as TeamChanged, - other, - ); - } - - @override - int get hashCode { - return TeamChangedMapper.ensureInitialized().hashValue(this as TeamChanged); - } -} - -/// @nodoc -extension TeamChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, TeamChanged, $Out> { - TeamChangedCopyWith<$R, TeamChanged, $Out> get $asTeamChanged => - $base.as((v, t, t2) => _TeamChangedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TeamChangedCopyWith<$R, $In extends TeamChanged, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - GameTeamCopyWith<$R, GameTeam, GameTeam> get team; - @override - $R call({String? name, String? newName, GameTeam? team}); - TeamChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TeamChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TeamChanged, $Out> - implements TeamChangedCopyWith<$R, TeamChanged, $Out> { - _TeamChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TeamChangedMapper.ensureInitialized(); - @override - GameTeamCopyWith<$R, GameTeam, GameTeam> get team => - $value.team.copyWith.$chain((v) => call(team: v)); - @override - $R call({String? name, Object? newName = $none, GameTeam? team}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (newName != $none) #newName: newName, - if (team != null) #team: team, - }), - ); - @override - TeamChanged $make(CopyWithData data) => TeamChanged.rename( - data.get(#name, or: $value.name), - data.get(#newName, or: $value.newName), - data.get(#team, or: $value.team), - ); - - @override - TeamChangedCopyWith<$R2, TeamChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TeamChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TeamRemovedMapper extends SubClassMapperBase { - TeamRemovedMapper._(); - - static TeamRemovedMapper? _instance; - static TeamRemovedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamRemovedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TeamRemoved'; - - static String _$team(TeamRemoved v) => v.team; - static const Field _f$team = Field('team', _$team); - - @override - final MappableFields fields = const {#team: _f$team}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TeamRemoved'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static TeamRemoved _instantiate(DecodingData data) { - return TeamRemoved(data.dec(_f$team)); - } - - @override - final Function instantiate = _instantiate; - - static TeamRemoved fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TeamRemoved fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TeamRemovedMappable { - String toJson() { - return TeamRemovedMapper.ensureInitialized().encodeJson( - this as TeamRemoved, - ); - } - - Map toMap() { - return TeamRemovedMapper.ensureInitialized().encodeMap( - this as TeamRemoved, - ); - } - - TeamRemovedCopyWith get copyWith => - _TeamRemovedCopyWithImpl( - this as TeamRemoved, - $identity, - $identity, - ); - @override - String toString() { - return TeamRemovedMapper.ensureInitialized().stringifyValue( - this as TeamRemoved, - ); - } - - @override - bool operator ==(Object other) { - return TeamRemovedMapper.ensureInitialized().equalsValue( - this as TeamRemoved, - other, - ); - } - - @override - int get hashCode { - return TeamRemovedMapper.ensureInitialized().hashValue(this as TeamRemoved); - } -} - -/// @nodoc -extension TeamRemovedValueCopy<$R, $Out> - on ObjectCopyWith<$R, TeamRemoved, $Out> { - TeamRemovedCopyWith<$R, TeamRemoved, $Out> get $asTeamRemoved => - $base.as((v, t, t2) => _TeamRemovedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TeamRemovedCopyWith<$R, $In extends TeamRemoved, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? team}); - TeamRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TeamRemovedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TeamRemoved, $Out> - implements TeamRemovedCopyWith<$R, TeamRemoved, $Out> { - _TeamRemovedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TeamRemovedMapper.ensureInitialized(); - @override - $R call({String? team}) => - $apply(FieldCopyWithData({if (team != null) #team: team})); - @override - TeamRemoved $make(CopyWithData data) => - TeamRemoved(data.get(#team, or: $value.team)); - - @override - TeamRemovedCopyWith<$R2, TeamRemoved, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TeamRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class CellMergeStrategyChangedMapper - extends SubClassMapperBase { - CellMergeStrategyChangedMapper._(); - - static CellMergeStrategyChangedMapper? _instance; - static CellMergeStrategyChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = CellMergeStrategyChangedMapper._(), - ); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - CellMergeStrategyMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'CellMergeStrategyChanged'; - - static GlobalVectorDefinition _$cell(CellMergeStrategyChanged v) => v.cell; - static const Field _f$cell = - Field('cell', _$cell); - static CellMergeStrategy? _$strategy(CellMergeStrategyChanged v) => - v.strategy; - static const Field _f$strategy = - Field('strategy', _$strategy); - static int _$span(CellMergeStrategyChanged v) => v.span; - static const Field _f$span = Field( - 'span', - _$span, - opt: true, - def: 1, - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #strategy: _f$strategy, - #span: _f$span, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'CellMergeStrategyChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static CellMergeStrategyChanged _instantiate(DecodingData data) { - return CellMergeStrategyChanged( - data.dec(_f$cell), - data.dec(_f$strategy), - span: data.dec(_f$span), - ); - } - - @override - final Function instantiate = _instantiate; - - static CellMergeStrategyChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static CellMergeStrategyChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin CellMergeStrategyChangedMappable { - String toJson() { - return CellMergeStrategyChangedMapper.ensureInitialized() - .encodeJson(this as CellMergeStrategyChanged); - } - - Map toMap() { - return CellMergeStrategyChangedMapper.ensureInitialized() - .encodeMap(this as CellMergeStrategyChanged); - } - - CellMergeStrategyChangedCopyWith< - CellMergeStrategyChanged, - CellMergeStrategyChanged, - CellMergeStrategyChanged - > - get copyWith => - _CellMergeStrategyChangedCopyWithImpl< - CellMergeStrategyChanged, - CellMergeStrategyChanged - >(this as CellMergeStrategyChanged, $identity, $identity); - @override - String toString() { - return CellMergeStrategyChangedMapper.ensureInitialized().stringifyValue( - this as CellMergeStrategyChanged, - ); - } - - @override - bool operator ==(Object other) { - return CellMergeStrategyChangedMapper.ensureInitialized().equalsValue( - this as CellMergeStrategyChanged, - other, - ); - } - - @override - int get hashCode { - return CellMergeStrategyChangedMapper.ensureInitialized().hashValue( - this as CellMergeStrategyChanged, - ); - } -} - -/// @nodoc -extension CellMergeStrategyChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, CellMergeStrategyChanged, $Out> { - CellMergeStrategyChangedCopyWith<$R, CellMergeStrategyChanged, $Out> - get $asCellMergeStrategyChanged => $base.as( - (v, t, t2) => _CellMergeStrategyChangedCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class CellMergeStrategyChangedCopyWith< - $R, - $In extends CellMergeStrategyChanged, - $Out -> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? - get strategy; - @override - $R call({ - GlobalVectorDefinition? cell, - CellMergeStrategy? strategy, - int? span, - }); - CellMergeStrategyChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _CellMergeStrategyChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, CellMergeStrategyChanged, $Out> - implements - CellMergeStrategyChangedCopyWith<$R, CellMergeStrategyChanged, $Out> { - _CellMergeStrategyChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - CellMergeStrategyChangedMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? - get strategy => $value.strategy?.copyWith.$chain((v) => call(strategy: v)); - @override - $R call({ - GlobalVectorDefinition? cell, - Object? strategy = $none, - int? span, - }) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (strategy != $none) #strategy: strategy, - if (span != null) #span: span, - }), - ); - @override - CellMergeStrategyChanged $make(CopyWithData data) => CellMergeStrategyChanged( - data.get(#cell, or: $value.cell), - data.get(#strategy, or: $value.strategy), - span: data.get(#span, or: $value.span), - ); - - @override - CellMergeStrategyChangedCopyWith<$R2, CellMergeStrategyChanged, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _CellMergeStrategyChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class MetadataChangedMapper extends SubClassMapperBase { - MetadataChangedMapper._(); - - static MetadataChangedMapper? _instance; - static MetadataChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = MetadataChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - FileMetadataMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'MetadataChanged'; - - static FileMetadata _$metadata(MetadataChanged v) => v.metadata; - static const Field _f$metadata = Field( - 'metadata', - _$metadata, - ); - - @override - final MappableFields fields = const {#metadata: _f$metadata}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'MetadataChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static MetadataChanged _instantiate(DecodingData data) { - return MetadataChanged(data.dec(_f$metadata)); - } - - @override - final Function instantiate = _instantiate; - - static MetadataChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static MetadataChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin MetadataChangedMappable { - String toJson() { - return MetadataChangedMapper.ensureInitialized() - .encodeJson(this as MetadataChanged); - } - - Map toMap() { - return MetadataChangedMapper.ensureInitialized().encodeMap( - this as MetadataChanged, - ); - } - - MetadataChangedCopyWith - get copyWith => - _MetadataChangedCopyWithImpl( - this as MetadataChanged, - $identity, - $identity, - ); - @override - String toString() { - return MetadataChangedMapper.ensureInitialized().stringifyValue( - this as MetadataChanged, - ); - } - - @override - bool operator ==(Object other) { - return MetadataChangedMapper.ensureInitialized().equalsValue( - this as MetadataChanged, - other, - ); - } - - @override - int get hashCode { - return MetadataChangedMapper.ensureInitialized().hashValue( - this as MetadataChanged, - ); - } -} - -/// @nodoc -extension MetadataChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, MetadataChanged, $Out> { - MetadataChangedCopyWith<$R, MetadataChanged, $Out> get $asMetadataChanged => - $base.as((v, t, t2) => _MetadataChangedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class MetadataChangedCopyWith<$R, $In extends MetadataChanged, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata; - @override - $R call({FileMetadata? metadata}); - MetadataChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _MetadataChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, MetadataChanged, $Out> - implements MetadataChangedCopyWith<$R, MetadataChanged, $Out> { - _MetadataChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - MetadataChangedMapper.ensureInitialized(); - @override - FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata => - $value.metadata.copyWith.$chain((v) => call(metadata: v)); - @override - $R call({FileMetadata? metadata}) => - $apply(FieldCopyWithData({if (metadata != null) #metadata: metadata})); - @override - MetadataChanged $make(CopyWithData data) => - MetadataChanged(data.get(#metadata, or: $value.metadata)); - - @override - MetadataChangedCopyWith<$R2, MetadataChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _MetadataChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ObjectsRemovedMapper extends SubClassMapperBase { - ObjectsRemovedMapper._(); - - static ObjectsRemovedMapper? _instance; - static ObjectsRemovedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ObjectsRemovedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ObjectsRemoved'; - - static GlobalVectorDefinition _$cell(ObjectsRemoved v) => v.cell; - static const Field _f$cell = Field( - 'cell', - _$cell, - ); - static List? _$objects(ObjectsRemoved v) => v.objects; - static const Field> _f$objects = Field( - 'objects', - _$objects, - opt: true, - ); - - @override - final MappableFields fields = const { - #cell: _f$cell, - #objects: _f$objects, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'ObjectsRemoved'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static ObjectsRemoved _instantiate(DecodingData data) { - return ObjectsRemoved(data.dec(_f$cell), objects: data.dec(_f$objects)); - } - - @override - final Function instantiate = _instantiate; - - static ObjectsRemoved fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ObjectsRemoved fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ObjectsRemovedMappable { - String toJson() { - return ObjectsRemovedMapper.ensureInitialized().encodeJson( - this as ObjectsRemoved, - ); - } - - Map toMap() { - return ObjectsRemovedMapper.ensureInitialized().encodeMap( - this as ObjectsRemoved, - ); - } - - ObjectsRemovedCopyWith - get copyWith => _ObjectsRemovedCopyWithImpl( - this as ObjectsRemoved, - $identity, - $identity, - ); - @override - String toString() { - return ObjectsRemovedMapper.ensureInitialized().stringifyValue( - this as ObjectsRemoved, - ); - } - - @override - bool operator ==(Object other) { - return ObjectsRemovedMapper.ensureInitialized().equalsValue( - this as ObjectsRemoved, - other, - ); - } - - @override - int get hashCode { - return ObjectsRemovedMapper.ensureInitialized().hashValue( - this as ObjectsRemoved, - ); - } -} - -/// @nodoc -extension ObjectsRemovedValueCopy<$R, $Out> - on ObjectCopyWith<$R, ObjectsRemoved, $Out> { - ObjectsRemovedCopyWith<$R, ObjectsRemoved, $Out> get $asObjectsRemoved => - $base.as((v, t, t2) => _ObjectsRemovedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ObjectsRemovedCopyWith<$R, $In extends ObjectsRemoved, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell; - ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>>? get objects; - @override - $R call({GlobalVectorDefinition? cell, List? objects}); - ObjectsRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ObjectsRemovedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ObjectsRemoved, $Out> - implements ObjectsRemovedCopyWith<$R, ObjectsRemoved, $Out> { - _ObjectsRemovedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ObjectsRemovedMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); - @override - ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>>? get objects => - $value.objects != null - ? ListCopyWith( - $value.objects!, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(objects: v), - ) - : null; - @override - $R call({GlobalVectorDefinition? cell, Object? objects = $none}) => $apply( - FieldCopyWithData({ - if (cell != null) #cell: cell, - if (objects != $none) #objects: objects, - }), - ); - @override - ObjectsRemoved $make(CopyWithData data) => ObjectsRemoved( - data.get(#cell, or: $value.cell), - objects: data.get(#objects, or: $value.objects), - ); - - @override - ObjectsRemovedCopyWith<$R2, ObjectsRemoved, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ObjectsRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TableRenamedMapper extends SubClassMapperBase { - TableRenamedMapper._(); - - static TableRenamedMapper? _instance; - static TableRenamedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TableRenamedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TableRenamed'; - - static String _$name(TableRenamed v) => v.name; - static const Field _f$name = Field('name', _$name); - static String _$newName(TableRenamed v) => v.newName; - static const Field _f$newName = Field( - 'newName', - _$newName, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #newName: _f$newName, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TableRenamed'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static TableRenamed _instantiate(DecodingData data) { - return TableRenamed(data.dec(_f$name), data.dec(_f$newName)); - } - - @override - final Function instantiate = _instantiate; - - static TableRenamed fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TableRenamed fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TableRenamedMappable { - String toJson() { - return TableRenamedMapper.ensureInitialized().encodeJson( - this as TableRenamed, - ); - } - - Map toMap() { - return TableRenamedMapper.ensureInitialized().encodeMap( - this as TableRenamed, - ); - } - - TableRenamedCopyWith get copyWith => - _TableRenamedCopyWithImpl( - this as TableRenamed, - $identity, - $identity, - ); - @override - String toString() { - return TableRenamedMapper.ensureInitialized().stringifyValue( - this as TableRenamed, - ); - } - - @override - bool operator ==(Object other) { - return TableRenamedMapper.ensureInitialized().equalsValue( - this as TableRenamed, - other, - ); - } - - @override - int get hashCode { - return TableRenamedMapper.ensureInitialized().hashValue( - this as TableRenamed, - ); - } -} - -/// @nodoc -extension TableRenamedValueCopy<$R, $Out> - on ObjectCopyWith<$R, TableRenamed, $Out> { - TableRenamedCopyWith<$R, TableRenamed, $Out> get $asTableRenamed => - $base.as((v, t, t2) => _TableRenamedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TableRenamedCopyWith<$R, $In extends TableRenamed, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? newName}); - TableRenamedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TableRenamedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TableRenamed, $Out> - implements TableRenamedCopyWith<$R, TableRenamed, $Out> { - _TableRenamedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TableRenamedMapper.ensureInitialized(); - @override - $R call({String? name, String? newName}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (newName != null) #newName: newName, - }), - ); - @override - TableRenamed $make(CopyWithData data) => TableRenamed( - data.get(#name, or: $value.name), - data.get(#newName, or: $value.newName), - ); - - @override - TableRenamedCopyWith<$R2, TableRenamed, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TableRenamedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class TableRemovedMapper extends SubClassMapperBase { - TableRemovedMapper._(); - - static TableRemovedMapper? _instance; - static TableRemovedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TableRemovedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'TableRemoved'; - - static String _$name(TableRemoved v) => v.name; - static const Field _f$name = Field('name', _$name); - - @override - final MappableFields fields = const {#name: _f$name}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'TableRemoved'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static TableRemoved _instantiate(DecodingData data) { - return TableRemoved(data.dec(_f$name)); - } - - @override - final Function instantiate = _instantiate; - - static TableRemoved fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TableRemoved fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TableRemovedMappable { - String toJson() { - return TableRemovedMapper.ensureInitialized().encodeJson( - this as TableRemoved, - ); - } - - Map toMap() { - return TableRemovedMapper.ensureInitialized().encodeMap( - this as TableRemoved, - ); - } - - TableRemovedCopyWith get copyWith => - _TableRemovedCopyWithImpl( - this as TableRemoved, - $identity, - $identity, - ); - @override - String toString() { - return TableRemovedMapper.ensureInitialized().stringifyValue( - this as TableRemoved, - ); - } - - @override - bool operator ==(Object other) { - return TableRemovedMapper.ensureInitialized().equalsValue( - this as TableRemoved, - other, - ); - } - - @override - int get hashCode { - return TableRemovedMapper.ensureInitialized().hashValue( - this as TableRemoved, - ); - } -} - -/// @nodoc -extension TableRemovedValueCopy<$R, $Out> - on ObjectCopyWith<$R, TableRemoved, $Out> { - TableRemovedCopyWith<$R, TableRemoved, $Out> get $asTableRemoved => - $base.as((v, t, t2) => _TableRemovedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TableRemovedCopyWith<$R, $In extends TableRemoved, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? name}); - TableRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TableRemovedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TableRemoved, $Out> - implements TableRemovedCopyWith<$R, TableRemoved, $Out> { - _TableRemovedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TableRemovedMapper.ensureInitialized(); - @override - $R call({String? name}) => - $apply(FieldCopyWithData({if (name != null) #name: name})); - @override - TableRemoved $make(CopyWithData data) => - TableRemoved(data.get(#name, or: $value.name)); - - @override - TableRemovedCopyWith<$R2, TableRemoved, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TableRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class NoteChangedMapper extends SubClassMapperBase { - NoteChangedMapper._(); - - static NoteChangedMapper? _instance; - static NoteChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = NoteChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'NoteChanged'; - - static String _$name(NoteChanged v) => v.name; - static const Field _f$name = Field('name', _$name); - static String _$content(NoteChanged v) => v.content; - static const Field _f$content = Field( - 'content', - _$content, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #content: _f$content, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'NoteChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static NoteChanged _instantiate(DecodingData data) { - return NoteChanged(data.dec(_f$name), data.dec(_f$content)); - } - - @override - final Function instantiate = _instantiate; - - static NoteChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static NoteChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin NoteChangedMappable { - String toJson() { - return NoteChangedMapper.ensureInitialized().encodeJson( - this as NoteChanged, - ); - } - - Map toMap() { - return NoteChangedMapper.ensureInitialized().encodeMap( - this as NoteChanged, - ); - } - - NoteChangedCopyWith get copyWith => - _NoteChangedCopyWithImpl( - this as NoteChanged, - $identity, - $identity, - ); - @override - String toString() { - return NoteChangedMapper.ensureInitialized().stringifyValue( - this as NoteChanged, - ); - } - - @override - bool operator ==(Object other) { - return NoteChangedMapper.ensureInitialized().equalsValue( - this as NoteChanged, - other, - ); - } - - @override - int get hashCode { - return NoteChangedMapper.ensureInitialized().hashValue(this as NoteChanged); - } -} - -/// @nodoc -extension NoteChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, NoteChanged, $Out> { - NoteChangedCopyWith<$R, NoteChanged, $Out> get $asNoteChanged => - $base.as((v, t, t2) => _NoteChangedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class NoteChangedCopyWith<$R, $In extends NoteChanged, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? content}); - NoteChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _NoteChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, NoteChanged, $Out> - implements NoteChangedCopyWith<$R, NoteChanged, $Out> { - _NoteChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - NoteChangedMapper.ensureInitialized(); - @override - $R call({String? name, String? content}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (content != null) #content: content, - }), - ); - @override - NoteChanged $make(CopyWithData data) => NoteChanged( - data.get(#name, or: $value.name), - data.get(#content, or: $value.content), - ); - - @override - NoteChangedCopyWith<$R2, NoteChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _NoteChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class NoteRemovedMapper extends SubClassMapperBase { - NoteRemovedMapper._(); - - static NoteRemovedMapper? _instance; - static NoteRemovedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = NoteRemovedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'NoteRemoved'; - - static String _$name(NoteRemoved v) => v.name; - static const Field _f$name = Field('name', _$name); - - @override - final MappableFields fields = const {#name: _f$name}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'NoteRemoved'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static NoteRemoved _instantiate(DecodingData data) { - return NoteRemoved(data.dec(_f$name)); - } - - @override - final Function instantiate = _instantiate; - - static NoteRemoved fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static NoteRemoved fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin NoteRemovedMappable { - String toJson() { - return NoteRemovedMapper.ensureInitialized().encodeJson( - this as NoteRemoved, - ); - } - - Map toMap() { - return NoteRemovedMapper.ensureInitialized().encodeMap( - this as NoteRemoved, - ); - } - - NoteRemovedCopyWith get copyWith => - _NoteRemovedCopyWithImpl( - this as NoteRemoved, - $identity, - $identity, - ); - @override - String toString() { - return NoteRemovedMapper.ensureInitialized().stringifyValue( - this as NoteRemoved, - ); - } - - @override - bool operator ==(Object other) { - return NoteRemovedMapper.ensureInitialized().equalsValue( - this as NoteRemoved, - other, - ); - } - - @override - int get hashCode { - return NoteRemovedMapper.ensureInitialized().hashValue(this as NoteRemoved); - } -} - -/// @nodoc -extension NoteRemovedValueCopy<$R, $Out> - on ObjectCopyWith<$R, NoteRemoved, $Out> { - NoteRemovedCopyWith<$R, NoteRemoved, $Out> get $asNoteRemoved => - $base.as((v, t, t2) => _NoteRemovedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class NoteRemovedCopyWith<$R, $In extends NoteRemoved, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? name}); - NoteRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _NoteRemovedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, NoteRemoved, $Out> - implements NoteRemovedCopyWith<$R, NoteRemoved, $Out> { - _NoteRemovedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - NoteRemovedMapper.ensureInitialized(); - @override - $R call({String? name}) => - $apply(FieldCopyWithData({if (name != null) #name: name})); - @override - NoteRemoved $make(CopyWithData data) => - NoteRemoved(data.get(#name, or: $value.name)); - - @override - NoteRemovedCopyWith<$R2, NoteRemoved, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _NoteRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class WaypointChangedMapper extends SubClassMapperBase { - WaypointChangedMapper._(); - - static WaypointChangedMapper? _instance; - static WaypointChangedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WaypointChangedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - WaypointMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'WaypointChanged'; - - static String? _$team(WaypointChanged v) => v.team; - static const Field _f$team = Field( - 'team', - _$team, - opt: true, - ); - static Waypoint _$waypoint(WaypointChanged v) => v.waypoint; - static const Field _f$waypoint = Field( - 'waypoint', - _$waypoint, - ); - static String? _$name(WaypointChanged v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - opt: true, - ); - - @override - final MappableFields fields = const { - #team: _f$team, - #waypoint: _f$waypoint, - #name: _f$name, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'WaypointChanged'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static WaypointChanged _instantiate(DecodingData data) { - return WaypointChanged( - team: data.dec(_f$team), - waypoint: data.dec(_f$waypoint), - name: data.dec(_f$name), - ); - } - - @override - final Function instantiate = _instantiate; - - static WaypointChanged fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static WaypointChanged fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin WaypointChangedMappable { - String toJson() { - return WaypointChangedMapper.ensureInitialized() - .encodeJson(this as WaypointChanged); - } - - Map toMap() { - return WaypointChangedMapper.ensureInitialized().encodeMap( - this as WaypointChanged, - ); - } - - WaypointChangedCopyWith - get copyWith => - _WaypointChangedCopyWithImpl( - this as WaypointChanged, - $identity, - $identity, - ); - @override - String toString() { - return WaypointChangedMapper.ensureInitialized().stringifyValue( - this as WaypointChanged, - ); - } - - @override - bool operator ==(Object other) { - return WaypointChangedMapper.ensureInitialized().equalsValue( - this as WaypointChanged, - other, - ); - } - - @override - int get hashCode { - return WaypointChangedMapper.ensureInitialized().hashValue( - this as WaypointChanged, - ); - } -} - -/// @nodoc -extension WaypointChangedValueCopy<$R, $Out> - on ObjectCopyWith<$R, WaypointChanged, $Out> { - WaypointChangedCopyWith<$R, WaypointChanged, $Out> get $asWaypointChanged => - $base.as((v, t, t2) => _WaypointChangedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class WaypointChangedCopyWith<$R, $In extends WaypointChanged, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - WaypointCopyWith<$R, Waypoint, Waypoint> get waypoint; - @override - $R call({String? team, Waypoint? waypoint, String? name}); - WaypointChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _WaypointChangedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, WaypointChanged, $Out> - implements WaypointChangedCopyWith<$R, WaypointChanged, $Out> { - _WaypointChangedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - WaypointChangedMapper.ensureInitialized(); - @override - WaypointCopyWith<$R, Waypoint, Waypoint> get waypoint => - $value.waypoint.copyWith.$chain((v) => call(waypoint: v)); - @override - $R call({Object? team = $none, Waypoint? waypoint, Object? name = $none}) => - $apply( - FieldCopyWithData({ - if (team != $none) #team: team, - if (waypoint != null) #waypoint: waypoint, - if (name != $none) #name: name, - }), - ); - @override - WaypointChanged $make(CopyWithData data) => WaypointChanged( - team: data.get(#team, or: $value.team), - waypoint: data.get(#waypoint, or: $value.waypoint), - name: data.get(#name, or: $value.name), - ); - - @override - WaypointChangedCopyWith<$R2, WaypointChanged, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _WaypointChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class WaypointRemovedMapper extends SubClassMapperBase { - WaypointRemovedMapper._(); - - static WaypointRemovedMapper? _instance; - static WaypointRemovedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WaypointRemovedMapper._()); - HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'WaypointRemoved'; - - static String? _$team(WaypointRemoved v) => v.team; - static const Field _f$team = Field( - 'team', - _$team, - opt: true, - ); - static String _$name(WaypointRemoved v) => v.name; - static const Field _f$name = Field('name', _$name); - - @override - final MappableFields fields = const { - #team: _f$team, - #name: _f$name, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'WaypointRemoved'; - @override - late final ClassMapperBase superMapper = - HybridWorldEventMapper.ensureInitialized(); - - static WaypointRemoved _instantiate(DecodingData data) { - return WaypointRemoved(team: data.dec(_f$team), name: data.dec(_f$name)); - } - - @override - final Function instantiate = _instantiate; - - static WaypointRemoved fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static WaypointRemoved fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin WaypointRemovedMappable { - String toJson() { - return WaypointRemovedMapper.ensureInitialized() - .encodeJson(this as WaypointRemoved); - } - - Map toMap() { - return WaypointRemovedMapper.ensureInitialized().encodeMap( - this as WaypointRemoved, - ); - } - - WaypointRemovedCopyWith - get copyWith => - _WaypointRemovedCopyWithImpl( - this as WaypointRemoved, - $identity, - $identity, - ); - @override - String toString() { - return WaypointRemovedMapper.ensureInitialized().stringifyValue( - this as WaypointRemoved, - ); - } - - @override - bool operator ==(Object other) { - return WaypointRemovedMapper.ensureInitialized().equalsValue( - this as WaypointRemoved, - other, - ); - } - - @override - int get hashCode { - return WaypointRemovedMapper.ensureInitialized().hashValue( - this as WaypointRemoved, - ); - } -} - -/// @nodoc -extension WaypointRemovedValueCopy<$R, $Out> - on ObjectCopyWith<$R, WaypointRemoved, $Out> { - WaypointRemovedCopyWith<$R, WaypointRemoved, $Out> get $asWaypointRemoved => - $base.as((v, t, t2) => _WaypointRemovedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class WaypointRemovedCopyWith<$R, $In extends WaypointRemoved, $Out> - implements HybridWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({String? team, String? name}); - WaypointRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _WaypointRemovedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, WaypointRemoved, $Out> - implements WaypointRemovedCopyWith<$R, WaypointRemoved, $Out> { - _WaypointRemovedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - WaypointRemovedMapper.ensureInitialized(); - @override - $R call({Object? team = $none, String? name}) => $apply( - FieldCopyWithData({ - if (team != $none) #team: team, - if (name != null) #name: name, - }), - ); - @override - WaypointRemoved $make(CopyWithData data) => WaypointRemoved( - team: data.get(#team, or: $value.team), - name: data.get(#name, or: $value.name), - ); - - @override - WaypointRemovedCopyWith<$R2, WaypointRemoved, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _WaypointRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class LocalWorldEventMapper extends SubClassMapperBase { - LocalWorldEventMapper._(); - - static LocalWorldEventMapper? _instance; - static LocalWorldEventMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = LocalWorldEventMapper._()); - WorldEventMapper.ensureInitialized().addSubMapper(_instance!); - } - return _instance!; - } - - @override - final String id = 'LocalWorldEvent'; - - @override - final MappableFields fields = const {}; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'LocalWorldEvent'; - @override - late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); - - static LocalWorldEvent _instantiate(DecodingData data) { - throw MapperException.missingConstructor('LocalWorldEvent'); - } - - @override - final Function instantiate = _instantiate; - - static LocalWorldEvent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static LocalWorldEvent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin LocalWorldEventMappable { - String toJson(); - Map toMap(); - LocalWorldEventCopyWith - get copyWith; -} - -/// @nodoc -abstract class LocalWorldEventCopyWith<$R, $In extends LocalWorldEvent, $Out> - implements - WorldEventCopyWith<$R, $In, $Out>, - PlayableWorldEventCopyWith<$R, $In, $Out> { - @override - $R call(); - LocalWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'event.dart'; + +/// @nodoc +class WorldEventMapper extends ClassMapperBase { + WorldEventMapper._(); + + static WorldEventMapper? _instance; + static WorldEventMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WorldEventMapper._()); + PlayableWorldEventMapper.ensureInitialized(); + ClientWorldEventMapper.ensureInitialized(); + HybridWorldEventMapper.ensureInitialized(); + LocalWorldEventMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'WorldEvent'; + + @override + final MappableFields fields = const {}; + + static WorldEvent _instantiate(DecodingData data) { + throw MapperException.missingSubclass( + 'WorldEvent', + 'type', + '${data.value['type']}', + ); + } + + @override + final Function instantiate = _instantiate; + + static WorldEvent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static WorldEvent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin WorldEventMappable { + String toJson(); + Map toMap(); + WorldEventCopyWith get copyWith; +} + +/// @nodoc +abstract class WorldEventCopyWith<$R, $In extends WorldEvent, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call(); + WorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class PlayableWorldEventMapper extends SubClassMapperBase { + PlayableWorldEventMapper._(); + + static PlayableWorldEventMapper? _instance; + static PlayableWorldEventMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = PlayableWorldEventMapper._()); + WorldEventMapper.ensureInitialized().addSubMapper(_instance!); + ServerWorldEventMapper.ensureInitialized(); + LocalWorldEventMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'PlayableWorldEvent'; + + @override + final MappableFields fields = const {}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'PlayableWorldEvent'; + @override + late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); + + static PlayableWorldEvent _instantiate(DecodingData data) { + throw MapperException.missingSubclass( + 'PlayableWorldEvent', + 'type', + '${data.value['type']}', + ); + } + + @override + final Function instantiate = _instantiate; + + static PlayableWorldEvent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static PlayableWorldEvent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin PlayableWorldEventMappable { + String toJson(); + Map toMap(); + PlayableWorldEventCopyWith< + PlayableWorldEvent, + PlayableWorldEvent, + PlayableWorldEvent + > + get copyWith; +} + +/// @nodoc +abstract class PlayableWorldEventCopyWith< + $R, + $In extends PlayableWorldEvent, + $Out +> + implements WorldEventCopyWith<$R, $In, $Out> { + @override + $R call(); + PlayableWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class ServerWorldEventMapper extends SubClassMapperBase { + ServerWorldEventMapper._(); + + static ServerWorldEventMapper? _instance; + static ServerWorldEventMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ServerWorldEventMapper._()); + PlayableWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + WorldInitializedMapper.ensureInitialized(); + TeamJoinedMapper.ensureInitialized(); + TeamLeftMapper.ensureInitialized(); + ObjectsChangedMapper.ensureInitialized(); + CellShuffledMapper.ensureInitialized(); + MessageSentMapper.ensureInitialized(); + BoardTilesSpawnedMapper.ensureInitialized(); + BoardTilesChangedMapper.ensureInitialized(); + DialogOpenedMapper.ensureInitialized(); + DialogsClosedMapper.ensureInitialized(); + ImagesUpdatedMapper.ensureInitialized(); + ServerStateUpdatedMapper.ensureInitialized(); + AuthenticatedRequestedMapper.ensureInitialized(); + ToolbarUpdatedMapper.ensureInitialized(); + HybridWorldEventMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ServerWorldEvent'; + + @override + final MappableFields fields = const {}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ServerWorldEvent'; + @override + late final ClassMapperBase superMapper = + PlayableWorldEventMapper.ensureInitialized(); + + static ServerWorldEvent _instantiate(DecodingData data) { + throw MapperException.missingSubclass( + 'ServerWorldEvent', + 'type', + '${data.value['type']}', + ); + } + + @override + final Function instantiate = _instantiate; + + static ServerWorldEvent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ServerWorldEvent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ServerWorldEventMappable { + String toJson(); + Map toMap(); + ServerWorldEventCopyWith + get copyWith; +} + +/// @nodoc +abstract class ServerWorldEventCopyWith<$R, $In extends ServerWorldEvent, $Out> + implements PlayableWorldEventCopyWith<$R, $In, $Out> { + @override + $R call(); + ServerWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class WorldInitializedMapper extends SubClassMapperBase { + WorldInitializedMapper._(); + + static WorldInitializedMapper? _instance; + static WorldInitializedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WorldInitializedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GameTableMapper.ensureInitialized(); + GameInfoMapper.ensureInitialized(); + SignatureMetadataMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'WorldInitialized'; + + static GameTable? _$table(WorldInitialized v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + opt: true, + ); + static GameInfo? _$info(WorldInitialized v) => v.info; + static const Field _f$info = Field( + 'info', + _$info, + opt: true, + ); + static Map>? _$teamMembers(WorldInitialized v) => + v.teamMembers; + static const Field>> _f$teamMembers = + Field('teamMembers', _$teamMembers, opt: true); + static int? _$id(WorldInitialized v) => v.id; + static const Field _f$id = Field( + 'id', + _$id, + opt: true, + ); + static List? _$packsSignature(WorldInitialized v) => + v.packsSignature; + static const Field> + _f$packsSignature = Field('packsSignature', _$packsSignature, opt: true); + static bool _$clearUserInterface(WorldInitialized v) => v.clearUserInterface; + static const Field _f$clearUserInterface = Field( + 'clearUserInterface', + _$clearUserInterface, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #table: _f$table, + #info: _f$info, + #teamMembers: _f$teamMembers, + #id: _f$id, + #packsSignature: _f$packsSignature, + #clearUserInterface: _f$clearUserInterface, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'WorldInitialized'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static WorldInitialized _instantiate(DecodingData data) { + return WorldInitialized( + table: data.dec(_f$table), + info: data.dec(_f$info), + teamMembers: data.dec(_f$teamMembers), + id: data.dec(_f$id), + packsSignature: data.dec(_f$packsSignature), + clearUserInterface: data.dec(_f$clearUserInterface), + ); + } + + @override + final Function instantiate = _instantiate; + + static WorldInitialized fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static WorldInitialized fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin WorldInitializedMappable { + String toJson() { + return WorldInitializedMapper.ensureInitialized() + .encodeJson(this as WorldInitialized); + } + + Map toMap() { + return WorldInitializedMapper.ensureInitialized() + .encodeMap(this as WorldInitialized); + } + + WorldInitializedCopyWith + get copyWith => + _WorldInitializedCopyWithImpl( + this as WorldInitialized, + $identity, + $identity, + ); + @override + String toString() { + return WorldInitializedMapper.ensureInitialized().stringifyValue( + this as WorldInitialized, + ); + } + + @override + bool operator ==(Object other) { + return WorldInitializedMapper.ensureInitialized().equalsValue( + this as WorldInitialized, + other, + ); + } + + @override + int get hashCode { + return WorldInitializedMapper.ensureInitialized().hashValue( + this as WorldInitialized, + ); + } +} + +/// @nodoc +extension WorldInitializedValueCopy<$R, $Out> + on ObjectCopyWith<$R, WorldInitialized, $Out> { + WorldInitializedCopyWith<$R, WorldInitialized, $Out> + get $asWorldInitialized => + $base.as((v, t, t2) => _WorldInitializedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class WorldInitializedCopyWith<$R, $In extends WorldInitialized, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + GameTableCopyWith<$R, GameTable, GameTable>? get table; + GameInfoCopyWith<$R, GameInfo, GameInfo>? get info; + MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>>? + get teamMembers; + ListCopyWith< + $R, + SignatureMetadata, + SignatureMetadataCopyWith<$R, SignatureMetadata, SignatureMetadata> + >? + get packsSignature; + @override + $R call({ + GameTable? table, + GameInfo? info, + Map>? teamMembers, + int? id, + List? packsSignature, + bool? clearUserInterface, + }); + WorldInitializedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _WorldInitializedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, WorldInitialized, $Out> + implements WorldInitializedCopyWith<$R, WorldInitialized, $Out> { + _WorldInitializedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + WorldInitializedMapper.ensureInitialized(); + @override + GameTableCopyWith<$R, GameTable, GameTable>? get table => + $value.table?.copyWith.$chain((v) => call(table: v)); + @override + GameInfoCopyWith<$R, GameInfo, GameInfo>? get info => + $value.info?.copyWith.$chain((v) => call(info: v)); + @override + MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>>? + get teamMembers => $value.teamMembers != null + ? MapCopyWith( + $value.teamMembers!, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(teamMembers: v), + ) + : null; + @override + ListCopyWith< + $R, + SignatureMetadata, + SignatureMetadataCopyWith<$R, SignatureMetadata, SignatureMetadata> + >? + get packsSignature => $value.packsSignature != null + ? ListCopyWith( + $value.packsSignature!, + (v, t) => v.copyWith.$chain(t), + (v) => call(packsSignature: v), + ) + : null; + @override + $R call({ + Object? table = $none, + Object? info = $none, + Object? teamMembers = $none, + Object? id = $none, + Object? packsSignature = $none, + bool? clearUserInterface, + }) => $apply( + FieldCopyWithData({ + if (table != $none) #table: table, + if (info != $none) #info: info, + if (teamMembers != $none) #teamMembers: teamMembers, + if (id != $none) #id: id, + if (packsSignature != $none) #packsSignature: packsSignature, + if (clearUserInterface != null) #clearUserInterface: clearUserInterface, + }), + ); + @override + WorldInitialized $make(CopyWithData data) => WorldInitialized( + table: data.get(#table, or: $value.table), + info: data.get(#info, or: $value.info), + teamMembers: data.get(#teamMembers, or: $value.teamMembers), + id: data.get(#id, or: $value.id), + packsSignature: data.get(#packsSignature, or: $value.packsSignature), + clearUserInterface: data.get( + #clearUserInterface, + or: $value.clearUserInterface, + ), + ); + + @override + WorldInitializedCopyWith<$R2, WorldInitialized, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _WorldInitializedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TeamJoinedMapper extends SubClassMapperBase { + TeamJoinedMapper._(); + + static TeamJoinedMapper? _instance; + static TeamJoinedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamJoinedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TeamJoined'; + + static int _$user(TeamJoined v) => v.user; + static const Field _f$user = Field('user', _$user); + static String _$team(TeamJoined v) => v.team; + static const Field _f$team = Field('team', _$team); + + @override + final MappableFields fields = const { + #user: _f$user, + #team: _f$team, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TeamJoined'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static TeamJoined _instantiate(DecodingData data) { + return TeamJoined(data.dec(_f$user), data.dec(_f$team)); + } + + @override + final Function instantiate = _instantiate; + + static TeamJoined fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TeamJoined fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TeamJoinedMappable { + String toJson() { + return TeamJoinedMapper.ensureInitialized().encodeJson( + this as TeamJoined, + ); + } + + Map toMap() { + return TeamJoinedMapper.ensureInitialized().encodeMap( + this as TeamJoined, + ); + } + + TeamJoinedCopyWith get copyWith => + _TeamJoinedCopyWithImpl( + this as TeamJoined, + $identity, + $identity, + ); + @override + String toString() { + return TeamJoinedMapper.ensureInitialized().stringifyValue( + this as TeamJoined, + ); + } + + @override + bool operator ==(Object other) { + return TeamJoinedMapper.ensureInitialized().equalsValue( + this as TeamJoined, + other, + ); + } + + @override + int get hashCode { + return TeamJoinedMapper.ensureInitialized().hashValue(this as TeamJoined); + } +} + +/// @nodoc +extension TeamJoinedValueCopy<$R, $Out> + on ObjectCopyWith<$R, TeamJoined, $Out> { + TeamJoinedCopyWith<$R, TeamJoined, $Out> get $asTeamJoined => + $base.as((v, t, t2) => _TeamJoinedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TeamJoinedCopyWith<$R, $In extends TeamJoined, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({int? user, String? team}); + TeamJoinedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TeamJoinedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TeamJoined, $Out> + implements TeamJoinedCopyWith<$R, TeamJoined, $Out> { + _TeamJoinedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TeamJoinedMapper.ensureInitialized(); + @override + $R call({int? user, String? team}) => $apply( + FieldCopyWithData({ + if (user != null) #user: user, + if (team != null) #team: team, + }), + ); + @override + TeamJoined $make(CopyWithData data) => TeamJoined( + data.get(#user, or: $value.user), + data.get(#team, or: $value.team), + ); + + @override + TeamJoinedCopyWith<$R2, TeamJoined, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TeamJoinedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TeamLeftMapper extends SubClassMapperBase { + TeamLeftMapper._(); + + static TeamLeftMapper? _instance; + static TeamLeftMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamLeftMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TeamLeft'; + + static int _$user(TeamLeft v) => v.user; + static const Field _f$user = Field('user', _$user); + static String _$team(TeamLeft v) => v.team; + static const Field _f$team = Field('team', _$team); + + @override + final MappableFields fields = const { + #user: _f$user, + #team: _f$team, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TeamLeft'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static TeamLeft _instantiate(DecodingData data) { + return TeamLeft(data.dec(_f$user), data.dec(_f$team)); + } + + @override + final Function instantiate = _instantiate; + + static TeamLeft fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TeamLeft fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TeamLeftMappable { + String toJson() { + return TeamLeftMapper.ensureInitialized().encodeJson( + this as TeamLeft, + ); + } + + Map toMap() { + return TeamLeftMapper.ensureInitialized().encodeMap( + this as TeamLeft, + ); + } + + TeamLeftCopyWith get copyWith => + _TeamLeftCopyWithImpl( + this as TeamLeft, + $identity, + $identity, + ); + @override + String toString() { + return TeamLeftMapper.ensureInitialized().stringifyValue(this as TeamLeft); + } + + @override + bool operator ==(Object other) { + return TeamLeftMapper.ensureInitialized().equalsValue( + this as TeamLeft, + other, + ); + } + + @override + int get hashCode { + return TeamLeftMapper.ensureInitialized().hashValue(this as TeamLeft); + } +} + +/// @nodoc +extension TeamLeftValueCopy<$R, $Out> on ObjectCopyWith<$R, TeamLeft, $Out> { + TeamLeftCopyWith<$R, TeamLeft, $Out> get $asTeamLeft => + $base.as((v, t, t2) => _TeamLeftCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TeamLeftCopyWith<$R, $In extends TeamLeft, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({int? user, String? team}); + TeamLeftCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TeamLeftCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TeamLeft, $Out> + implements TeamLeftCopyWith<$R, TeamLeft, $Out> { + _TeamLeftCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TeamLeftMapper.ensureInitialized(); + @override + $R call({int? user, String? team}) => $apply( + FieldCopyWithData({ + if (user != null) #user: user, + if (team != null) #team: team, + }), + ); + @override + TeamLeft $make(CopyWithData data) => TeamLeft( + data.get(#user, or: $value.user), + data.get(#team, or: $value.team), + ); + + @override + TeamLeftCopyWith<$R2, TeamLeft, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TeamLeftCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ObjectsChangedMapper extends SubClassMapperBase { + ObjectsChangedMapper._(); + + static ObjectsChangedMapper? _instance; + static ObjectsChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ObjectsChangedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + GameObjectMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ObjectsChanged'; + + static GlobalVectorDefinition _$cell(ObjectsChanged v) => v.cell; + static const Field _f$cell = Field( + 'cell', + _$cell, + ); + static List _$objects(ObjectsChanged v) => v.objects; + static const Field> _f$objects = Field( + 'objects', + _$objects, + opt: true, + def: const [], + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #objects: _f$objects, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ObjectsChanged'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static ObjectsChanged _instantiate(DecodingData data) { + return ObjectsChanged(data.dec(_f$cell), data.dec(_f$objects)); + } + + @override + final Function instantiate = _instantiate; + + static ObjectsChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ObjectsChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ObjectsChangedMappable { + String toJson() { + return ObjectsChangedMapper.ensureInitialized().encodeJson( + this as ObjectsChanged, + ); + } + + Map toMap() { + return ObjectsChangedMapper.ensureInitialized().encodeMap( + this as ObjectsChanged, + ); + } + + ObjectsChangedCopyWith + get copyWith => _ObjectsChangedCopyWithImpl( + this as ObjectsChanged, + $identity, + $identity, + ); + @override + String toString() { + return ObjectsChangedMapper.ensureInitialized().stringifyValue( + this as ObjectsChanged, + ); + } + + @override + bool operator ==(Object other) { + return ObjectsChangedMapper.ensureInitialized().equalsValue( + this as ObjectsChanged, + other, + ); + } + + @override + int get hashCode { + return ObjectsChangedMapper.ensureInitialized().hashValue( + this as ObjectsChanged, + ); + } +} + +/// @nodoc +extension ObjectsChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ObjectsChanged, $Out> { + ObjectsChangedCopyWith<$R, ObjectsChanged, $Out> get $asObjectsChanged => + $base.as((v, t, t2) => _ObjectsChangedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ObjectsChangedCopyWith<$R, $In extends ObjectsChanged, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> + get objects; + @override + $R call({GlobalVectorDefinition? cell, List? objects}); + ObjectsChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ObjectsChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ObjectsChanged, $Out> + implements ObjectsChangedCopyWith<$R, ObjectsChanged, $Out> { + _ObjectsChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ObjectsChangedMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> + get objects => ListCopyWith( + $value.objects, + (v, t) => v.copyWith.$chain(t), + (v) => call(objects: v), + ); + @override + $R call({GlobalVectorDefinition? cell, List? objects}) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (objects != null) #objects: objects, + }), + ); + @override + ObjectsChanged $make(CopyWithData data) => ObjectsChanged( + data.get(#cell, or: $value.cell), + data.get(#objects, or: $value.objects), + ); + + @override + ObjectsChangedCopyWith<$R2, ObjectsChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ObjectsChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class CellShuffledMapper extends SubClassMapperBase { + CellShuffledMapper._(); + + static CellShuffledMapper? _instance; + static CellShuffledMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = CellShuffledMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'CellShuffled'; + + static GlobalVectorDefinition _$cell(CellShuffled v) => v.cell; + static const Field _f$cell = Field( + 'cell', + _$cell, + ); + static List _$positions(CellShuffled v) => v.positions; + static const Field> _f$positions = Field( + 'positions', + _$positions, + opt: true, + def: const [], + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #positions: _f$positions, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'CellShuffled'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static CellShuffled _instantiate(DecodingData data) { + return CellShuffled(data.dec(_f$cell), data.dec(_f$positions)); + } + + @override + final Function instantiate = _instantiate; + + static CellShuffled fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static CellShuffled fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin CellShuffledMappable { + String toJson() { + return CellShuffledMapper.ensureInitialized().encodeJson( + this as CellShuffled, + ); + } + + Map toMap() { + return CellShuffledMapper.ensureInitialized().encodeMap( + this as CellShuffled, + ); + } + + CellShuffledCopyWith get copyWith => + _CellShuffledCopyWithImpl( + this as CellShuffled, + $identity, + $identity, + ); + @override + String toString() { + return CellShuffledMapper.ensureInitialized().stringifyValue( + this as CellShuffled, + ); + } + + @override + bool operator ==(Object other) { + return CellShuffledMapper.ensureInitialized().equalsValue( + this as CellShuffled, + other, + ); + } + + @override + int get hashCode { + return CellShuffledMapper.ensureInitialized().hashValue( + this as CellShuffled, + ); + } +} + +/// @nodoc +extension CellShuffledValueCopy<$R, $Out> + on ObjectCopyWith<$R, CellShuffled, $Out> { + CellShuffledCopyWith<$R, CellShuffled, $Out> get $asCellShuffled => + $base.as((v, t, t2) => _CellShuffledCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class CellShuffledCopyWith<$R, $In extends CellShuffled, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get positions; + @override + $R call({GlobalVectorDefinition? cell, List? positions}); + CellShuffledCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _CellShuffledCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, CellShuffled, $Out> + implements CellShuffledCopyWith<$R, CellShuffled, $Out> { + _CellShuffledCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + CellShuffledMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get positions => + ListCopyWith( + $value.positions, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(positions: v), + ); + @override + $R call({GlobalVectorDefinition? cell, List? positions}) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (positions != null) #positions: positions, + }), + ); + @override + CellShuffled $make(CopyWithData data) => CellShuffled( + data.get(#cell, or: $value.cell), + data.get(#positions, or: $value.positions), + ); + + @override + CellShuffledCopyWith<$R2, CellShuffled, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _CellShuffledCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class MessageSentMapper extends SubClassMapperBase { + MessageSentMapper._(); + + static MessageSentMapper? _instance; + static MessageSentMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = MessageSentMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'MessageSent'; + + static int _$user(MessageSent v) => v.user; + static const Field _f$user = Field('user', _$user); + static String _$message(MessageSent v) => v.message; + static const Field _f$message = Field( + 'message', + _$message, + ); + + @override + final MappableFields fields = const { + #user: _f$user, + #message: _f$message, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'MessageSent'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static MessageSent _instantiate(DecodingData data) { + return MessageSent(data.dec(_f$user), data.dec(_f$message)); + } + + @override + final Function instantiate = _instantiate; + + static MessageSent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static MessageSent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin MessageSentMappable { + String toJson() { + return MessageSentMapper.ensureInitialized().encodeJson( + this as MessageSent, + ); + } + + Map toMap() { + return MessageSentMapper.ensureInitialized().encodeMap( + this as MessageSent, + ); + } + + MessageSentCopyWith get copyWith => + _MessageSentCopyWithImpl( + this as MessageSent, + $identity, + $identity, + ); + @override + String toString() { + return MessageSentMapper.ensureInitialized().stringifyValue( + this as MessageSent, + ); + } + + @override + bool operator ==(Object other) { + return MessageSentMapper.ensureInitialized().equalsValue( + this as MessageSent, + other, + ); + } + + @override + int get hashCode { + return MessageSentMapper.ensureInitialized().hashValue(this as MessageSent); + } +} + +/// @nodoc +extension MessageSentValueCopy<$R, $Out> + on ObjectCopyWith<$R, MessageSent, $Out> { + MessageSentCopyWith<$R, MessageSent, $Out> get $asMessageSent => + $base.as((v, t, t2) => _MessageSentCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class MessageSentCopyWith<$R, $In extends MessageSent, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({int? user, String? message}); + MessageSentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _MessageSentCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, MessageSent, $Out> + implements MessageSentCopyWith<$R, MessageSent, $Out> { + _MessageSentCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + MessageSentMapper.ensureInitialized(); + @override + $R call({int? user, String? message}) => $apply( + FieldCopyWithData({ + if (user != null) #user: user, + if (message != null) #message: message, + }), + ); + @override + MessageSent $make(CopyWithData data) => MessageSent( + data.get(#user, or: $value.user), + data.get(#message, or: $value.message), + ); + + @override + MessageSentCopyWith<$R2, MessageSent, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _MessageSentCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardTilesSpawnedMapper extends SubClassMapperBase { + BoardTilesSpawnedMapper._(); + + static BoardTilesSpawnedMapper? _instance; + static BoardTilesSpawnedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardTilesSpawnedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + BoardTileMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardTilesSpawned'; + + static String _$table(BoardTilesSpawned v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + ); + static Map> _$tiles(BoardTilesSpawned v) => + v.tiles; + static const Field>> + _f$tiles = Field('tiles', _$tiles, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #table: _f$table, + #tiles: _f$tiles, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'BoardTilesSpawned'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static BoardTilesSpawned _instantiate(DecodingData data) { + return BoardTilesSpawned(data.dec(_f$table), data.dec(_f$tiles)); + } + + @override + final Function instantiate = _instantiate; + + static BoardTilesSpawned fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardTilesSpawned fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardTilesSpawnedMappable { + String toJson() { + return BoardTilesSpawnedMapper.ensureInitialized() + .encodeJson(this as BoardTilesSpawned); + } + + Map toMap() { + return BoardTilesSpawnedMapper.ensureInitialized() + .encodeMap(this as BoardTilesSpawned); + } + + BoardTilesSpawnedCopyWith< + BoardTilesSpawned, + BoardTilesSpawned, + BoardTilesSpawned + > + get copyWith => + _BoardTilesSpawnedCopyWithImpl( + this as BoardTilesSpawned, + $identity, + $identity, + ); + @override + String toString() { + return BoardTilesSpawnedMapper.ensureInitialized().stringifyValue( + this as BoardTilesSpawned, + ); + } + + @override + bool operator ==(Object other) { + return BoardTilesSpawnedMapper.ensureInitialized().equalsValue( + this as BoardTilesSpawned, + other, + ); + } + + @override + int get hashCode { + return BoardTilesSpawnedMapper.ensureInitialized().hashValue( + this as BoardTilesSpawned, + ); + } +} + +/// @nodoc +extension BoardTilesSpawnedValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardTilesSpawned, $Out> { + BoardTilesSpawnedCopyWith<$R, BoardTilesSpawned, $Out> + get $asBoardTilesSpawned => $base.as( + (v, t, t2) => _BoardTilesSpawnedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BoardTilesSpawnedCopyWith< + $R, + $In extends BoardTilesSpawned, + $Out +> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get tiles; + @override + $R call({String? table, Map>? tiles}); + BoardTilesSpawnedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardTilesSpawnedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardTilesSpawned, $Out> + implements BoardTilesSpawnedCopyWith<$R, BoardTilesSpawned, $Out> { + _BoardTilesSpawnedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardTilesSpawnedMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get tiles => MapCopyWith( + $value.tiles, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(tiles: v), + ); + @override + $R call({String? table, Map>? tiles}) => + $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (tiles != null) #tiles: tiles, + }), + ); + @override + BoardTilesSpawned $make(CopyWithData data) => BoardTilesSpawned( + data.get(#table, or: $value.table), + data.get(#tiles, or: $value.tiles), + ); + + @override + BoardTilesSpawnedCopyWith<$R2, BoardTilesSpawned, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardTilesSpawnedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardTilesChangedMapper extends SubClassMapperBase { + BoardTilesChangedMapper._(); + + static BoardTilesChangedMapper? _instance; + static BoardTilesChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardTilesChangedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + BoardTileMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardTilesChanged'; + + static String _$table(BoardTilesChanged v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + ); + static Map> _$tiles(BoardTilesChanged v) => + v.tiles; + static const Field>> + _f$tiles = Field('tiles', _$tiles, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #table: _f$table, + #tiles: _f$tiles, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'BoardTilesChanged'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static BoardTilesChanged _instantiate(DecodingData data) { + return BoardTilesChanged(data.dec(_f$table), data.dec(_f$tiles)); + } + + @override + final Function instantiate = _instantiate; + + static BoardTilesChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardTilesChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardTilesChangedMappable { + String toJson() { + return BoardTilesChangedMapper.ensureInitialized() + .encodeJson(this as BoardTilesChanged); + } + + Map toMap() { + return BoardTilesChangedMapper.ensureInitialized() + .encodeMap(this as BoardTilesChanged); + } + + BoardTilesChangedCopyWith< + BoardTilesChanged, + BoardTilesChanged, + BoardTilesChanged + > + get copyWith => + _BoardTilesChangedCopyWithImpl( + this as BoardTilesChanged, + $identity, + $identity, + ); + @override + String toString() { + return BoardTilesChangedMapper.ensureInitialized().stringifyValue( + this as BoardTilesChanged, + ); + } + + @override + bool operator ==(Object other) { + return BoardTilesChangedMapper.ensureInitialized().equalsValue( + this as BoardTilesChanged, + other, + ); + } + + @override + int get hashCode { + return BoardTilesChangedMapper.ensureInitialized().hashValue( + this as BoardTilesChanged, + ); + } +} + +/// @nodoc +extension BoardTilesChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardTilesChanged, $Out> { + BoardTilesChangedCopyWith<$R, BoardTilesChanged, $Out> + get $asBoardTilesChanged => $base.as( + (v, t, t2) => _BoardTilesChangedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BoardTilesChangedCopyWith< + $R, + $In extends BoardTilesChanged, + $Out +> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get tiles; + @override + $R call({String? table, Map>? tiles}); + BoardTilesChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardTilesChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardTilesChanged, $Out> + implements BoardTilesChangedCopyWith<$R, BoardTilesChanged, $Out> { + _BoardTilesChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardTilesChangedMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get tiles => MapCopyWith( + $value.tiles, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(tiles: v), + ); + @override + $R call({String? table, Map>? tiles}) => + $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (tiles != null) #tiles: tiles, + }), + ); + @override + BoardTilesChanged $make(CopyWithData data) => BoardTilesChanged( + data.get(#table, or: $value.table), + data.get(#tiles, or: $value.tiles), + ); + + @override + BoardTilesChangedCopyWith<$R2, BoardTilesChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardTilesChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DialogOpenedMapper extends SubClassMapperBase { + DialogOpenedMapper._(); + + static DialogOpenedMapper? _instance; + static DialogOpenedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DialogOpenedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GameDialogMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'DialogOpened'; + + static GameDialog _$dialog(DialogOpened v) => v.dialog; + static const Field _f$dialog = Field( + 'dialog', + _$dialog, + ); + static bool _$closeOthers(DialogOpened v) => v.closeOthers; + static const Field _f$closeOthers = Field( + 'closeOthers', + _$closeOthers, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #dialog: _f$dialog, + #closeOthers: _f$closeOthers, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'DialogOpened'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static DialogOpened _instantiate(DecodingData data) { + return DialogOpened( + data.dec(_f$dialog), + closeOthers: data.dec(_f$closeOthers), + ); + } + + @override + final Function instantiate = _instantiate; + + static DialogOpened fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DialogOpened fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DialogOpenedMappable { + String toJson() { + return DialogOpenedMapper.ensureInitialized().encodeJson( + this as DialogOpened, + ); + } + + Map toMap() { + return DialogOpenedMapper.ensureInitialized().encodeMap( + this as DialogOpened, + ); + } + + DialogOpenedCopyWith get copyWith => + _DialogOpenedCopyWithImpl( + this as DialogOpened, + $identity, + $identity, + ); + @override + String toString() { + return DialogOpenedMapper.ensureInitialized().stringifyValue( + this as DialogOpened, + ); + } + + @override + bool operator ==(Object other) { + return DialogOpenedMapper.ensureInitialized().equalsValue( + this as DialogOpened, + other, + ); + } + + @override + int get hashCode { + return DialogOpenedMapper.ensureInitialized().hashValue( + this as DialogOpened, + ); + } +} + +/// @nodoc +extension DialogOpenedValueCopy<$R, $Out> + on ObjectCopyWith<$R, DialogOpened, $Out> { + DialogOpenedCopyWith<$R, DialogOpened, $Out> get $asDialogOpened => + $base.as((v, t, t2) => _DialogOpenedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class DialogOpenedCopyWith<$R, $In extends DialogOpened, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + GameDialogCopyWith<$R, GameDialog, GameDialog> get dialog; + @override + $R call({GameDialog? dialog, bool? closeOthers}); + DialogOpenedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _DialogOpenedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DialogOpened, $Out> + implements DialogOpenedCopyWith<$R, DialogOpened, $Out> { + _DialogOpenedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + DialogOpenedMapper.ensureInitialized(); + @override + GameDialogCopyWith<$R, GameDialog, GameDialog> get dialog => + $value.dialog.copyWith.$chain((v) => call(dialog: v)); + @override + $R call({GameDialog? dialog, bool? closeOthers}) => $apply( + FieldCopyWithData({ + if (dialog != null) #dialog: dialog, + if (closeOthers != null) #closeOthers: closeOthers, + }), + ); + @override + DialogOpened $make(CopyWithData data) => DialogOpened( + data.get(#dialog, or: $value.dialog), + closeOthers: data.get(#closeOthers, or: $value.closeOthers), + ); + + @override + DialogOpenedCopyWith<$R2, DialogOpened, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _DialogOpenedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DialogsClosedMapper extends SubClassMapperBase { + DialogsClosedMapper._(); + + static DialogsClosedMapper? _instance; + static DialogsClosedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DialogsClosedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'DialogsClosed'; + + static List? _$ids(DialogsClosed v) => v.ids; + static const Field> _f$ids = Field('ids', _$ids); + + @override + final MappableFields fields = const {#ids: _f$ids}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'DialogsClosed'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static DialogsClosed _instantiate(DecodingData data) { + return DialogsClosed(data.dec(_f$ids)); + } + + @override + final Function instantiate = _instantiate; + + static DialogsClosed fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DialogsClosed fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DialogsClosedMappable { + String toJson() { + return DialogsClosedMapper.ensureInitialized().encodeJson( + this as DialogsClosed, + ); + } + + Map toMap() { + return DialogsClosedMapper.ensureInitialized().encodeMap( + this as DialogsClosed, + ); + } + + DialogsClosedCopyWith + get copyWith => _DialogsClosedCopyWithImpl( + this as DialogsClosed, + $identity, + $identity, + ); + @override + String toString() { + return DialogsClosedMapper.ensureInitialized().stringifyValue( + this as DialogsClosed, + ); + } + + @override + bool operator ==(Object other) { + return DialogsClosedMapper.ensureInitialized().equalsValue( + this as DialogsClosed, + other, + ); + } + + @override + int get hashCode { + return DialogsClosedMapper.ensureInitialized().hashValue( + this as DialogsClosed, + ); + } +} + +/// @nodoc +extension DialogsClosedValueCopy<$R, $Out> + on ObjectCopyWith<$R, DialogsClosed, $Out> { + DialogsClosedCopyWith<$R, DialogsClosed, $Out> get $asDialogsClosed => + $base.as((v, t, t2) => _DialogsClosedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class DialogsClosedCopyWith<$R, $In extends DialogsClosed, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>>? get ids; + @override + $R call({List? ids}); + DialogsClosedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _DialogsClosedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DialogsClosed, $Out> + implements DialogsClosedCopyWith<$R, DialogsClosed, $Out> { + _DialogsClosedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + DialogsClosedMapper.ensureInitialized(); + @override + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>>? get ids => + $value.ids != null + ? ListCopyWith( + $value.ids!, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(ids: v), + ) + : null; + @override + $R call({Object? ids = $none}) => + $apply(FieldCopyWithData({if (ids != $none) #ids: ids})); + @override + DialogsClosed $make(CopyWithData data) => + DialogsClosed(data.get(#ids, or: $value.ids)); + + @override + DialogsClosedCopyWith<$R2, DialogsClosed, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _DialogsClosedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ImagesUpdatedMapper extends SubClassMapperBase { + ImagesUpdatedMapper._(); + + static ImagesUpdatedMapper? _instance; + static ImagesUpdatedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ImagesUpdatedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + MapperContainer.globals.useAll([Base64IdMapHook()]); + } + return _instance!; + } + + @override + final String id = 'ImagesUpdated'; + + static Map _$images(ImagesUpdated v) => v.images; + static const Field> _f$images = Field( + 'images', + _$images, + ); + + @override + final MappableFields fields = const {#images: _f$images}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ImagesUpdated'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static ImagesUpdated _instantiate(DecodingData data) { + return ImagesUpdated(data.dec(_f$images)); + } + + @override + final Function instantiate = _instantiate; + + static ImagesUpdated fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ImagesUpdated fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ImagesUpdatedMappable { + String toJson() { + return ImagesUpdatedMapper.ensureInitialized().encodeJson( + this as ImagesUpdated, + ); + } + + Map toMap() { + return ImagesUpdatedMapper.ensureInitialized().encodeMap( + this as ImagesUpdated, + ); + } + + ImagesUpdatedCopyWith + get copyWith => _ImagesUpdatedCopyWithImpl( + this as ImagesUpdated, + $identity, + $identity, + ); + @override + String toString() { + return ImagesUpdatedMapper.ensureInitialized().stringifyValue( + this as ImagesUpdated, + ); + } + + @override + bool operator ==(Object other) { + return ImagesUpdatedMapper.ensureInitialized().equalsValue( + this as ImagesUpdated, + other, + ); + } + + @override + int get hashCode { + return ImagesUpdatedMapper.ensureInitialized().hashValue( + this as ImagesUpdated, + ); + } +} + +/// @nodoc +extension ImagesUpdatedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ImagesUpdated, $Out> { + ImagesUpdatedCopyWith<$R, ImagesUpdated, $Out> get $asImagesUpdated => + $base.as((v, t, t2) => _ImagesUpdatedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ImagesUpdatedCopyWith<$R, $In extends ImagesUpdated, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> + get images; + @override + $R call({Map? images}); + ImagesUpdatedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _ImagesUpdatedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ImagesUpdated, $Out> + implements ImagesUpdatedCopyWith<$R, ImagesUpdated, $Out> { + _ImagesUpdatedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ImagesUpdatedMapper.ensureInitialized(); + @override + MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> + get images => MapCopyWith( + $value.images, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(images: v), + ); + @override + $R call({Map? images}) => + $apply(FieldCopyWithData({if (images != null) #images: images})); + @override + ImagesUpdated $make(CopyWithData data) => + ImagesUpdated(data.get(#images, or: $value.images)); + + @override + ImagesUpdatedCopyWith<$R2, ImagesUpdated, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ImagesUpdatedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ServerStateUpdatedMapper extends SubClassMapperBase { + ServerStateUpdatedMapper._(); + + static ServerStateUpdatedMapper? _instance; + static ServerStateUpdatedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ServerStateUpdatedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + ServerStateMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ServerStateUpdated'; + + static ServerState _$state(ServerStateUpdated v) => v.state; + static const Field _f$state = Field( + 'state', + _$state, + ); + + @override + final MappableFields fields = const {#state: _f$state}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ServerStateUpdated'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static ServerStateUpdated _instantiate(DecodingData data) { + return ServerStateUpdated(data.dec(_f$state)); + } + + @override + final Function instantiate = _instantiate; + + static ServerStateUpdated fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ServerStateUpdated fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ServerStateUpdatedMappable { + String toJson() { + return ServerStateUpdatedMapper.ensureInitialized() + .encodeJson(this as ServerStateUpdated); + } + + Map toMap() { + return ServerStateUpdatedMapper.ensureInitialized() + .encodeMap(this as ServerStateUpdated); + } + + ServerStateUpdatedCopyWith< + ServerStateUpdated, + ServerStateUpdated, + ServerStateUpdated + > + get copyWith => + _ServerStateUpdatedCopyWithImpl( + this as ServerStateUpdated, + $identity, + $identity, + ); + @override + String toString() { + return ServerStateUpdatedMapper.ensureInitialized().stringifyValue( + this as ServerStateUpdated, + ); + } + + @override + bool operator ==(Object other) { + return ServerStateUpdatedMapper.ensureInitialized().equalsValue( + this as ServerStateUpdated, + other, + ); + } + + @override + int get hashCode { + return ServerStateUpdatedMapper.ensureInitialized().hashValue( + this as ServerStateUpdated, + ); + } +} + +/// @nodoc +extension ServerStateUpdatedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ServerStateUpdated, $Out> { + ServerStateUpdatedCopyWith<$R, ServerStateUpdated, $Out> + get $asServerStateUpdated => $base.as( + (v, t, t2) => _ServerStateUpdatedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class ServerStateUpdatedCopyWith< + $R, + $In extends ServerStateUpdated, + $Out +> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + ServerStateCopyWith<$R, ServerState, ServerState> get state; + @override + $R call({ServerState? state}); + ServerStateUpdatedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ServerStateUpdatedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ServerStateUpdated, $Out> + implements ServerStateUpdatedCopyWith<$R, ServerStateUpdated, $Out> { + _ServerStateUpdatedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ServerStateUpdatedMapper.ensureInitialized(); + @override + ServerStateCopyWith<$R, ServerState, ServerState> get state => + $value.state.copyWith.$chain((v) => call(state: v)); + @override + $R call({ServerState? state}) => + $apply(FieldCopyWithData({if (state != null) #state: state})); + @override + ServerStateUpdated $make(CopyWithData data) => + ServerStateUpdated(data.get(#state, or: $value.state)); + + @override + ServerStateUpdatedCopyWith<$R2, ServerStateUpdated, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ServerStateUpdatedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class AuthenticatedRequestedMapper + extends SubClassMapperBase { + AuthenticatedRequestedMapper._(); + + static AuthenticatedRequestedMapper? _instance; + static AuthenticatedRequestedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = AuthenticatedRequestedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + MapperContainer.globals.useAll([Base64Uint8ListHook()]); + } + return _instance!; + } + + @override + final String id = 'AuthenticatedRequested'; + + static Uint8List _$challenge(AuthenticatedRequested v) => v.challenge; + static const Field _f$challenge = Field( + 'challenge', + _$challenge, + ); + static bool _$isRequired(AuthenticatedRequested v) => v.isRequired; + static const Field _f$isRequired = Field( + 'isRequired', + _$isRequired, + opt: true, + def: true, + ); + + @override + final MappableFields fields = const { + #challenge: _f$challenge, + #isRequired: _f$isRequired, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'AuthenticatedRequested'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static AuthenticatedRequested _instantiate(DecodingData data) { + return AuthenticatedRequested( + data.dec(_f$challenge), + isRequired: data.dec(_f$isRequired), + ); + } + + @override + final Function instantiate = _instantiate; + + static AuthenticatedRequested fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static AuthenticatedRequested fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin AuthenticatedRequestedMappable { + String toJson() { + return AuthenticatedRequestedMapper.ensureInitialized() + .encodeJson(this as AuthenticatedRequested); + } + + Map toMap() { + return AuthenticatedRequestedMapper.ensureInitialized() + .encodeMap(this as AuthenticatedRequested); + } + + AuthenticatedRequestedCopyWith< + AuthenticatedRequested, + AuthenticatedRequested, + AuthenticatedRequested + > + get copyWith => + _AuthenticatedRequestedCopyWithImpl< + AuthenticatedRequested, + AuthenticatedRequested + >(this as AuthenticatedRequested, $identity, $identity); + @override + String toString() { + return AuthenticatedRequestedMapper.ensureInitialized().stringifyValue( + this as AuthenticatedRequested, + ); + } + + @override + bool operator ==(Object other) { + return AuthenticatedRequestedMapper.ensureInitialized().equalsValue( + this as AuthenticatedRequested, + other, + ); + } + + @override + int get hashCode { + return AuthenticatedRequestedMapper.ensureInitialized().hashValue( + this as AuthenticatedRequested, + ); + } +} + +/// @nodoc +extension AuthenticatedRequestedValueCopy<$R, $Out> + on ObjectCopyWith<$R, AuthenticatedRequested, $Out> { + AuthenticatedRequestedCopyWith<$R, AuthenticatedRequested, $Out> + get $asAuthenticatedRequested => $base.as( + (v, t, t2) => _AuthenticatedRequestedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class AuthenticatedRequestedCopyWith< + $R, + $In extends AuthenticatedRequested, + $Out +> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({Uint8List? challenge, bool? isRequired}); + AuthenticatedRequestedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _AuthenticatedRequestedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, AuthenticatedRequested, $Out> + implements + AuthenticatedRequestedCopyWith<$R, AuthenticatedRequested, $Out> { + _AuthenticatedRequestedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + AuthenticatedRequestedMapper.ensureInitialized(); + @override + $R call({Uint8List? challenge, bool? isRequired}) => $apply( + FieldCopyWithData({ + if (challenge != null) #challenge: challenge, + if (isRequired != null) #isRequired: isRequired, + }), + ); + @override + AuthenticatedRequested $make(CopyWithData data) => AuthenticatedRequested( + data.get(#challenge, or: $value.challenge), + isRequired: data.get(#isRequired, or: $value.isRequired), + ); + + @override + AuthenticatedRequestedCopyWith<$R2, AuthenticatedRequested, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _AuthenticatedRequestedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ToolbarUpdatedMapper extends SubClassMapperBase { + ToolbarUpdatedMapper._(); + + static ToolbarUpdatedMapper? _instance; + static ToolbarUpdatedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ToolbarUpdatedMapper._()); + ServerWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GameToolbarMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ToolbarUpdated'; + + static GameToolbar _$toolbar(ToolbarUpdated v) => v.toolbar; + static const Field _f$toolbar = Field( + 'toolbar', + _$toolbar, + ); + + @override + final MappableFields fields = const {#toolbar: _f$toolbar}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ToolbarUpdated'; + @override + late final ClassMapperBase superMapper = + ServerWorldEventMapper.ensureInitialized(); + + static ToolbarUpdated _instantiate(DecodingData data) { + return ToolbarUpdated(data.dec(_f$toolbar)); + } + + @override + final Function instantiate = _instantiate; + + static ToolbarUpdated fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ToolbarUpdated fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ToolbarUpdatedMappable { + String toJson() { + return ToolbarUpdatedMapper.ensureInitialized().encodeJson( + this as ToolbarUpdated, + ); + } + + Map toMap() { + return ToolbarUpdatedMapper.ensureInitialized().encodeMap( + this as ToolbarUpdated, + ); + } + + ToolbarUpdatedCopyWith + get copyWith => _ToolbarUpdatedCopyWithImpl( + this as ToolbarUpdated, + $identity, + $identity, + ); + @override + String toString() { + return ToolbarUpdatedMapper.ensureInitialized().stringifyValue( + this as ToolbarUpdated, + ); + } + + @override + bool operator ==(Object other) { + return ToolbarUpdatedMapper.ensureInitialized().equalsValue( + this as ToolbarUpdated, + other, + ); + } + + @override + int get hashCode { + return ToolbarUpdatedMapper.ensureInitialized().hashValue( + this as ToolbarUpdated, + ); + } +} + +/// @nodoc +extension ToolbarUpdatedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ToolbarUpdated, $Out> { + ToolbarUpdatedCopyWith<$R, ToolbarUpdated, $Out> get $asToolbarUpdated => + $base.as((v, t, t2) => _ToolbarUpdatedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ToolbarUpdatedCopyWith<$R, $In extends ToolbarUpdated, $Out> + implements ServerWorldEventCopyWith<$R, $In, $Out> { + GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar; + @override + $R call({GameToolbar? toolbar}); + ToolbarUpdatedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ToolbarUpdatedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ToolbarUpdated, $Out> + implements ToolbarUpdatedCopyWith<$R, ToolbarUpdated, $Out> { + _ToolbarUpdatedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ToolbarUpdatedMapper.ensureInitialized(); + @override + GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar => + $value.toolbar.copyWith.$chain((v) => call(toolbar: v)); + @override + $R call({GameToolbar? toolbar}) => + $apply(FieldCopyWithData({if (toolbar != null) #toolbar: toolbar})); + @override + ToolbarUpdated $make(CopyWithData data) => + ToolbarUpdated(data.get(#toolbar, or: $value.toolbar)); + + @override + ToolbarUpdatedCopyWith<$R2, ToolbarUpdated, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ToolbarUpdatedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ClientWorldEventMapper extends SubClassMapperBase { + ClientWorldEventMapper._(); + + static ClientWorldEventMapper? _instance; + static ClientWorldEventMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ClientWorldEventMapper._()); + WorldEventMapper.ensureInitialized().addSubMapper(_instance!); + TeamJoinRequestMapper.ensureInitialized(); + TeamLeaveRequestMapper.ensureInitialized(); + CellRollRequestMapper.ensureInitialized(); + ShuffleCellRequestMapper.ensureInitialized(); + PacksChangeRequestMapper.ensureInitialized(); + MessageRequestMapper.ensureInitialized(); + BoardsSpawnRequestMapper.ensureInitialized(); + BoardRemoveRequestMapper.ensureInitialized(); + BoardMoveRequestMapper.ensureInitialized(); + DialogCloseRequestMapper.ensureInitialized(); + ImagesRequestMapper.ensureInitialized(); + ModeChangeRequestMapper.ensureInitialized(); + AuthenticateRequestMapper.ensureInitialized(); + ToolbarActionRequestMapper.ensureInitialized(); + HybridWorldEventMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ClientWorldEvent'; + + @override + final MappableFields fields = const {}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ClientWorldEvent'; + @override + late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); + + static ClientWorldEvent _instantiate(DecodingData data) { + throw MapperException.missingSubclass( + 'ClientWorldEvent', + 'type', + '${data.value['type']}', + ); + } + + @override + final Function instantiate = _instantiate; + + static ClientWorldEvent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ClientWorldEvent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ClientWorldEventMappable { + String toJson(); + Map toMap(); + ClientWorldEventCopyWith + get copyWith; +} + +/// @nodoc +abstract class ClientWorldEventCopyWith<$R, $In extends ClientWorldEvent, $Out> + implements WorldEventCopyWith<$R, $In, $Out> { + @override + $R call(); + ClientWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class TeamJoinRequestMapper extends SubClassMapperBase { + TeamJoinRequestMapper._(); + + static TeamJoinRequestMapper? _instance; + static TeamJoinRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamJoinRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TeamJoinRequest'; + + static String _$team(TeamJoinRequest v) => v.team; + static const Field _f$team = Field('team', _$team); + + @override + final MappableFields fields = const {#team: _f$team}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TeamJoinRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static TeamJoinRequest _instantiate(DecodingData data) { + return TeamJoinRequest(data.dec(_f$team)); + } + + @override + final Function instantiate = _instantiate; + + static TeamJoinRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TeamJoinRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TeamJoinRequestMappable { + String toJson() { + return TeamJoinRequestMapper.ensureInitialized() + .encodeJson(this as TeamJoinRequest); + } + + Map toMap() { + return TeamJoinRequestMapper.ensureInitialized().encodeMap( + this as TeamJoinRequest, + ); + } + + TeamJoinRequestCopyWith + get copyWith => + _TeamJoinRequestCopyWithImpl( + this as TeamJoinRequest, + $identity, + $identity, + ); + @override + String toString() { + return TeamJoinRequestMapper.ensureInitialized().stringifyValue( + this as TeamJoinRequest, + ); + } + + @override + bool operator ==(Object other) { + return TeamJoinRequestMapper.ensureInitialized().equalsValue( + this as TeamJoinRequest, + other, + ); + } + + @override + int get hashCode { + return TeamJoinRequestMapper.ensureInitialized().hashValue( + this as TeamJoinRequest, + ); + } +} + +/// @nodoc +extension TeamJoinRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, TeamJoinRequest, $Out> { + TeamJoinRequestCopyWith<$R, TeamJoinRequest, $Out> get $asTeamJoinRequest => + $base.as((v, t, t2) => _TeamJoinRequestCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TeamJoinRequestCopyWith<$R, $In extends TeamJoinRequest, $Out> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? team}); + TeamJoinRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _TeamJoinRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TeamJoinRequest, $Out> + implements TeamJoinRequestCopyWith<$R, TeamJoinRequest, $Out> { + _TeamJoinRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TeamJoinRequestMapper.ensureInitialized(); + @override + $R call({String? team}) => + $apply(FieldCopyWithData({if (team != null) #team: team})); + @override + TeamJoinRequest $make(CopyWithData data) => + TeamJoinRequest(data.get(#team, or: $value.team)); + + @override + TeamJoinRequestCopyWith<$R2, TeamJoinRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TeamJoinRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TeamLeaveRequestMapper extends SubClassMapperBase { + TeamLeaveRequestMapper._(); + + static TeamLeaveRequestMapper? _instance; + static TeamLeaveRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamLeaveRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TeamLeaveRequest'; + + static String _$team(TeamLeaveRequest v) => v.team; + static const Field _f$team = Field('team', _$team); + + @override + final MappableFields fields = const {#team: _f$team}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TeamLeaveRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static TeamLeaveRequest _instantiate(DecodingData data) { + return TeamLeaveRequest(data.dec(_f$team)); + } + + @override + final Function instantiate = _instantiate; + + static TeamLeaveRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TeamLeaveRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TeamLeaveRequestMappable { + String toJson() { + return TeamLeaveRequestMapper.ensureInitialized() + .encodeJson(this as TeamLeaveRequest); + } + + Map toMap() { + return TeamLeaveRequestMapper.ensureInitialized() + .encodeMap(this as TeamLeaveRequest); + } + + TeamLeaveRequestCopyWith + get copyWith => + _TeamLeaveRequestCopyWithImpl( + this as TeamLeaveRequest, + $identity, + $identity, + ); + @override + String toString() { + return TeamLeaveRequestMapper.ensureInitialized().stringifyValue( + this as TeamLeaveRequest, + ); + } + + @override + bool operator ==(Object other) { + return TeamLeaveRequestMapper.ensureInitialized().equalsValue( + this as TeamLeaveRequest, + other, + ); + } + + @override + int get hashCode { + return TeamLeaveRequestMapper.ensureInitialized().hashValue( + this as TeamLeaveRequest, + ); + } +} + +/// @nodoc +extension TeamLeaveRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, TeamLeaveRequest, $Out> { + TeamLeaveRequestCopyWith<$R, TeamLeaveRequest, $Out> + get $asTeamLeaveRequest => + $base.as((v, t, t2) => _TeamLeaveRequestCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TeamLeaveRequestCopyWith<$R, $In extends TeamLeaveRequest, $Out> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? team}); + TeamLeaveRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _TeamLeaveRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TeamLeaveRequest, $Out> + implements TeamLeaveRequestCopyWith<$R, TeamLeaveRequest, $Out> { + _TeamLeaveRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TeamLeaveRequestMapper.ensureInitialized(); + @override + $R call({String? team}) => + $apply(FieldCopyWithData({if (team != null) #team: team})); + @override + TeamLeaveRequest $make(CopyWithData data) => + TeamLeaveRequest(data.get(#team, or: $value.team)); + + @override + TeamLeaveRequestCopyWith<$R2, TeamLeaveRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TeamLeaveRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class CellRollRequestMapper extends SubClassMapperBase { + CellRollRequestMapper._(); + + static CellRollRequestMapper? _instance; + static CellRollRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = CellRollRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'CellRollRequest'; + + static GlobalVectorDefinition _$cell(CellRollRequest v) => v.cell; + static const Field _f$cell = Field( + 'cell', + _$cell, + ); + static int? _$object(CellRollRequest v) => v.object; + static const Field _f$object = Field( + 'object', + _$object, + opt: true, + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #object: _f$object, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'CellRollRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static CellRollRequest _instantiate(DecodingData data) { + return CellRollRequest(data.dec(_f$cell), object: data.dec(_f$object)); + } + + @override + final Function instantiate = _instantiate; + + static CellRollRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static CellRollRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin CellRollRequestMappable { + String toJson() { + return CellRollRequestMapper.ensureInitialized() + .encodeJson(this as CellRollRequest); + } + + Map toMap() { + return CellRollRequestMapper.ensureInitialized().encodeMap( + this as CellRollRequest, + ); + } + + CellRollRequestCopyWith + get copyWith => + _CellRollRequestCopyWithImpl( + this as CellRollRequest, + $identity, + $identity, + ); + @override + String toString() { + return CellRollRequestMapper.ensureInitialized().stringifyValue( + this as CellRollRequest, + ); + } + + @override + bool operator ==(Object other) { + return CellRollRequestMapper.ensureInitialized().equalsValue( + this as CellRollRequest, + other, + ); + } + + @override + int get hashCode { + return CellRollRequestMapper.ensureInitialized().hashValue( + this as CellRollRequest, + ); + } +} + +/// @nodoc +extension CellRollRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, CellRollRequest, $Out> { + CellRollRequestCopyWith<$R, CellRollRequest, $Out> get $asCellRollRequest => + $base.as((v, t, t2) => _CellRollRequestCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class CellRollRequestCopyWith<$R, $In extends CellRollRequest, $Out> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + @override + $R call({GlobalVectorDefinition? cell, int? object}); + CellRollRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _CellRollRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, CellRollRequest, $Out> + implements CellRollRequestCopyWith<$R, CellRollRequest, $Out> { + _CellRollRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + CellRollRequestMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + $R call({GlobalVectorDefinition? cell, Object? object = $none}) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (object != $none) #object: object, + }), + ); + @override + CellRollRequest $make(CopyWithData data) => CellRollRequest( + data.get(#cell, or: $value.cell), + object: data.get(#object, or: $value.object), + ); + + @override + CellRollRequestCopyWith<$R2, CellRollRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _CellRollRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ShuffleCellRequestMapper extends SubClassMapperBase { + ShuffleCellRequestMapper._(); + + static ShuffleCellRequestMapper? _instance; + static ShuffleCellRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ShuffleCellRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ShuffleCellRequest'; + + static GlobalVectorDefinition _$cell(ShuffleCellRequest v) => v.cell; + static const Field _f$cell = + Field('cell', _$cell); + + @override + final MappableFields fields = const {#cell: _f$cell}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ShuffleCellRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static ShuffleCellRequest _instantiate(DecodingData data) { + return ShuffleCellRequest(data.dec(_f$cell)); + } + + @override + final Function instantiate = _instantiate; + + static ShuffleCellRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ShuffleCellRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ShuffleCellRequestMappable { + String toJson() { + return ShuffleCellRequestMapper.ensureInitialized() + .encodeJson(this as ShuffleCellRequest); + } + + Map toMap() { + return ShuffleCellRequestMapper.ensureInitialized() + .encodeMap(this as ShuffleCellRequest); + } + + ShuffleCellRequestCopyWith< + ShuffleCellRequest, + ShuffleCellRequest, + ShuffleCellRequest + > + get copyWith => + _ShuffleCellRequestCopyWithImpl( + this as ShuffleCellRequest, + $identity, + $identity, + ); + @override + String toString() { + return ShuffleCellRequestMapper.ensureInitialized().stringifyValue( + this as ShuffleCellRequest, + ); + } + + @override + bool operator ==(Object other) { + return ShuffleCellRequestMapper.ensureInitialized().equalsValue( + this as ShuffleCellRequest, + other, + ); + } + + @override + int get hashCode { + return ShuffleCellRequestMapper.ensureInitialized().hashValue( + this as ShuffleCellRequest, + ); + } +} + +/// @nodoc +extension ShuffleCellRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, ShuffleCellRequest, $Out> { + ShuffleCellRequestCopyWith<$R, ShuffleCellRequest, $Out> + get $asShuffleCellRequest => $base.as( + (v, t, t2) => _ShuffleCellRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class ShuffleCellRequestCopyWith< + $R, + $In extends ShuffleCellRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + @override + $R call({GlobalVectorDefinition? cell}); + ShuffleCellRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ShuffleCellRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ShuffleCellRequest, $Out> + implements ShuffleCellRequestCopyWith<$R, ShuffleCellRequest, $Out> { + _ShuffleCellRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ShuffleCellRequestMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + $R call({GlobalVectorDefinition? cell}) => + $apply(FieldCopyWithData({if (cell != null) #cell: cell})); + @override + ShuffleCellRequest $make(CopyWithData data) => + ShuffleCellRequest(data.get(#cell, or: $value.cell)); + + @override + ShuffleCellRequestCopyWith<$R2, ShuffleCellRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ShuffleCellRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class PacksChangeRequestMapper extends SubClassMapperBase { + PacksChangeRequestMapper._(); + + static PacksChangeRequestMapper? _instance; + static PacksChangeRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = PacksChangeRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'PacksChangeRequest'; + + static List _$packs(PacksChangeRequest v) => v.packs; + static const Field> _f$packs = Field( + 'packs', + _$packs, + ); + + @override + final MappableFields fields = const {#packs: _f$packs}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'PacksChangeRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static PacksChangeRequest _instantiate(DecodingData data) { + return PacksChangeRequest(data.dec(_f$packs)); + } + + @override + final Function instantiate = _instantiate; + + static PacksChangeRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static PacksChangeRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin PacksChangeRequestMappable { + String toJson() { + return PacksChangeRequestMapper.ensureInitialized() + .encodeJson(this as PacksChangeRequest); + } + + Map toMap() { + return PacksChangeRequestMapper.ensureInitialized() + .encodeMap(this as PacksChangeRequest); + } + + PacksChangeRequestCopyWith< + PacksChangeRequest, + PacksChangeRequest, + PacksChangeRequest + > + get copyWith => + _PacksChangeRequestCopyWithImpl( + this as PacksChangeRequest, + $identity, + $identity, + ); + @override + String toString() { + return PacksChangeRequestMapper.ensureInitialized().stringifyValue( + this as PacksChangeRequest, + ); + } + + @override + bool operator ==(Object other) { + return PacksChangeRequestMapper.ensureInitialized().equalsValue( + this as PacksChangeRequest, + other, + ); + } + + @override + int get hashCode { + return PacksChangeRequestMapper.ensureInitialized().hashValue( + this as PacksChangeRequest, + ); + } +} + +/// @nodoc +extension PacksChangeRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, PacksChangeRequest, $Out> { + PacksChangeRequestCopyWith<$R, PacksChangeRequest, $Out> + get $asPacksChangeRequest => $base.as( + (v, t, t2) => _PacksChangeRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class PacksChangeRequestCopyWith< + $R, + $In extends PacksChangeRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs; + @override + $R call({List? packs}); + PacksChangeRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _PacksChangeRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, PacksChangeRequest, $Out> + implements PacksChangeRequestCopyWith<$R, PacksChangeRequest, $Out> { + _PacksChangeRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + PacksChangeRequestMapper.ensureInitialized(); + @override + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs => + ListCopyWith( + $value.packs, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(packs: v), + ); + @override + $R call({List? packs}) => + $apply(FieldCopyWithData({if (packs != null) #packs: packs})); + @override + PacksChangeRequest $make(CopyWithData data) => + PacksChangeRequest(data.get(#packs, or: $value.packs)); + + @override + PacksChangeRequestCopyWith<$R2, PacksChangeRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _PacksChangeRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class MessageRequestMapper extends SubClassMapperBase { + MessageRequestMapper._(); + + static MessageRequestMapper? _instance; + static MessageRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = MessageRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'MessageRequest'; + + static String _$message(MessageRequest v) => v.message; + static const Field _f$message = Field( + 'message', + _$message, + ); + + @override + final MappableFields fields = const {#message: _f$message}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'MessageRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static MessageRequest _instantiate(DecodingData data) { + return MessageRequest(data.dec(_f$message)); + } + + @override + final Function instantiate = _instantiate; + + static MessageRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static MessageRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin MessageRequestMappable { + String toJson() { + return MessageRequestMapper.ensureInitialized().encodeJson( + this as MessageRequest, + ); + } + + Map toMap() { + return MessageRequestMapper.ensureInitialized().encodeMap( + this as MessageRequest, + ); + } + + MessageRequestCopyWith + get copyWith => _MessageRequestCopyWithImpl( + this as MessageRequest, + $identity, + $identity, + ); + @override + String toString() { + return MessageRequestMapper.ensureInitialized().stringifyValue( + this as MessageRequest, + ); + } + + @override + bool operator ==(Object other) { + return MessageRequestMapper.ensureInitialized().equalsValue( + this as MessageRequest, + other, + ); + } + + @override + int get hashCode { + return MessageRequestMapper.ensureInitialized().hashValue( + this as MessageRequest, + ); + } +} + +/// @nodoc +extension MessageRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, MessageRequest, $Out> { + MessageRequestCopyWith<$R, MessageRequest, $Out> get $asMessageRequest => + $base.as((v, t, t2) => _MessageRequestCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class MessageRequestCopyWith<$R, $In extends MessageRequest, $Out> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? message}); + MessageRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _MessageRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, MessageRequest, $Out> + implements MessageRequestCopyWith<$R, MessageRequest, $Out> { + _MessageRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + MessageRequestMapper.ensureInitialized(); + @override + $R call({String? message}) => + $apply(FieldCopyWithData({if (message != null) #message: message})); + @override + MessageRequest $make(CopyWithData data) => + MessageRequest(data.get(#message, or: $value.message)); + + @override + MessageRequestCopyWith<$R2, MessageRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _MessageRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardsSpawnRequestMapper extends SubClassMapperBase { + BoardsSpawnRequestMapper._(); + + static BoardsSpawnRequestMapper? _instance; + static BoardsSpawnRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardsSpawnRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + ItemLocationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardsSpawnRequest'; + + static String _$table(BoardsSpawnRequest v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + ); + static Map> _$assets( + BoardsSpawnRequest v, + ) => v.assets; + static const Field< + BoardsSpawnRequest, + Map> + > + _f$assets = Field('assets', _$assets, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #table: _f$table, + #assets: _f$assets, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'BoardsSpawnRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static BoardsSpawnRequest _instantiate(DecodingData data) { + return BoardsSpawnRequest(data.dec(_f$table), data.dec(_f$assets)); + } + + @override + final Function instantiate = _instantiate; + + static BoardsSpawnRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardsSpawnRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardsSpawnRequestMappable { + String toJson() { + return BoardsSpawnRequestMapper.ensureInitialized() + .encodeJson(this as BoardsSpawnRequest); + } + + Map toMap() { + return BoardsSpawnRequestMapper.ensureInitialized() + .encodeMap(this as BoardsSpawnRequest); + } + + BoardsSpawnRequestCopyWith< + BoardsSpawnRequest, + BoardsSpawnRequest, + BoardsSpawnRequest + > + get copyWith => + _BoardsSpawnRequestCopyWithImpl( + this as BoardsSpawnRequest, + $identity, + $identity, + ); + @override + String toString() { + return BoardsSpawnRequestMapper.ensureInitialized().stringifyValue( + this as BoardsSpawnRequest, + ); + } + + @override + bool operator ==(Object other) { + return BoardsSpawnRequestMapper.ensureInitialized().equalsValue( + this as BoardsSpawnRequest, + other, + ); + } + + @override + int get hashCode { + return BoardsSpawnRequestMapper.ensureInitialized().hashValue( + this as BoardsSpawnRequest, + ); + } +} + +/// @nodoc +extension BoardsSpawnRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardsSpawnRequest, $Out> { + BoardsSpawnRequestCopyWith<$R, BoardsSpawnRequest, $Out> + get $asBoardsSpawnRequest => $base.as( + (v, t, t2) => _BoardsSpawnRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BoardsSpawnRequestCopyWith< + $R, + $In extends BoardsSpawnRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get assets; + @override + $R call({String? table, Map>? assets}); + BoardsSpawnRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardsSpawnRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardsSpawnRequest, $Out> + implements BoardsSpawnRequestCopyWith<$R, BoardsSpawnRequest, $Out> { + _BoardsSpawnRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardsSpawnRequestMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get assets => MapCopyWith( + $value.assets, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(assets: v), + ); + @override + $R call({String? table, Map>? assets}) => + $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (assets != null) #assets: assets, + }), + ); + @override + BoardsSpawnRequest $make(CopyWithData data) => BoardsSpawnRequest( + data.get(#table, or: $value.table), + data.get(#assets, or: $value.assets), + ); + + @override + BoardsSpawnRequestCopyWith<$R2, BoardsSpawnRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardsSpawnRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardRemoveRequestMapper extends SubClassMapperBase { + BoardRemoveRequestMapper._(); + + static BoardRemoveRequestMapper? _instance; + static BoardRemoveRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardRemoveRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardRemoveRequest'; + + static GlobalVectorDefinition _$position(BoardRemoveRequest v) => v.position; + static const Field _f$position = + Field('position', _$position); + static int _$index(BoardRemoveRequest v) => v.index; + static const Field _f$index = Field( + 'index', + _$index, + ); + + @override + final MappableFields fields = const { + #position: _f$position, + #index: _f$index, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'BoardRemoveRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static BoardRemoveRequest _instantiate(DecodingData data) { + return BoardRemoveRequest(data.dec(_f$position), data.dec(_f$index)); + } + + @override + final Function instantiate = _instantiate; + + static BoardRemoveRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardRemoveRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardRemoveRequestMappable { + String toJson() { + return BoardRemoveRequestMapper.ensureInitialized() + .encodeJson(this as BoardRemoveRequest); + } + + Map toMap() { + return BoardRemoveRequestMapper.ensureInitialized() + .encodeMap(this as BoardRemoveRequest); + } + + BoardRemoveRequestCopyWith< + BoardRemoveRequest, + BoardRemoveRequest, + BoardRemoveRequest + > + get copyWith => + _BoardRemoveRequestCopyWithImpl( + this as BoardRemoveRequest, + $identity, + $identity, + ); + @override + String toString() { + return BoardRemoveRequestMapper.ensureInitialized().stringifyValue( + this as BoardRemoveRequest, + ); + } + + @override + bool operator ==(Object other) { + return BoardRemoveRequestMapper.ensureInitialized().equalsValue( + this as BoardRemoveRequest, + other, + ); + } + + @override + int get hashCode { + return BoardRemoveRequestMapper.ensureInitialized().hashValue( + this as BoardRemoveRequest, + ); + } +} + +/// @nodoc +extension BoardRemoveRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardRemoveRequest, $Out> { + BoardRemoveRequestCopyWith<$R, BoardRemoveRequest, $Out> + get $asBoardRemoveRequest => $base.as( + (v, t, t2) => _BoardRemoveRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BoardRemoveRequestCopyWith< + $R, + $In extends BoardRemoveRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get position; + @override + $R call({GlobalVectorDefinition? position, int? index}); + BoardRemoveRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardRemoveRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardRemoveRequest, $Out> + implements BoardRemoveRequestCopyWith<$R, BoardRemoveRequest, $Out> { + _BoardRemoveRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardRemoveRequestMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get position => $value.position.copyWith.$chain((v) => call(position: v)); + @override + $R call({GlobalVectorDefinition? position, int? index}) => $apply( + FieldCopyWithData({ + if (position != null) #position: position, + if (index != null) #index: index, + }), + ); + @override + BoardRemoveRequest $make(CopyWithData data) => BoardRemoveRequest( + data.get(#position, or: $value.position), + data.get(#index, or: $value.index), + ); + + @override + BoardRemoveRequestCopyWith<$R2, BoardRemoveRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardRemoveRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardMoveRequestMapper extends SubClassMapperBase { + BoardMoveRequestMapper._(); + + static BoardMoveRequestMapper? _instance; + static BoardMoveRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardMoveRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardMoveRequest'; + + static String _$table(BoardMoveRequest v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + ); + static VectorDefinition _$from(BoardMoveRequest v) => v.from; + static const Field _f$from = Field( + 'from', + _$from, + ); + static VectorDefinition _$to(BoardMoveRequest v) => v.to; + static const Field _f$to = Field( + 'to', + _$to, + ); + static int _$index(BoardMoveRequest v) => v.index; + static const Field _f$index = Field('index', _$index); + + @override + final MappableFields fields = const { + #table: _f$table, + #from: _f$from, + #to: _f$to, + #index: _f$index, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'BoardMoveRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static BoardMoveRequest _instantiate(DecodingData data) { + return BoardMoveRequest( + data.dec(_f$table), + data.dec(_f$from), + data.dec(_f$to), + data.dec(_f$index), + ); + } + + @override + final Function instantiate = _instantiate; + + static BoardMoveRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardMoveRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardMoveRequestMappable { + String toJson() { + return BoardMoveRequestMapper.ensureInitialized() + .encodeJson(this as BoardMoveRequest); + } + + Map toMap() { + return BoardMoveRequestMapper.ensureInitialized() + .encodeMap(this as BoardMoveRequest); + } + + BoardMoveRequestCopyWith + get copyWith => + _BoardMoveRequestCopyWithImpl( + this as BoardMoveRequest, + $identity, + $identity, + ); + @override + String toString() { + return BoardMoveRequestMapper.ensureInitialized().stringifyValue( + this as BoardMoveRequest, + ); + } + + @override + bool operator ==(Object other) { + return BoardMoveRequestMapper.ensureInitialized().equalsValue( + this as BoardMoveRequest, + other, + ); + } + + @override + int get hashCode { + return BoardMoveRequestMapper.ensureInitialized().hashValue( + this as BoardMoveRequest, + ); + } +} + +/// @nodoc +extension BoardMoveRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardMoveRequest, $Out> { + BoardMoveRequestCopyWith<$R, BoardMoveRequest, $Out> + get $asBoardMoveRequest => + $base.as((v, t, t2) => _BoardMoveRequestCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class BoardMoveRequestCopyWith<$R, $In extends BoardMoveRequest, $Out> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from; + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to; + @override + $R call({ + String? table, + VectorDefinition? from, + VectorDefinition? to, + int? index, + }); + BoardMoveRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardMoveRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardMoveRequest, $Out> + implements BoardMoveRequestCopyWith<$R, BoardMoveRequest, $Out> { + _BoardMoveRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardMoveRequestMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from => + $value.from.copyWith.$chain((v) => call(from: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to => + $value.to.copyWith.$chain((v) => call(to: v)); + @override + $R call({ + String? table, + VectorDefinition? from, + VectorDefinition? to, + int? index, + }) => $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (from != null) #from: from, + if (to != null) #to: to, + if (index != null) #index: index, + }), + ); + @override + BoardMoveRequest $make(CopyWithData data) => BoardMoveRequest( + data.get(#table, or: $value.table), + data.get(#from, or: $value.from), + data.get(#to, or: $value.to), + data.get(#index, or: $value.index), + ); + + @override + BoardMoveRequestCopyWith<$R2, BoardMoveRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardMoveRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DialogCloseRequestMapper extends SubClassMapperBase { + DialogCloseRequestMapper._(); + + static DialogCloseRequestMapper? _instance; + static DialogCloseRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DialogCloseRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GameDialogValueMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'DialogCloseRequest'; + + static String _$id(DialogCloseRequest v) => v.id; + static const Field _f$id = Field('id', _$id); + static GameDialogValue? _$value(DialogCloseRequest v) => v.value; + static const Field _f$value = Field( + 'value', + _$value, + ); + + @override + final MappableFields fields = const { + #id: _f$id, + #value: _f$value, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'DialogCloseRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static DialogCloseRequest _instantiate(DecodingData data) { + return DialogCloseRequest(data.dec(_f$id), data.dec(_f$value)); + } + + @override + final Function instantiate = _instantiate; + + static DialogCloseRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DialogCloseRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DialogCloseRequestMappable { + String toJson() { + return DialogCloseRequestMapper.ensureInitialized() + .encodeJson(this as DialogCloseRequest); + } + + Map toMap() { + return DialogCloseRequestMapper.ensureInitialized() + .encodeMap(this as DialogCloseRequest); + } + + DialogCloseRequestCopyWith< + DialogCloseRequest, + DialogCloseRequest, + DialogCloseRequest + > + get copyWith => + _DialogCloseRequestCopyWithImpl( + this as DialogCloseRequest, + $identity, + $identity, + ); + @override + String toString() { + return DialogCloseRequestMapper.ensureInitialized().stringifyValue( + this as DialogCloseRequest, + ); + } + + @override + bool operator ==(Object other) { + return DialogCloseRequestMapper.ensureInitialized().equalsValue( + this as DialogCloseRequest, + other, + ); + } + + @override + int get hashCode { + return DialogCloseRequestMapper.ensureInitialized().hashValue( + this as DialogCloseRequest, + ); + } +} + +/// @nodoc +extension DialogCloseRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, DialogCloseRequest, $Out> { + DialogCloseRequestCopyWith<$R, DialogCloseRequest, $Out> + get $asDialogCloseRequest => $base.as( + (v, t, t2) => _DialogCloseRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class DialogCloseRequestCopyWith< + $R, + $In extends DialogCloseRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + GameDialogValueCopyWith<$R, GameDialogValue, GameDialogValue>? get value; + @override + $R call({String? id, GameDialogValue? value}); + DialogCloseRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _DialogCloseRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DialogCloseRequest, $Out> + implements DialogCloseRequestCopyWith<$R, DialogCloseRequest, $Out> { + _DialogCloseRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + DialogCloseRequestMapper.ensureInitialized(); + @override + GameDialogValueCopyWith<$R, GameDialogValue, GameDialogValue>? get value => + $value.value?.copyWith.$chain((v) => call(value: v)); + @override + $R call({String? id, Object? value = $none}) => $apply( + FieldCopyWithData({ + if (id != null) #id: id, + if (value != $none) #value: value, + }), + ); + @override + DialogCloseRequest $make(CopyWithData data) => DialogCloseRequest( + data.get(#id, or: $value.id), + data.get(#value, or: $value.value), + ); + + @override + DialogCloseRequestCopyWith<$R2, DialogCloseRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _DialogCloseRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ImagesRequestMapper extends SubClassMapperBase { + ImagesRequestMapper._(); + + static ImagesRequestMapper? _instance; + static ImagesRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ImagesRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'ImagesRequest'; + + static List _$ids(ImagesRequest v) => v.ids; + static const Field> _f$ids = Field('ids', _$ids); + + @override + final MappableFields fields = const {#ids: _f$ids}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ImagesRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static ImagesRequest _instantiate(DecodingData data) { + return ImagesRequest(data.dec(_f$ids)); + } + + @override + final Function instantiate = _instantiate; + + static ImagesRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ImagesRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ImagesRequestMappable { + String toJson() { + return ImagesRequestMapper.ensureInitialized().encodeJson( + this as ImagesRequest, + ); + } + + Map toMap() { + return ImagesRequestMapper.ensureInitialized().encodeMap( + this as ImagesRequest, + ); + } + + ImagesRequestCopyWith + get copyWith => _ImagesRequestCopyWithImpl( + this as ImagesRequest, + $identity, + $identity, + ); + @override + String toString() { + return ImagesRequestMapper.ensureInitialized().stringifyValue( + this as ImagesRequest, + ); + } + + @override + bool operator ==(Object other) { + return ImagesRequestMapper.ensureInitialized().equalsValue( + this as ImagesRequest, + other, + ); + } + + @override + int get hashCode { + return ImagesRequestMapper.ensureInitialized().hashValue( + this as ImagesRequest, + ); + } +} + +/// @nodoc +extension ImagesRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, ImagesRequest, $Out> { + ImagesRequestCopyWith<$R, ImagesRequest, $Out> get $asImagesRequest => + $base.as((v, t, t2) => _ImagesRequestCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ImagesRequestCopyWith<$R, $In extends ImagesRequest, $Out> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get ids; + @override + $R call({List? ids}); + ImagesRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _ImagesRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ImagesRequest, $Out> + implements ImagesRequestCopyWith<$R, ImagesRequest, $Out> { + _ImagesRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ImagesRequestMapper.ensureInitialized(); + @override + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get ids => + ListCopyWith( + $value.ids, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(ids: v), + ); + @override + $R call({List? ids}) => + $apply(FieldCopyWithData({if (ids != null) #ids: ids})); + @override + ImagesRequest $make(CopyWithData data) => + ImagesRequest(data.get(#ids, or: $value.ids)); + + @override + ImagesRequestCopyWith<$R2, ImagesRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ImagesRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ModeChangeRequestMapper extends SubClassMapperBase { + ModeChangeRequestMapper._(); + + static ModeChangeRequestMapper? _instance; + static ModeChangeRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ModeChangeRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + ItemLocationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ModeChangeRequest'; + + static ItemLocation? _$location(ModeChangeRequest v) => v.location; + static const Field _f$location = Field( + 'location', + _$location, + ); + + @override + final MappableFields fields = const { + #location: _f$location, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ModeChangeRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static ModeChangeRequest _instantiate(DecodingData data) { + return ModeChangeRequest(data.dec(_f$location)); + } + + @override + final Function instantiate = _instantiate; + + static ModeChangeRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ModeChangeRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ModeChangeRequestMappable { + String toJson() { + return ModeChangeRequestMapper.ensureInitialized() + .encodeJson(this as ModeChangeRequest); + } + + Map toMap() { + return ModeChangeRequestMapper.ensureInitialized() + .encodeMap(this as ModeChangeRequest); + } + + ModeChangeRequestCopyWith< + ModeChangeRequest, + ModeChangeRequest, + ModeChangeRequest + > + get copyWith => + _ModeChangeRequestCopyWithImpl( + this as ModeChangeRequest, + $identity, + $identity, + ); + @override + String toString() { + return ModeChangeRequestMapper.ensureInitialized().stringifyValue( + this as ModeChangeRequest, + ); + } + + @override + bool operator ==(Object other) { + return ModeChangeRequestMapper.ensureInitialized().equalsValue( + this as ModeChangeRequest, + other, + ); + } + + @override + int get hashCode { + return ModeChangeRequestMapper.ensureInitialized().hashValue( + this as ModeChangeRequest, + ); + } +} + +/// @nodoc +extension ModeChangeRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, ModeChangeRequest, $Out> { + ModeChangeRequestCopyWith<$R, ModeChangeRequest, $Out> + get $asModeChangeRequest => $base.as( + (v, t, t2) => _ModeChangeRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class ModeChangeRequestCopyWith< + $R, + $In extends ModeChangeRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get location; + @override + $R call({ItemLocation? location}); + ModeChangeRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ModeChangeRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ModeChangeRequest, $Out> + implements ModeChangeRequestCopyWith<$R, ModeChangeRequest, $Out> { + _ModeChangeRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ModeChangeRequestMapper.ensureInitialized(); + @override + ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get location => + $value.location?.copyWith.$chain((v) => call(location: v)); + @override + $R call({Object? location = $none}) => + $apply(FieldCopyWithData({if (location != $none) #location: location})); + @override + ModeChangeRequest $make(CopyWithData data) => + ModeChangeRequest(data.get(#location, or: $value.location)); + + @override + ModeChangeRequestCopyWith<$R2, ModeChangeRequest, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ModeChangeRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class AuthenticateRequestMapper + extends SubClassMapperBase { + AuthenticateRequestMapper._(); + + static AuthenticateRequestMapper? _instance; + static AuthenticateRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = AuthenticateRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + MapperContainer.globals.useAll([Base64Uint8ListHook()]); + } + return _instance!; + } + + @override + final String id = 'AuthenticateRequest'; + + static Uint8List _$signature(AuthenticateRequest v) => v.signature; + static const Field _f$signature = Field( + 'signature', + _$signature, + ); + static Uint8List _$publicKey(AuthenticateRequest v) => v.publicKey; + static const Field _f$publicKey = Field( + 'publicKey', + _$publicKey, + ); + + @override + final MappableFields fields = const { + #signature: _f$signature, + #publicKey: _f$publicKey, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'AuthenticateRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static AuthenticateRequest _instantiate(DecodingData data) { + return AuthenticateRequest(data.dec(_f$signature), data.dec(_f$publicKey)); + } + + @override + final Function instantiate = _instantiate; + + static AuthenticateRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static AuthenticateRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin AuthenticateRequestMappable { + String toJson() { + return AuthenticateRequestMapper.ensureInitialized() + .encodeJson(this as AuthenticateRequest); + } + + Map toMap() { + return AuthenticateRequestMapper.ensureInitialized() + .encodeMap(this as AuthenticateRequest); + } + + AuthenticateRequestCopyWith< + AuthenticateRequest, + AuthenticateRequest, + AuthenticateRequest + > + get copyWith => + _AuthenticateRequestCopyWithImpl< + AuthenticateRequest, + AuthenticateRequest + >(this as AuthenticateRequest, $identity, $identity); + @override + String toString() { + return AuthenticateRequestMapper.ensureInitialized().stringifyValue( + this as AuthenticateRequest, + ); + } + + @override + bool operator ==(Object other) { + return AuthenticateRequestMapper.ensureInitialized().equalsValue( + this as AuthenticateRequest, + other, + ); + } + + @override + int get hashCode { + return AuthenticateRequestMapper.ensureInitialized().hashValue( + this as AuthenticateRequest, + ); + } +} + +/// @nodoc +extension AuthenticateRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, AuthenticateRequest, $Out> { + AuthenticateRequestCopyWith<$R, AuthenticateRequest, $Out> + get $asAuthenticateRequest => $base.as( + (v, t, t2) => _AuthenticateRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class AuthenticateRequestCopyWith< + $R, + $In extends AuthenticateRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({Uint8List? signature, Uint8List? publicKey}); + AuthenticateRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _AuthenticateRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, AuthenticateRequest, $Out> + implements AuthenticateRequestCopyWith<$R, AuthenticateRequest, $Out> { + _AuthenticateRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + AuthenticateRequestMapper.ensureInitialized(); + @override + $R call({Uint8List? signature, Uint8List? publicKey}) => $apply( + FieldCopyWithData({ + if (signature != null) #signature: signature, + if (publicKey != null) #publicKey: publicKey, + }), + ); + @override + AuthenticateRequest $make(CopyWithData data) => AuthenticateRequest( + data.get(#signature, or: $value.signature), + data.get(#publicKey, or: $value.publicKey), + ); + + @override + AuthenticateRequestCopyWith<$R2, AuthenticateRequest, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _AuthenticateRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ToolbarActionRequestMapper + extends SubClassMapperBase { + ToolbarActionRequestMapper._(); + + static ToolbarActionRequestMapper? _instance; + static ToolbarActionRequestMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ToolbarActionRequestMapper._()); + ClientWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'ToolbarActionRequest'; + + static String _$actionId(ToolbarActionRequest v) => v.actionId; + static const Field _f$actionId = Field( + 'actionId', + _$actionId, + ); + + @override + final MappableFields fields = const { + #actionId: _f$actionId, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ToolbarActionRequest'; + @override + late final ClassMapperBase superMapper = + ClientWorldEventMapper.ensureInitialized(); + + static ToolbarActionRequest _instantiate(DecodingData data) { + return ToolbarActionRequest(data.dec(_f$actionId)); + } + + @override + final Function instantiate = _instantiate; + + static ToolbarActionRequest fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ToolbarActionRequest fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ToolbarActionRequestMappable { + String toJson() { + return ToolbarActionRequestMapper.ensureInitialized() + .encodeJson(this as ToolbarActionRequest); + } + + Map toMap() { + return ToolbarActionRequestMapper.ensureInitialized() + .encodeMap(this as ToolbarActionRequest); + } + + ToolbarActionRequestCopyWith< + ToolbarActionRequest, + ToolbarActionRequest, + ToolbarActionRequest + > + get copyWith => + _ToolbarActionRequestCopyWithImpl< + ToolbarActionRequest, + ToolbarActionRequest + >(this as ToolbarActionRequest, $identity, $identity); + @override + String toString() { + return ToolbarActionRequestMapper.ensureInitialized().stringifyValue( + this as ToolbarActionRequest, + ); + } + + @override + bool operator ==(Object other) { + return ToolbarActionRequestMapper.ensureInitialized().equalsValue( + this as ToolbarActionRequest, + other, + ); + } + + @override + int get hashCode { + return ToolbarActionRequestMapper.ensureInitialized().hashValue( + this as ToolbarActionRequest, + ); + } +} + +/// @nodoc +extension ToolbarActionRequestValueCopy<$R, $Out> + on ObjectCopyWith<$R, ToolbarActionRequest, $Out> { + ToolbarActionRequestCopyWith<$R, ToolbarActionRequest, $Out> + get $asToolbarActionRequest => $base.as( + (v, t, t2) => _ToolbarActionRequestCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class ToolbarActionRequestCopyWith< + $R, + $In extends ToolbarActionRequest, + $Out +> + implements ClientWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? actionId}); + ToolbarActionRequestCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ToolbarActionRequestCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ToolbarActionRequest, $Out> + implements ToolbarActionRequestCopyWith<$R, ToolbarActionRequest, $Out> { + _ToolbarActionRequestCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ToolbarActionRequestMapper.ensureInitialized(); + @override + $R call({String? actionId}) => + $apply(FieldCopyWithData({if (actionId != null) #actionId: actionId})); + @override + ToolbarActionRequest $make(CopyWithData data) => + ToolbarActionRequest(data.get(#actionId, or: $value.actionId)); + + @override + ToolbarActionRequestCopyWith<$R2, ToolbarActionRequest, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _ToolbarActionRequestCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class HybridWorldEventMapper extends SubClassMapperBase { + HybridWorldEventMapper._(); + + static HybridWorldEventMapper? _instance; + static HybridWorldEventMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = HybridWorldEventMapper._()); + WorldEventMapper.ensureInitialized().addSubMapper(_instance!); + CellSwitchedMapper.ensureInitialized(); + BackgroundChangedMapper.ensureInitialized(); + ObjectsSpawnedMapper.ensureInitialized(); + ObjectsMovedMapper.ensureInitialized(); + CellHideChangedMapper.ensureInitialized(); + ObjectIndexChangedMapper.ensureInitialized(); + TeamChangedMapper.ensureInitialized(); + TeamRemovedMapper.ensureInitialized(); + CellMergeStrategyChangedMapper.ensureInitialized(); + MetadataChangedMapper.ensureInitialized(); + ObjectsRemovedMapper.ensureInitialized(); + TableRenamedMapper.ensureInitialized(); + TableRemovedMapper.ensureInitialized(); + NoteChangedMapper.ensureInitialized(); + NoteRemovedMapper.ensureInitialized(); + WaypointChangedMapper.ensureInitialized(); + WaypointRemovedMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'HybridWorldEvent'; + + @override + final MappableFields fields = const {}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'HybridWorldEvent'; + @override + late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); + + static HybridWorldEvent _instantiate(DecodingData data) { + throw MapperException.missingSubclass( + 'HybridWorldEvent', + 'type', + '${data.value['type']}', + ); + } + + @override + final Function instantiate = _instantiate; + + static HybridWorldEvent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static HybridWorldEvent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin HybridWorldEventMappable { + String toJson(); + Map toMap(); + HybridWorldEventCopyWith + get copyWith; +} + +/// @nodoc +abstract class HybridWorldEventCopyWith<$R, $In extends HybridWorldEvent, $Out> + implements + WorldEventCopyWith<$R, $In, $Out>, + ClientWorldEventCopyWith<$R, $In, $Out>, + ServerWorldEventCopyWith<$R, $In, $Out> { + @override + $R call(); + HybridWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class CellSwitchedMapper extends SubClassMapperBase { + CellSwitchedMapper._(); + + static CellSwitchedMapper? _instance; + static CellSwitchedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = CellSwitchedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'CellSwitched'; + + static VectorDefinition? _$cell(CellSwitched v) => v.cell; + static const Field _f$cell = Field( + 'cell', + _$cell, + ); + static bool _$selected(CellSwitched v) => v.selected; + static const Field _f$selected = Field( + 'selected', + _$selected, + opt: true, + def: true, + ); + static bool _$teleport(CellSwitched v) => v.teleport; + static const Field _f$teleport = Field( + 'teleport', + _$teleport, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #selected: _f$selected, + #teleport: _f$teleport, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'CellSwitched'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static CellSwitched _instantiate(DecodingData data) { + return CellSwitched( + data.dec(_f$cell), + selected: data.dec(_f$selected), + teleport: data.dec(_f$teleport), + ); + } + + @override + final Function instantiate = _instantiate; + + static CellSwitched fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static CellSwitched fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin CellSwitchedMappable { + String toJson() { + return CellSwitchedMapper.ensureInitialized().encodeJson( + this as CellSwitched, + ); + } + + Map toMap() { + return CellSwitchedMapper.ensureInitialized().encodeMap( + this as CellSwitched, + ); + } + + CellSwitchedCopyWith get copyWith => + _CellSwitchedCopyWithImpl( + this as CellSwitched, + $identity, + $identity, + ); + @override + String toString() { + return CellSwitchedMapper.ensureInitialized().stringifyValue( + this as CellSwitched, + ); + } + + @override + bool operator ==(Object other) { + return CellSwitchedMapper.ensureInitialized().equalsValue( + this as CellSwitched, + other, + ); + } + + @override + int get hashCode { + return CellSwitchedMapper.ensureInitialized().hashValue( + this as CellSwitched, + ); + } +} + +/// @nodoc +extension CellSwitchedValueCopy<$R, $Out> + on ObjectCopyWith<$R, CellSwitched, $Out> { + CellSwitchedCopyWith<$R, CellSwitched, $Out> get $asCellSwitched => + $base.as((v, t, t2) => _CellSwitchedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class CellSwitchedCopyWith<$R, $In extends CellSwitched, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get cell; + @override + $R call({VectorDefinition? cell, bool? selected, bool? teleport}); + CellSwitchedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _CellSwitchedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, CellSwitched, $Out> + implements CellSwitchedCopyWith<$R, CellSwitched, $Out> { + _CellSwitchedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + CellSwitchedMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get cell => + $value.cell?.copyWith.$chain((v) => call(cell: v)); + @override + $R call({Object? cell = $none, bool? selected, bool? teleport}) => $apply( + FieldCopyWithData({ + if (cell != $none) #cell: cell, + if (selected != null) #selected: selected, + if (teleport != null) #teleport: teleport, + }), + ); + @override + CellSwitched $make(CopyWithData data) => CellSwitched( + data.get(#cell, or: $value.cell), + selected: data.get(#selected, or: $value.selected), + teleport: data.get(#teleport, or: $value.teleport), + ); + + @override + CellSwitchedCopyWith<$R2, CellSwitched, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _CellSwitchedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BackgroundChangedMapper extends SubClassMapperBase { + BackgroundChangedMapper._(); + + static BackgroundChangedMapper? _instance; + static BackgroundChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BackgroundChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + ItemLocationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BackgroundChanged'; + + static ItemLocation _$background(BackgroundChanged v) => v.background; + static const Field _f$background = Field( + 'background', + _$background, + ); + + @override + final MappableFields fields = const { + #background: _f$background, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'BackgroundChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static BackgroundChanged _instantiate(DecodingData data) { + return BackgroundChanged(data.dec(_f$background)); + } + + @override + final Function instantiate = _instantiate; + + static BackgroundChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BackgroundChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BackgroundChangedMappable { + String toJson() { + return BackgroundChangedMapper.ensureInitialized() + .encodeJson(this as BackgroundChanged); + } + + Map toMap() { + return BackgroundChangedMapper.ensureInitialized() + .encodeMap(this as BackgroundChanged); + } + + BackgroundChangedCopyWith< + BackgroundChanged, + BackgroundChanged, + BackgroundChanged + > + get copyWith => + _BackgroundChangedCopyWithImpl( + this as BackgroundChanged, + $identity, + $identity, + ); + @override + String toString() { + return BackgroundChangedMapper.ensureInitialized().stringifyValue( + this as BackgroundChanged, + ); + } + + @override + bool operator ==(Object other) { + return BackgroundChangedMapper.ensureInitialized().equalsValue( + this as BackgroundChanged, + other, + ); + } + + @override + int get hashCode { + return BackgroundChangedMapper.ensureInitialized().hashValue( + this as BackgroundChanged, + ); + } +} + +/// @nodoc +extension BackgroundChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, BackgroundChanged, $Out> { + BackgroundChangedCopyWith<$R, BackgroundChanged, $Out> + get $asBackgroundChanged => $base.as( + (v, t, t2) => _BackgroundChangedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BackgroundChangedCopyWith< + $R, + $In extends BackgroundChanged, + $Out +> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get background; + @override + $R call({ItemLocation? background}); + BackgroundChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BackgroundChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BackgroundChanged, $Out> + implements BackgroundChangedCopyWith<$R, BackgroundChanged, $Out> { + _BackgroundChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BackgroundChangedMapper.ensureInitialized(); + @override + ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get background => + $value.background.copyWith.$chain((v) => call(background: v)); + @override + $R call({ItemLocation? background}) => $apply( + FieldCopyWithData({if (background != null) #background: background}), + ); + @override + BackgroundChanged $make(CopyWithData data) => + BackgroundChanged(data.get(#background, or: $value.background)); + + @override + BackgroundChangedCopyWith<$R2, BackgroundChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BackgroundChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ObjectsSpawnedMapper extends SubClassMapperBase { + ObjectsSpawnedMapper._(); + + static ObjectsSpawnedMapper? _instance; + static ObjectsSpawnedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ObjectsSpawnedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + GameObjectMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ObjectsSpawned'; + + static String _$table(ObjectsSpawned v) => v.table; + static const Field _f$table = Field('table', _$table); + static Map> _$objects(ObjectsSpawned v) => + v.objects; + static const Field>> + _f$objects = Field('objects', _$objects, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #table: _f$table, + #objects: _f$objects, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ObjectsSpawned'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static ObjectsSpawned _instantiate(DecodingData data) { + return ObjectsSpawned(data.dec(_f$table), data.dec(_f$objects)); + } + + @override + final Function instantiate = _instantiate; + + static ObjectsSpawned fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ObjectsSpawned fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ObjectsSpawnedMappable { + String toJson() { + return ObjectsSpawnedMapper.ensureInitialized().encodeJson( + this as ObjectsSpawned, + ); + } + + Map toMap() { + return ObjectsSpawnedMapper.ensureInitialized().encodeMap( + this as ObjectsSpawned, + ); + } + + ObjectsSpawnedCopyWith + get copyWith => _ObjectsSpawnedCopyWithImpl( + this as ObjectsSpawned, + $identity, + $identity, + ); + @override + String toString() { + return ObjectsSpawnedMapper.ensureInitialized().stringifyValue( + this as ObjectsSpawned, + ); + } + + @override + bool operator ==(Object other) { + return ObjectsSpawnedMapper.ensureInitialized().equalsValue( + this as ObjectsSpawned, + other, + ); + } + + @override + int get hashCode { + return ObjectsSpawnedMapper.ensureInitialized().hashValue( + this as ObjectsSpawned, + ); + } +} + +/// @nodoc +extension ObjectsSpawnedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ObjectsSpawned, $Out> { + ObjectsSpawnedCopyWith<$R, ObjectsSpawned, $Out> get $asObjectsSpawned => + $base.as((v, t, t2) => _ObjectsSpawnedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ObjectsSpawnedCopyWith<$R, $In extends ObjectsSpawned, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get objects; + @override + $R call({String? table, Map>? objects}); + ObjectsSpawnedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ObjectsSpawnedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ObjectsSpawned, $Out> + implements ObjectsSpawnedCopyWith<$R, ObjectsSpawned, $Out> { + _ObjectsSpawnedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ObjectsSpawnedMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + VectorDefinition, + List, + ObjectCopyWith<$R, List, List> + > + get objects => MapCopyWith( + $value.objects, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(objects: v), + ); + @override + $R call({String? table, Map>? objects}) => + $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (objects != null) #objects: objects, + }), + ); + @override + ObjectsSpawned $make(CopyWithData data) => ObjectsSpawned( + data.get(#table, or: $value.table), + data.get(#objects, or: $value.objects), + ); + + @override + ObjectsSpawnedCopyWith<$R2, ObjectsSpawned, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ObjectsSpawnedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ObjectsMovedMapper extends SubClassMapperBase { + ObjectsMovedMapper._(); + + static ObjectsMovedMapper? _instance; + static ObjectsMovedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ObjectsMovedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ObjectsMoved'; + + static String _$table(ObjectsMoved v) => v.table; + static const Field _f$table = Field('table', _$table); + static List _$objects(ObjectsMoved v) => v.objects; + static const Field> _f$objects = Field( + 'objects', + _$objects, + ); + static VectorDefinition _$from(ObjectsMoved v) => v.from; + static const Field _f$from = Field( + 'from', + _$from, + ); + static VectorDefinition _$to(ObjectsMoved v) => v.to; + static const Field _f$to = Field('to', _$to); + + @override + final MappableFields fields = const { + #table: _f$table, + #objects: _f$objects, + #from: _f$from, + #to: _f$to, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ObjectsMoved'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static ObjectsMoved _instantiate(DecodingData data) { + return ObjectsMoved( + data.dec(_f$table), + data.dec(_f$objects), + data.dec(_f$from), + data.dec(_f$to), + ); + } + + @override + final Function instantiate = _instantiate; + + static ObjectsMoved fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ObjectsMoved fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ObjectsMovedMappable { + String toJson() { + return ObjectsMovedMapper.ensureInitialized().encodeJson( + this as ObjectsMoved, + ); + } + + Map toMap() { + return ObjectsMovedMapper.ensureInitialized().encodeMap( + this as ObjectsMoved, + ); + } + + ObjectsMovedCopyWith get copyWith => + _ObjectsMovedCopyWithImpl( + this as ObjectsMoved, + $identity, + $identity, + ); + @override + String toString() { + return ObjectsMovedMapper.ensureInitialized().stringifyValue( + this as ObjectsMoved, + ); + } + + @override + bool operator ==(Object other) { + return ObjectsMovedMapper.ensureInitialized().equalsValue( + this as ObjectsMoved, + other, + ); + } + + @override + int get hashCode { + return ObjectsMovedMapper.ensureInitialized().hashValue( + this as ObjectsMoved, + ); + } +} + +/// @nodoc +extension ObjectsMovedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ObjectsMoved, $Out> { + ObjectsMovedCopyWith<$R, ObjectsMoved, $Out> get $asObjectsMoved => + $base.as((v, t, t2) => _ObjectsMovedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ObjectsMovedCopyWith<$R, $In extends ObjectsMoved, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get objects; + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from; + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to; + @override + $R call({ + String? table, + List? objects, + VectorDefinition? from, + VectorDefinition? to, + }); + ObjectsMovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _ObjectsMovedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ObjectsMoved, $Out> + implements ObjectsMovedCopyWith<$R, ObjectsMoved, $Out> { + _ObjectsMovedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ObjectsMovedMapper.ensureInitialized(); + @override + ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>> get objects => + ListCopyWith( + $value.objects, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(objects: v), + ); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get from => + $value.from.copyWith.$chain((v) => call(from: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get to => + $value.to.copyWith.$chain((v) => call(to: v)); + @override + $R call({ + String? table, + List? objects, + VectorDefinition? from, + VectorDefinition? to, + }) => $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (objects != null) #objects: objects, + if (from != null) #from: from, + if (to != null) #to: to, + }), + ); + @override + ObjectsMoved $make(CopyWithData data) => ObjectsMoved( + data.get(#table, or: $value.table), + data.get(#objects, or: $value.objects), + data.get(#from, or: $value.from), + data.get(#to, or: $value.to), + ); + + @override + ObjectsMovedCopyWith<$R2, ObjectsMoved, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ObjectsMovedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class CellHideChangedMapper extends SubClassMapperBase { + CellHideChangedMapper._(); + + static CellHideChangedMapper? _instance; + static CellHideChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = CellHideChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'CellHideChanged'; + + static GlobalVectorDefinition _$cell(CellHideChanged v) => v.cell; + static const Field _f$cell = Field( + 'cell', + _$cell, + ); + static int? _$object(CellHideChanged v) => v.object; + static const Field _f$object = Field( + 'object', + _$object, + opt: true, + ); + static bool? _$hide(CellHideChanged v) => v.hide; + static const Field _f$hide = Field( + 'hide', + _$hide, + opt: true, + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #object: _f$object, + #hide: _f$hide, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'CellHideChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static CellHideChanged _instantiate(DecodingData data) { + return CellHideChanged( + data.dec(_f$cell), + object: data.dec(_f$object), + hide: data.dec(_f$hide), + ); + } + + @override + final Function instantiate = _instantiate; + + static CellHideChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static CellHideChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin CellHideChangedMappable { + String toJson() { + return CellHideChangedMapper.ensureInitialized() + .encodeJson(this as CellHideChanged); + } + + Map toMap() { + return CellHideChangedMapper.ensureInitialized().encodeMap( + this as CellHideChanged, + ); + } + + CellHideChangedCopyWith + get copyWith => + _CellHideChangedCopyWithImpl( + this as CellHideChanged, + $identity, + $identity, + ); + @override + String toString() { + return CellHideChangedMapper.ensureInitialized().stringifyValue( + this as CellHideChanged, + ); + } + + @override + bool operator ==(Object other) { + return CellHideChangedMapper.ensureInitialized().equalsValue( + this as CellHideChanged, + other, + ); + } + + @override + int get hashCode { + return CellHideChangedMapper.ensureInitialized().hashValue( + this as CellHideChanged, + ); + } +} + +/// @nodoc +extension CellHideChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, CellHideChanged, $Out> { + CellHideChangedCopyWith<$R, CellHideChanged, $Out> get $asCellHideChanged => + $base.as((v, t, t2) => _CellHideChangedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class CellHideChangedCopyWith<$R, $In extends CellHideChanged, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + @override + $R call({GlobalVectorDefinition? cell, int? object, bool? hide}); + CellHideChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _CellHideChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, CellHideChanged, $Out> + implements CellHideChangedCopyWith<$R, CellHideChanged, $Out> { + _CellHideChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + CellHideChangedMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + $R call({ + GlobalVectorDefinition? cell, + Object? object = $none, + Object? hide = $none, + }) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (object != $none) #object: object, + if (hide != $none) #hide: hide, + }), + ); + @override + CellHideChanged $make(CopyWithData data) => CellHideChanged( + data.get(#cell, or: $value.cell), + object: data.get(#object, or: $value.object), + hide: data.get(#hide, or: $value.hide), + ); + + @override + CellHideChangedCopyWith<$R2, CellHideChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _CellHideChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ObjectIndexChangedMapper extends SubClassMapperBase { + ObjectIndexChangedMapper._(); + + static ObjectIndexChangedMapper? _instance; + static ObjectIndexChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ObjectIndexChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ObjectIndexChanged'; + + static GlobalVectorDefinition _$cell(ObjectIndexChanged v) => v.cell; + static const Field _f$cell = + Field('cell', _$cell); + static int _$object(ObjectIndexChanged v) => v.object; + static const Field _f$object = Field( + 'object', + _$object, + ); + static int _$index(ObjectIndexChanged v) => v.index; + static const Field _f$index = Field( + 'index', + _$index, + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #object: _f$object, + #index: _f$index, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ObjectIndexChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static ObjectIndexChanged _instantiate(DecodingData data) { + return ObjectIndexChanged( + data.dec(_f$cell), + data.dec(_f$object), + data.dec(_f$index), + ); + } + + @override + final Function instantiate = _instantiate; + + static ObjectIndexChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ObjectIndexChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ObjectIndexChangedMappable { + String toJson() { + return ObjectIndexChangedMapper.ensureInitialized() + .encodeJson(this as ObjectIndexChanged); + } + + Map toMap() { + return ObjectIndexChangedMapper.ensureInitialized() + .encodeMap(this as ObjectIndexChanged); + } + + ObjectIndexChangedCopyWith< + ObjectIndexChanged, + ObjectIndexChanged, + ObjectIndexChanged + > + get copyWith => + _ObjectIndexChangedCopyWithImpl( + this as ObjectIndexChanged, + $identity, + $identity, + ); + @override + String toString() { + return ObjectIndexChangedMapper.ensureInitialized().stringifyValue( + this as ObjectIndexChanged, + ); + } + + @override + bool operator ==(Object other) { + return ObjectIndexChangedMapper.ensureInitialized().equalsValue( + this as ObjectIndexChanged, + other, + ); + } + + @override + int get hashCode { + return ObjectIndexChangedMapper.ensureInitialized().hashValue( + this as ObjectIndexChanged, + ); + } +} + +/// @nodoc +extension ObjectIndexChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ObjectIndexChanged, $Out> { + ObjectIndexChangedCopyWith<$R, ObjectIndexChanged, $Out> + get $asObjectIndexChanged => $base.as( + (v, t, t2) => _ObjectIndexChangedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class ObjectIndexChangedCopyWith< + $R, + $In extends ObjectIndexChanged, + $Out +> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + @override + $R call({GlobalVectorDefinition? cell, int? object, int? index}); + ObjectIndexChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ObjectIndexChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ObjectIndexChanged, $Out> + implements ObjectIndexChangedCopyWith<$R, ObjectIndexChanged, $Out> { + _ObjectIndexChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ObjectIndexChangedMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + $R call({GlobalVectorDefinition? cell, int? object, int? index}) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (object != null) #object: object, + if (index != null) #index: index, + }), + ); + @override + ObjectIndexChanged $make(CopyWithData data) => ObjectIndexChanged( + data.get(#cell, or: $value.cell), + data.get(#object, or: $value.object), + data.get(#index, or: $value.index), + ); + + @override + ObjectIndexChangedCopyWith<$R2, ObjectIndexChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ObjectIndexChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TeamChangedMapper extends SubClassMapperBase { + TeamChangedMapper._(); + + static TeamChangedMapper? _instance; + static TeamChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GameTeamMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'TeamChanged'; + + static String _$name(TeamChanged v) => v.name; + static const Field _f$name = Field('name', _$name); + static String? _$newName(TeamChanged v) => v.newName; + static const Field _f$newName = Field( + 'newName', + _$newName, + ); + static GameTeam _$team(TeamChanged v) => v.team; + static const Field _f$team = Field('team', _$team); + + @override + final MappableFields fields = const { + #name: _f$name, + #newName: _f$newName, + #team: _f$team, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TeamChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static TeamChanged _instantiate(DecodingData data) { + return TeamChanged.rename( + data.dec(_f$name), + data.dec(_f$newName), + data.dec(_f$team), + ); + } + + @override + final Function instantiate = _instantiate; + + static TeamChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TeamChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TeamChangedMappable { + String toJson() { + return TeamChangedMapper.ensureInitialized().encodeJson( + this as TeamChanged, + ); + } + + Map toMap() { + return TeamChangedMapper.ensureInitialized().encodeMap( + this as TeamChanged, + ); + } + + TeamChangedCopyWith get copyWith => + _TeamChangedCopyWithImpl( + this as TeamChanged, + $identity, + $identity, + ); + @override + String toString() { + return TeamChangedMapper.ensureInitialized().stringifyValue( + this as TeamChanged, + ); + } + + @override + bool operator ==(Object other) { + return TeamChangedMapper.ensureInitialized().equalsValue( + this as TeamChanged, + other, + ); + } + + @override + int get hashCode { + return TeamChangedMapper.ensureInitialized().hashValue(this as TeamChanged); + } +} + +/// @nodoc +extension TeamChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, TeamChanged, $Out> { + TeamChangedCopyWith<$R, TeamChanged, $Out> get $asTeamChanged => + $base.as((v, t, t2) => _TeamChangedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TeamChangedCopyWith<$R, $In extends TeamChanged, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + GameTeamCopyWith<$R, GameTeam, GameTeam> get team; + @override + $R call({String? name, String? newName, GameTeam? team}); + TeamChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TeamChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TeamChanged, $Out> + implements TeamChangedCopyWith<$R, TeamChanged, $Out> { + _TeamChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TeamChangedMapper.ensureInitialized(); + @override + GameTeamCopyWith<$R, GameTeam, GameTeam> get team => + $value.team.copyWith.$chain((v) => call(team: v)); + @override + $R call({String? name, Object? newName = $none, GameTeam? team}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (newName != $none) #newName: newName, + if (team != null) #team: team, + }), + ); + @override + TeamChanged $make(CopyWithData data) => TeamChanged.rename( + data.get(#name, or: $value.name), + data.get(#newName, or: $value.newName), + data.get(#team, or: $value.team), + ); + + @override + TeamChangedCopyWith<$R2, TeamChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TeamChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TeamRemovedMapper extends SubClassMapperBase { + TeamRemovedMapper._(); + + static TeamRemovedMapper? _instance; + static TeamRemovedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamRemovedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TeamRemoved'; + + static String _$team(TeamRemoved v) => v.team; + static const Field _f$team = Field('team', _$team); + + @override + final MappableFields fields = const {#team: _f$team}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TeamRemoved'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static TeamRemoved _instantiate(DecodingData data) { + return TeamRemoved(data.dec(_f$team)); + } + + @override + final Function instantiate = _instantiate; + + static TeamRemoved fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TeamRemoved fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TeamRemovedMappable { + String toJson() { + return TeamRemovedMapper.ensureInitialized().encodeJson( + this as TeamRemoved, + ); + } + + Map toMap() { + return TeamRemovedMapper.ensureInitialized().encodeMap( + this as TeamRemoved, + ); + } + + TeamRemovedCopyWith get copyWith => + _TeamRemovedCopyWithImpl( + this as TeamRemoved, + $identity, + $identity, + ); + @override + String toString() { + return TeamRemovedMapper.ensureInitialized().stringifyValue( + this as TeamRemoved, + ); + } + + @override + bool operator ==(Object other) { + return TeamRemovedMapper.ensureInitialized().equalsValue( + this as TeamRemoved, + other, + ); + } + + @override + int get hashCode { + return TeamRemovedMapper.ensureInitialized().hashValue(this as TeamRemoved); + } +} + +/// @nodoc +extension TeamRemovedValueCopy<$R, $Out> + on ObjectCopyWith<$R, TeamRemoved, $Out> { + TeamRemovedCopyWith<$R, TeamRemoved, $Out> get $asTeamRemoved => + $base.as((v, t, t2) => _TeamRemovedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TeamRemovedCopyWith<$R, $In extends TeamRemoved, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? team}); + TeamRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TeamRemovedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TeamRemoved, $Out> + implements TeamRemovedCopyWith<$R, TeamRemoved, $Out> { + _TeamRemovedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TeamRemovedMapper.ensureInitialized(); + @override + $R call({String? team}) => + $apply(FieldCopyWithData({if (team != null) #team: team})); + @override + TeamRemoved $make(CopyWithData data) => + TeamRemoved(data.get(#team, or: $value.team)); + + @override + TeamRemovedCopyWith<$R2, TeamRemoved, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TeamRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class CellMergeStrategyChangedMapper + extends SubClassMapperBase { + CellMergeStrategyChangedMapper._(); + + static CellMergeStrategyChangedMapper? _instance; + static CellMergeStrategyChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = CellMergeStrategyChangedMapper._(), + ); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + CellMergeStrategyMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'CellMergeStrategyChanged'; + + static GlobalVectorDefinition _$cell(CellMergeStrategyChanged v) => v.cell; + static const Field _f$cell = + Field('cell', _$cell); + static CellMergeStrategy? _$strategy(CellMergeStrategyChanged v) => + v.strategy; + static const Field _f$strategy = + Field('strategy', _$strategy); + static int _$span(CellMergeStrategyChanged v) => v.span; + static const Field _f$span = Field( + 'span', + _$span, + opt: true, + def: 1, + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #strategy: _f$strategy, + #span: _f$span, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'CellMergeStrategyChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static CellMergeStrategyChanged _instantiate(DecodingData data) { + return CellMergeStrategyChanged( + data.dec(_f$cell), + data.dec(_f$strategy), + span: data.dec(_f$span), + ); + } + + @override + final Function instantiate = _instantiate; + + static CellMergeStrategyChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static CellMergeStrategyChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin CellMergeStrategyChangedMappable { + String toJson() { + return CellMergeStrategyChangedMapper.ensureInitialized() + .encodeJson(this as CellMergeStrategyChanged); + } + + Map toMap() { + return CellMergeStrategyChangedMapper.ensureInitialized() + .encodeMap(this as CellMergeStrategyChanged); + } + + CellMergeStrategyChangedCopyWith< + CellMergeStrategyChanged, + CellMergeStrategyChanged, + CellMergeStrategyChanged + > + get copyWith => + _CellMergeStrategyChangedCopyWithImpl< + CellMergeStrategyChanged, + CellMergeStrategyChanged + >(this as CellMergeStrategyChanged, $identity, $identity); + @override + String toString() { + return CellMergeStrategyChangedMapper.ensureInitialized().stringifyValue( + this as CellMergeStrategyChanged, + ); + } + + @override + bool operator ==(Object other) { + return CellMergeStrategyChangedMapper.ensureInitialized().equalsValue( + this as CellMergeStrategyChanged, + other, + ); + } + + @override + int get hashCode { + return CellMergeStrategyChangedMapper.ensureInitialized().hashValue( + this as CellMergeStrategyChanged, + ); + } +} + +/// @nodoc +extension CellMergeStrategyChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, CellMergeStrategyChanged, $Out> { + CellMergeStrategyChangedCopyWith<$R, CellMergeStrategyChanged, $Out> + get $asCellMergeStrategyChanged => $base.as( + (v, t, t2) => _CellMergeStrategyChangedCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class CellMergeStrategyChangedCopyWith< + $R, + $In extends CellMergeStrategyChanged, + $Out +> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? + get strategy; + @override + $R call({ + GlobalVectorDefinition? cell, + CellMergeStrategy? strategy, + int? span, + }); + CellMergeStrategyChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _CellMergeStrategyChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, CellMergeStrategyChanged, $Out> + implements + CellMergeStrategyChangedCopyWith<$R, CellMergeStrategyChanged, $Out> { + _CellMergeStrategyChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + CellMergeStrategyChangedMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? + get strategy => $value.strategy?.copyWith.$chain((v) => call(strategy: v)); + @override + $R call({ + GlobalVectorDefinition? cell, + Object? strategy = $none, + int? span, + }) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (strategy != $none) #strategy: strategy, + if (span != null) #span: span, + }), + ); + @override + CellMergeStrategyChanged $make(CopyWithData data) => CellMergeStrategyChanged( + data.get(#cell, or: $value.cell), + data.get(#strategy, or: $value.strategy), + span: data.get(#span, or: $value.span), + ); + + @override + CellMergeStrategyChangedCopyWith<$R2, CellMergeStrategyChanged, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _CellMergeStrategyChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class MetadataChangedMapper extends SubClassMapperBase { + MetadataChangedMapper._(); + + static MetadataChangedMapper? _instance; + static MetadataChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = MetadataChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + FileMetadataMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'MetadataChanged'; + + static FileMetadata _$metadata(MetadataChanged v) => v.metadata; + static const Field _f$metadata = Field( + 'metadata', + _$metadata, + ); + + @override + final MappableFields fields = const {#metadata: _f$metadata}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'MetadataChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static MetadataChanged _instantiate(DecodingData data) { + return MetadataChanged(data.dec(_f$metadata)); + } + + @override + final Function instantiate = _instantiate; + + static MetadataChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static MetadataChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin MetadataChangedMappable { + String toJson() { + return MetadataChangedMapper.ensureInitialized() + .encodeJson(this as MetadataChanged); + } + + Map toMap() { + return MetadataChangedMapper.ensureInitialized().encodeMap( + this as MetadataChanged, + ); + } + + MetadataChangedCopyWith + get copyWith => + _MetadataChangedCopyWithImpl( + this as MetadataChanged, + $identity, + $identity, + ); + @override + String toString() { + return MetadataChangedMapper.ensureInitialized().stringifyValue( + this as MetadataChanged, + ); + } + + @override + bool operator ==(Object other) { + return MetadataChangedMapper.ensureInitialized().equalsValue( + this as MetadataChanged, + other, + ); + } + + @override + int get hashCode { + return MetadataChangedMapper.ensureInitialized().hashValue( + this as MetadataChanged, + ); + } +} + +/// @nodoc +extension MetadataChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, MetadataChanged, $Out> { + MetadataChangedCopyWith<$R, MetadataChanged, $Out> get $asMetadataChanged => + $base.as((v, t, t2) => _MetadataChangedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class MetadataChangedCopyWith<$R, $In extends MetadataChanged, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata; + @override + $R call({FileMetadata? metadata}); + MetadataChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _MetadataChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, MetadataChanged, $Out> + implements MetadataChangedCopyWith<$R, MetadataChanged, $Out> { + _MetadataChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + MetadataChangedMapper.ensureInitialized(); + @override + FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata => + $value.metadata.copyWith.$chain((v) => call(metadata: v)); + @override + $R call({FileMetadata? metadata}) => + $apply(FieldCopyWithData({if (metadata != null) #metadata: metadata})); + @override + MetadataChanged $make(CopyWithData data) => + MetadataChanged(data.get(#metadata, or: $value.metadata)); + + @override + MetadataChangedCopyWith<$R2, MetadataChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _MetadataChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ObjectsRemovedMapper extends SubClassMapperBase { + ObjectsRemovedMapper._(); + + static ObjectsRemovedMapper? _instance; + static ObjectsRemovedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ObjectsRemovedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ObjectsRemoved'; + + static GlobalVectorDefinition _$cell(ObjectsRemoved v) => v.cell; + static const Field _f$cell = Field( + 'cell', + _$cell, + ); + static List? _$objects(ObjectsRemoved v) => v.objects; + static const Field> _f$objects = Field( + 'objects', + _$objects, + opt: true, + ); + + @override + final MappableFields fields = const { + #cell: _f$cell, + #objects: _f$objects, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'ObjectsRemoved'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static ObjectsRemoved _instantiate(DecodingData data) { + return ObjectsRemoved(data.dec(_f$cell), objects: data.dec(_f$objects)); + } + + @override + final Function instantiate = _instantiate; + + static ObjectsRemoved fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ObjectsRemoved fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ObjectsRemovedMappable { + String toJson() { + return ObjectsRemovedMapper.ensureInitialized().encodeJson( + this as ObjectsRemoved, + ); + } + + Map toMap() { + return ObjectsRemovedMapper.ensureInitialized().encodeMap( + this as ObjectsRemoved, + ); + } + + ObjectsRemovedCopyWith + get copyWith => _ObjectsRemovedCopyWithImpl( + this as ObjectsRemoved, + $identity, + $identity, + ); + @override + String toString() { + return ObjectsRemovedMapper.ensureInitialized().stringifyValue( + this as ObjectsRemoved, + ); + } + + @override + bool operator ==(Object other) { + return ObjectsRemovedMapper.ensureInitialized().equalsValue( + this as ObjectsRemoved, + other, + ); + } + + @override + int get hashCode { + return ObjectsRemovedMapper.ensureInitialized().hashValue( + this as ObjectsRemoved, + ); + } +} + +/// @nodoc +extension ObjectsRemovedValueCopy<$R, $Out> + on ObjectCopyWith<$R, ObjectsRemoved, $Out> { + ObjectsRemovedCopyWith<$R, ObjectsRemoved, $Out> get $asObjectsRemoved => + $base.as((v, t, t2) => _ObjectsRemovedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ObjectsRemovedCopyWith<$R, $In extends ObjectsRemoved, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell; + ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>>? get objects; + @override + $R call({GlobalVectorDefinition? cell, List? objects}); + ObjectsRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ObjectsRemovedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ObjectsRemoved, $Out> + implements ObjectsRemovedCopyWith<$R, ObjectsRemoved, $Out> { + _ObjectsRemovedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ObjectsRemovedMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get cell => $value.cell.copyWith.$chain((v) => call(cell: v)); + @override + ListCopyWith<$R, int, ObjectCopyWith<$R, int, int>>? get objects => + $value.objects != null + ? ListCopyWith( + $value.objects!, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(objects: v), + ) + : null; + @override + $R call({GlobalVectorDefinition? cell, Object? objects = $none}) => $apply( + FieldCopyWithData({ + if (cell != null) #cell: cell, + if (objects != $none) #objects: objects, + }), + ); + @override + ObjectsRemoved $make(CopyWithData data) => ObjectsRemoved( + data.get(#cell, or: $value.cell), + objects: data.get(#objects, or: $value.objects), + ); + + @override + ObjectsRemovedCopyWith<$R2, ObjectsRemoved, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ObjectsRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TableRenamedMapper extends SubClassMapperBase { + TableRenamedMapper._(); + + static TableRenamedMapper? _instance; + static TableRenamedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TableRenamedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TableRenamed'; + + static String _$name(TableRenamed v) => v.name; + static const Field _f$name = Field('name', _$name); + static String _$newName(TableRenamed v) => v.newName; + static const Field _f$newName = Field( + 'newName', + _$newName, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #newName: _f$newName, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TableRenamed'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static TableRenamed _instantiate(DecodingData data) { + return TableRenamed(data.dec(_f$name), data.dec(_f$newName)); + } + + @override + final Function instantiate = _instantiate; + + static TableRenamed fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TableRenamed fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TableRenamedMappable { + String toJson() { + return TableRenamedMapper.ensureInitialized().encodeJson( + this as TableRenamed, + ); + } + + Map toMap() { + return TableRenamedMapper.ensureInitialized().encodeMap( + this as TableRenamed, + ); + } + + TableRenamedCopyWith get copyWith => + _TableRenamedCopyWithImpl( + this as TableRenamed, + $identity, + $identity, + ); + @override + String toString() { + return TableRenamedMapper.ensureInitialized().stringifyValue( + this as TableRenamed, + ); + } + + @override + bool operator ==(Object other) { + return TableRenamedMapper.ensureInitialized().equalsValue( + this as TableRenamed, + other, + ); + } + + @override + int get hashCode { + return TableRenamedMapper.ensureInitialized().hashValue( + this as TableRenamed, + ); + } +} + +/// @nodoc +extension TableRenamedValueCopy<$R, $Out> + on ObjectCopyWith<$R, TableRenamed, $Out> { + TableRenamedCopyWith<$R, TableRenamed, $Out> get $asTableRenamed => + $base.as((v, t, t2) => _TableRenamedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TableRenamedCopyWith<$R, $In extends TableRenamed, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? newName}); + TableRenamedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TableRenamedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TableRenamed, $Out> + implements TableRenamedCopyWith<$R, TableRenamed, $Out> { + _TableRenamedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TableRenamedMapper.ensureInitialized(); + @override + $R call({String? name, String? newName}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (newName != null) #newName: newName, + }), + ); + @override + TableRenamed $make(CopyWithData data) => TableRenamed( + data.get(#name, or: $value.name), + data.get(#newName, or: $value.newName), + ); + + @override + TableRenamedCopyWith<$R2, TableRenamed, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TableRenamedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class TableRemovedMapper extends SubClassMapperBase { + TableRemovedMapper._(); + + static TableRemovedMapper? _instance; + static TableRemovedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TableRemovedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'TableRemoved'; + + static String _$name(TableRemoved v) => v.name; + static const Field _f$name = Field('name', _$name); + + @override + final MappableFields fields = const {#name: _f$name}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'TableRemoved'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static TableRemoved _instantiate(DecodingData data) { + return TableRemoved(data.dec(_f$name)); + } + + @override + final Function instantiate = _instantiate; + + static TableRemoved fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TableRemoved fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TableRemovedMappable { + String toJson() { + return TableRemovedMapper.ensureInitialized().encodeJson( + this as TableRemoved, + ); + } + + Map toMap() { + return TableRemovedMapper.ensureInitialized().encodeMap( + this as TableRemoved, + ); + } + + TableRemovedCopyWith get copyWith => + _TableRemovedCopyWithImpl( + this as TableRemoved, + $identity, + $identity, + ); + @override + String toString() { + return TableRemovedMapper.ensureInitialized().stringifyValue( + this as TableRemoved, + ); + } + + @override + bool operator ==(Object other) { + return TableRemovedMapper.ensureInitialized().equalsValue( + this as TableRemoved, + other, + ); + } + + @override + int get hashCode { + return TableRemovedMapper.ensureInitialized().hashValue( + this as TableRemoved, + ); + } +} + +/// @nodoc +extension TableRemovedValueCopy<$R, $Out> + on ObjectCopyWith<$R, TableRemoved, $Out> { + TableRemovedCopyWith<$R, TableRemoved, $Out> get $asTableRemoved => + $base.as((v, t, t2) => _TableRemovedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TableRemovedCopyWith<$R, $In extends TableRemoved, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? name}); + TableRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TableRemovedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TableRemoved, $Out> + implements TableRemovedCopyWith<$R, TableRemoved, $Out> { + _TableRemovedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TableRemovedMapper.ensureInitialized(); + @override + $R call({String? name}) => + $apply(FieldCopyWithData({if (name != null) #name: name})); + @override + TableRemoved $make(CopyWithData data) => + TableRemoved(data.get(#name, or: $value.name)); + + @override + TableRemovedCopyWith<$R2, TableRemoved, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TableRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class NoteChangedMapper extends SubClassMapperBase { + NoteChangedMapper._(); + + static NoteChangedMapper? _instance; + static NoteChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = NoteChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'NoteChanged'; + + static String _$name(NoteChanged v) => v.name; + static const Field _f$name = Field('name', _$name); + static String _$content(NoteChanged v) => v.content; + static const Field _f$content = Field( + 'content', + _$content, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #content: _f$content, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'NoteChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static NoteChanged _instantiate(DecodingData data) { + return NoteChanged(data.dec(_f$name), data.dec(_f$content)); + } + + @override + final Function instantiate = _instantiate; + + static NoteChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static NoteChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin NoteChangedMappable { + String toJson() { + return NoteChangedMapper.ensureInitialized().encodeJson( + this as NoteChanged, + ); + } + + Map toMap() { + return NoteChangedMapper.ensureInitialized().encodeMap( + this as NoteChanged, + ); + } + + NoteChangedCopyWith get copyWith => + _NoteChangedCopyWithImpl( + this as NoteChanged, + $identity, + $identity, + ); + @override + String toString() { + return NoteChangedMapper.ensureInitialized().stringifyValue( + this as NoteChanged, + ); + } + + @override + bool operator ==(Object other) { + return NoteChangedMapper.ensureInitialized().equalsValue( + this as NoteChanged, + other, + ); + } + + @override + int get hashCode { + return NoteChangedMapper.ensureInitialized().hashValue(this as NoteChanged); + } +} + +/// @nodoc +extension NoteChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, NoteChanged, $Out> { + NoteChangedCopyWith<$R, NoteChanged, $Out> get $asNoteChanged => + $base.as((v, t, t2) => _NoteChangedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class NoteChangedCopyWith<$R, $In extends NoteChanged, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? content}); + NoteChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _NoteChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, NoteChanged, $Out> + implements NoteChangedCopyWith<$R, NoteChanged, $Out> { + _NoteChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + NoteChangedMapper.ensureInitialized(); + @override + $R call({String? name, String? content}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (content != null) #content: content, + }), + ); + @override + NoteChanged $make(CopyWithData data) => NoteChanged( + data.get(#name, or: $value.name), + data.get(#content, or: $value.content), + ); + + @override + NoteChangedCopyWith<$R2, NoteChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _NoteChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class NoteRemovedMapper extends SubClassMapperBase { + NoteRemovedMapper._(); + + static NoteRemovedMapper? _instance; + static NoteRemovedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = NoteRemovedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'NoteRemoved'; + + static String _$name(NoteRemoved v) => v.name; + static const Field _f$name = Field('name', _$name); + + @override + final MappableFields fields = const {#name: _f$name}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'NoteRemoved'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static NoteRemoved _instantiate(DecodingData data) { + return NoteRemoved(data.dec(_f$name)); + } + + @override + final Function instantiate = _instantiate; + + static NoteRemoved fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static NoteRemoved fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin NoteRemovedMappable { + String toJson() { + return NoteRemovedMapper.ensureInitialized().encodeJson( + this as NoteRemoved, + ); + } + + Map toMap() { + return NoteRemovedMapper.ensureInitialized().encodeMap( + this as NoteRemoved, + ); + } + + NoteRemovedCopyWith get copyWith => + _NoteRemovedCopyWithImpl( + this as NoteRemoved, + $identity, + $identity, + ); + @override + String toString() { + return NoteRemovedMapper.ensureInitialized().stringifyValue( + this as NoteRemoved, + ); + } + + @override + bool operator ==(Object other) { + return NoteRemovedMapper.ensureInitialized().equalsValue( + this as NoteRemoved, + other, + ); + } + + @override + int get hashCode { + return NoteRemovedMapper.ensureInitialized().hashValue(this as NoteRemoved); + } +} + +/// @nodoc +extension NoteRemovedValueCopy<$R, $Out> + on ObjectCopyWith<$R, NoteRemoved, $Out> { + NoteRemovedCopyWith<$R, NoteRemoved, $Out> get $asNoteRemoved => + $base.as((v, t, t2) => _NoteRemovedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class NoteRemovedCopyWith<$R, $In extends NoteRemoved, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? name}); + NoteRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _NoteRemovedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, NoteRemoved, $Out> + implements NoteRemovedCopyWith<$R, NoteRemoved, $Out> { + _NoteRemovedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + NoteRemovedMapper.ensureInitialized(); + @override + $R call({String? name}) => + $apply(FieldCopyWithData({if (name != null) #name: name})); + @override + NoteRemoved $make(CopyWithData data) => + NoteRemoved(data.get(#name, or: $value.name)); + + @override + NoteRemovedCopyWith<$R2, NoteRemoved, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _NoteRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class WaypointChangedMapper extends SubClassMapperBase { + WaypointChangedMapper._(); + + static WaypointChangedMapper? _instance; + static WaypointChangedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WaypointChangedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + WaypointMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'WaypointChanged'; + + static String? _$team(WaypointChanged v) => v.team; + static const Field _f$team = Field( + 'team', + _$team, + opt: true, + ); + static Waypoint _$waypoint(WaypointChanged v) => v.waypoint; + static const Field _f$waypoint = Field( + 'waypoint', + _$waypoint, + ); + static String? _$name(WaypointChanged v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + opt: true, + ); + + @override + final MappableFields fields = const { + #team: _f$team, + #waypoint: _f$waypoint, + #name: _f$name, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'WaypointChanged'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static WaypointChanged _instantiate(DecodingData data) { + return WaypointChanged( + team: data.dec(_f$team), + waypoint: data.dec(_f$waypoint), + name: data.dec(_f$name), + ); + } + + @override + final Function instantiate = _instantiate; + + static WaypointChanged fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static WaypointChanged fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin WaypointChangedMappable { + String toJson() { + return WaypointChangedMapper.ensureInitialized() + .encodeJson(this as WaypointChanged); + } + + Map toMap() { + return WaypointChangedMapper.ensureInitialized().encodeMap( + this as WaypointChanged, + ); + } + + WaypointChangedCopyWith + get copyWith => + _WaypointChangedCopyWithImpl( + this as WaypointChanged, + $identity, + $identity, + ); + @override + String toString() { + return WaypointChangedMapper.ensureInitialized().stringifyValue( + this as WaypointChanged, + ); + } + + @override + bool operator ==(Object other) { + return WaypointChangedMapper.ensureInitialized().equalsValue( + this as WaypointChanged, + other, + ); + } + + @override + int get hashCode { + return WaypointChangedMapper.ensureInitialized().hashValue( + this as WaypointChanged, + ); + } +} + +/// @nodoc +extension WaypointChangedValueCopy<$R, $Out> + on ObjectCopyWith<$R, WaypointChanged, $Out> { + WaypointChangedCopyWith<$R, WaypointChanged, $Out> get $asWaypointChanged => + $base.as((v, t, t2) => _WaypointChangedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class WaypointChangedCopyWith<$R, $In extends WaypointChanged, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + WaypointCopyWith<$R, Waypoint, Waypoint> get waypoint; + @override + $R call({String? team, Waypoint? waypoint, String? name}); + WaypointChangedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _WaypointChangedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, WaypointChanged, $Out> + implements WaypointChangedCopyWith<$R, WaypointChanged, $Out> { + _WaypointChangedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + WaypointChangedMapper.ensureInitialized(); + @override + WaypointCopyWith<$R, Waypoint, Waypoint> get waypoint => + $value.waypoint.copyWith.$chain((v) => call(waypoint: v)); + @override + $R call({Object? team = $none, Waypoint? waypoint, Object? name = $none}) => + $apply( + FieldCopyWithData({ + if (team != $none) #team: team, + if (waypoint != null) #waypoint: waypoint, + if (name != $none) #name: name, + }), + ); + @override + WaypointChanged $make(CopyWithData data) => WaypointChanged( + team: data.get(#team, or: $value.team), + waypoint: data.get(#waypoint, or: $value.waypoint), + name: data.get(#name, or: $value.name), + ); + + @override + WaypointChangedCopyWith<$R2, WaypointChanged, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _WaypointChangedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class WaypointRemovedMapper extends SubClassMapperBase { + WaypointRemovedMapper._(); + + static WaypointRemovedMapper? _instance; + static WaypointRemovedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WaypointRemovedMapper._()); + HybridWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'WaypointRemoved'; + + static String? _$team(WaypointRemoved v) => v.team; + static const Field _f$team = Field( + 'team', + _$team, + opt: true, + ); + static String _$name(WaypointRemoved v) => v.name; + static const Field _f$name = Field('name', _$name); + + @override + final MappableFields fields = const { + #team: _f$team, + #name: _f$name, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'WaypointRemoved'; + @override + late final ClassMapperBase superMapper = + HybridWorldEventMapper.ensureInitialized(); + + static WaypointRemoved _instantiate(DecodingData data) { + return WaypointRemoved(team: data.dec(_f$team), name: data.dec(_f$name)); + } + + @override + final Function instantiate = _instantiate; + + static WaypointRemoved fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static WaypointRemoved fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin WaypointRemovedMappable { + String toJson() { + return WaypointRemovedMapper.ensureInitialized() + .encodeJson(this as WaypointRemoved); + } + + Map toMap() { + return WaypointRemovedMapper.ensureInitialized().encodeMap( + this as WaypointRemoved, + ); + } + + WaypointRemovedCopyWith + get copyWith => + _WaypointRemovedCopyWithImpl( + this as WaypointRemoved, + $identity, + $identity, + ); + @override + String toString() { + return WaypointRemovedMapper.ensureInitialized().stringifyValue( + this as WaypointRemoved, + ); + } + + @override + bool operator ==(Object other) { + return WaypointRemovedMapper.ensureInitialized().equalsValue( + this as WaypointRemoved, + other, + ); + } + + @override + int get hashCode { + return WaypointRemovedMapper.ensureInitialized().hashValue( + this as WaypointRemoved, + ); + } +} + +/// @nodoc +extension WaypointRemovedValueCopy<$R, $Out> + on ObjectCopyWith<$R, WaypointRemoved, $Out> { + WaypointRemovedCopyWith<$R, WaypointRemoved, $Out> get $asWaypointRemoved => + $base.as((v, t, t2) => _WaypointRemovedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class WaypointRemovedCopyWith<$R, $In extends WaypointRemoved, $Out> + implements HybridWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({String? team, String? name}); + WaypointRemovedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _WaypointRemovedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, WaypointRemoved, $Out> + implements WaypointRemovedCopyWith<$R, WaypointRemoved, $Out> { + _WaypointRemovedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + WaypointRemovedMapper.ensureInitialized(); + @override + $R call({Object? team = $none, String? name}) => $apply( + FieldCopyWithData({ + if (team != $none) #team: team, + if (name != null) #name: name, + }), + ); + @override + WaypointRemoved $make(CopyWithData data) => WaypointRemoved( + team: data.get(#team, or: $value.team), + name: data.get(#name, or: $value.name), + ); + + @override + WaypointRemovedCopyWith<$R2, WaypointRemoved, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _WaypointRemovedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class LocalWorldEventMapper extends SubClassMapperBase { + LocalWorldEventMapper._(); + + static LocalWorldEventMapper? _instance; + static LocalWorldEventMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = LocalWorldEventMapper._()); + WorldEventMapper.ensureInitialized().addSubMapper(_instance!); + } + return _instance!; + } + + @override + final String id = 'LocalWorldEvent'; + + @override + final MappableFields fields = const {}; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'LocalWorldEvent'; + @override + late final ClassMapperBase superMapper = WorldEventMapper.ensureInitialized(); + + static LocalWorldEvent _instantiate(DecodingData data) { + throw MapperException.missingConstructor('LocalWorldEvent'); + } + + @override + final Function instantiate = _instantiate; + + static LocalWorldEvent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static LocalWorldEvent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin LocalWorldEventMappable { + String toJson(); + Map toMap(); + LocalWorldEventCopyWith + get copyWith; +} + +/// @nodoc +abstract class LocalWorldEventCopyWith<$R, $In extends LocalWorldEvent, $Out> + implements + WorldEventCopyWith<$R, $In, $Out>, + PlayableWorldEventCopyWith<$R, $In, $Out> { + @override + $R call(); + LocalWorldEventCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + diff --git a/api/lib/src/event/local.dart b/api/lib/src/event/local.dart index 37fa683b..0a5eba3c 100644 --- a/api/lib/src/event/local.dart +++ b/api/lib/src/event/local.dart @@ -1,6 +1,6 @@ -part of 'event.dart'; - -@MappableClass() -abstract class LocalWorldEvent extends WorldEvent - with LocalWorldEventMappable - implements PlayableWorldEvent {} +part of 'event.dart'; + +@MappableClass() +abstract class LocalWorldEvent extends WorldEvent + with LocalWorldEventMappable + implements PlayableWorldEvent {} diff --git a/api/lib/src/event/process/client.dart b/api/lib/src/event/process/client.dart index 0ba1fc7d..c3a5414b 100644 --- a/api/lib/src/event/process/client.dart +++ b/api/lib/src/event/process/client.dart @@ -1,457 +1,457 @@ -import 'dart:math'; - -import 'package:dart_leap/dart_leap.dart'; -import 'package:networker/networker.dart'; -import 'package:setonix_api/setonix_api.dart'; - -const _maxTextLength = 2000; -const _maxIdentifierLength = 256; -const _maxImagesPerRequest = 100; -const _maxPacksPerRequest = 128; -const _maxBoardsPerRequest = 256; - -bool _isReasonableIdentifier(String value) => - value.isNotEmpty && value.length <= _maxIdentifierLength; - -bool isValidClientEvent( - WorldEvent event, - Channel channel, - WorldState state, { - required AssetManager assetManager, - ChallengeManager? challengeManager, -}) => switch (event) { - TeamJoinRequest() => - _isReasonableIdentifier(event.team) && - state.info.teams.containsKey(event.team), - TeamLeaveRequest() => - _isReasonableIdentifier(event.team) && - state.info.teams.containsKey(event.team), - CellRollRequest() => - event.object?.inRange( - 0, - state - .getTableOrDefault(event.cell.table) - .getCell(event.cell.position) - .objects - .length - - 1, - ) ?? - true, - ShuffleCellRequest() => - state - .getTableOrDefault(event.cell.table) - .cells - .containsKey(event.cell.position), - ObjectsSpawned() => event.objects.values.expand((e) => e).every((e) { - final figure = assetManager.getFigure(e.asset); - return figure != null && - (e.variation == null || figure.variations.containsKey(e.variation)); - }), - ObjectsMoved() => - event.from != event.to && - event.objects.every( - (e) => e.inRange( - 0, - state - .getTableOrDefault(event.table) - .getCell(event.from) - .objects - .length - - 1, - ), - ), - CellHideChanged() => - event.object?.inRange( - 0, - state - .getTableOrDefault(event.cell.table) - .getCell(event.cell.position) - .objects - .length - - 1, - ) ?? - true, - ObjectIndexChanged() => event.index.inRange( - 0, - state - .getTableOrDefault(event.cell.table) - .getCell(event.cell.position) - .objects - .length - - 1, - ), - TeamRemoved() => state.info.teams.containsKey(event.team), - PacksChangeRequest() => - channel == kAuthorityChannel && - event.packs.length <= _maxPacksPerRequest && - event.packs.every(_isReasonableIdentifier), - MessageRequest() => - event.message.isNotEmpty && event.message.length <= _maxTextLength, - BoardsSpawnRequest() => - _isReasonableIdentifier(event.table) && - event.assets.length <= _maxBoardsPerRequest && - event.assets.values.expand((e) => e).length <= _maxBoardsPerRequest, - BoardMoveRequest() => - _isReasonableIdentifier(event.table) && - event.from != event.to && - event.index.inRange( - 0, - state - .getTableOrDefault(event.table) - .getCell(event.from) - .tiles - .length - - 1, - ), - ModeChangeRequest() => channel == kAuthorityChannel, - DialogCloseRequest() => _isReasonableIdentifier(event.id), - ImagesRequest() => - event.ids.length <= _maxImagesPerRequest && - event.ids.every(_isReasonableIdentifier), - ToolbarActionRequest() => _isReasonableIdentifier(event.actionId), - _ => true, -}; - -sealed class ServerResponse { - const ServerResponse(); -} - -class KickServerResponse extends ServerResponse { - final KickMessage message; - final Set kicked; - - const KickServerResponse(this.message, {this.kicked = const {}}); -} - -HybridWorldEvent _hybridProtectPacket(HybridWorldEvent event) => - switch (event) { - ObjectsSpawned() => event.copyWith( - objects: event.objects.map((cell, objects) { - final protectedObjects = objects - .map((e) => e.hidden ? e.copyWith(variation: null) : e) - .toList(); - return MapEntry(cell, protectedObjects); - }), - ), - _ => event, - }; - -ServerWorldEvent protectServerEvent(ServerWorldEvent event) => - event is HybridWorldEvent ? _hybridProtectPacket(event) : event; - -class UpdateServerResponse extends ServerResponse { - final NetworkerPacket? main; - final Set needsUpdate; - - UpdateServerResponse(this.main, [this.needsUpdate = const {}]); - UpdateServerResponse.builder( - ServerWorldEvent? event, [ - Channel channel = kAnyChannel, - this.needsUpdate = const {}, - ]) : main = event == null ? null : NetworkerPacket(event, channel); - - List> buildPackets( - WorldState state, - Iterable connected, - ) { - return [?main, ...buildUpdatePackets(state, connected)]; - } - - List> buildUpdatePackets( - WorldState state, - Iterable connected, - ) => buildUpdatePacketsFor(state, connected, needsUpdate); - - List> buildUpdatePacketsFor( - WorldState state, - Iterable connected, - Set? needsUpdate, - ) { - needsUpdate ??= this.needsUpdate; - if (needsUpdate.isEmpty) return []; - final packets = >[]; - for (final channel in connected) { - if (needsUpdate.contains(channel) || needsUpdate.contains(kAnyChannel)) { - packets.add( - NetworkerPacket( - WorldInitialized(table: state.protectTable(channel)), - channel, - ), - ); - } - } - return packets; - } -} - -Set _hybridNeedsUpdate( - HybridWorldEvent event, - WorldState state, - Channel channel, -) => switch (event) { - TeamRemoved() => {kAnyChannel}, - CellHideChanged() => {kAnyChannel}, - _ => {}, -}; - -Future processClientEvent( - WorldEvent? event, - Channel channel, - WorldState state, { - required AssetManager assetManager, - bool allowServerEvents = false, - ChallengeManager? challengeManager, - UserManager? userManager, -}) async { - buildInitialize() => WorldInitialized( - table: state.protectTable(channel), - info: state.info, - id: channel, - packsSignature: assetManager - .createSignature(state.info.packs.toSet()) - .values - .toList(), - teamMembers: state.teamMembers, - ); - - if (event == null) { - if (challengeManager != null) { - final challenge = challengeManager.generateNewChallenge(channel); - return UpdateServerResponse.builder( - AuthenticatedRequested(challenge, isRequired: true), - channel, - ); - } - await userManager?.addUser(channel); - return UpdateServerResponse.builder(buildInitialize(), channel); - } - if (!isValidClientEvent(event, channel, state, assetManager: assetManager)) { - return null; - } - switch (event) { - case HybridWorldEvent(): - return UpdateServerResponse.builder( - event, - kAnyChannel, - _hybridNeedsUpdate(event, state, channel), - ); - case LocalWorldEvent(): - return null; - case ServerWorldEvent(): - return allowServerEvents - ? UpdateServerResponse.builder(event, kAnyChannel) - : null; - case TeamJoinRequest(team: final team): - return UpdateServerResponse.builder( - TeamJoined(channel, team), - kAnyChannel, - {channel}, - ); - case TeamLeaveRequest(team: final team): - return UpdateServerResponse.builder( - TeamLeft(channel, team), - kAnyChannel, - {channel}, - ); - case CellRollRequest(): - final table = state.getTableOrDefault(event.cell.table); - var cell = table.getCell(event.cell.position); - final random = Random.secure(); - GameObject roll(GameObject object) { - final figure = assetManager.getFigure(object.asset); - if (figure == null || !figure.rollable) return object; - final variations = figure.variations.keys.toList(); - if (variations.isEmpty) return object; - final picked = variations[random.nextInt(variations.length)]; - return object.copyWith(variation: picked); - } - final objectIndex = event.object; - List objects; - if (objectIndex != null) { - final object = cell.objects[objectIndex]; - objects = List.from(cell.objects) - ..[objectIndex] = roll(object); - } else { - objects = cell.objects.map(roll).toList(); - } - return UpdateServerResponse.builder( - ObjectsChanged(event.cell, objects), - kAnyChannel, - ); - case ShuffleCellRequest(): - final table = state.getTableOrDefault(event.cell.table); - final cell = table.cells[event.cell.position]; - if (cell == null) return null; - final positions = List.generate(cell.objects.length, (i) => i) - ..shuffle(Random.secure()); - return UpdateServerResponse.builder( - CellShuffled(event.cell, positions), - kAnyChannel, - ); - case PacksChangeRequest(): - return UpdateServerResponse.builder( - WorldInitialized( - info: state.info.copyWith( - packs: event.packs.where((e) => assetManager.hasPack(e)).toList(), - ), - ), - ); - case MessageRequest(): - return UpdateServerResponse.builder( - MessageSent(channel, event.message), - kAnyChannel, - ); - case BoardsSpawnRequest(): - final tiles = >{}; - for (final (cell, asset) in event.assets.entries.expand( - (e) => e.value.map((l) => (e.key, l)), - )) { - final definition = assetManager.getBoard(asset); - if (definition == null) return null; - final size = definition.tiles; - for (var x = 0; x < size.x; x++) { - for (var y = 0; y < size.y; y++) { - final tile = VectorDefinition(x, y); - final position = cell + tile; - tiles.putIfAbsent(position, () => []).add(BoardTile(asset, tile)); - } - } - } - return UpdateServerResponse.builder( - BoardTilesSpawned(event.table, tiles), - kAnyChannel, - ); - case BoardRemoveRequest(): - final table = state.getTableOrDefault(event.position.table); - final cell = table.getCell(event.position.position); - final currentObject = cell.tiles[event.index]; - final definition = assetManager.getBoard(currentObject.asset); - final size = definition?.tiles ?? VectorDefinition.one; - final newTiles = >{}; - for (var x = 0; x < size.x; x++) { - for (var y = 0; y < size.y; y++) { - final position = VectorDefinition( - x + event.position.x - currentObject.tile.x, - y + event.position.y - currentObject.tile.y, - ); - final cell = table.getCell(position); - final index = cell.tiles.indexWhere( - (e) => - e.asset == currentObject.asset && - e.tile.x == x && - e.tile.y == y, - ); - if (index != -1) { - final newTilesList = List.from(cell.tiles) - ..removeAt(index); - newTiles[position] = newTilesList; - } - } - } - return UpdateServerResponse.builder( - BoardTilesChanged(event.position.table, newTiles), - kAnyChannel, - ); - case BoardMoveRequest(): - final table = state.getTableOrDefault(event.table); - final from = table.getCell(event.from); - final currentObject = from.tiles[event.index]; - final definition = assetManager.getBoard(currentObject.asset); - final size = definition?.tiles ?? VectorDefinition.one; - final newTiles = >{}; - for (var x = 0; x < size.x; x++) { - for (var y = 0; y < size.y; y++) { - final fromPosition = VectorDefinition( - x + event.from.x - currentObject.tile.x, - y + event.from.y - currentObject.tile.y, - ); - final toPosition = fromPosition + event.to - event.from; - final tiles = - newTiles[fromPosition] ?? table.getCell(fromPosition).tiles; - final index = tiles.indexWhere( - (e) => - e.asset == currentObject.asset && - e.tile.x == x && - e.tile.y == y, - ); - if (index != -1) { - final newTilesList = List.from(tiles)..removeAt(index); - newTiles[fromPosition] = newTilesList; - newTiles - .putIfAbsent( - toPosition, - () => List.from(table.getCell(toPosition).tiles), - ) - .add(BoardTile(currentObject.asset, VectorDefinition(x, y))); - } - } - } - return UpdateServerResponse.builder( - BoardTilesChanged(event.table, newTiles), - kAnyChannel, - ); - case DialogCloseRequest(): - return UpdateServerResponse.builder( - DialogsClosed.single(event.id), - channel, - ); - case ImagesRequest(): - return UpdateServerResponse.builder( - ImagesUpdated( - Map.fromEntries( - event.ids.map((e) { - final image = state.images[e]; - if (image == null) return null; - return MapEntry(e, image); - }).nonNulls, - ), - ), - channel, - ); - case ModeChangeRequest(): - final location = event.location; - final mode = location == null ? null : assetManager.getModeItem(location); - return UpdateServerResponse.builder( - WorldInitialized.fromMode(mode, state), - channel, - ); - case AuthenticateRequest(): - final challenge = challengeManager?.getChallenge(channel); - if (challenge == null) return null; - if (challengeManager == null) return null; - final verified = await event.verify(challenge); - if (!verified) { - final newChallenge = challengeManager.generateNewChallenge(channel); - return UpdateServerResponse.builder( - AuthenticatedRequested(newChallenge, isRequired: true), - channel, - ); - } - challengeManager.removeChallenge(channel); - SetonixUser? user; - try { - user = await userManager?.addUser( - channel, - generateFingerprint(event.publicKey), - ); - } catch (e) { - if (e is KickMessage) { - return KickServerResponse(e, kicked: {channel}); - } else { - return KickServerResponse( - KickMessage(reason: KickReason.notRegistered), - ); - } - } - if (user == null) { - final newChallenge = challengeManager.generateNewChallenge(channel); - return UpdateServerResponse.builder( - AuthenticatedRequested(newChallenge, isRequired: true), - channel, - ); - } - return UpdateServerResponse.builder(buildInitialize(), channel); - case ToolbarActionRequest(): - return UpdateServerResponse.builder(null); - } -} +import 'dart:math'; + +import 'package:dart_leap/dart_leap.dart'; +import 'package:networker/networker.dart'; +import 'package:setonix_api/setonix_api.dart'; + +const _maxTextLength = 2000; +const _maxIdentifierLength = 256; +const _maxImagesPerRequest = 100; +const _maxPacksPerRequest = 128; +const _maxBoardsPerRequest = 256; + +bool _isReasonableIdentifier(String value) => + value.isNotEmpty && value.length <= _maxIdentifierLength; + +bool isValidClientEvent( + WorldEvent event, + Channel channel, + WorldState state, { + required AssetManager assetManager, + ChallengeManager? challengeManager, +}) => switch (event) { + TeamJoinRequest() => + _isReasonableIdentifier(event.team) && + state.info.teams.containsKey(event.team), + TeamLeaveRequest() => + _isReasonableIdentifier(event.team) && + state.info.teams.containsKey(event.team), + CellRollRequest() => + event.object?.inRange( + 0, + state + .getTableOrDefault(event.cell.table) + .getCell(event.cell.position) + .objects + .length - + 1, + ) ?? + true, + ShuffleCellRequest() => + state + .getTableOrDefault(event.cell.table) + .cells + .containsKey(event.cell.position), + ObjectsSpawned() => event.objects.values.expand((e) => e).every((e) { + final figure = assetManager.getFigure(e.asset); + return figure != null && + (e.variation == null || figure.variations.containsKey(e.variation)); + }), + ObjectsMoved() => + event.from != event.to && + event.objects.every( + (e) => e.inRange( + 0, + state + .getTableOrDefault(event.table) + .getCell(event.from) + .objects + .length - + 1, + ), + ), + CellHideChanged() => + event.object?.inRange( + 0, + state + .getTableOrDefault(event.cell.table) + .getCell(event.cell.position) + .objects + .length - + 1, + ) ?? + true, + ObjectIndexChanged() => event.index.inRange( + 0, + state + .getTableOrDefault(event.cell.table) + .getCell(event.cell.position) + .objects + .length - + 1, + ), + TeamRemoved() => state.info.teams.containsKey(event.team), + PacksChangeRequest() => + channel == kAuthorityChannel && + event.packs.length <= _maxPacksPerRequest && + event.packs.every(_isReasonableIdentifier), + MessageRequest() => + event.message.isNotEmpty && event.message.length <= _maxTextLength, + BoardsSpawnRequest() => + _isReasonableIdentifier(event.table) && + event.assets.length <= _maxBoardsPerRequest && + event.assets.values.expand((e) => e).length <= _maxBoardsPerRequest, + BoardMoveRequest() => + _isReasonableIdentifier(event.table) && + event.from != event.to && + event.index.inRange( + 0, + state + .getTableOrDefault(event.table) + .getCell(event.from) + .tiles + .length - + 1, + ), + ModeChangeRequest() => channel == kAuthorityChannel, + DialogCloseRequest() => _isReasonableIdentifier(event.id), + ImagesRequest() => + event.ids.length <= _maxImagesPerRequest && + event.ids.every(_isReasonableIdentifier), + ToolbarActionRequest() => _isReasonableIdentifier(event.actionId), + _ => true, +}; + +sealed class ServerResponse { + const ServerResponse(); +} + +class KickServerResponse extends ServerResponse { + final KickMessage message; + final Set kicked; + + const KickServerResponse(this.message, {this.kicked = const {}}); +} + +HybridWorldEvent _hybridProtectPacket(HybridWorldEvent event) => + switch (event) { + ObjectsSpawned() => event.copyWith( + objects: event.objects.map((cell, objects) { + final protectedObjects = objects + .map((e) => e.hidden ? e.copyWith(variation: null) : e) + .toList(); + return MapEntry(cell, protectedObjects); + }), + ), + _ => event, + }; + +ServerWorldEvent protectServerEvent(ServerWorldEvent event) => + event is HybridWorldEvent ? _hybridProtectPacket(event) : event; + +class UpdateServerResponse extends ServerResponse { + final NetworkerPacket? main; + final Set needsUpdate; + + UpdateServerResponse(this.main, [this.needsUpdate = const {}]); + UpdateServerResponse.builder( + ServerWorldEvent? event, [ + Channel channel = kAnyChannel, + this.needsUpdate = const {}, + ]) : main = event == null ? null : NetworkerPacket(event, channel); + + List> buildPackets( + WorldState state, + Iterable connected, + ) { + return [?main, ...buildUpdatePackets(state, connected)]; + } + + List> buildUpdatePackets( + WorldState state, + Iterable connected, + ) => buildUpdatePacketsFor(state, connected, needsUpdate); + + List> buildUpdatePacketsFor( + WorldState state, + Iterable connected, + Set? needsUpdate, + ) { + needsUpdate ??= this.needsUpdate; + if (needsUpdate.isEmpty) return []; + final packets = >[]; + for (final channel in connected) { + if (needsUpdate.contains(channel) || needsUpdate.contains(kAnyChannel)) { + packets.add( + NetworkerPacket( + WorldInitialized(table: state.protectTable(channel)), + channel, + ), + ); + } + } + return packets; + } +} + +Set _hybridNeedsUpdate( + HybridWorldEvent event, + WorldState state, + Channel channel, +) => switch (event) { + TeamRemoved() => {kAnyChannel}, + CellHideChanged() => {kAnyChannel}, + _ => {}, +}; + +Future processClientEvent( + WorldEvent? event, + Channel channel, + WorldState state, { + required AssetManager assetManager, + bool allowServerEvents = false, + ChallengeManager? challengeManager, + UserManager? userManager, +}) async { + buildInitialize() => WorldInitialized( + table: state.protectTable(channel), + info: state.info, + id: channel, + packsSignature: assetManager + .createSignature(state.info.packs.toSet()) + .values + .toList(), + teamMembers: state.teamMembers, + ); + + if (event == null) { + if (challengeManager != null) { + final challenge = challengeManager.generateNewChallenge(channel); + return UpdateServerResponse.builder( + AuthenticatedRequested(challenge, isRequired: true), + channel, + ); + } + await userManager?.addUser(channel); + return UpdateServerResponse.builder(buildInitialize(), channel); + } + if (!isValidClientEvent(event, channel, state, assetManager: assetManager)) { + return null; + } + switch (event) { + case HybridWorldEvent(): + return UpdateServerResponse.builder( + event, + kAnyChannel, + _hybridNeedsUpdate(event, state, channel), + ); + case LocalWorldEvent(): + return null; + case ServerWorldEvent(): + return allowServerEvents + ? UpdateServerResponse.builder(event, kAnyChannel) + : null; + case TeamJoinRequest(team: final team): + return UpdateServerResponse.builder( + TeamJoined(channel, team), + kAnyChannel, + {channel}, + ); + case TeamLeaveRequest(team: final team): + return UpdateServerResponse.builder( + TeamLeft(channel, team), + kAnyChannel, + {channel}, + ); + case CellRollRequest(): + final table = state.getTableOrDefault(event.cell.table); + var cell = table.getCell(event.cell.position); + final random = Random.secure(); + GameObject roll(GameObject object) { + final figure = assetManager.getFigure(object.asset); + if (figure == null || !figure.rollable) return object; + final variations = figure.variations.keys.toList(); + if (variations.isEmpty) return object; + final picked = variations[random.nextInt(variations.length)]; + return object.copyWith(variation: picked); + } + final objectIndex = event.object; + List objects; + if (objectIndex != null) { + final object = cell.objects[objectIndex]; + objects = List.from(cell.objects) + ..[objectIndex] = roll(object); + } else { + objects = cell.objects.map(roll).toList(); + } + return UpdateServerResponse.builder( + ObjectsChanged(event.cell, objects), + kAnyChannel, + ); + case ShuffleCellRequest(): + final table = state.getTableOrDefault(event.cell.table); + final cell = table.cells[event.cell.position]; + if (cell == null) return null; + final positions = List.generate(cell.objects.length, (i) => i) + ..shuffle(Random.secure()); + return UpdateServerResponse.builder( + CellShuffled(event.cell, positions), + kAnyChannel, + ); + case PacksChangeRequest(): + return UpdateServerResponse.builder( + WorldInitialized( + info: state.info.copyWith( + packs: event.packs.where((e) => assetManager.hasPack(e)).toList(), + ), + ), + ); + case MessageRequest(): + return UpdateServerResponse.builder( + MessageSent(channel, event.message), + kAnyChannel, + ); + case BoardsSpawnRequest(): + final tiles = >{}; + for (final (cell, asset) in event.assets.entries.expand( + (e) => e.value.map((l) => (e.key, l)), + )) { + final definition = assetManager.getBoard(asset); + if (definition == null) return null; + final size = definition.tiles; + for (var x = 0; x < size.x; x++) { + for (var y = 0; y < size.y; y++) { + final tile = VectorDefinition(x, y); + final position = cell + tile; + tiles.putIfAbsent(position, () => []).add(BoardTile(asset, tile)); + } + } + } + return UpdateServerResponse.builder( + BoardTilesSpawned(event.table, tiles), + kAnyChannel, + ); + case BoardRemoveRequest(): + final table = state.getTableOrDefault(event.position.table); + final cell = table.getCell(event.position.position); + final currentObject = cell.tiles[event.index]; + final definition = assetManager.getBoard(currentObject.asset); + final size = definition?.tiles ?? VectorDefinition.one; + final newTiles = >{}; + for (var x = 0; x < size.x; x++) { + for (var y = 0; y < size.y; y++) { + final position = VectorDefinition( + x + event.position.x - currentObject.tile.x, + y + event.position.y - currentObject.tile.y, + ); + final cell = table.getCell(position); + final index = cell.tiles.indexWhere( + (e) => + e.asset == currentObject.asset && + e.tile.x == x && + e.tile.y == y, + ); + if (index != -1) { + final newTilesList = List.from(cell.tiles) + ..removeAt(index); + newTiles[position] = newTilesList; + } + } + } + return UpdateServerResponse.builder( + BoardTilesChanged(event.position.table, newTiles), + kAnyChannel, + ); + case BoardMoveRequest(): + final table = state.getTableOrDefault(event.table); + final from = table.getCell(event.from); + final currentObject = from.tiles[event.index]; + final definition = assetManager.getBoard(currentObject.asset); + final size = definition?.tiles ?? VectorDefinition.one; + final newTiles = >{}; + for (var x = 0; x < size.x; x++) { + for (var y = 0; y < size.y; y++) { + final fromPosition = VectorDefinition( + x + event.from.x - currentObject.tile.x, + y + event.from.y - currentObject.tile.y, + ); + final toPosition = fromPosition + event.to - event.from; + final tiles = + newTiles[fromPosition] ?? table.getCell(fromPosition).tiles; + final index = tiles.indexWhere( + (e) => + e.asset == currentObject.asset && + e.tile.x == x && + e.tile.y == y, + ); + if (index != -1) { + final newTilesList = List.from(tiles)..removeAt(index); + newTiles[fromPosition] = newTilesList; + newTiles + .putIfAbsent( + toPosition, + () => List.from(table.getCell(toPosition).tiles), + ) + .add(BoardTile(currentObject.asset, VectorDefinition(x, y))); + } + } + } + return UpdateServerResponse.builder( + BoardTilesChanged(event.table, newTiles), + kAnyChannel, + ); + case DialogCloseRequest(): + return UpdateServerResponse.builder( + DialogsClosed.single(event.id), + channel, + ); + case ImagesRequest(): + return UpdateServerResponse.builder( + ImagesUpdated( + Map.fromEntries( + event.ids.map((e) { + final image = state.images[e]; + if (image == null) return null; + return MapEntry(e, image); + }).nonNulls, + ), + ), + channel, + ); + case ModeChangeRequest(): + final location = event.location; + final mode = location == null ? null : assetManager.getModeItem(location); + return UpdateServerResponse.builder( + WorldInitialized.fromMode(mode, state), + channel, + ); + case AuthenticateRequest(): + final challenge = challengeManager?.getChallenge(channel); + if (challenge == null) return null; + if (challengeManager == null) return null; + final verified = await event.verify(challenge); + if (!verified) { + final newChallenge = challengeManager.generateNewChallenge(channel); + return UpdateServerResponse.builder( + AuthenticatedRequested(newChallenge, isRequired: true), + channel, + ); + } + challengeManager.removeChallenge(channel); + SetonixUser? user; + try { + user = await userManager?.addUser( + channel, + generateFingerprint(event.publicKey), + ); + } catch (e) { + if (e is KickMessage) { + return KickServerResponse(e, kicked: {channel}); + } else { + return KickServerResponse( + KickMessage(reason: KickReason.notRegistered), + ); + } + } + if (user == null) { + final newChallenge = challengeManager.generateNewChallenge(channel); + return UpdateServerResponse.builder( + AuthenticatedRequested(newChallenge, isRequired: true), + channel, + ); + } + return UpdateServerResponse.builder(buildInitialize(), channel); + case ToolbarActionRequest(): + return UpdateServerResponse.builder(null); + } +} diff --git a/api/lib/src/event/process/server.dart b/api/lib/src/event/process/server.dart index 41a61350..b50dee9e 100644 --- a/api/lib/src/event/process/server.dart +++ b/api/lib/src/event/process/server.dart @@ -1,568 +1,568 @@ -import 'package:collection/collection.dart'; -import 'package:dart_leap/dart_leap.dart'; -import 'package:networker/networker.dart'; -import 'package:setonix_api/setonix_api.dart'; - -bool isValidServerEvent(ServerWorldEvent event, WorldState state) => - switch (event) { - WorldInitialized() => - event.info?.packs.length == event.packsSignature?.length && - (event.info?.packs.every( - (e) => event.packsSignature?.any((p) => p.id == e) ?? false, - ) ?? - true), - TeamJoined() => state.info.teams.containsKey(event.team), - TeamLeft() => state.info.teams.containsKey(event.team), - CellShuffled() => event.positions.every( - (e) => e.inRange( - 0, - state - .getTableOrDefault(event.cell.table) - .getCell(event.cell.position) - .objects - .length - - 1, - ), - ), - ObjectsMoved() => - event.from != event.to && - event.objects.every( - (e) => e.inRange( - 0, - state - .getTableOrDefault(event.table) - .getCell(event.from) - .objects - .length - - 1, - ), - ), - CellHideChanged() => - event.object?.inRange( - 0, - state - .getTableOrDefault(event.cell.table) - .getCell(event.cell.position) - .objects - .length - - 1, - ) ?? - true, - ObjectIndexChanged() => event.index.inRange( - 0, - state - .getTableOrDefault(event.cell.table) - .getCell(event.cell.position) - .objects - .length - - 1, - ), - CellMergeStrategyChanged() => - event.span > 0 && event.span <= GameTable.maxMergeSpan, - DialogOpened() => event.dialog.isValid(), - _ => true, - }; - -sealed class FatalServerEventError {} - -final class InvalidPacksError extends FatalServerEventError { - final List signature, expected; - - InvalidPacksError({required this.signature, required this.expected}); - - @override - String toString() => - 'Server requested packs, that are not available on the client (or is empty): $signature, expected: $expected'; -} - -bool isServerSupported( - List mySignature, - List serverSignature, -) { - for (final entry in serverSignature) { - final current = mySignature.firstWhereOrNull((e) => e.id == entry.id); - if (current == null || !current.supports(entry)) { - return false; - } - } - return true; -} - -class ServerProcessed { - final WorldState? state; - final List responses; - - ServerProcessed(this.state, [this.responses = const []]); -} - -ServerProcessed processServerEvent( - ServerWorldEvent event, - WorldState state, { - required List signature, -}) { - if (!isValidServerEvent(event, state)) return ServerProcessed(null); - switch (event) { - case WorldInitialized(): - final serverSignature = event.packsSignature; - final supported = serverSignature == null - ? true - : isServerSupported(signature, serverSignature); - if (!supported) { - throw InvalidPacksError( - signature: serverSignature, - expected: signature, - ); - } - return ServerProcessed( - state.copyWith( - table: event.table ?? state.table, - id: event.id ?? state.id, - teamMembers: event.teamMembers ?? state.teamMembers, - info: event.info ?? state.info, - dialogs: event.clearUserInterface ? [] : state.dialogs, - images: event.clearUserInterface ? {} : state.images, - gameState: GameState.play, - authRequest: null, - ), - ); - case TeamJoined(): - return ServerProcessed( - state.copyWith( - teamMembers: { - ...state.teamMembers, - event.team: {...?state.teamMembers[event.team], event.user}, - }, - ), - ); - case TeamLeft(): - final members = Set.from(state.teamMembers[event.team] ?? {}); - members.remove(event.user); - final allMembers = Map>.from(state.teamMembers); - if (members.isEmpty) { - allMembers.remove(event.team); - } else { - allMembers[event.team] = members; - } - return ServerProcessed(state.copyWith(teamMembers: allMembers)); - case ObjectsChanged(): - return ServerProcessed( - state.mapTableOrDefault(event.cell.table, (table) { - final cell = table.cells[event.cell.position] ?? TableCell(); - final newCell = cell.copyWith(objects: event.objects); - if (newCell.isEmpty) { - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..remove(event.cell.position), - ); - } - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..[event.cell.position] = newCell, - ); - }), - ); - case CellShuffled(positions: final positions): - return ServerProcessed( - state.mapTableOrDefault(event.cell.table, (table) { - final cell = table.cells[event.cell.position] ?? TableCell(); - final objects = cell.objects; - final newObjects = List.from(objects); - for (var i = 0; i < positions.length; i++) { - newObjects[positions[i]] = objects[i]; - } - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..[event.cell.position] = cell.copyWith(objects: newObjects), - ); - }), - ); - case BackgroundChanged(): - return ServerProcessed( - state.copyWith.table(background: event.background), - ); - case ObjectsSpawned(): - return ServerProcessed( - state.mapTableOrDefault(event.table, (table) { - final cells = Map.from(table.cells); - for (final entry in event.objects.entries) { - cells[entry.key] = table - .getCell(entry.key) - .copyWith - .objects - .addAll(entry.value); - } - return table.copyWith.cellsBox(content: cells); - }), - ); - case ObjectsMoved(): - return ServerProcessed( - state.mapTableOrDefault(event.table, (table) { - var from = table.cells[event.from] ?? TableCell(); - var to = table.cells[event.to] ?? TableCell(); - final toRemove = List.from(event.objects) - ..sort((a, b) => b.compareTo(a)); - final toAdd = toRemove.map((e) => from.objects[e]).toList(); - final newObjects = List.from(from.objects); - for (final i in toRemove) { - newObjects.removeAt(i); - } - from = from.copyWith(objects: newObjects); - to = to.copyWith(objects: [...to.objects, ...toAdd]); - final cells = Map.from(table.cells) - ..[event.to] = to; - if (from.isEmpty) { - cells.remove(event.from); - } else { - cells[event.from] = from; - } - - return table.copyWith.cellsBox(content: cells); - }), - ); - case CellHideChanged(): - return ServerProcessed( - state.mapTableOrDefault(event.cell.table, (table) { - final cell = table.cells[event.cell.position] ?? TableCell(); - final objectIndex = event.object; - if (objectIndex != null) { - final object = cell.objects[objectIndex]; - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..[event.cell.position] = cell.copyWith.objects.replace( - objectIndex, - object.copyWith(hidden: event.hide ?? !object.hidden), - ), - ); - } - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..[event.cell.position] = cell.copyWith( - objects: cell.objects - .map((e) => e.copyWith(hidden: event.hide ?? !e.hidden)) - .toList(), - ), - ); - }), - ); - case ObjectsRemoved(): - return ServerProcessed( - state.mapTableOrDefault(event.cell.table, (table) { - final cell = table.cells[event.cell.position] ?? TableCell(); - final objectIndex = event.objects; - var newCell = cell; - if (objectIndex != null) { - final objects = List.from(cell.objects); - final indexes = objectIndex.toList() - ..sort((a, b) => b.compareTo(a)); - for (final index in indexes) { - objects.removeAt(index); - } - newCell = cell.copyWith(); - } else { - newCell = cell.copyWith(objects: []); - } - if (newCell.isEmpty) { - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..remove(event.cell.position), - ); - } - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..[event.cell.position] = newCell, - ); - }), - ); - case ObjectIndexChanged(): - return ServerProcessed( - state.mapTableOrDefault(event.cell.table, (table) { - final cell = table.cells[event.cell.position] ?? TableCell(); - final object = cell.objects[event.object]; - final newObjects = List.from(cell.objects); - newObjects.removeAt(event.object); - newObjects.insert(event.index, object); - return table.copyWith.cellsBox( - content: Map.from(table.cells) - ..[event.cell.position] = cell.copyWith(objects: newObjects), - ); - }), - ); - case TeamChanged(): - var info = state.info; - var newName = event.newName; - var teamMembers = Map>.from(state.teamMembers); - if (newName != null) { - final teams = Map.fromEntries( - info.teams.entries.map((e) { - if (e.key == event.name) { - return MapEntry(newName, event.team); - } - return e; - }), - ); - info = info.copyWith(teams: teams); - teamMembers[newName] = teamMembers.remove(event.name) ?? {}; - } else { - info = info.copyWith.teams.put(event.name, event.team); - } - return ServerProcessed( - state.copyWith(info: info, teamMembers: teamMembers), - ); - case TeamRemoved(): - return ServerProcessed( - state.copyWith( - info: state.info.copyWith.teams.remove(event.team), - teamMembers: Map.from(state.teamMembers)..remove(event.team), - ), - ); - case CellMergeStrategyChanged(): - return ServerProcessed( - state.mapTableOrDefault(event.cell.table, (table) { - final cell = table.getCell(event.cell.position); - final cells = Map.from(table.cells); - - CellMergeDirection? getDirection(CellMergeStrategy? strategy) { - if (strategy is LayoutCellMergeStrategy) return strategy.direction; - return null; - } - - // Cleanup old neighbors - final oldCell = cells[event.cell.position]; - final oldStrategy = oldCell?.merge; - final oldDirection = getDirection(oldStrategy); - if (oldDirection != null) { - final oldSpan = table.calculateSpan( - event.cell.position, - oldDirection, - ); - if (oldSpan > 1) { - var current = event.cell.position; - for (var i = 1; i < oldSpan; i++) { - current = oldDirection == CellMergeDirection.horizontal - ? VectorDefinition(current.x + 1, current.y) - : VectorDefinition(current.x, current.y + 1); - - final neighbor = cells[current] ?? TableCell(); - if (neighbor.merge is MergedCellStrategy && - (neighbor.merge as MergedCellStrategy).direction == - oldDirection) { - final updatedNeighbor = neighbor.copyWith(merge: null); - if (updatedNeighbor.isEmpty) { - cells.remove(current); - } else { - cells[current] = updatedNeighbor; - } - } - } - } - } - - // Update target cell - var newCell = cell.copyWith(merge: event.strategy); - - // Expand new neighbors - - final strategy = event.strategy; - - final span = event.span; - - if (strategy != null) { - final direction = getDirection(strategy); - - if (direction != null) { - var current = event.cell.position; - final allObjects = (cells[current] ?? TableCell()).objects - .toList(); - - for (var i = 1; i < span; i++) { - current = direction == CellMergeDirection.horizontal - ? VectorDefinition(current.x + 1, current.y) - : VectorDefinition(current.x, current.y + 1); - - final neighbor = cells[current] ?? TableCell(); - if (neighbor.objects.isNotEmpty) { - allObjects.addAll(neighbor.objects); - } - - cells[current] = neighbor.copyWith( - merge: MergedCellStrategy(direction), - objects: [], - ); - } - newCell = newCell.copyWith(objects: allObjects); - } - } - cells[event.cell.position] = newCell; - - return table.copyWith.cellsBox(content: cells); - }), - ); - case MetadataChanged(): - return ServerProcessed(state.copyWith(metadata: event.metadata)); - case MessageSent(): - return ServerProcessed( - state.copyWith.messages.add( - ChatMessage( - author: event.user, - content: event.message, - timestamp: DateTime.now(), - ), - ), - ); - case TableRenamed(): - final data = state.data.getTable(event.name); - return ServerProcessed( - state.copyWith( - tableName: event.name == state.tableName - ? event.newName - : state.tableName, - data: data == null - ? state.data - : state.data - .removeTable(event.name) - .setTable(data, event.newName), - ), - ); - case TableRemoved(): - return ServerProcessed( - state.copyWith( - tableName: state.tableName == event.name ? '' : state.tableName, - data: state.data.removeTable(event.name), - info: state.info.copyWith( - teams: state.info.teams.map( - (k, v) => MapEntry( - k, - v.copyWith( - claimedCells: v.claimedCells - .where((e) => e.table != event.name) - .toSet(), - waypoints: v.waypoints - .where((e) => e.position.table != event.name) - .toList(), - ), - ), - ), - ), - ), - ); - case NoteChanged(): - return ServerProcessed( - state.copyWith(data: state.data.setNote(event.name, event.content)), - ); - case NoteRemoved(): - return ServerProcessed( - state.copyWith(data: state.data.removeNote(event.name)), - ); - case BoardTilesSpawned(): - return ServerProcessed( - state.mapTableOrDefault(event.table, (table) { - final cells = Map.from(table.cells); - for (final entry in event.tiles.entries) { - cells[entry.key] = table - .getCell(entry.key) - .copyWith - .tiles - .addAll(entry.value); - } - return table.copyWith.cellsBox(content: cells); - }), - ); - case BoardTilesChanged(): - return ServerProcessed( - state.mapTableOrDefault(event.table, (table) { - final cells = Map.from(table.cells); - for (final entry in event.tiles.entries) { - final newCell = table - .getCell(entry.key) - .copyWith(tiles: entry.value); - if (newCell.isEmpty) { - cells.remove(entry.key); - } else { - cells[entry.key] = newCell; - } - } - return table.copyWith.cellsBox(content: cells); - }), - ); - case DialogOpened(): - final index = state.dialogs.indexWhere((e) => e.id == event.dialog.id); - final image = event.dialog.image; - final responses = []; - if (image != null && !state.images.containsKey(image)) { - responses.add(ImagesRequest([image])); - } - if (index != -1) { - return ServerProcessed( - state.copyWith.dialogs.replace(index, event.dialog), - responses, - ); - } - return ServerProcessed( - state.copyWith.dialogs.add(event.dialog), - responses, - ); - case DialogsClosed(): - return ServerProcessed( - state.copyWith.dialogs.where( - (e) => !(event.ids?.contains(e.id) ?? true), - ), - ); - case ImagesUpdated(): - return ServerProcessed( - state.copyWith(images: {...state.images, ...event.images}), - ); - case ServerStateUpdated(): - return ServerProcessed(state.copyWith(serverState: event.state)); - case AuthenticatedRequested(): - return ServerProcessed(state.copyWith(authRequest: event)); - case WaypointChanged(): - var info = state.info; - final team = event.team; - final waypoints = List.from( - team == null ? info.waypoints : (info.teams[team]?.waypoints ?? []), - ); - final index = waypoints.indexWhere( - (e) => e.name == (event.name ?? event.waypoint.name), - ); - if (index != -1) { - waypoints[index] = event.waypoint; - } else { - waypoints.add(event.waypoint); - } - if (team == null) { - info = info.copyWith(waypoints: waypoints); - } else { - final gameTeam = info.teams[event.team]; - if (gameTeam != null) { - info = info.copyWith.teams.put( - team, - gameTeam.copyWith(waypoints: waypoints), - ); - } - } - return ServerProcessed(state.copyWith(info: info)); - case WaypointRemoved(): - var info = state.info; - final team = event.team; - final waypoints = team == null - ? List.from(info.waypoints) - : List.from(info.teams[team]?.waypoints ?? []); - waypoints.removeWhere((e) => e.name == event.name); - if (team == null) { - info = info.copyWith(waypoints: waypoints); - } else { - final gameTeam = info.teams[event.team]; - if (gameTeam != null) { - info = info.copyWith.teams.put( - team, - gameTeam.copyWith(waypoints: waypoints), - ); - } - } - return ServerProcessed(state.copyWith(info: info)); - case CellSwitched(): - return ServerProcessed(null); - case ToolbarUpdated(): - return ServerProcessed(state.copyWith(toolbar: event.toolbar)); - } -} +import 'package:collection/collection.dart'; +import 'package:dart_leap/dart_leap.dart'; +import 'package:networker/networker.dart'; +import 'package:setonix_api/setonix_api.dart'; + +bool isValidServerEvent(ServerWorldEvent event, WorldState state) => + switch (event) { + WorldInitialized() => + event.info?.packs.length == event.packsSignature?.length && + (event.info?.packs.every( + (e) => event.packsSignature?.any((p) => p.id == e) ?? false, + ) ?? + true), + TeamJoined() => state.info.teams.containsKey(event.team), + TeamLeft() => state.info.teams.containsKey(event.team), + CellShuffled() => event.positions.every( + (e) => e.inRange( + 0, + state + .getTableOrDefault(event.cell.table) + .getCell(event.cell.position) + .objects + .length - + 1, + ), + ), + ObjectsMoved() => + event.from != event.to && + event.objects.every( + (e) => e.inRange( + 0, + state + .getTableOrDefault(event.table) + .getCell(event.from) + .objects + .length - + 1, + ), + ), + CellHideChanged() => + event.object?.inRange( + 0, + state + .getTableOrDefault(event.cell.table) + .getCell(event.cell.position) + .objects + .length - + 1, + ) ?? + true, + ObjectIndexChanged() => event.index.inRange( + 0, + state + .getTableOrDefault(event.cell.table) + .getCell(event.cell.position) + .objects + .length - + 1, + ), + CellMergeStrategyChanged() => + event.span > 0 && event.span <= GameTable.maxMergeSpan, + DialogOpened() => event.dialog.isValid(), + _ => true, + }; + +sealed class FatalServerEventError {} + +final class InvalidPacksError extends FatalServerEventError { + final List signature, expected; + + InvalidPacksError({required this.signature, required this.expected}); + + @override + String toString() => + 'Server requested packs, that are not available on the client (or is empty): $signature, expected: $expected'; +} + +bool isServerSupported( + List mySignature, + List serverSignature, +) { + for (final entry in serverSignature) { + final current = mySignature.firstWhereOrNull((e) => e.id == entry.id); + if (current == null || !current.supports(entry)) { + return false; + } + } + return true; +} + +class ServerProcessed { + final WorldState? state; + final List responses; + + ServerProcessed(this.state, [this.responses = const []]); +} + +ServerProcessed processServerEvent( + ServerWorldEvent event, + WorldState state, { + required List signature, +}) { + if (!isValidServerEvent(event, state)) return ServerProcessed(null); + switch (event) { + case WorldInitialized(): + final serverSignature = event.packsSignature; + final supported = serverSignature == null + ? true + : isServerSupported(signature, serverSignature); + if (!supported) { + throw InvalidPacksError( + signature: serverSignature, + expected: signature, + ); + } + return ServerProcessed( + state.copyWith( + table: event.table ?? state.table, + id: event.id ?? state.id, + teamMembers: event.teamMembers ?? state.teamMembers, + info: event.info ?? state.info, + dialogs: event.clearUserInterface ? [] : state.dialogs, + images: event.clearUserInterface ? {} : state.images, + gameState: GameState.play, + authRequest: null, + ), + ); + case TeamJoined(): + return ServerProcessed( + state.copyWith( + teamMembers: { + ...state.teamMembers, + event.team: {...?state.teamMembers[event.team], event.user}, + }, + ), + ); + case TeamLeft(): + final members = Set.from(state.teamMembers[event.team] ?? {}); + members.remove(event.user); + final allMembers = Map>.from(state.teamMembers); + if (members.isEmpty) { + allMembers.remove(event.team); + } else { + allMembers[event.team] = members; + } + return ServerProcessed(state.copyWith(teamMembers: allMembers)); + case ObjectsChanged(): + return ServerProcessed( + state.mapTableOrDefault(event.cell.table, (table) { + final cell = table.cells[event.cell.position] ?? TableCell(); + final newCell = cell.copyWith(objects: event.objects); + if (newCell.isEmpty) { + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..remove(event.cell.position), + ); + } + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..[event.cell.position] = newCell, + ); + }), + ); + case CellShuffled(positions: final positions): + return ServerProcessed( + state.mapTableOrDefault(event.cell.table, (table) { + final cell = table.cells[event.cell.position] ?? TableCell(); + final objects = cell.objects; + final newObjects = List.from(objects); + for (var i = 0; i < positions.length; i++) { + newObjects[positions[i]] = objects[i]; + } + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..[event.cell.position] = cell.copyWith(objects: newObjects), + ); + }), + ); + case BackgroundChanged(): + return ServerProcessed( + state.copyWith.table(background: event.background), + ); + case ObjectsSpawned(): + return ServerProcessed( + state.mapTableOrDefault(event.table, (table) { + final cells = Map.from(table.cells); + for (final entry in event.objects.entries) { + cells[entry.key] = table + .getCell(entry.key) + .copyWith + .objects + .addAll(entry.value); + } + return table.copyWith.cellsBox(content: cells); + }), + ); + case ObjectsMoved(): + return ServerProcessed( + state.mapTableOrDefault(event.table, (table) { + var from = table.cells[event.from] ?? TableCell(); + var to = table.cells[event.to] ?? TableCell(); + final toRemove = List.from(event.objects) + ..sort((a, b) => b.compareTo(a)); + final toAdd = toRemove.map((e) => from.objects[e]).toList(); + final newObjects = List.from(from.objects); + for (final i in toRemove) { + newObjects.removeAt(i); + } + from = from.copyWith(objects: newObjects); + to = to.copyWith(objects: [...to.objects, ...toAdd]); + final cells = Map.from(table.cells) + ..[event.to] = to; + if (from.isEmpty) { + cells.remove(event.from); + } else { + cells[event.from] = from; + } + + return table.copyWith.cellsBox(content: cells); + }), + ); + case CellHideChanged(): + return ServerProcessed( + state.mapTableOrDefault(event.cell.table, (table) { + final cell = table.cells[event.cell.position] ?? TableCell(); + final objectIndex = event.object; + if (objectIndex != null) { + final object = cell.objects[objectIndex]; + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..[event.cell.position] = cell.copyWith.objects.replace( + objectIndex, + object.copyWith(hidden: event.hide ?? !object.hidden), + ), + ); + } + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..[event.cell.position] = cell.copyWith( + objects: cell.objects + .map((e) => e.copyWith(hidden: event.hide ?? !e.hidden)) + .toList(), + ), + ); + }), + ); + case ObjectsRemoved(): + return ServerProcessed( + state.mapTableOrDefault(event.cell.table, (table) { + final cell = table.cells[event.cell.position] ?? TableCell(); + final objectIndex = event.objects; + var newCell = cell; + if (objectIndex != null) { + final objects = List.from(cell.objects); + final indexes = objectIndex.toList() + ..sort((a, b) => b.compareTo(a)); + for (final index in indexes) { + objects.removeAt(index); + } + newCell = cell.copyWith(); + } else { + newCell = cell.copyWith(objects: []); + } + if (newCell.isEmpty) { + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..remove(event.cell.position), + ); + } + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..[event.cell.position] = newCell, + ); + }), + ); + case ObjectIndexChanged(): + return ServerProcessed( + state.mapTableOrDefault(event.cell.table, (table) { + final cell = table.cells[event.cell.position] ?? TableCell(); + final object = cell.objects[event.object]; + final newObjects = List.from(cell.objects); + newObjects.removeAt(event.object); + newObjects.insert(event.index, object); + return table.copyWith.cellsBox( + content: Map.from(table.cells) + ..[event.cell.position] = cell.copyWith(objects: newObjects), + ); + }), + ); + case TeamChanged(): + var info = state.info; + var newName = event.newName; + var teamMembers = Map>.from(state.teamMembers); + if (newName != null) { + final teams = Map.fromEntries( + info.teams.entries.map((e) { + if (e.key == event.name) { + return MapEntry(newName, event.team); + } + return e; + }), + ); + info = info.copyWith(teams: teams); + teamMembers[newName] = teamMembers.remove(event.name) ?? {}; + } else { + info = info.copyWith.teams.put(event.name, event.team); + } + return ServerProcessed( + state.copyWith(info: info, teamMembers: teamMembers), + ); + case TeamRemoved(): + return ServerProcessed( + state.copyWith( + info: state.info.copyWith.teams.remove(event.team), + teamMembers: Map.from(state.teamMembers)..remove(event.team), + ), + ); + case CellMergeStrategyChanged(): + return ServerProcessed( + state.mapTableOrDefault(event.cell.table, (table) { + final cell = table.getCell(event.cell.position); + final cells = Map.from(table.cells); + + CellMergeDirection? getDirection(CellMergeStrategy? strategy) { + if (strategy is LayoutCellMergeStrategy) return strategy.direction; + return null; + } + + // Cleanup old neighbors + final oldCell = cells[event.cell.position]; + final oldStrategy = oldCell?.merge; + final oldDirection = getDirection(oldStrategy); + if (oldDirection != null) { + final oldSpan = table.calculateSpan( + event.cell.position, + oldDirection, + ); + if (oldSpan > 1) { + var current = event.cell.position; + for (var i = 1; i < oldSpan; i++) { + current = oldDirection == CellMergeDirection.horizontal + ? VectorDefinition(current.x + 1, current.y) + : VectorDefinition(current.x, current.y + 1); + + final neighbor = cells[current] ?? TableCell(); + if (neighbor.merge is MergedCellStrategy && + (neighbor.merge as MergedCellStrategy).direction == + oldDirection) { + final updatedNeighbor = neighbor.copyWith(merge: null); + if (updatedNeighbor.isEmpty) { + cells.remove(current); + } else { + cells[current] = updatedNeighbor; + } + } + } + } + } + + // Update target cell + var newCell = cell.copyWith(merge: event.strategy); + + // Expand new neighbors + + final strategy = event.strategy; + + final span = event.span; + + if (strategy != null) { + final direction = getDirection(strategy); + + if (direction != null) { + var current = event.cell.position; + final allObjects = (cells[current] ?? TableCell()).objects + .toList(); + + for (var i = 1; i < span; i++) { + current = direction == CellMergeDirection.horizontal + ? VectorDefinition(current.x + 1, current.y) + : VectorDefinition(current.x, current.y + 1); + + final neighbor = cells[current] ?? TableCell(); + if (neighbor.objects.isNotEmpty) { + allObjects.addAll(neighbor.objects); + } + + cells[current] = neighbor.copyWith( + merge: MergedCellStrategy(direction), + objects: [], + ); + } + newCell = newCell.copyWith(objects: allObjects); + } + } + cells[event.cell.position] = newCell; + + return table.copyWith.cellsBox(content: cells); + }), + ); + case MetadataChanged(): + return ServerProcessed(state.copyWith(metadata: event.metadata)); + case MessageSent(): + return ServerProcessed( + state.copyWith.messages.add( + ChatMessage( + author: event.user, + content: event.message, + timestamp: DateTime.now(), + ), + ), + ); + case TableRenamed(): + final data = state.data.getTable(event.name); + return ServerProcessed( + state.copyWith( + tableName: event.name == state.tableName + ? event.newName + : state.tableName, + data: data == null + ? state.data + : state.data + .removeTable(event.name) + .setTable(data, event.newName), + ), + ); + case TableRemoved(): + return ServerProcessed( + state.copyWith( + tableName: state.tableName == event.name ? '' : state.tableName, + data: state.data.removeTable(event.name), + info: state.info.copyWith( + teams: state.info.teams.map( + (k, v) => MapEntry( + k, + v.copyWith( + claimedCells: v.claimedCells + .where((e) => e.table != event.name) + .toSet(), + waypoints: v.waypoints + .where((e) => e.position.table != event.name) + .toList(), + ), + ), + ), + ), + ), + ); + case NoteChanged(): + return ServerProcessed( + state.copyWith(data: state.data.setNote(event.name, event.content)), + ); + case NoteRemoved(): + return ServerProcessed( + state.copyWith(data: state.data.removeNote(event.name)), + ); + case BoardTilesSpawned(): + return ServerProcessed( + state.mapTableOrDefault(event.table, (table) { + final cells = Map.from(table.cells); + for (final entry in event.tiles.entries) { + cells[entry.key] = table + .getCell(entry.key) + .copyWith + .tiles + .addAll(entry.value); + } + return table.copyWith.cellsBox(content: cells); + }), + ); + case BoardTilesChanged(): + return ServerProcessed( + state.mapTableOrDefault(event.table, (table) { + final cells = Map.from(table.cells); + for (final entry in event.tiles.entries) { + final newCell = table + .getCell(entry.key) + .copyWith(tiles: entry.value); + if (newCell.isEmpty) { + cells.remove(entry.key); + } else { + cells[entry.key] = newCell; + } + } + return table.copyWith.cellsBox(content: cells); + }), + ); + case DialogOpened(): + final index = state.dialogs.indexWhere((e) => e.id == event.dialog.id); + final image = event.dialog.image; + final responses = []; + if (image != null && !state.images.containsKey(image)) { + responses.add(ImagesRequest([image])); + } + if (index != -1) { + return ServerProcessed( + state.copyWith.dialogs.replace(index, event.dialog), + responses, + ); + } + return ServerProcessed( + state.copyWith.dialogs.add(event.dialog), + responses, + ); + case DialogsClosed(): + return ServerProcessed( + state.copyWith.dialogs.where( + (e) => !(event.ids?.contains(e.id) ?? true), + ), + ); + case ImagesUpdated(): + return ServerProcessed( + state.copyWith(images: {...state.images, ...event.images}), + ); + case ServerStateUpdated(): + return ServerProcessed(state.copyWith(serverState: event.state)); + case AuthenticatedRequested(): + return ServerProcessed(state.copyWith(authRequest: event)); + case WaypointChanged(): + var info = state.info; + final team = event.team; + final waypoints = List.from( + team == null ? info.waypoints : (info.teams[team]?.waypoints ?? []), + ); + final index = waypoints.indexWhere( + (e) => e.name == (event.name ?? event.waypoint.name), + ); + if (index != -1) { + waypoints[index] = event.waypoint; + } else { + waypoints.add(event.waypoint); + } + if (team == null) { + info = info.copyWith(waypoints: waypoints); + } else { + final gameTeam = info.teams[event.team]; + if (gameTeam != null) { + info = info.copyWith.teams.put( + team, + gameTeam.copyWith(waypoints: waypoints), + ); + } + } + return ServerProcessed(state.copyWith(info: info)); + case WaypointRemoved(): + var info = state.info; + final team = event.team; + final waypoints = team == null + ? List.from(info.waypoints) + : List.from(info.teams[team]?.waypoints ?? []); + waypoints.removeWhere((e) => e.name == event.name); + if (team == null) { + info = info.copyWith(waypoints: waypoints); + } else { + final gameTeam = info.teams[event.team]; + if (gameTeam != null) { + info = info.copyWith.teams.put( + team, + gameTeam.copyWith(waypoints: waypoints), + ); + } + } + return ServerProcessed(state.copyWith(info: info)); + case CellSwitched(): + return ServerProcessed(null); + case ToolbarUpdated(): + return ServerProcessed(state.copyWith(toolbar: event.toolbar)); + } +} diff --git a/api/lib/src/event/server.dart b/api/lib/src/event/server.dart index c73342a4..b4756485 100644 --- a/api/lib/src/event/server.dart +++ b/api/lib/src/event/server.dart @@ -1,281 +1,281 @@ -part of 'event.dart'; - -/// Events that will be send by the client -/// Naming convention: present tense + Event -@MappableClass(discriminatorKey: 'type') -sealed class ServerWorldEvent extends PlayableWorldEvent - with ServerWorldEventMappable { - const ServerWorldEvent(); -} - -@MappableClass() -final class WorldInitialized extends ServerWorldEvent - with WorldInitializedMappable { - final GameTable? table; - final GameInfo? info; - final Map>? teamMembers; - final Channel? id; - final List? packsSignature; - final bool clearUserInterface; - - WorldInitialized({ - this.table, - this.info, - this.teamMembers, - this.id, - this.packsSignature, - this.clearUserInterface = false, - }); - - factory WorldInitialized.fromMode( - PackItem? mode, - WorldState state, - ) => WorldInitialized( - clearUserInterface: true, - info: state.info.copyWith( - teams: mode?.item.teams ?? {}, - gameMode: mode?.location, - ), - table: mode?.item.tables[state.tableName] ?? GameTable(), - teamMembers: const {}, - ); -} - -@MappableClass() -final class TeamJoined extends ServerWorldEvent with TeamJoinedMappable { - final Channel user; - final String team; - - TeamJoined(this.user, this.team); -} - -@MappableClass() -final class TeamLeft extends ServerWorldEvent with TeamLeftMappable { - final Channel user; - final String team; - - TeamLeft(this.user, this.team); -} - -@MappableClass() -final class ObjectsChanged extends ServerWorldEvent - with ObjectsChangedMappable { - final GlobalVectorDefinition cell; - final List objects; - - ObjectsChanged(this.cell, [this.objects = const []]); - - ObjectsChanged addObjects(List objects) => - copyWith.objects.addAll(objects); - - ObjectsChanged addObject(GameObject object) => addObjects([object]); - - ObjectsChanged object( - ItemLocation asset, { - String? variation, - bool hidden = false, - }) => addObject(GameObject(asset, variation: variation, hidden: hidden)); -} - -@MappableClass() -final class CellShuffled extends ServerWorldEvent with CellShuffledMappable { - final GlobalVectorDefinition cell; - final List positions; - - CellShuffled(this.cell, [this.positions = const []]); - - CellShuffled addPositions(List positions) => - copyWith(positions: [...this.positions, ...positions]); - - CellShuffled addPosition(int position) => addPositions([position]); - - Map getObjects(WorldState state) { - final cellObject = state - .getTableOrDefault(cell.table) - .getCell(cell.position); - return Map.fromEntries( - positions.map((e) { - final object = cellObject.objects.elementAtOrNull(e); - if (object == null) return null; - return MapEntry(e, object); - }).nonNulls, - ); - } -} - -@MappableClass() -final class MessageSent extends ServerWorldEvent with MessageSentMappable { - final Channel user; - final String message; - - MessageSent(this.user, this.message); -} - -@MappableClass() -final class BoardTilesSpawned extends ServerWorldEvent - with BoardTilesSpawnedMappable { - final String table; - final Map> tiles; - - BoardTilesSpawned(this.table, [this.tiles = const {}]); - BoardTilesSpawned.single( - GlobalVectorDefinition position, - List tiles, - ) : table = position.table, - tiles = {position.position: tiles}; - BoardTilesSpawned.singleTile(GlobalVectorDefinition position, BoardTile tile) - : table = position.table, - tiles = { - position.position: [tile], - }; - - BoardTilesSpawned addTiles(int x, int y, List tiles) => copyWith( - tiles: { - ...this.tiles, - VectorDefinition(x, y): [ - ...?this.tiles[VectorDefinition(x, y)], - ...tiles, - ], - }, - ); - - BoardTilesSpawned addTile(int x, int y, BoardTile tile) => - addTiles(x, y, [tile]); - - BoardTilesSpawned tile( - int x, - int y, - ItemLocation asset, - int tileX, - int tileY, - ) => addTile(x, y, BoardTile(asset, VectorDefinition(tileX, tileY))); -} - -@MappableClass() -final class BoardTilesChanged extends ServerWorldEvent - with BoardTilesChangedMappable { - final String table; - final Map> tiles; - - BoardTilesChanged(this.table, [this.tiles = const {}]); - BoardTilesChanged.single( - GlobalVectorDefinition position, - List tiles, - ) : table = position.table, - tiles = {position.position: tiles}; - BoardTilesChanged.singleTile(GlobalVectorDefinition position, BoardTile tile) - : table = position.table, - tiles = { - position.position: [tile], - }; - - BoardTilesChanged addTiles(int x, int y, List tiles) => copyWith( - tiles: { - ...this.tiles, - VectorDefinition(x, y): [ - ...?this.tiles[VectorDefinition(x, y)], - ...tiles, - ], - }, - ); - - BoardTilesChanged addTile(int x, int y, BoardTile tile) => - addTiles(x, y, [tile]); - - BoardTilesChanged tile( - int x, - int y, - ItemLocation asset, - int tileX, - int tileY, - ) => addTile(x, y, BoardTile(asset, VectorDefinition(tileX, tileY))); -} - -@MappableClass() -final class DialogOpened extends ServerWorldEvent with DialogOpenedMappable { - final GameDialog dialog; - final bool closeOthers; - - DialogOpened(this.dialog, {this.closeOthers = false}); -} - -@MappableClass() -final class DialogsClosed extends ServerWorldEvent with DialogsClosedMappable { - final List? ids; - - DialogsClosed(this.ids); - DialogsClosed.single(String id) : ids = [id]; - DialogsClosed.all() : ids = null; -} - -class Base64Uint8ListHook extends SimpleMapper { - const Base64Uint8ListHook(); - - @override - Uint8List decode(Object value) { - if (value is String) { - return base64Decode(value); - } - return value as Uint8List; - } - - @override - Object? encode(Uint8List self) { - return base64Encode(self); - } -} - -class Base64IdMapHook extends SimpleMapper> { - const Base64IdMapHook(); - - @override - Map decode(Object value) { - if (value is Map) { - return value.map((key, value) { - if (value is String) { - return MapEntry(key, base64Decode(value)); - } - return MapEntry(key, value as Uint8List); - }); - } - return {}; - } - - @override - Object? encode(Map self) { - return self.map((key, value) => MapEntry(key, base64Encode(value))); - } -} - -@MappableClass(includeCustomMappers: [Base64IdMapHook()]) -final class ImagesUpdated extends ServerWorldEvent with ImagesUpdatedMappable { - final Map images; - - const ImagesUpdated(this.images); - ImagesUpdated.single(String id, Uint8List image) : images = {id: image}; -} - -@MappableClass() -final class ServerStateUpdated extends ServerWorldEvent - with ServerStateUpdatedMappable { - final ServerState state; - - const ServerStateUpdated(this.state); -} - -@MappableClass(includeCustomMappers: [Base64Uint8ListHook()]) -final class AuthenticatedRequested extends ServerWorldEvent - with AuthenticatedRequestedMappable { - final Uint8List challenge; - final bool isRequired; - - const AuthenticatedRequested(this.challenge, {this.isRequired = true}); -} - -@MappableClass() -final class ToolbarUpdated extends ServerWorldEvent - with ToolbarUpdatedMappable { - final GameToolbar toolbar; - - const ToolbarUpdated(this.toolbar); -} +part of 'event.dart'; + +/// Events that will be send by the client +/// Naming convention: present tense + Event +@MappableClass(discriminatorKey: 'type') +sealed class ServerWorldEvent extends PlayableWorldEvent + with ServerWorldEventMappable { + const ServerWorldEvent(); +} + +@MappableClass() +final class WorldInitialized extends ServerWorldEvent + with WorldInitializedMappable { + final GameTable? table; + final GameInfo? info; + final Map>? teamMembers; + final Channel? id; + final List? packsSignature; + final bool clearUserInterface; + + WorldInitialized({ + this.table, + this.info, + this.teamMembers, + this.id, + this.packsSignature, + this.clearUserInterface = false, + }); + + factory WorldInitialized.fromMode( + PackItem? mode, + WorldState state, + ) => WorldInitialized( + clearUserInterface: true, + info: state.info.copyWith( + teams: mode?.item.teams ?? {}, + gameMode: mode?.location, + ), + table: mode?.item.tables[state.tableName] ?? GameTable(), + teamMembers: const {}, + ); +} + +@MappableClass() +final class TeamJoined extends ServerWorldEvent with TeamJoinedMappable { + final Channel user; + final String team; + + TeamJoined(this.user, this.team); +} + +@MappableClass() +final class TeamLeft extends ServerWorldEvent with TeamLeftMappable { + final Channel user; + final String team; + + TeamLeft(this.user, this.team); +} + +@MappableClass() +final class ObjectsChanged extends ServerWorldEvent + with ObjectsChangedMappable { + final GlobalVectorDefinition cell; + final List objects; + + ObjectsChanged(this.cell, [this.objects = const []]); + + ObjectsChanged addObjects(List objects) => + copyWith.objects.addAll(objects); + + ObjectsChanged addObject(GameObject object) => addObjects([object]); + + ObjectsChanged object( + ItemLocation asset, { + String? variation, + bool hidden = false, + }) => addObject(GameObject(asset, variation: variation, hidden: hidden)); +} + +@MappableClass() +final class CellShuffled extends ServerWorldEvent with CellShuffledMappable { + final GlobalVectorDefinition cell; + final List positions; + + CellShuffled(this.cell, [this.positions = const []]); + + CellShuffled addPositions(List positions) => + copyWith(positions: [...this.positions, ...positions]); + + CellShuffled addPosition(int position) => addPositions([position]); + + Map getObjects(WorldState state) { + final cellObject = state + .getTableOrDefault(cell.table) + .getCell(cell.position); + return Map.fromEntries( + positions.map((e) { + final object = cellObject.objects.elementAtOrNull(e); + if (object == null) return null; + return MapEntry(e, object); + }).nonNulls, + ); + } +} + +@MappableClass() +final class MessageSent extends ServerWorldEvent with MessageSentMappable { + final Channel user; + final String message; + + MessageSent(this.user, this.message); +} + +@MappableClass() +final class BoardTilesSpawned extends ServerWorldEvent + with BoardTilesSpawnedMappable { + final String table; + final Map> tiles; + + BoardTilesSpawned(this.table, [this.tiles = const {}]); + BoardTilesSpawned.single( + GlobalVectorDefinition position, + List tiles, + ) : table = position.table, + tiles = {position.position: tiles}; + BoardTilesSpawned.singleTile(GlobalVectorDefinition position, BoardTile tile) + : table = position.table, + tiles = { + position.position: [tile], + }; + + BoardTilesSpawned addTiles(int x, int y, List tiles) => copyWith( + tiles: { + ...this.tiles, + VectorDefinition(x, y): [ + ...?this.tiles[VectorDefinition(x, y)], + ...tiles, + ], + }, + ); + + BoardTilesSpawned addTile(int x, int y, BoardTile tile) => + addTiles(x, y, [tile]); + + BoardTilesSpawned tile( + int x, + int y, + ItemLocation asset, + int tileX, + int tileY, + ) => addTile(x, y, BoardTile(asset, VectorDefinition(tileX, tileY))); +} + +@MappableClass() +final class BoardTilesChanged extends ServerWorldEvent + with BoardTilesChangedMappable { + final String table; + final Map> tiles; + + BoardTilesChanged(this.table, [this.tiles = const {}]); + BoardTilesChanged.single( + GlobalVectorDefinition position, + List tiles, + ) : table = position.table, + tiles = {position.position: tiles}; + BoardTilesChanged.singleTile(GlobalVectorDefinition position, BoardTile tile) + : table = position.table, + tiles = { + position.position: [tile], + }; + + BoardTilesChanged addTiles(int x, int y, List tiles) => copyWith( + tiles: { + ...this.tiles, + VectorDefinition(x, y): [ + ...?this.tiles[VectorDefinition(x, y)], + ...tiles, + ], + }, + ); + + BoardTilesChanged addTile(int x, int y, BoardTile tile) => + addTiles(x, y, [tile]); + + BoardTilesChanged tile( + int x, + int y, + ItemLocation asset, + int tileX, + int tileY, + ) => addTile(x, y, BoardTile(asset, VectorDefinition(tileX, tileY))); +} + +@MappableClass() +final class DialogOpened extends ServerWorldEvent with DialogOpenedMappable { + final GameDialog dialog; + final bool closeOthers; + + DialogOpened(this.dialog, {this.closeOthers = false}); +} + +@MappableClass() +final class DialogsClosed extends ServerWorldEvent with DialogsClosedMappable { + final List? ids; + + DialogsClosed(this.ids); + DialogsClosed.single(String id) : ids = [id]; + DialogsClosed.all() : ids = null; +} + +class Base64Uint8ListHook extends SimpleMapper { + const Base64Uint8ListHook(); + + @override + Uint8List decode(Object value) { + if (value is String) { + return base64Decode(value); + } + return value as Uint8List; + } + + @override + Object? encode(Uint8List self) { + return base64Encode(self); + } +} + +class Base64IdMapHook extends SimpleMapper> { + const Base64IdMapHook(); + + @override + Map decode(Object value) { + if (value is Map) { + return value.map((key, value) { + if (value is String) { + return MapEntry(key, base64Decode(value)); + } + return MapEntry(key, value as Uint8List); + }); + } + return {}; + } + + @override + Object? encode(Map self) { + return self.map((key, value) => MapEntry(key, base64Encode(value))); + } +} + +@MappableClass(includeCustomMappers: [Base64IdMapHook()]) +final class ImagesUpdated extends ServerWorldEvent with ImagesUpdatedMappable { + final Map images; + + const ImagesUpdated(this.images); + ImagesUpdated.single(String id, Uint8List image) : images = {id: image}; +} + +@MappableClass() +final class ServerStateUpdated extends ServerWorldEvent + with ServerStateUpdatedMappable { + final ServerState state; + + const ServerStateUpdated(this.state); +} + +@MappableClass(includeCustomMappers: [Base64Uint8ListHook()]) +final class AuthenticatedRequested extends ServerWorldEvent + with AuthenticatedRequestedMappable { + final Uint8List challenge; + final bool isRequired; + + const AuthenticatedRequested(this.challenge, {this.isRequired = true}); +} + +@MappableClass() +final class ToolbarUpdated extends ServerWorldEvent + with ToolbarUpdatedMappable { + final GameToolbar toolbar; + + const ToolbarUpdated(this.toolbar); +} diff --git a/api/lib/src/event/state.mapper.dart b/api/lib/src/event/state.mapper.dart index 0824e91c..4f563e14 100644 --- a/api/lib/src/event/state.mapper.dart +++ b/api/lib/src/event/state.mapper.dart @@ -1,503 +1,503 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'state.dart'; - -/// @nodoc - -class WorldOperationModeMapper extends EnumMapper { - WorldOperationModeMapper._(); - - static WorldOperationModeMapper? _instance; - static WorldOperationModeMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WorldOperationModeMapper._()); - } - return _instance!; - } - - static WorldOperationMode fromValue(dynamic value) { - ensureInitialized(); - return MapperContainer.globals.fromValue(value); - } - - @override - WorldOperationMode decode(dynamic value) { - switch (value) { - case r'figures': - return WorldOperationMode.figures; - case r'boards': - return WorldOperationMode.boards; - default: - throw MapperException.unknownEnumValue(value); - } - } - - @override - dynamic encode(WorldOperationMode self) { - switch (self) { - case WorldOperationMode.figures: - return r'figures'; - case WorldOperationMode.boards: - return r'boards'; - } - } -} - -/// @nodoc - -extension WorldOperationModeMapperExtension on WorldOperationMode { - String toValue() { - WorldOperationModeMapper.ensureInitialized(); - return MapperContainer.globals.toValue(this) as String; - } -} - -/// @nodoc - -class GameStateMapper extends EnumMapper { - GameStateMapper._(); - - static GameStateMapper? _instance; - static GameStateMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameStateMapper._()); - } - return _instance!; - } - - static GameState fromValue(dynamic value) { - ensureInitialized(); - return MapperContainer.globals.fromValue(value); - } - - @override - GameState decode(dynamic value) { - switch (value) { - case r'configuration': - return GameState.configuration; - case r'play': - return GameState.play; - default: - throw MapperException.unknownEnumValue(value); - } - } - - @override - dynamic encode(GameState self) { - switch (self) { - case GameState.configuration: - return r'configuration'; - case GameState.play: - return r'play'; - } - } -} - -/// @nodoc - -extension GameStateMapperExtension on GameState { - String toValue() { - GameStateMapper.ensureInitialized(); - return MapperContainer.globals.toValue(this) as String; - } -} - -/// @nodoc -class WorldStateMapper extends ClassMapperBase { - WorldStateMapper._(); - - static WorldStateMapper? _instance; - static WorldStateMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WorldStateMapper._()); - GameStateMapper.ensureInitialized(); - GameTableMapper.ensureInitialized(); - GameInfoMapper.ensureInitialized(); - FileMetadataMapper.ensureInitialized(); - ChatMessageMapper.ensureInitialized(); - GameDialogMapper.ensureInitialized(); - ServerStateMapper.ensureInitialized(); - AuthenticatedRequestedMapper.ensureInitialized(); - GameToolbarMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'WorldState'; - - static String? _$name(WorldState v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - opt: true, - ); - static GameState _$gameState(WorldState v) => v.gameState; - static const Field _f$gameState = Field( - 'gameState', - _$gameState, - opt: true, - def: GameState.play, - ); - static GameTable _$table(WorldState v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - opt: true, - def: const GameTable(), - ); - static String _$tableName(WorldState v) => v.tableName; - static const Field _f$tableName = Field( - 'tableName', - _$tableName, - opt: true, - def: '', - ); - static GameInfo _$info(WorldState v) => v.info; - static const Field _f$info = Field( - 'info', - _$info, - opt: true, - def: const GameInfo(), - ); - static FileMetadata _$metadata(WorldState v) => v.metadata; - static const Field _f$metadata = Field( - 'metadata', - _$metadata, - opt: true, - def: const FileMetadata(), - ); - static Map> _$teamMembers(WorldState v) => v.teamMembers; - static const Field>> _f$teamMembers = Field( - 'teamMembers', - _$teamMembers, - opt: true, - def: const {}, - ); - static List _$messages(WorldState v) => v.messages; - static const Field> _f$messages = Field( - 'messages', - _$messages, - opt: true, - def: const [], - ); - static int _$id(WorldState v) => v.id; - static const Field _f$id = Field( - 'id', - _$id, - opt: true, - def: kAuthorityChannel, - ); - static List _$dialogs(WorldState v) => v.dialogs; - static const Field> _f$dialogs = Field( - 'dialogs', - _$dialogs, - opt: true, - def: const [], - ); - static Map _$images(WorldState v) => v.images; - static const Field> _f$images = Field( - 'images', - _$images, - opt: true, - def: const {}, - ); - static ServerState _$serverState(WorldState v) => v.serverState; - static const Field _f$serverState = Field( - 'serverState', - _$serverState, - opt: true, - def: const ServerState(), - ); - static AuthenticatedRequested? _$authRequest(WorldState v) => v.authRequest; - static const Field _f$authRequest = Field( - 'authRequest', - _$authRequest, - opt: true, - ); - static GameToolbar _$toolbar(WorldState v) => v.toolbar; - static const Field _f$toolbar = Field( - 'toolbar', - _$toolbar, - opt: true, - def: const GameToolbar(), - ); - static SetonixData _$data(WorldState v) => v.data; - static const Field _f$data = Field('data', _$data); - - @override - final MappableFields fields = const { - #name: _f$name, - #gameState: _f$gameState, - #table: _f$table, - #tableName: _f$tableName, - #info: _f$info, - #metadata: _f$metadata, - #teamMembers: _f$teamMembers, - #messages: _f$messages, - #id: _f$id, - #dialogs: _f$dialogs, - #images: _f$images, - #serverState: _f$serverState, - #authRequest: _f$authRequest, - #toolbar: _f$toolbar, - #data: _f$data, - }; - - static WorldState _instantiate(DecodingData data) { - return WorldState( - name: data.dec(_f$name), - gameState: data.dec(_f$gameState), - table: data.dec(_f$table), - tableName: data.dec(_f$tableName), - info: data.dec(_f$info), - metadata: data.dec(_f$metadata), - teamMembers: data.dec(_f$teamMembers), - messages: data.dec(_f$messages), - id: data.dec(_f$id), - dialogs: data.dec(_f$dialogs), - images: data.dec(_f$images), - serverState: data.dec(_f$serverState), - authRequest: data.dec(_f$authRequest), - toolbar: data.dec(_f$toolbar), - data: data.dec(_f$data), - ); - } - - @override - final Function instantiate = _instantiate; - - static WorldState fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static WorldState fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin WorldStateMappable { - String toJson() { - return WorldStateMapper.ensureInitialized().encodeJson( - this as WorldState, - ); - } - - Map toMap() { - return WorldStateMapper.ensureInitialized().encodeMap( - this as WorldState, - ); - } - - WorldStateCopyWith get copyWith => - _WorldStateCopyWithImpl( - this as WorldState, - $identity, - $identity, - ); - @override - String toString() { - return WorldStateMapper.ensureInitialized().stringifyValue( - this as WorldState, - ); - } - - @override - bool operator ==(Object other) { - return WorldStateMapper.ensureInitialized().equalsValue( - this as WorldState, - other, - ); - } - - @override - int get hashCode { - return WorldStateMapper.ensureInitialized().hashValue(this as WorldState); - } -} - -/// @nodoc -extension WorldStateValueCopy<$R, $Out> - on ObjectCopyWith<$R, WorldState, $Out> { - WorldStateCopyWith<$R, WorldState, $Out> get $asWorldState => - $base.as((v, t, t2) => _WorldStateCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class WorldStateCopyWith<$R, $In extends WorldState, $Out> - implements ClassCopyWith<$R, $In, $Out> { - GameTableCopyWith<$R, GameTable, GameTable> get table; - GameInfoCopyWith<$R, GameInfo, GameInfo> get info; - FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata; - MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>> - get teamMembers; - ListCopyWith< - $R, - ChatMessage, - ChatMessageCopyWith<$R, ChatMessage, ChatMessage> - > - get messages; - ListCopyWith<$R, GameDialog, GameDialogCopyWith<$R, GameDialog, GameDialog>> - get dialogs; - MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> - get images; - ServerStateCopyWith<$R, ServerState, ServerState> get serverState; - AuthenticatedRequestedCopyWith< - $R, - AuthenticatedRequested, - AuthenticatedRequested - >? - get authRequest; - GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar; - $R call({ - String? name, - GameState? gameState, - GameTable? table, - String? tableName, - GameInfo? info, - FileMetadata? metadata, - Map>? teamMembers, - List? messages, - int? id, - List? dialogs, - Map? images, - ServerState? serverState, - AuthenticatedRequested? authRequest, - GameToolbar? toolbar, - SetonixData? data, - }); - WorldStateCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _WorldStateCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, WorldState, $Out> - implements WorldStateCopyWith<$R, WorldState, $Out> { - _WorldStateCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - WorldStateMapper.ensureInitialized(); - @override - GameTableCopyWith<$R, GameTable, GameTable> get table => - $value.table.copyWith.$chain((v) => call(table: v)); - @override - GameInfoCopyWith<$R, GameInfo, GameInfo> get info => - $value.info.copyWith.$chain((v) => call(info: v)); - @override - FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata => - $value.metadata.copyWith.$chain((v) => call(metadata: v)); - @override - MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>> - get teamMembers => MapCopyWith( - $value.teamMembers, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(teamMembers: v), - ); - @override - ListCopyWith< - $R, - ChatMessage, - ChatMessageCopyWith<$R, ChatMessage, ChatMessage> - > - get messages => ListCopyWith( - $value.messages, - (v, t) => v.copyWith.$chain(t), - (v) => call(messages: v), - ); - @override - ListCopyWith<$R, GameDialog, GameDialogCopyWith<$R, GameDialog, GameDialog>> - get dialogs => ListCopyWith( - $value.dialogs, - (v, t) => v.copyWith.$chain(t), - (v) => call(dialogs: v), - ); - @override - MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> - get images => MapCopyWith( - $value.images, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(images: v), - ); - @override - ServerStateCopyWith<$R, ServerState, ServerState> get serverState => - $value.serverState.copyWith.$chain((v) => call(serverState: v)); - @override - AuthenticatedRequestedCopyWith< - $R, - AuthenticatedRequested, - AuthenticatedRequested - >? - get authRequest => - $value.authRequest?.copyWith.$chain((v) => call(authRequest: v)); - @override - GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar => - $value.toolbar.copyWith.$chain((v) => call(toolbar: v)); - @override - $R call({ - Object? name = $none, - GameState? gameState, - GameTable? table, - String? tableName, - GameInfo? info, - FileMetadata? metadata, - Map>? teamMembers, - List? messages, - int? id, - List? dialogs, - Map? images, - ServerState? serverState, - Object? authRequest = $none, - GameToolbar? toolbar, - SetonixData? data, - }) => $apply( - FieldCopyWithData({ - if (name != $none) #name: name, - if (gameState != null) #gameState: gameState, - if (table != null) #table: table, - if (tableName != null) #tableName: tableName, - if (info != null) #info: info, - if (metadata != null) #metadata: metadata, - if (teamMembers != null) #teamMembers: teamMembers, - if (messages != null) #messages: messages, - if (id != null) #id: id, - if (dialogs != null) #dialogs: dialogs, - if (images != null) #images: images, - if (serverState != null) #serverState: serverState, - if (authRequest != $none) #authRequest: authRequest, - if (toolbar != null) #toolbar: toolbar, - if (data != null) #data: data, - }), - ); - @override - WorldState $make(CopyWithData data) => WorldState( - name: data.get(#name, or: $value.name), - gameState: data.get(#gameState, or: $value.gameState), - table: data.get(#table, or: $value.table), - tableName: data.get(#tableName, or: $value.tableName), - info: data.get(#info, or: $value.info), - metadata: data.get(#metadata, or: $value.metadata), - teamMembers: data.get(#teamMembers, or: $value.teamMembers), - messages: data.get(#messages, or: $value.messages), - id: data.get(#id, or: $value.id), - dialogs: data.get(#dialogs, or: $value.dialogs), - images: data.get(#images, or: $value.images), - serverState: data.get(#serverState, or: $value.serverState), - authRequest: data.get(#authRequest, or: $value.authRequest), - toolbar: data.get(#toolbar, or: $value.toolbar), - data: data.get(#data, or: $value.data), - ); - - @override - WorldStateCopyWith<$R2, WorldState, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _WorldStateCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'state.dart'; + +/// @nodoc + +class WorldOperationModeMapper extends EnumMapper { + WorldOperationModeMapper._(); + + static WorldOperationModeMapper? _instance; + static WorldOperationModeMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WorldOperationModeMapper._()); + } + return _instance!; + } + + static WorldOperationMode fromValue(dynamic value) { + ensureInitialized(); + return MapperContainer.globals.fromValue(value); + } + + @override + WorldOperationMode decode(dynamic value) { + switch (value) { + case r'figures': + return WorldOperationMode.figures; + case r'boards': + return WorldOperationMode.boards; + default: + throw MapperException.unknownEnumValue(value); + } + } + + @override + dynamic encode(WorldOperationMode self) { + switch (self) { + case WorldOperationMode.figures: + return r'figures'; + case WorldOperationMode.boards: + return r'boards'; + } + } +} + +/// @nodoc + +extension WorldOperationModeMapperExtension on WorldOperationMode { + String toValue() { + WorldOperationModeMapper.ensureInitialized(); + return MapperContainer.globals.toValue(this) as String; + } +} + +/// @nodoc + +class GameStateMapper extends EnumMapper { + GameStateMapper._(); + + static GameStateMapper? _instance; + static GameStateMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameStateMapper._()); + } + return _instance!; + } + + static GameState fromValue(dynamic value) { + ensureInitialized(); + return MapperContainer.globals.fromValue(value); + } + + @override + GameState decode(dynamic value) { + switch (value) { + case r'configuration': + return GameState.configuration; + case r'play': + return GameState.play; + default: + throw MapperException.unknownEnumValue(value); + } + } + + @override + dynamic encode(GameState self) { + switch (self) { + case GameState.configuration: + return r'configuration'; + case GameState.play: + return r'play'; + } + } +} + +/// @nodoc + +extension GameStateMapperExtension on GameState { + String toValue() { + GameStateMapper.ensureInitialized(); + return MapperContainer.globals.toValue(this) as String; + } +} + +/// @nodoc +class WorldStateMapper extends ClassMapperBase { + WorldStateMapper._(); + + static WorldStateMapper? _instance; + static WorldStateMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WorldStateMapper._()); + GameStateMapper.ensureInitialized(); + GameTableMapper.ensureInitialized(); + GameInfoMapper.ensureInitialized(); + FileMetadataMapper.ensureInitialized(); + ChatMessageMapper.ensureInitialized(); + GameDialogMapper.ensureInitialized(); + ServerStateMapper.ensureInitialized(); + AuthenticatedRequestedMapper.ensureInitialized(); + GameToolbarMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'WorldState'; + + static String? _$name(WorldState v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + opt: true, + ); + static GameState _$gameState(WorldState v) => v.gameState; + static const Field _f$gameState = Field( + 'gameState', + _$gameState, + opt: true, + def: GameState.play, + ); + static GameTable _$table(WorldState v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + opt: true, + def: const GameTable(), + ); + static String _$tableName(WorldState v) => v.tableName; + static const Field _f$tableName = Field( + 'tableName', + _$tableName, + opt: true, + def: '', + ); + static GameInfo _$info(WorldState v) => v.info; + static const Field _f$info = Field( + 'info', + _$info, + opt: true, + def: const GameInfo(), + ); + static FileMetadata _$metadata(WorldState v) => v.metadata; + static const Field _f$metadata = Field( + 'metadata', + _$metadata, + opt: true, + def: const FileMetadata(), + ); + static Map> _$teamMembers(WorldState v) => v.teamMembers; + static const Field>> _f$teamMembers = Field( + 'teamMembers', + _$teamMembers, + opt: true, + def: const {}, + ); + static List _$messages(WorldState v) => v.messages; + static const Field> _f$messages = Field( + 'messages', + _$messages, + opt: true, + def: const [], + ); + static int _$id(WorldState v) => v.id; + static const Field _f$id = Field( + 'id', + _$id, + opt: true, + def: kAuthorityChannel, + ); + static List _$dialogs(WorldState v) => v.dialogs; + static const Field> _f$dialogs = Field( + 'dialogs', + _$dialogs, + opt: true, + def: const [], + ); + static Map _$images(WorldState v) => v.images; + static const Field> _f$images = Field( + 'images', + _$images, + opt: true, + def: const {}, + ); + static ServerState _$serverState(WorldState v) => v.serverState; + static const Field _f$serverState = Field( + 'serverState', + _$serverState, + opt: true, + def: const ServerState(), + ); + static AuthenticatedRequested? _$authRequest(WorldState v) => v.authRequest; + static const Field _f$authRequest = Field( + 'authRequest', + _$authRequest, + opt: true, + ); + static GameToolbar _$toolbar(WorldState v) => v.toolbar; + static const Field _f$toolbar = Field( + 'toolbar', + _$toolbar, + opt: true, + def: const GameToolbar(), + ); + static SetonixData _$data(WorldState v) => v.data; + static const Field _f$data = Field('data', _$data); + + @override + final MappableFields fields = const { + #name: _f$name, + #gameState: _f$gameState, + #table: _f$table, + #tableName: _f$tableName, + #info: _f$info, + #metadata: _f$metadata, + #teamMembers: _f$teamMembers, + #messages: _f$messages, + #id: _f$id, + #dialogs: _f$dialogs, + #images: _f$images, + #serverState: _f$serverState, + #authRequest: _f$authRequest, + #toolbar: _f$toolbar, + #data: _f$data, + }; + + static WorldState _instantiate(DecodingData data) { + return WorldState( + name: data.dec(_f$name), + gameState: data.dec(_f$gameState), + table: data.dec(_f$table), + tableName: data.dec(_f$tableName), + info: data.dec(_f$info), + metadata: data.dec(_f$metadata), + teamMembers: data.dec(_f$teamMembers), + messages: data.dec(_f$messages), + id: data.dec(_f$id), + dialogs: data.dec(_f$dialogs), + images: data.dec(_f$images), + serverState: data.dec(_f$serverState), + authRequest: data.dec(_f$authRequest), + toolbar: data.dec(_f$toolbar), + data: data.dec(_f$data), + ); + } + + @override + final Function instantiate = _instantiate; + + static WorldState fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static WorldState fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin WorldStateMappable { + String toJson() { + return WorldStateMapper.ensureInitialized().encodeJson( + this as WorldState, + ); + } + + Map toMap() { + return WorldStateMapper.ensureInitialized().encodeMap( + this as WorldState, + ); + } + + WorldStateCopyWith get copyWith => + _WorldStateCopyWithImpl( + this as WorldState, + $identity, + $identity, + ); + @override + String toString() { + return WorldStateMapper.ensureInitialized().stringifyValue( + this as WorldState, + ); + } + + @override + bool operator ==(Object other) { + return WorldStateMapper.ensureInitialized().equalsValue( + this as WorldState, + other, + ); + } + + @override + int get hashCode { + return WorldStateMapper.ensureInitialized().hashValue(this as WorldState); + } +} + +/// @nodoc +extension WorldStateValueCopy<$R, $Out> + on ObjectCopyWith<$R, WorldState, $Out> { + WorldStateCopyWith<$R, WorldState, $Out> get $asWorldState => + $base.as((v, t, t2) => _WorldStateCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class WorldStateCopyWith<$R, $In extends WorldState, $Out> + implements ClassCopyWith<$R, $In, $Out> { + GameTableCopyWith<$R, GameTable, GameTable> get table; + GameInfoCopyWith<$R, GameInfo, GameInfo> get info; + FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata; + MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>> + get teamMembers; + ListCopyWith< + $R, + ChatMessage, + ChatMessageCopyWith<$R, ChatMessage, ChatMessage> + > + get messages; + ListCopyWith<$R, GameDialog, GameDialogCopyWith<$R, GameDialog, GameDialog>> + get dialogs; + MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> + get images; + ServerStateCopyWith<$R, ServerState, ServerState> get serverState; + AuthenticatedRequestedCopyWith< + $R, + AuthenticatedRequested, + AuthenticatedRequested + >? + get authRequest; + GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar; + $R call({ + String? name, + GameState? gameState, + GameTable? table, + String? tableName, + GameInfo? info, + FileMetadata? metadata, + Map>? teamMembers, + List? messages, + int? id, + List? dialogs, + Map? images, + ServerState? serverState, + AuthenticatedRequested? authRequest, + GameToolbar? toolbar, + SetonixData? data, + }); + WorldStateCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _WorldStateCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, WorldState, $Out> + implements WorldStateCopyWith<$R, WorldState, $Out> { + _WorldStateCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + WorldStateMapper.ensureInitialized(); + @override + GameTableCopyWith<$R, GameTable, GameTable> get table => + $value.table.copyWith.$chain((v) => call(table: v)); + @override + GameInfoCopyWith<$R, GameInfo, GameInfo> get info => + $value.info.copyWith.$chain((v) => call(info: v)); + @override + FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata => + $value.metadata.copyWith.$chain((v) => call(metadata: v)); + @override + MapCopyWith<$R, String, Set, ObjectCopyWith<$R, Set, Set>> + get teamMembers => MapCopyWith( + $value.teamMembers, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(teamMembers: v), + ); + @override + ListCopyWith< + $R, + ChatMessage, + ChatMessageCopyWith<$R, ChatMessage, ChatMessage> + > + get messages => ListCopyWith( + $value.messages, + (v, t) => v.copyWith.$chain(t), + (v) => call(messages: v), + ); + @override + ListCopyWith<$R, GameDialog, GameDialogCopyWith<$R, GameDialog, GameDialog>> + get dialogs => ListCopyWith( + $value.dialogs, + (v, t) => v.copyWith.$chain(t), + (v) => call(dialogs: v), + ); + @override + MapCopyWith<$R, String, Uint8List, ObjectCopyWith<$R, Uint8List, Uint8List>> + get images => MapCopyWith( + $value.images, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(images: v), + ); + @override + ServerStateCopyWith<$R, ServerState, ServerState> get serverState => + $value.serverState.copyWith.$chain((v) => call(serverState: v)); + @override + AuthenticatedRequestedCopyWith< + $R, + AuthenticatedRequested, + AuthenticatedRequested + >? + get authRequest => + $value.authRequest?.copyWith.$chain((v) => call(authRequest: v)); + @override + GameToolbarCopyWith<$R, GameToolbar, GameToolbar> get toolbar => + $value.toolbar.copyWith.$chain((v) => call(toolbar: v)); + @override + $R call({ + Object? name = $none, + GameState? gameState, + GameTable? table, + String? tableName, + GameInfo? info, + FileMetadata? metadata, + Map>? teamMembers, + List? messages, + int? id, + List? dialogs, + Map? images, + ServerState? serverState, + Object? authRequest = $none, + GameToolbar? toolbar, + SetonixData? data, + }) => $apply( + FieldCopyWithData({ + if (name != $none) #name: name, + if (gameState != null) #gameState: gameState, + if (table != null) #table: table, + if (tableName != null) #tableName: tableName, + if (info != null) #info: info, + if (metadata != null) #metadata: metadata, + if (teamMembers != null) #teamMembers: teamMembers, + if (messages != null) #messages: messages, + if (id != null) #id: id, + if (dialogs != null) #dialogs: dialogs, + if (images != null) #images: images, + if (serverState != null) #serverState: serverState, + if (authRequest != $none) #authRequest: authRequest, + if (toolbar != null) #toolbar: toolbar, + if (data != null) #data: data, + }), + ); + @override + WorldState $make(CopyWithData data) => WorldState( + name: data.get(#name, or: $value.name), + gameState: data.get(#gameState, or: $value.gameState), + table: data.get(#table, or: $value.table), + tableName: data.get(#tableName, or: $value.tableName), + info: data.get(#info, or: $value.info), + metadata: data.get(#metadata, or: $value.metadata), + teamMembers: data.get(#teamMembers, or: $value.teamMembers), + messages: data.get(#messages, or: $value.messages), + id: data.get(#id, or: $value.id), + dialogs: data.get(#dialogs, or: $value.dialogs), + images: data.get(#images, or: $value.images), + serverState: data.get(#serverState, or: $value.serverState), + authRequest: data.get(#authRequest, or: $value.authRequest), + toolbar: data.get(#toolbar, or: $value.toolbar), + data: data.get(#data, or: $value.data), + ); + + @override + WorldStateCopyWith<$R2, WorldState, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _WorldStateCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/helpers/crypto.dart b/api/lib/src/helpers/crypto.dart index b8e70cbd..47574122 100644 --- a/api/lib/src/helpers/crypto.dart +++ b/api/lib/src/helpers/crypto.dart @@ -1,25 +1,25 @@ -import 'dart:typed_data'; - -import 'package:convert/convert.dart'; -import 'package:crypto/crypto.dart'; - -String generateFingerprint( - Uint8List publicKeyBytes, { - bool short = false, - bool pretty = false, -}) { - final digest = sha256.convert(publicKeyBytes); - var hexString = hex.encode(digest.bytes); - if (short) { - hexString = hexString.substring(0, 32); - } - if (!pretty) { - return hexString; - } - final output = hexString.replaceAllMapped( - RegExp(r'.{2}'), - (match) => '${match.group(0)!}:', - ); - - return output.endsWith(':') ? output.substring(0, output.length - 1) : output; -} +import 'dart:typed_data'; + +import 'package:convert/convert.dart'; +import 'package:crypto/crypto.dart'; + +String generateFingerprint( + Uint8List publicKeyBytes, { + bool short = false, + bool pretty = false, +}) { + final digest = sha256.convert(publicKeyBytes); + var hexString = hex.encode(digest.bytes); + if (short) { + hexString = hexString.substring(0, 32); + } + if (!pretty) { + return hexString; + } + final output = hexString.replaceAllMapped( + RegExp(r'.{2}'), + (match) => '${match.group(0)!}:', + ); + + return output.endsWith(':') ? output.substring(0, output.length - 1) : output; +} diff --git a/api/lib/src/helpers/equality.dart b/api/lib/src/helpers/equality.dart index f359b607..7cef722c 100644 --- a/api/lib/src/helpers/equality.dart +++ b/api/lib/src/helpers/equality.dart @@ -1,50 +1,50 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -part 'equality.mapper.dart'; - -@MappableClass( - includeCustomMappers: [IgnoreForEquality()], - generateMethods: - GenerateMethods.all & - ~GenerateMethods.equals & - ~GenerateMethods.stringify, -) -class IgnoreEqualityBox with IgnoreEqualityBoxMappable { - final T content; - - const IgnoreEqualityBox(this.content); -} - -class IgnoreForEquality extends SimpleMapper1 { - const IgnoreForEquality(); - @override - // use the type parameter [T] in the return type [GenericBox] - IgnoreEqualityBox decode(dynamic value) { - // use the type parameter [T] in your decoding logic - T content = MapperContainer.globals.fromValue(value); - return IgnoreEqualityBox(content); - } - - @override - // use the type parameter [T] in the parameter type [GenericBox] - dynamic encode(IgnoreEqualityBox self) { - // use the type parameter [T] in your encoding logic - return MapperContainer.globals.toValue(self.content); - } - - // In case of generic types, we also must specify a type factory. This is a special type of - // function used internally to construct generic instances of your type. - // Specify any type arguments in alignment to the decode/encode functions. - @override - Function get typeFactory => - (f) => f>(); - - @override - bool equals(value, other, MappingContext context) => value == other; - - @override - int hash(value, MappingContext context) => value.hashCode; - - @override - String stringify(value, MappingContext context) => value.toString(); -} +import 'package:dart_mappable/dart_mappable.dart'; + +part 'equality.mapper.dart'; + +@MappableClass( + includeCustomMappers: [IgnoreForEquality()], + generateMethods: + GenerateMethods.all & + ~GenerateMethods.equals & + ~GenerateMethods.stringify, +) +class IgnoreEqualityBox with IgnoreEqualityBoxMappable { + final T content; + + const IgnoreEqualityBox(this.content); +} + +class IgnoreForEquality extends SimpleMapper1 { + const IgnoreForEquality(); + @override + // use the type parameter [T] in the return type [GenericBox] + IgnoreEqualityBox decode(dynamic value) { + // use the type parameter [T] in your decoding logic + T content = MapperContainer.globals.fromValue(value); + return IgnoreEqualityBox(content); + } + + @override + // use the type parameter [T] in the parameter type [GenericBox] + dynamic encode(IgnoreEqualityBox self) { + // use the type parameter [T] in your encoding logic + return MapperContainer.globals.toValue(self.content); + } + + // In case of generic types, we also must specify a type factory. This is a special type of + // function used internally to construct generic instances of your type. + // Specify any type arguments in alignment to the decode/encode functions. + @override + Function get typeFactory => + (f) => f>(); + + @override + bool equals(value, other, MappingContext context) => value == other; + + @override + int hash(value, MappingContext context) => value.hashCode; + + @override + String stringify(value, MappingContext context) => value.toString(); +} diff --git a/api/lib/src/helpers/equality.mapper.dart b/api/lib/src/helpers/equality.mapper.dart index 3350b581..560814cd 100644 --- a/api/lib/src/helpers/equality.mapper.dart +++ b/api/lib/src/helpers/equality.mapper.dart @@ -1,127 +1,127 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'equality.dart'; - -/// @nodoc -class IgnoreEqualityBoxMapper extends ClassMapperBase { - IgnoreEqualityBoxMapper._(); - - static IgnoreEqualityBoxMapper? _instance; - static IgnoreEqualityBoxMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = IgnoreEqualityBoxMapper._()); - MapperContainer.globals.useAll([IgnoreForEquality()]); - } - return _instance!; - } - - @override - final String id = 'IgnoreEqualityBox'; - @override - Function get typeFactory => - (f) => f>(); - - static dynamic _$content(IgnoreEqualityBox v) => v.content; - static dynamic _arg$content(f) => f(); - static const Field _f$content = Field( - 'content', - _$content, - arg: _arg$content, - ); - - @override - final MappableFields fields = const {#content: _f$content}; - - static IgnoreEqualityBox _instantiate(DecodingData data) { - return IgnoreEqualityBox(data.dec(_f$content)); - } - - @override - final Function instantiate = _instantiate; - - static IgnoreEqualityBox fromMap(Map map) { - return ensureInitialized().decodeMap>(map); - } - - static IgnoreEqualityBox fromJson(String json) { - return ensureInitialized().decodeJson>(json); - } -} - -/// @nodoc -mixin IgnoreEqualityBoxMappable { - String toJson() { - return IgnoreEqualityBoxMapper.ensureInitialized() - .encodeJson>(this as IgnoreEqualityBox); - } - - Map toMap() { - return IgnoreEqualityBoxMapper.ensureInitialized() - .encodeMap>(this as IgnoreEqualityBox); - } - - IgnoreEqualityBoxCopyWith< - IgnoreEqualityBox, - IgnoreEqualityBox, - IgnoreEqualityBox, - T - > - get copyWith => - _IgnoreEqualityBoxCopyWithImpl< - IgnoreEqualityBox, - IgnoreEqualityBox, - T - >(this as IgnoreEqualityBox, $identity, $identity); -} - -/// @nodoc -extension IgnoreEqualityBoxValueCopy<$R, $Out, T> - on ObjectCopyWith<$R, IgnoreEqualityBox, $Out> { - IgnoreEqualityBoxCopyWith<$R, IgnoreEqualityBox, $Out, T> - get $asIgnoreEqualityBox => $base.as( - (v, t, t2) => _IgnoreEqualityBoxCopyWithImpl<$R, $Out, T>(v, t, t2), - ); -} - -/// @nodoc -abstract class IgnoreEqualityBoxCopyWith< - $R, - $In extends IgnoreEqualityBox, - $Out, - T -> - implements ClassCopyWith<$R, $In, $Out> { - $R call({T? content}); - IgnoreEqualityBoxCopyWith<$R2, $In, $Out2, T> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _IgnoreEqualityBoxCopyWithImpl<$R, $Out, T> - extends ClassCopyWithBase<$R, IgnoreEqualityBox, $Out> - implements IgnoreEqualityBoxCopyWith<$R, IgnoreEqualityBox, $Out, T> { - _IgnoreEqualityBoxCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - IgnoreEqualityBoxMapper.ensureInitialized(); - @override - $R call({Object? content = $none}) => - $apply(FieldCopyWithData({if (content != $none) #content: content})); - @override - IgnoreEqualityBox $make(CopyWithData data) => - IgnoreEqualityBox(data.get(#content, or: $value.content)); - - @override - IgnoreEqualityBoxCopyWith<$R2, IgnoreEqualityBox, $Out2, T> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _IgnoreEqualityBoxCopyWithImpl<$R2, $Out2, T>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'equality.dart'; + +/// @nodoc +class IgnoreEqualityBoxMapper extends ClassMapperBase { + IgnoreEqualityBoxMapper._(); + + static IgnoreEqualityBoxMapper? _instance; + static IgnoreEqualityBoxMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = IgnoreEqualityBoxMapper._()); + MapperContainer.globals.useAll([IgnoreForEquality()]); + } + return _instance!; + } + + @override + final String id = 'IgnoreEqualityBox'; + @override + Function get typeFactory => + (f) => f>(); + + static dynamic _$content(IgnoreEqualityBox v) => v.content; + static dynamic _arg$content(f) => f(); + static const Field _f$content = Field( + 'content', + _$content, + arg: _arg$content, + ); + + @override + final MappableFields fields = const {#content: _f$content}; + + static IgnoreEqualityBox _instantiate(DecodingData data) { + return IgnoreEqualityBox(data.dec(_f$content)); + } + + @override + final Function instantiate = _instantiate; + + static IgnoreEqualityBox fromMap(Map map) { + return ensureInitialized().decodeMap>(map); + } + + static IgnoreEqualityBox fromJson(String json) { + return ensureInitialized().decodeJson>(json); + } +} + +/// @nodoc +mixin IgnoreEqualityBoxMappable { + String toJson() { + return IgnoreEqualityBoxMapper.ensureInitialized() + .encodeJson>(this as IgnoreEqualityBox); + } + + Map toMap() { + return IgnoreEqualityBoxMapper.ensureInitialized() + .encodeMap>(this as IgnoreEqualityBox); + } + + IgnoreEqualityBoxCopyWith< + IgnoreEqualityBox, + IgnoreEqualityBox, + IgnoreEqualityBox, + T + > + get copyWith => + _IgnoreEqualityBoxCopyWithImpl< + IgnoreEqualityBox, + IgnoreEqualityBox, + T + >(this as IgnoreEqualityBox, $identity, $identity); +} + +/// @nodoc +extension IgnoreEqualityBoxValueCopy<$R, $Out, T> + on ObjectCopyWith<$R, IgnoreEqualityBox, $Out> { + IgnoreEqualityBoxCopyWith<$R, IgnoreEqualityBox, $Out, T> + get $asIgnoreEqualityBox => $base.as( + (v, t, t2) => _IgnoreEqualityBoxCopyWithImpl<$R, $Out, T>(v, t, t2), + ); +} + +/// @nodoc +abstract class IgnoreEqualityBoxCopyWith< + $R, + $In extends IgnoreEqualityBox, + $Out, + T +> + implements ClassCopyWith<$R, $In, $Out> { + $R call({T? content}); + IgnoreEqualityBoxCopyWith<$R2, $In, $Out2, T> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _IgnoreEqualityBoxCopyWithImpl<$R, $Out, T> + extends ClassCopyWithBase<$R, IgnoreEqualityBox, $Out> + implements IgnoreEqualityBoxCopyWith<$R, IgnoreEqualityBox, $Out, T> { + _IgnoreEqualityBoxCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + IgnoreEqualityBoxMapper.ensureInitialized(); + @override + $R call({Object? content = $none}) => + $apply(FieldCopyWithData({if (content != $none) #content: content})); + @override + IgnoreEqualityBox $make(CopyWithData data) => + IgnoreEqualityBox(data.get(#content, or: $value.content)); + + @override + IgnoreEqualityBoxCopyWith<$R2, IgnoreEqualityBox, $Out2, T> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _IgnoreEqualityBoxCopyWithImpl<$R2, $Out2, T>($value, $cast, t); +} + diff --git a/api/lib/src/models/background.dart b/api/lib/src/models/background.dart index 3d097f98..ae3980af 100644 --- a/api/lib/src/models/background.dart +++ b/api/lib/src/models/background.dart @@ -1,18 +1,18 @@ -import 'package:dart_mappable/dart_mappable.dart'; -import 'vector.dart'; -import 'visual.dart'; - -part 'background.mapper.dart'; - -@MappableClass() -class BackgroundDefinition extends VisualDefinition - with BackgroundDefinitionMappable { - final int priority; - - BackgroundDefinition({ - super.offset, - super.size, - required super.texture, - this.priority = 0, - }); -} +import 'package:dart_mappable/dart_mappable.dart'; +import 'vector.dart'; +import 'visual.dart'; + +part 'background.mapper.dart'; + +@MappableClass() +class BackgroundDefinition extends VisualDefinition + with BackgroundDefinitionMappable { + final int priority; + + BackgroundDefinition({ + super.offset, + super.size, + required super.texture, + this.priority = 0, + }); +} diff --git a/api/lib/src/models/background.mapper.dart b/api/lib/src/models/background.mapper.dart index 25005bb2..997ca3bb 100644 --- a/api/lib/src/models/background.mapper.dart +++ b/api/lib/src/models/background.mapper.dart @@ -1,202 +1,202 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'background.dart'; - -/// @nodoc -class BackgroundDefinitionMapper extends ClassMapperBase { - BackgroundDefinitionMapper._(); - - static BackgroundDefinitionMapper? _instance; - static BackgroundDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BackgroundDefinitionMapper._()); - VisualDefinitionMapper.ensureInitialized(); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BackgroundDefinition'; - - static VectorDefinition _$offset(BackgroundDefinition v) => v.offset; - static const Field _f$offset = Field( - 'offset', - _$offset, - opt: true, - def: VectorDefinition.zero, - ); - static VectorDefinition? _$size(BackgroundDefinition v) => v.size; - static const Field _f$size = Field( - 'size', - _$size, - opt: true, - ); - static String _$texture(BackgroundDefinition v) => v.texture; - static const Field _f$texture = Field( - 'texture', - _$texture, - ); - static int _$priority(BackgroundDefinition v) => v.priority; - static const Field _f$priority = Field( - 'priority', - _$priority, - opt: true, - def: 0, - ); - - @override - final MappableFields fields = const { - #offset: _f$offset, - #size: _f$size, - #texture: _f$texture, - #priority: _f$priority, - }; - - static BackgroundDefinition _instantiate(DecodingData data) { - return BackgroundDefinition( - offset: data.dec(_f$offset), - size: data.dec(_f$size), - texture: data.dec(_f$texture), - priority: data.dec(_f$priority), - ); - } - - @override - final Function instantiate = _instantiate; - - static BackgroundDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BackgroundDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BackgroundDefinitionMappable { - String toJson() { - return BackgroundDefinitionMapper.ensureInitialized() - .encodeJson(this as BackgroundDefinition); - } - - Map toMap() { - return BackgroundDefinitionMapper.ensureInitialized() - .encodeMap(this as BackgroundDefinition); - } - - BackgroundDefinitionCopyWith< - BackgroundDefinition, - BackgroundDefinition, - BackgroundDefinition - > - get copyWith => - _BackgroundDefinitionCopyWithImpl< - BackgroundDefinition, - BackgroundDefinition - >(this as BackgroundDefinition, $identity, $identity); - @override - String toString() { - return BackgroundDefinitionMapper.ensureInitialized().stringifyValue( - this as BackgroundDefinition, - ); - } - - @override - bool operator ==(Object other) { - return BackgroundDefinitionMapper.ensureInitialized().equalsValue( - this as BackgroundDefinition, - other, - ); - } - - @override - int get hashCode { - return BackgroundDefinitionMapper.ensureInitialized().hashValue( - this as BackgroundDefinition, - ); - } -} - -/// @nodoc -extension BackgroundDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, BackgroundDefinition, $Out> { - BackgroundDefinitionCopyWith<$R, BackgroundDefinition, $Out> - get $asBackgroundDefinition => $base.as( - (v, t, t2) => _BackgroundDefinitionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BackgroundDefinitionCopyWith< - $R, - $In extends BackgroundDefinition, - $Out -> - implements VisualDefinitionCopyWith<$R, $In, $Out> { - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; - @override - $R call({ - VectorDefinition? offset, - VectorDefinition? size, - String? texture, - int? priority, - }); - BackgroundDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BackgroundDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BackgroundDefinition, $Out> - implements BackgroundDefinitionCopyWith<$R, BackgroundDefinition, $Out> { - _BackgroundDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BackgroundDefinitionMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => - $value.offset.copyWith.$chain((v) => call(offset: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => - $value.size?.copyWith.$chain((v) => call(size: v)); - @override - $R call({ - VectorDefinition? offset, - Object? size = $none, - String? texture, - int? priority, - }) => $apply( - FieldCopyWithData({ - if (offset != null) #offset: offset, - if (size != $none) #size: size, - if (texture != null) #texture: texture, - if (priority != null) #priority: priority, - }), - ); - @override - BackgroundDefinition $make(CopyWithData data) => BackgroundDefinition( - offset: data.get(#offset, or: $value.offset), - size: data.get(#size, or: $value.size), - texture: data.get(#texture, or: $value.texture), - priority: data.get(#priority, or: $value.priority), - ); - - @override - BackgroundDefinitionCopyWith<$R2, BackgroundDefinition, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _BackgroundDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'background.dart'; + +/// @nodoc +class BackgroundDefinitionMapper extends ClassMapperBase { + BackgroundDefinitionMapper._(); + + static BackgroundDefinitionMapper? _instance; + static BackgroundDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BackgroundDefinitionMapper._()); + VisualDefinitionMapper.ensureInitialized(); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BackgroundDefinition'; + + static VectorDefinition _$offset(BackgroundDefinition v) => v.offset; + static const Field _f$offset = Field( + 'offset', + _$offset, + opt: true, + def: VectorDefinition.zero, + ); + static VectorDefinition? _$size(BackgroundDefinition v) => v.size; + static const Field _f$size = Field( + 'size', + _$size, + opt: true, + ); + static String _$texture(BackgroundDefinition v) => v.texture; + static const Field _f$texture = Field( + 'texture', + _$texture, + ); + static int _$priority(BackgroundDefinition v) => v.priority; + static const Field _f$priority = Field( + 'priority', + _$priority, + opt: true, + def: 0, + ); + + @override + final MappableFields fields = const { + #offset: _f$offset, + #size: _f$size, + #texture: _f$texture, + #priority: _f$priority, + }; + + static BackgroundDefinition _instantiate(DecodingData data) { + return BackgroundDefinition( + offset: data.dec(_f$offset), + size: data.dec(_f$size), + texture: data.dec(_f$texture), + priority: data.dec(_f$priority), + ); + } + + @override + final Function instantiate = _instantiate; + + static BackgroundDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BackgroundDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BackgroundDefinitionMappable { + String toJson() { + return BackgroundDefinitionMapper.ensureInitialized() + .encodeJson(this as BackgroundDefinition); + } + + Map toMap() { + return BackgroundDefinitionMapper.ensureInitialized() + .encodeMap(this as BackgroundDefinition); + } + + BackgroundDefinitionCopyWith< + BackgroundDefinition, + BackgroundDefinition, + BackgroundDefinition + > + get copyWith => + _BackgroundDefinitionCopyWithImpl< + BackgroundDefinition, + BackgroundDefinition + >(this as BackgroundDefinition, $identity, $identity); + @override + String toString() { + return BackgroundDefinitionMapper.ensureInitialized().stringifyValue( + this as BackgroundDefinition, + ); + } + + @override + bool operator ==(Object other) { + return BackgroundDefinitionMapper.ensureInitialized().equalsValue( + this as BackgroundDefinition, + other, + ); + } + + @override + int get hashCode { + return BackgroundDefinitionMapper.ensureInitialized().hashValue( + this as BackgroundDefinition, + ); + } +} + +/// @nodoc +extension BackgroundDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, BackgroundDefinition, $Out> { + BackgroundDefinitionCopyWith<$R, BackgroundDefinition, $Out> + get $asBackgroundDefinition => $base.as( + (v, t, t2) => _BackgroundDefinitionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BackgroundDefinitionCopyWith< + $R, + $In extends BackgroundDefinition, + $Out +> + implements VisualDefinitionCopyWith<$R, $In, $Out> { + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; + @override + $R call({ + VectorDefinition? offset, + VectorDefinition? size, + String? texture, + int? priority, + }); + BackgroundDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BackgroundDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BackgroundDefinition, $Out> + implements BackgroundDefinitionCopyWith<$R, BackgroundDefinition, $Out> { + _BackgroundDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BackgroundDefinitionMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => + $value.offset.copyWith.$chain((v) => call(offset: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => + $value.size?.copyWith.$chain((v) => call(size: v)); + @override + $R call({ + VectorDefinition? offset, + Object? size = $none, + String? texture, + int? priority, + }) => $apply( + FieldCopyWithData({ + if (offset != null) #offset: offset, + if (size != $none) #size: size, + if (texture != null) #texture: texture, + if (priority != null) #priority: priority, + }), + ); + @override + BackgroundDefinition $make(CopyWithData data) => BackgroundDefinition( + offset: data.get(#offset, or: $value.offset), + size: data.get(#size, or: $value.size), + texture: data.get(#texture, or: $value.texture), + priority: data.get(#priority, or: $value.priority), + ); + + @override + BackgroundDefinitionCopyWith<$R2, BackgroundDefinition, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _BackgroundDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/cell.mapper.dart b/api/lib/src/models/cell.mapper.dart index f30b0cd6..a01bf96a 100644 --- a/api/lib/src/models/cell.mapper.dart +++ b/api/lib/src/models/cell.mapper.dart @@ -1,1208 +1,1208 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'cell.dart'; - -/// @nodoc - -class CellMergeDirectionMapper extends EnumMapper { - CellMergeDirectionMapper._(); - - static CellMergeDirectionMapper? _instance; - static CellMergeDirectionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = CellMergeDirectionMapper._()); - } - return _instance!; - } - - static CellMergeDirection fromValue(dynamic value) { - ensureInitialized(); - return MapperContainer.globals.fromValue(value); - } - - @override - CellMergeDirection decode(dynamic value) { - switch (value) { - case r'horizontal': - return CellMergeDirection.horizontal; - case r'vertical': - return CellMergeDirection.vertical; - default: - throw MapperException.unknownEnumValue(value); - } - } - - @override - dynamic encode(CellMergeDirection self) { - switch (self) { - case CellMergeDirection.horizontal: - return r'horizontal'; - case CellMergeDirection.vertical: - return r'vertical'; - } - } -} - -/// @nodoc - -extension CellMergeDirectionMapperExtension on CellMergeDirection { - String toValue() { - CellMergeDirectionMapper.ensureInitialized(); - return MapperContainer.globals.toValue(this) as String; - } -} - -/// @nodoc -class TableCellMapper extends ClassMapperBase { - TableCellMapper._(); - - static TableCellMapper? _instance; - static TableCellMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TableCellMapper._()); - GameObjectMapper.ensureInitialized(); - BoardTileMapper.ensureInitialized(); - CellMergeStrategyMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'TableCell'; - - static List _$objects(TableCell v) => v.objects; - static const Field> _f$objects = Field( - 'objects', - _$objects, - opt: true, - def: const [], - ); - static List _$tiles(TableCell v) => v.tiles; - static const Field> _f$tiles = Field( - 'tiles', - _$tiles, - opt: true, - def: const [], - ); - static CellMergeStrategy? _$merge(TableCell v) => v.merge; - static const Field _f$merge = Field( - 'merge', - _$merge, - opt: true, - ); - - @override - final MappableFields fields = const { - #objects: _f$objects, - #tiles: _f$tiles, - #merge: _f$merge, - }; - - static TableCell _instantiate(DecodingData data) { - return TableCell( - objects: data.dec(_f$objects), - tiles: data.dec(_f$tiles), - merge: data.dec(_f$merge), - ); - } - - @override - final Function instantiate = _instantiate; - - static TableCell fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static TableCell fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin TableCellMappable { - String toJson() { - return TableCellMapper.ensureInitialized().encodeJson( - this as TableCell, - ); - } - - Map toMap() { - return TableCellMapper.ensureInitialized().encodeMap( - this as TableCell, - ); - } - - TableCellCopyWith get copyWith => - _TableCellCopyWithImpl( - this as TableCell, - $identity, - $identity, - ); - @override - String toString() { - return TableCellMapper.ensureInitialized().stringifyValue( - this as TableCell, - ); - } - - @override - bool operator ==(Object other) { - return TableCellMapper.ensureInitialized().equalsValue( - this as TableCell, - other, - ); - } - - @override - int get hashCode { - return TableCellMapper.ensureInitialized().hashValue(this as TableCell); - } -} - -/// @nodoc -extension TableCellValueCopy<$R, $Out> on ObjectCopyWith<$R, TableCell, $Out> { - TableCellCopyWith<$R, TableCell, $Out> get $asTableCell => - $base.as((v, t, t2) => _TableCellCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class TableCellCopyWith<$R, $In extends TableCell, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> - get objects; - ListCopyWith<$R, BoardTile, BoardTileCopyWith<$R, BoardTile, BoardTile>> - get tiles; - CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? - get merge; - $R call({ - List? objects, - List? tiles, - CellMergeStrategy? merge, - }); - TableCellCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _TableCellCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, TableCell, $Out> - implements TableCellCopyWith<$R, TableCell, $Out> { - _TableCellCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - TableCellMapper.ensureInitialized(); - @override - ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> - get objects => ListCopyWith( - $value.objects, - (v, t) => v.copyWith.$chain(t), - (v) => call(objects: v), - ); - @override - ListCopyWith<$R, BoardTile, BoardTileCopyWith<$R, BoardTile, BoardTile>> - get tiles => ListCopyWith( - $value.tiles, - (v, t) => v.copyWith.$chain(t), - (v) => call(tiles: v), - ); - @override - CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? - get merge => $value.merge?.copyWith.$chain((v) => call(merge: v)); - @override - $R call({ - List? objects, - List? tiles, - Object? merge = $none, - }) => $apply( - FieldCopyWithData({ - if (objects != null) #objects: objects, - if (tiles != null) #tiles: tiles, - if (merge != $none) #merge: merge, - }), - ); - @override - TableCell $make(CopyWithData data) => TableCell( - objects: data.get(#objects, or: $value.objects), - tiles: data.get(#tiles, or: $value.tiles), - merge: data.get(#merge, or: $value.merge), - ); - - @override - TableCellCopyWith<$R2, TableCell, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _TableCellCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameObjectMapper extends ClassMapperBase { - GameObjectMapper._(); - - static GameObjectMapper? _instance; - static GameObjectMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameObjectMapper._()); - ItemLocationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameObject'; - - static ItemLocation _$asset(GameObject v) => v.asset; - static const Field _f$asset = Field( - 'asset', - _$asset, - ); - static String? _$variation(GameObject v) => v.variation; - static const Field _f$variation = Field( - 'variation', - _$variation, - opt: true, - ); - static bool _$hidden(GameObject v) => v.hidden; - static const Field _f$hidden = Field( - 'hidden', - _$hidden, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #asset: _f$asset, - #variation: _f$variation, - #hidden: _f$hidden, - }; - - static GameObject _instantiate(DecodingData data) { - return GameObject( - data.dec(_f$asset), - variation: data.dec(_f$variation), - hidden: data.dec(_f$hidden), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameObject fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameObject fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameObjectMappable { - String toJson() { - return GameObjectMapper.ensureInitialized().encodeJson( - this as GameObject, - ); - } - - Map toMap() { - return GameObjectMapper.ensureInitialized().encodeMap( - this as GameObject, - ); - } - - GameObjectCopyWith get copyWith => - _GameObjectCopyWithImpl( - this as GameObject, - $identity, - $identity, - ); - @override - String toString() { - return GameObjectMapper.ensureInitialized().stringifyValue( - this as GameObject, - ); - } - - @override - bool operator ==(Object other) { - return GameObjectMapper.ensureInitialized().equalsValue( - this as GameObject, - other, - ); - } - - @override - int get hashCode { - return GameObjectMapper.ensureInitialized().hashValue(this as GameObject); - } -} - -/// @nodoc -extension GameObjectValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameObject, $Out> { - GameObjectCopyWith<$R, GameObject, $Out> get $asGameObject => - $base.as((v, t, t2) => _GameObjectCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameObjectCopyWith<$R, $In extends GameObject, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset; - $R call({ItemLocation? asset, String? variation, bool? hidden}); - GameObjectCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _GameObjectCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameObject, $Out> - implements GameObjectCopyWith<$R, GameObject, $Out> { - _GameObjectCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameObjectMapper.ensureInitialized(); - @override - ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset => - $value.asset.copyWith.$chain((v) => call(asset: v)); - @override - $R call({ItemLocation? asset, Object? variation = $none, bool? hidden}) => - $apply( - FieldCopyWithData({ - if (asset != null) #asset: asset, - if (variation != $none) #variation: variation, - if (hidden != null) #hidden: hidden, - }), - ); - @override - GameObject $make(CopyWithData data) => GameObject( - data.get(#asset, or: $value.asset), - variation: data.get(#variation, or: $value.variation), - hidden: data.get(#hidden, or: $value.hidden), - ); - - @override - GameObjectCopyWith<$R2, GameObject, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameObjectCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardTileMapper extends ClassMapperBase { - BoardTileMapper._(); - - static BoardTileMapper? _instance; - static BoardTileMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardTileMapper._()); - ItemLocationMapper.ensureInitialized(); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardTile'; - - static ItemLocation _$asset(BoardTile v) => v.asset; - static const Field _f$asset = Field( - 'asset', - _$asset, - ); - static VectorDefinition _$tile(BoardTile v) => v.tile; - static const Field _f$tile = Field( - 'tile', - _$tile, - ); - - @override - final MappableFields fields = const { - #asset: _f$asset, - #tile: _f$tile, - }; - - static BoardTile _instantiate(DecodingData data) { - return BoardTile(data.dec(_f$asset), data.dec(_f$tile)); - } - - @override - final Function instantiate = _instantiate; - - static BoardTile fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardTile fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardTileMappable { - String toJson() { - return BoardTileMapper.ensureInitialized().encodeJson( - this as BoardTile, - ); - } - - Map toMap() { - return BoardTileMapper.ensureInitialized().encodeMap( - this as BoardTile, - ); - } - - BoardTileCopyWith get copyWith => - _BoardTileCopyWithImpl( - this as BoardTile, - $identity, - $identity, - ); - @override - String toString() { - return BoardTileMapper.ensureInitialized().stringifyValue( - this as BoardTile, - ); - } - - @override - bool operator ==(Object other) { - return BoardTileMapper.ensureInitialized().equalsValue( - this as BoardTile, - other, - ); - } - - @override - int get hashCode { - return BoardTileMapper.ensureInitialized().hashValue(this as BoardTile); - } -} - -/// @nodoc -extension BoardTileValueCopy<$R, $Out> on ObjectCopyWith<$R, BoardTile, $Out> { - BoardTileCopyWith<$R, BoardTile, $Out> get $asBoardTile => - $base.as((v, t, t2) => _BoardTileCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class BoardTileCopyWith<$R, $In extends BoardTile, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset; - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tile; - $R call({ItemLocation? asset, VectorDefinition? tile}); - BoardTileCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _BoardTileCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardTile, $Out> - implements BoardTileCopyWith<$R, BoardTile, $Out> { - _BoardTileCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardTileMapper.ensureInitialized(); - @override - ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset => - $value.asset.copyWith.$chain((v) => call(asset: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tile => - $value.tile.copyWith.$chain((v) => call(tile: v)); - @override - $R call({ItemLocation? asset, VectorDefinition? tile}) => $apply( - FieldCopyWithData({ - if (asset != null) #asset: asset, - if (tile != null) #tile: tile, - }), - ); - @override - BoardTile $make(CopyWithData data) => BoardTile( - data.get(#asset, or: $value.asset), - data.get(#tile, or: $value.tile), - ); - - @override - BoardTileCopyWith<$R2, BoardTile, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardTileCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class CellMergeStrategyMapper extends ClassMapperBase { - CellMergeStrategyMapper._(); - - static CellMergeStrategyMapper? _instance; - static CellMergeStrategyMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = CellMergeStrategyMapper._()); - MergedCellStrategyMapper.ensureInitialized(); - LayoutCellMergeStrategyMapper.ensureInitialized(); - CellMergeDirectionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'CellMergeStrategy'; - - static CellMergeDirection _$direction(CellMergeStrategy v) => v.direction; - static const Field _f$direction = - Field( - 'direction', - _$direction, - opt: true, - def: CellMergeDirection.vertical, - ); - - @override - final MappableFields fields = const { - #direction: _f$direction, - }; - - static CellMergeStrategy _instantiate(DecodingData data) { - throw MapperException.missingConstructor('CellMergeStrategy'); - } - - @override - final Function instantiate = _instantiate; - - static CellMergeStrategy fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static CellMergeStrategy fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin CellMergeStrategyMappable { - String toJson(); - Map toMap(); - CellMergeStrategyCopyWith< - CellMergeStrategy, - CellMergeStrategy, - CellMergeStrategy - > - get copyWith; -} - -/// @nodoc -abstract class CellMergeStrategyCopyWith< - $R, - $In extends CellMergeStrategy, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - $R call({CellMergeDirection? direction}); - CellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class MergedCellStrategyMapper extends ClassMapperBase { - MergedCellStrategyMapper._(); - - static MergedCellStrategyMapper? _instance; - static MergedCellStrategyMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = MergedCellStrategyMapper._()); - CellMergeStrategyMapper.ensureInitialized(); - CellMergeDirectionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'MergedCellStrategy'; - - static CellMergeDirection _$direction(MergedCellStrategy v) => v.direction; - static const Field _f$direction = - Field('direction', _$direction); - - @override - final MappableFields fields = const { - #direction: _f$direction, - }; - - static MergedCellStrategy _instantiate(DecodingData data) { - return MergedCellStrategy(data.dec(_f$direction)); - } - - @override - final Function instantiate = _instantiate; - - static MergedCellStrategy fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static MergedCellStrategy fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin MergedCellStrategyMappable { - String toJson() { - return MergedCellStrategyMapper.ensureInitialized() - .encodeJson(this as MergedCellStrategy); - } - - Map toMap() { - return MergedCellStrategyMapper.ensureInitialized() - .encodeMap(this as MergedCellStrategy); - } - - MergedCellStrategyCopyWith< - MergedCellStrategy, - MergedCellStrategy, - MergedCellStrategy - > - get copyWith => - _MergedCellStrategyCopyWithImpl( - this as MergedCellStrategy, - $identity, - $identity, - ); - @override - String toString() { - return MergedCellStrategyMapper.ensureInitialized().stringifyValue( - this as MergedCellStrategy, - ); - } - - @override - bool operator ==(Object other) { - return MergedCellStrategyMapper.ensureInitialized().equalsValue( - this as MergedCellStrategy, - other, - ); - } - - @override - int get hashCode { - return MergedCellStrategyMapper.ensureInitialized().hashValue( - this as MergedCellStrategy, - ); - } -} - -/// @nodoc -extension MergedCellStrategyValueCopy<$R, $Out> - on ObjectCopyWith<$R, MergedCellStrategy, $Out> { - MergedCellStrategyCopyWith<$R, MergedCellStrategy, $Out> - get $asMergedCellStrategy => $base.as( - (v, t, t2) => _MergedCellStrategyCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class MergedCellStrategyCopyWith< - $R, - $In extends MergedCellStrategy, - $Out -> - implements CellMergeStrategyCopyWith<$R, $In, $Out> { - @override - $R call({CellMergeDirection? direction}); - MergedCellStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _MergedCellStrategyCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, MergedCellStrategy, $Out> - implements MergedCellStrategyCopyWith<$R, MergedCellStrategy, $Out> { - _MergedCellStrategyCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - MergedCellStrategyMapper.ensureInitialized(); - @override - $R call({CellMergeDirection? direction}) => - $apply(FieldCopyWithData({if (direction != null) #direction: direction})); - @override - MergedCellStrategy $make(CopyWithData data) => - MergedCellStrategy(data.get(#direction, or: $value.direction)); - - @override - MergedCellStrategyCopyWith<$R2, MergedCellStrategy, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _MergedCellStrategyCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class LayoutCellMergeStrategyMapper - extends ClassMapperBase { - LayoutCellMergeStrategyMapper._(); - - static LayoutCellMergeStrategyMapper? _instance; - static LayoutCellMergeStrategyMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = LayoutCellMergeStrategyMapper._(), - ); - CellMergeStrategyMapper.ensureInitialized(); - StackedCellMergeStrategyMapper.ensureInitialized(); - DistributeCellMergeStrategyMapper.ensureInitialized(); - CellMergeDirectionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'LayoutCellMergeStrategy'; - - static CellMergeDirection _$direction(LayoutCellMergeStrategy v) => - v.direction; - static const Field _f$direction = - Field( - 'direction', - _$direction, - opt: true, - def: CellMergeDirection.vertical, - ); - static bool _$reverse(LayoutCellMergeStrategy v) => v.reverse; - static const Field _f$reverse = Field( - 'reverse', - _$reverse, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #direction: _f$direction, - #reverse: _f$reverse, - }; - - static LayoutCellMergeStrategy _instantiate(DecodingData data) { - throw MapperException.missingConstructor('LayoutCellMergeStrategy'); - } - - @override - final Function instantiate = _instantiate; - - static LayoutCellMergeStrategy fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static LayoutCellMergeStrategy fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin LayoutCellMergeStrategyMappable { - String toJson(); - Map toMap(); - LayoutCellMergeStrategyCopyWith< - LayoutCellMergeStrategy, - LayoutCellMergeStrategy, - LayoutCellMergeStrategy - > - get copyWith; -} - -/// @nodoc -abstract class LayoutCellMergeStrategyCopyWith< - $R, - $In extends LayoutCellMergeStrategy, - $Out -> - implements CellMergeStrategyCopyWith<$R, $In, $Out> { - @override - $R call({CellMergeDirection? direction, bool? reverse}); - LayoutCellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class StackedCellMergeStrategyMapper - extends ClassMapperBase { - StackedCellMergeStrategyMapper._(); - - static StackedCellMergeStrategyMapper? _instance; - static StackedCellMergeStrategyMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = StackedCellMergeStrategyMapper._(), - ); - LayoutCellMergeStrategyMapper.ensureInitialized(); - CellMergeDirectionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'StackedCellMergeStrategy'; - - static int _$visiblePercentage(StackedCellMergeStrategy v) => - v.visiblePercentage; - static const Field _f$visiblePercentage = - Field('visiblePercentage', _$visiblePercentage, opt: true, def: 10); - static bool _$reverse(StackedCellMergeStrategy v) => v.reverse; - static const Field _f$reverse = Field( - 'reverse', - _$reverse, - opt: true, - def: false, - ); - static CellMergeDirection _$direction(StackedCellMergeStrategy v) => - v.direction; - static const Field - _f$direction = Field( - 'direction', - _$direction, - opt: true, - def: CellMergeDirection.vertical, - ); - - @override - final MappableFields fields = const { - #visiblePercentage: _f$visiblePercentage, - #reverse: _f$reverse, - #direction: _f$direction, - }; - - static StackedCellMergeStrategy _instantiate(DecodingData data) { - return StackedCellMergeStrategy( - visiblePercentage: data.dec(_f$visiblePercentage), - reverse: data.dec(_f$reverse), - direction: data.dec(_f$direction), - ); - } - - @override - final Function instantiate = _instantiate; - - static StackedCellMergeStrategy fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static StackedCellMergeStrategy fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin StackedCellMergeStrategyMappable { - String toJson() { - return StackedCellMergeStrategyMapper.ensureInitialized() - .encodeJson(this as StackedCellMergeStrategy); - } - - Map toMap() { - return StackedCellMergeStrategyMapper.ensureInitialized() - .encodeMap(this as StackedCellMergeStrategy); - } - - StackedCellMergeStrategyCopyWith< - StackedCellMergeStrategy, - StackedCellMergeStrategy, - StackedCellMergeStrategy - > - get copyWith => - _StackedCellMergeStrategyCopyWithImpl< - StackedCellMergeStrategy, - StackedCellMergeStrategy - >(this as StackedCellMergeStrategy, $identity, $identity); - @override - String toString() { - return StackedCellMergeStrategyMapper.ensureInitialized().stringifyValue( - this as StackedCellMergeStrategy, - ); - } - - @override - bool operator ==(Object other) { - return StackedCellMergeStrategyMapper.ensureInitialized().equalsValue( - this as StackedCellMergeStrategy, - other, - ); - } - - @override - int get hashCode { - return StackedCellMergeStrategyMapper.ensureInitialized().hashValue( - this as StackedCellMergeStrategy, - ); - } -} - -/// @nodoc -extension StackedCellMergeStrategyValueCopy<$R, $Out> - on ObjectCopyWith<$R, StackedCellMergeStrategy, $Out> { - StackedCellMergeStrategyCopyWith<$R, StackedCellMergeStrategy, $Out> - get $asStackedCellMergeStrategy => $base.as( - (v, t, t2) => _StackedCellMergeStrategyCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class StackedCellMergeStrategyCopyWith< - $R, - $In extends StackedCellMergeStrategy, - $Out -> - implements LayoutCellMergeStrategyCopyWith<$R, $In, $Out> { - @override - $R call({ - int? visiblePercentage, - bool? reverse, - CellMergeDirection? direction, - }); - StackedCellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _StackedCellMergeStrategyCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, StackedCellMergeStrategy, $Out> - implements - StackedCellMergeStrategyCopyWith<$R, StackedCellMergeStrategy, $Out> { - _StackedCellMergeStrategyCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - StackedCellMergeStrategyMapper.ensureInitialized(); - @override - $R call({ - int? visiblePercentage, - bool? reverse, - CellMergeDirection? direction, - }) => $apply( - FieldCopyWithData({ - if (visiblePercentage != null) #visiblePercentage: visiblePercentage, - if (reverse != null) #reverse: reverse, - if (direction != null) #direction: direction, - }), - ); - @override - StackedCellMergeStrategy $make(CopyWithData data) => StackedCellMergeStrategy( - visiblePercentage: data.get( - #visiblePercentage, - or: $value.visiblePercentage, - ), - reverse: data.get(#reverse, or: $value.reverse), - direction: data.get(#direction, or: $value.direction), - ); - - @override - StackedCellMergeStrategyCopyWith<$R2, StackedCellMergeStrategy, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _StackedCellMergeStrategyCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DistributeCellMergeStrategyMapper - extends ClassMapperBase { - DistributeCellMergeStrategyMapper._(); - - static DistributeCellMergeStrategyMapper? _instance; - static DistributeCellMergeStrategyMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = DistributeCellMergeStrategyMapper._(), - ); - LayoutCellMergeStrategyMapper.ensureInitialized(); - CellMergeDirectionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'DistributeCellMergeStrategy'; - - static int _$maxCards(DistributeCellMergeStrategy v) => v.maxCards; - static const Field _f$maxCards = Field( - 'maxCards', - _$maxCards, - opt: true, - def: 5, - ); - static bool _$fillVariableSpace(DistributeCellMergeStrategy v) => - v.fillVariableSpace; - static const Field _f$fillVariableSpace = - Field('fillVariableSpace', _$fillVariableSpace, opt: true, def: true); - static bool _$reverse(DistributeCellMergeStrategy v) => v.reverse; - static const Field _f$reverse = Field( - 'reverse', - _$reverse, - opt: true, - def: false, - ); - static CellMergeDirection _$direction(DistributeCellMergeStrategy v) => - v.direction; - static const Field - _f$direction = Field( - 'direction', - _$direction, - opt: true, - def: CellMergeDirection.horizontal, - ); - - @override - final MappableFields fields = const { - #maxCards: _f$maxCards, - #fillVariableSpace: _f$fillVariableSpace, - #reverse: _f$reverse, - #direction: _f$direction, - }; - - static DistributeCellMergeStrategy _instantiate(DecodingData data) { - return DistributeCellMergeStrategy( - maxCards: data.dec(_f$maxCards), - fillVariableSpace: data.dec(_f$fillVariableSpace), - reverse: data.dec(_f$reverse), - direction: data.dec(_f$direction), - ); - } - - @override - final Function instantiate = _instantiate; - - static DistributeCellMergeStrategy fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DistributeCellMergeStrategy fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DistributeCellMergeStrategyMappable { - String toJson() { - return DistributeCellMergeStrategyMapper.ensureInitialized() - .encodeJson( - this as DistributeCellMergeStrategy, - ); - } - - Map toMap() { - return DistributeCellMergeStrategyMapper.ensureInitialized() - .encodeMap( - this as DistributeCellMergeStrategy, - ); - } - - DistributeCellMergeStrategyCopyWith< - DistributeCellMergeStrategy, - DistributeCellMergeStrategy, - DistributeCellMergeStrategy - > - get copyWith => - _DistributeCellMergeStrategyCopyWithImpl< - DistributeCellMergeStrategy, - DistributeCellMergeStrategy - >(this as DistributeCellMergeStrategy, $identity, $identity); - @override - String toString() { - return DistributeCellMergeStrategyMapper.ensureInitialized().stringifyValue( - this as DistributeCellMergeStrategy, - ); - } - - @override - bool operator ==(Object other) { - return DistributeCellMergeStrategyMapper.ensureInitialized().equalsValue( - this as DistributeCellMergeStrategy, - other, - ); - } - - @override - int get hashCode { - return DistributeCellMergeStrategyMapper.ensureInitialized().hashValue( - this as DistributeCellMergeStrategy, - ); - } -} - -/// @nodoc -extension DistributeCellMergeStrategyValueCopy<$R, $Out> - on ObjectCopyWith<$R, DistributeCellMergeStrategy, $Out> { - DistributeCellMergeStrategyCopyWith<$R, DistributeCellMergeStrategy, $Out> - get $asDistributeCellMergeStrategy => $base.as( - (v, t, t2) => _DistributeCellMergeStrategyCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class DistributeCellMergeStrategyCopyWith< - $R, - $In extends DistributeCellMergeStrategy, - $Out -> - implements LayoutCellMergeStrategyCopyWith<$R, $In, $Out> { - @override - $R call({ - int? maxCards, - bool? fillVariableSpace, - bool? reverse, - CellMergeDirection? direction, - }); - DistributeCellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _DistributeCellMergeStrategyCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DistributeCellMergeStrategy, $Out> - implements - DistributeCellMergeStrategyCopyWith< - $R, - DistributeCellMergeStrategy, - $Out - > { - _DistributeCellMergeStrategyCopyWithImpl( - super.value, - super.then, - super.then2, - ); - - @override - late final ClassMapperBase $mapper = - DistributeCellMergeStrategyMapper.ensureInitialized(); - @override - $R call({ - int? maxCards, - bool? fillVariableSpace, - bool? reverse, - CellMergeDirection? direction, - }) => $apply( - FieldCopyWithData({ - if (maxCards != null) #maxCards: maxCards, - if (fillVariableSpace != null) #fillVariableSpace: fillVariableSpace, - if (reverse != null) #reverse: reverse, - if (direction != null) #direction: direction, - }), - ); - @override - DistributeCellMergeStrategy $make(CopyWithData data) => - DistributeCellMergeStrategy( - maxCards: data.get(#maxCards, or: $value.maxCards), - fillVariableSpace: data.get( - #fillVariableSpace, - or: $value.fillVariableSpace, - ), - reverse: data.get(#reverse, or: $value.reverse), - direction: data.get(#direction, or: $value.direction), - ); - - @override - DistributeCellMergeStrategyCopyWith<$R2, DistributeCellMergeStrategy, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _DistributeCellMergeStrategyCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'cell.dart'; + +/// @nodoc + +class CellMergeDirectionMapper extends EnumMapper { + CellMergeDirectionMapper._(); + + static CellMergeDirectionMapper? _instance; + static CellMergeDirectionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = CellMergeDirectionMapper._()); + } + return _instance!; + } + + static CellMergeDirection fromValue(dynamic value) { + ensureInitialized(); + return MapperContainer.globals.fromValue(value); + } + + @override + CellMergeDirection decode(dynamic value) { + switch (value) { + case r'horizontal': + return CellMergeDirection.horizontal; + case r'vertical': + return CellMergeDirection.vertical; + default: + throw MapperException.unknownEnumValue(value); + } + } + + @override + dynamic encode(CellMergeDirection self) { + switch (self) { + case CellMergeDirection.horizontal: + return r'horizontal'; + case CellMergeDirection.vertical: + return r'vertical'; + } + } +} + +/// @nodoc + +extension CellMergeDirectionMapperExtension on CellMergeDirection { + String toValue() { + CellMergeDirectionMapper.ensureInitialized(); + return MapperContainer.globals.toValue(this) as String; + } +} + +/// @nodoc +class TableCellMapper extends ClassMapperBase { + TableCellMapper._(); + + static TableCellMapper? _instance; + static TableCellMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TableCellMapper._()); + GameObjectMapper.ensureInitialized(); + BoardTileMapper.ensureInitialized(); + CellMergeStrategyMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'TableCell'; + + static List _$objects(TableCell v) => v.objects; + static const Field> _f$objects = Field( + 'objects', + _$objects, + opt: true, + def: const [], + ); + static List _$tiles(TableCell v) => v.tiles; + static const Field> _f$tiles = Field( + 'tiles', + _$tiles, + opt: true, + def: const [], + ); + static CellMergeStrategy? _$merge(TableCell v) => v.merge; + static const Field _f$merge = Field( + 'merge', + _$merge, + opt: true, + ); + + @override + final MappableFields fields = const { + #objects: _f$objects, + #tiles: _f$tiles, + #merge: _f$merge, + }; + + static TableCell _instantiate(DecodingData data) { + return TableCell( + objects: data.dec(_f$objects), + tiles: data.dec(_f$tiles), + merge: data.dec(_f$merge), + ); + } + + @override + final Function instantiate = _instantiate; + + static TableCell fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static TableCell fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin TableCellMappable { + String toJson() { + return TableCellMapper.ensureInitialized().encodeJson( + this as TableCell, + ); + } + + Map toMap() { + return TableCellMapper.ensureInitialized().encodeMap( + this as TableCell, + ); + } + + TableCellCopyWith get copyWith => + _TableCellCopyWithImpl( + this as TableCell, + $identity, + $identity, + ); + @override + String toString() { + return TableCellMapper.ensureInitialized().stringifyValue( + this as TableCell, + ); + } + + @override + bool operator ==(Object other) { + return TableCellMapper.ensureInitialized().equalsValue( + this as TableCell, + other, + ); + } + + @override + int get hashCode { + return TableCellMapper.ensureInitialized().hashValue(this as TableCell); + } +} + +/// @nodoc +extension TableCellValueCopy<$R, $Out> on ObjectCopyWith<$R, TableCell, $Out> { + TableCellCopyWith<$R, TableCell, $Out> get $asTableCell => + $base.as((v, t, t2) => _TableCellCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class TableCellCopyWith<$R, $In extends TableCell, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> + get objects; + ListCopyWith<$R, BoardTile, BoardTileCopyWith<$R, BoardTile, BoardTile>> + get tiles; + CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? + get merge; + $R call({ + List? objects, + List? tiles, + CellMergeStrategy? merge, + }); + TableCellCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _TableCellCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, TableCell, $Out> + implements TableCellCopyWith<$R, TableCell, $Out> { + _TableCellCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + TableCellMapper.ensureInitialized(); + @override + ListCopyWith<$R, GameObject, GameObjectCopyWith<$R, GameObject, GameObject>> + get objects => ListCopyWith( + $value.objects, + (v, t) => v.copyWith.$chain(t), + (v) => call(objects: v), + ); + @override + ListCopyWith<$R, BoardTile, BoardTileCopyWith<$R, BoardTile, BoardTile>> + get tiles => ListCopyWith( + $value.tiles, + (v, t) => v.copyWith.$chain(t), + (v) => call(tiles: v), + ); + @override + CellMergeStrategyCopyWith<$R, CellMergeStrategy, CellMergeStrategy>? + get merge => $value.merge?.copyWith.$chain((v) => call(merge: v)); + @override + $R call({ + List? objects, + List? tiles, + Object? merge = $none, + }) => $apply( + FieldCopyWithData({ + if (objects != null) #objects: objects, + if (tiles != null) #tiles: tiles, + if (merge != $none) #merge: merge, + }), + ); + @override + TableCell $make(CopyWithData data) => TableCell( + objects: data.get(#objects, or: $value.objects), + tiles: data.get(#tiles, or: $value.tiles), + merge: data.get(#merge, or: $value.merge), + ); + + @override + TableCellCopyWith<$R2, TableCell, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _TableCellCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameObjectMapper extends ClassMapperBase { + GameObjectMapper._(); + + static GameObjectMapper? _instance; + static GameObjectMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameObjectMapper._()); + ItemLocationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameObject'; + + static ItemLocation _$asset(GameObject v) => v.asset; + static const Field _f$asset = Field( + 'asset', + _$asset, + ); + static String? _$variation(GameObject v) => v.variation; + static const Field _f$variation = Field( + 'variation', + _$variation, + opt: true, + ); + static bool _$hidden(GameObject v) => v.hidden; + static const Field _f$hidden = Field( + 'hidden', + _$hidden, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #asset: _f$asset, + #variation: _f$variation, + #hidden: _f$hidden, + }; + + static GameObject _instantiate(DecodingData data) { + return GameObject( + data.dec(_f$asset), + variation: data.dec(_f$variation), + hidden: data.dec(_f$hidden), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameObject fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameObject fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameObjectMappable { + String toJson() { + return GameObjectMapper.ensureInitialized().encodeJson( + this as GameObject, + ); + } + + Map toMap() { + return GameObjectMapper.ensureInitialized().encodeMap( + this as GameObject, + ); + } + + GameObjectCopyWith get copyWith => + _GameObjectCopyWithImpl( + this as GameObject, + $identity, + $identity, + ); + @override + String toString() { + return GameObjectMapper.ensureInitialized().stringifyValue( + this as GameObject, + ); + } + + @override + bool operator ==(Object other) { + return GameObjectMapper.ensureInitialized().equalsValue( + this as GameObject, + other, + ); + } + + @override + int get hashCode { + return GameObjectMapper.ensureInitialized().hashValue(this as GameObject); + } +} + +/// @nodoc +extension GameObjectValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameObject, $Out> { + GameObjectCopyWith<$R, GameObject, $Out> get $asGameObject => + $base.as((v, t, t2) => _GameObjectCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameObjectCopyWith<$R, $In extends GameObject, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset; + $R call({ItemLocation? asset, String? variation, bool? hidden}); + GameObjectCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _GameObjectCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameObject, $Out> + implements GameObjectCopyWith<$R, GameObject, $Out> { + _GameObjectCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameObjectMapper.ensureInitialized(); + @override + ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset => + $value.asset.copyWith.$chain((v) => call(asset: v)); + @override + $R call({ItemLocation? asset, Object? variation = $none, bool? hidden}) => + $apply( + FieldCopyWithData({ + if (asset != null) #asset: asset, + if (variation != $none) #variation: variation, + if (hidden != null) #hidden: hidden, + }), + ); + @override + GameObject $make(CopyWithData data) => GameObject( + data.get(#asset, or: $value.asset), + variation: data.get(#variation, or: $value.variation), + hidden: data.get(#hidden, or: $value.hidden), + ); + + @override + GameObjectCopyWith<$R2, GameObject, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameObjectCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardTileMapper extends ClassMapperBase { + BoardTileMapper._(); + + static BoardTileMapper? _instance; + static BoardTileMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardTileMapper._()); + ItemLocationMapper.ensureInitialized(); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardTile'; + + static ItemLocation _$asset(BoardTile v) => v.asset; + static const Field _f$asset = Field( + 'asset', + _$asset, + ); + static VectorDefinition _$tile(BoardTile v) => v.tile; + static const Field _f$tile = Field( + 'tile', + _$tile, + ); + + @override + final MappableFields fields = const { + #asset: _f$asset, + #tile: _f$tile, + }; + + static BoardTile _instantiate(DecodingData data) { + return BoardTile(data.dec(_f$asset), data.dec(_f$tile)); + } + + @override + final Function instantiate = _instantiate; + + static BoardTile fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardTile fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardTileMappable { + String toJson() { + return BoardTileMapper.ensureInitialized().encodeJson( + this as BoardTile, + ); + } + + Map toMap() { + return BoardTileMapper.ensureInitialized().encodeMap( + this as BoardTile, + ); + } + + BoardTileCopyWith get copyWith => + _BoardTileCopyWithImpl( + this as BoardTile, + $identity, + $identity, + ); + @override + String toString() { + return BoardTileMapper.ensureInitialized().stringifyValue( + this as BoardTile, + ); + } + + @override + bool operator ==(Object other) { + return BoardTileMapper.ensureInitialized().equalsValue( + this as BoardTile, + other, + ); + } + + @override + int get hashCode { + return BoardTileMapper.ensureInitialized().hashValue(this as BoardTile); + } +} + +/// @nodoc +extension BoardTileValueCopy<$R, $Out> on ObjectCopyWith<$R, BoardTile, $Out> { + BoardTileCopyWith<$R, BoardTile, $Out> get $asBoardTile => + $base.as((v, t, t2) => _BoardTileCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class BoardTileCopyWith<$R, $In extends BoardTile, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset; + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tile; + $R call({ItemLocation? asset, VectorDefinition? tile}); + BoardTileCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _BoardTileCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardTile, $Out> + implements BoardTileCopyWith<$R, BoardTile, $Out> { + _BoardTileCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardTileMapper.ensureInitialized(); + @override + ItemLocationCopyWith<$R, ItemLocation, ItemLocation> get asset => + $value.asset.copyWith.$chain((v) => call(asset: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tile => + $value.tile.copyWith.$chain((v) => call(tile: v)); + @override + $R call({ItemLocation? asset, VectorDefinition? tile}) => $apply( + FieldCopyWithData({ + if (asset != null) #asset: asset, + if (tile != null) #tile: tile, + }), + ); + @override + BoardTile $make(CopyWithData data) => BoardTile( + data.get(#asset, or: $value.asset), + data.get(#tile, or: $value.tile), + ); + + @override + BoardTileCopyWith<$R2, BoardTile, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardTileCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class CellMergeStrategyMapper extends ClassMapperBase { + CellMergeStrategyMapper._(); + + static CellMergeStrategyMapper? _instance; + static CellMergeStrategyMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = CellMergeStrategyMapper._()); + MergedCellStrategyMapper.ensureInitialized(); + LayoutCellMergeStrategyMapper.ensureInitialized(); + CellMergeDirectionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'CellMergeStrategy'; + + static CellMergeDirection _$direction(CellMergeStrategy v) => v.direction; + static const Field _f$direction = + Field( + 'direction', + _$direction, + opt: true, + def: CellMergeDirection.vertical, + ); + + @override + final MappableFields fields = const { + #direction: _f$direction, + }; + + static CellMergeStrategy _instantiate(DecodingData data) { + throw MapperException.missingConstructor('CellMergeStrategy'); + } + + @override + final Function instantiate = _instantiate; + + static CellMergeStrategy fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static CellMergeStrategy fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin CellMergeStrategyMappable { + String toJson(); + Map toMap(); + CellMergeStrategyCopyWith< + CellMergeStrategy, + CellMergeStrategy, + CellMergeStrategy + > + get copyWith; +} + +/// @nodoc +abstract class CellMergeStrategyCopyWith< + $R, + $In extends CellMergeStrategy, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + $R call({CellMergeDirection? direction}); + CellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class MergedCellStrategyMapper extends ClassMapperBase { + MergedCellStrategyMapper._(); + + static MergedCellStrategyMapper? _instance; + static MergedCellStrategyMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = MergedCellStrategyMapper._()); + CellMergeStrategyMapper.ensureInitialized(); + CellMergeDirectionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'MergedCellStrategy'; + + static CellMergeDirection _$direction(MergedCellStrategy v) => v.direction; + static const Field _f$direction = + Field('direction', _$direction); + + @override + final MappableFields fields = const { + #direction: _f$direction, + }; + + static MergedCellStrategy _instantiate(DecodingData data) { + return MergedCellStrategy(data.dec(_f$direction)); + } + + @override + final Function instantiate = _instantiate; + + static MergedCellStrategy fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static MergedCellStrategy fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin MergedCellStrategyMappable { + String toJson() { + return MergedCellStrategyMapper.ensureInitialized() + .encodeJson(this as MergedCellStrategy); + } + + Map toMap() { + return MergedCellStrategyMapper.ensureInitialized() + .encodeMap(this as MergedCellStrategy); + } + + MergedCellStrategyCopyWith< + MergedCellStrategy, + MergedCellStrategy, + MergedCellStrategy + > + get copyWith => + _MergedCellStrategyCopyWithImpl( + this as MergedCellStrategy, + $identity, + $identity, + ); + @override + String toString() { + return MergedCellStrategyMapper.ensureInitialized().stringifyValue( + this as MergedCellStrategy, + ); + } + + @override + bool operator ==(Object other) { + return MergedCellStrategyMapper.ensureInitialized().equalsValue( + this as MergedCellStrategy, + other, + ); + } + + @override + int get hashCode { + return MergedCellStrategyMapper.ensureInitialized().hashValue( + this as MergedCellStrategy, + ); + } +} + +/// @nodoc +extension MergedCellStrategyValueCopy<$R, $Out> + on ObjectCopyWith<$R, MergedCellStrategy, $Out> { + MergedCellStrategyCopyWith<$R, MergedCellStrategy, $Out> + get $asMergedCellStrategy => $base.as( + (v, t, t2) => _MergedCellStrategyCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class MergedCellStrategyCopyWith< + $R, + $In extends MergedCellStrategy, + $Out +> + implements CellMergeStrategyCopyWith<$R, $In, $Out> { + @override + $R call({CellMergeDirection? direction}); + MergedCellStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _MergedCellStrategyCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, MergedCellStrategy, $Out> + implements MergedCellStrategyCopyWith<$R, MergedCellStrategy, $Out> { + _MergedCellStrategyCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + MergedCellStrategyMapper.ensureInitialized(); + @override + $R call({CellMergeDirection? direction}) => + $apply(FieldCopyWithData({if (direction != null) #direction: direction})); + @override + MergedCellStrategy $make(CopyWithData data) => + MergedCellStrategy(data.get(#direction, or: $value.direction)); + + @override + MergedCellStrategyCopyWith<$R2, MergedCellStrategy, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _MergedCellStrategyCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class LayoutCellMergeStrategyMapper + extends ClassMapperBase { + LayoutCellMergeStrategyMapper._(); + + static LayoutCellMergeStrategyMapper? _instance; + static LayoutCellMergeStrategyMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = LayoutCellMergeStrategyMapper._(), + ); + CellMergeStrategyMapper.ensureInitialized(); + StackedCellMergeStrategyMapper.ensureInitialized(); + DistributeCellMergeStrategyMapper.ensureInitialized(); + CellMergeDirectionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'LayoutCellMergeStrategy'; + + static CellMergeDirection _$direction(LayoutCellMergeStrategy v) => + v.direction; + static const Field _f$direction = + Field( + 'direction', + _$direction, + opt: true, + def: CellMergeDirection.vertical, + ); + static bool _$reverse(LayoutCellMergeStrategy v) => v.reverse; + static const Field _f$reverse = Field( + 'reverse', + _$reverse, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #direction: _f$direction, + #reverse: _f$reverse, + }; + + static LayoutCellMergeStrategy _instantiate(DecodingData data) { + throw MapperException.missingConstructor('LayoutCellMergeStrategy'); + } + + @override + final Function instantiate = _instantiate; + + static LayoutCellMergeStrategy fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static LayoutCellMergeStrategy fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin LayoutCellMergeStrategyMappable { + String toJson(); + Map toMap(); + LayoutCellMergeStrategyCopyWith< + LayoutCellMergeStrategy, + LayoutCellMergeStrategy, + LayoutCellMergeStrategy + > + get copyWith; +} + +/// @nodoc +abstract class LayoutCellMergeStrategyCopyWith< + $R, + $In extends LayoutCellMergeStrategy, + $Out +> + implements CellMergeStrategyCopyWith<$R, $In, $Out> { + @override + $R call({CellMergeDirection? direction, bool? reverse}); + LayoutCellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class StackedCellMergeStrategyMapper + extends ClassMapperBase { + StackedCellMergeStrategyMapper._(); + + static StackedCellMergeStrategyMapper? _instance; + static StackedCellMergeStrategyMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = StackedCellMergeStrategyMapper._(), + ); + LayoutCellMergeStrategyMapper.ensureInitialized(); + CellMergeDirectionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'StackedCellMergeStrategy'; + + static int _$visiblePercentage(StackedCellMergeStrategy v) => + v.visiblePercentage; + static const Field _f$visiblePercentage = + Field('visiblePercentage', _$visiblePercentage, opt: true, def: 10); + static bool _$reverse(StackedCellMergeStrategy v) => v.reverse; + static const Field _f$reverse = Field( + 'reverse', + _$reverse, + opt: true, + def: false, + ); + static CellMergeDirection _$direction(StackedCellMergeStrategy v) => + v.direction; + static const Field + _f$direction = Field( + 'direction', + _$direction, + opt: true, + def: CellMergeDirection.vertical, + ); + + @override + final MappableFields fields = const { + #visiblePercentage: _f$visiblePercentage, + #reverse: _f$reverse, + #direction: _f$direction, + }; + + static StackedCellMergeStrategy _instantiate(DecodingData data) { + return StackedCellMergeStrategy( + visiblePercentage: data.dec(_f$visiblePercentage), + reverse: data.dec(_f$reverse), + direction: data.dec(_f$direction), + ); + } + + @override + final Function instantiate = _instantiate; + + static StackedCellMergeStrategy fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static StackedCellMergeStrategy fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin StackedCellMergeStrategyMappable { + String toJson() { + return StackedCellMergeStrategyMapper.ensureInitialized() + .encodeJson(this as StackedCellMergeStrategy); + } + + Map toMap() { + return StackedCellMergeStrategyMapper.ensureInitialized() + .encodeMap(this as StackedCellMergeStrategy); + } + + StackedCellMergeStrategyCopyWith< + StackedCellMergeStrategy, + StackedCellMergeStrategy, + StackedCellMergeStrategy + > + get copyWith => + _StackedCellMergeStrategyCopyWithImpl< + StackedCellMergeStrategy, + StackedCellMergeStrategy + >(this as StackedCellMergeStrategy, $identity, $identity); + @override + String toString() { + return StackedCellMergeStrategyMapper.ensureInitialized().stringifyValue( + this as StackedCellMergeStrategy, + ); + } + + @override + bool operator ==(Object other) { + return StackedCellMergeStrategyMapper.ensureInitialized().equalsValue( + this as StackedCellMergeStrategy, + other, + ); + } + + @override + int get hashCode { + return StackedCellMergeStrategyMapper.ensureInitialized().hashValue( + this as StackedCellMergeStrategy, + ); + } +} + +/// @nodoc +extension StackedCellMergeStrategyValueCopy<$R, $Out> + on ObjectCopyWith<$R, StackedCellMergeStrategy, $Out> { + StackedCellMergeStrategyCopyWith<$R, StackedCellMergeStrategy, $Out> + get $asStackedCellMergeStrategy => $base.as( + (v, t, t2) => _StackedCellMergeStrategyCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class StackedCellMergeStrategyCopyWith< + $R, + $In extends StackedCellMergeStrategy, + $Out +> + implements LayoutCellMergeStrategyCopyWith<$R, $In, $Out> { + @override + $R call({ + int? visiblePercentage, + bool? reverse, + CellMergeDirection? direction, + }); + StackedCellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _StackedCellMergeStrategyCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, StackedCellMergeStrategy, $Out> + implements + StackedCellMergeStrategyCopyWith<$R, StackedCellMergeStrategy, $Out> { + _StackedCellMergeStrategyCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + StackedCellMergeStrategyMapper.ensureInitialized(); + @override + $R call({ + int? visiblePercentage, + bool? reverse, + CellMergeDirection? direction, + }) => $apply( + FieldCopyWithData({ + if (visiblePercentage != null) #visiblePercentage: visiblePercentage, + if (reverse != null) #reverse: reverse, + if (direction != null) #direction: direction, + }), + ); + @override + StackedCellMergeStrategy $make(CopyWithData data) => StackedCellMergeStrategy( + visiblePercentage: data.get( + #visiblePercentage, + or: $value.visiblePercentage, + ), + reverse: data.get(#reverse, or: $value.reverse), + direction: data.get(#direction, or: $value.direction), + ); + + @override + StackedCellMergeStrategyCopyWith<$R2, StackedCellMergeStrategy, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _StackedCellMergeStrategyCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DistributeCellMergeStrategyMapper + extends ClassMapperBase { + DistributeCellMergeStrategyMapper._(); + + static DistributeCellMergeStrategyMapper? _instance; + static DistributeCellMergeStrategyMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = DistributeCellMergeStrategyMapper._(), + ); + LayoutCellMergeStrategyMapper.ensureInitialized(); + CellMergeDirectionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'DistributeCellMergeStrategy'; + + static int _$maxCards(DistributeCellMergeStrategy v) => v.maxCards; + static const Field _f$maxCards = Field( + 'maxCards', + _$maxCards, + opt: true, + def: 5, + ); + static bool _$fillVariableSpace(DistributeCellMergeStrategy v) => + v.fillVariableSpace; + static const Field _f$fillVariableSpace = + Field('fillVariableSpace', _$fillVariableSpace, opt: true, def: true); + static bool _$reverse(DistributeCellMergeStrategy v) => v.reverse; + static const Field _f$reverse = Field( + 'reverse', + _$reverse, + opt: true, + def: false, + ); + static CellMergeDirection _$direction(DistributeCellMergeStrategy v) => + v.direction; + static const Field + _f$direction = Field( + 'direction', + _$direction, + opt: true, + def: CellMergeDirection.horizontal, + ); + + @override + final MappableFields fields = const { + #maxCards: _f$maxCards, + #fillVariableSpace: _f$fillVariableSpace, + #reverse: _f$reverse, + #direction: _f$direction, + }; + + static DistributeCellMergeStrategy _instantiate(DecodingData data) { + return DistributeCellMergeStrategy( + maxCards: data.dec(_f$maxCards), + fillVariableSpace: data.dec(_f$fillVariableSpace), + reverse: data.dec(_f$reverse), + direction: data.dec(_f$direction), + ); + } + + @override + final Function instantiate = _instantiate; + + static DistributeCellMergeStrategy fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DistributeCellMergeStrategy fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DistributeCellMergeStrategyMappable { + String toJson() { + return DistributeCellMergeStrategyMapper.ensureInitialized() + .encodeJson( + this as DistributeCellMergeStrategy, + ); + } + + Map toMap() { + return DistributeCellMergeStrategyMapper.ensureInitialized() + .encodeMap( + this as DistributeCellMergeStrategy, + ); + } + + DistributeCellMergeStrategyCopyWith< + DistributeCellMergeStrategy, + DistributeCellMergeStrategy, + DistributeCellMergeStrategy + > + get copyWith => + _DistributeCellMergeStrategyCopyWithImpl< + DistributeCellMergeStrategy, + DistributeCellMergeStrategy + >(this as DistributeCellMergeStrategy, $identity, $identity); + @override + String toString() { + return DistributeCellMergeStrategyMapper.ensureInitialized().stringifyValue( + this as DistributeCellMergeStrategy, + ); + } + + @override + bool operator ==(Object other) { + return DistributeCellMergeStrategyMapper.ensureInitialized().equalsValue( + this as DistributeCellMergeStrategy, + other, + ); + } + + @override + int get hashCode { + return DistributeCellMergeStrategyMapper.ensureInitialized().hashValue( + this as DistributeCellMergeStrategy, + ); + } +} + +/// @nodoc +extension DistributeCellMergeStrategyValueCopy<$R, $Out> + on ObjectCopyWith<$R, DistributeCellMergeStrategy, $Out> { + DistributeCellMergeStrategyCopyWith<$R, DistributeCellMergeStrategy, $Out> + get $asDistributeCellMergeStrategy => $base.as( + (v, t, t2) => _DistributeCellMergeStrategyCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class DistributeCellMergeStrategyCopyWith< + $R, + $In extends DistributeCellMergeStrategy, + $Out +> + implements LayoutCellMergeStrategyCopyWith<$R, $In, $Out> { + @override + $R call({ + int? maxCards, + bool? fillVariableSpace, + bool? reverse, + CellMergeDirection? direction, + }); + DistributeCellMergeStrategyCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _DistributeCellMergeStrategyCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DistributeCellMergeStrategy, $Out> + implements + DistributeCellMergeStrategyCopyWith< + $R, + DistributeCellMergeStrategy, + $Out + > { + _DistributeCellMergeStrategyCopyWithImpl( + super.value, + super.then, + super.then2, + ); + + @override + late final ClassMapperBase $mapper = + DistributeCellMergeStrategyMapper.ensureInitialized(); + @override + $R call({ + int? maxCards, + bool? fillVariableSpace, + bool? reverse, + CellMergeDirection? direction, + }) => $apply( + FieldCopyWithData({ + if (maxCards != null) #maxCards: maxCards, + if (fillVariableSpace != null) #fillVariableSpace: fillVariableSpace, + if (reverse != null) #reverse: reverse, + if (direction != null) #direction: direction, + }), + ); + @override + DistributeCellMergeStrategy $make(CopyWithData data) => + DistributeCellMergeStrategy( + maxCards: data.get(#maxCards, or: $value.maxCards), + fillVariableSpace: data.get( + #fillVariableSpace, + or: $value.fillVariableSpace, + ), + reverse: data.get(#reverse, or: $value.reverse), + direction: data.get(#direction, or: $value.direction), + ); + + @override + DistributeCellMergeStrategyCopyWith<$R2, DistributeCellMergeStrategy, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _DistributeCellMergeStrategyCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/chat.dart b/api/lib/src/models/chat.dart index 4cbf5c4c..c6d4faa2 100644 --- a/api/lib/src/models/chat.dart +++ b/api/lib/src/models/chat.dart @@ -1,17 +1,17 @@ -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:networker/networker.dart'; - -part 'chat.mapper.dart'; - -@MappableClass() -final class ChatMessage with ChatMessageMappable { - final Channel author; - final String content; - final DateTime timestamp; - - const ChatMessage({ - required this.author, - required this.content, - required this.timestamp, - }); -} +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:networker/networker.dart'; + +part 'chat.mapper.dart'; + +@MappableClass() +final class ChatMessage with ChatMessageMappable { + final Channel author; + final String content; + final DateTime timestamp; + + const ChatMessage({ + required this.author, + required this.content, + required this.timestamp, + }); +} diff --git a/api/lib/src/models/chat.mapper.dart b/api/lib/src/models/chat.mapper.dart index f09b3b0b..8b84a636 100644 --- a/api/lib/src/models/chat.mapper.dart +++ b/api/lib/src/models/chat.mapper.dart @@ -1,150 +1,150 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'chat.dart'; - -/// @nodoc -class ChatMessageMapper extends ClassMapperBase { - ChatMessageMapper._(); - - static ChatMessageMapper? _instance; - static ChatMessageMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ChatMessageMapper._()); - } - return _instance!; - } - - @override - final String id = 'ChatMessage'; - - static int _$author(ChatMessage v) => v.author; - static const Field _f$author = Field('author', _$author); - static String _$content(ChatMessage v) => v.content; - static const Field _f$content = Field( - 'content', - _$content, - ); - static DateTime _$timestamp(ChatMessage v) => v.timestamp; - static const Field _f$timestamp = Field( - 'timestamp', - _$timestamp, - ); - - @override - final MappableFields fields = const { - #author: _f$author, - #content: _f$content, - #timestamp: _f$timestamp, - }; - - static ChatMessage _instantiate(DecodingData data) { - return ChatMessage( - author: data.dec(_f$author), - content: data.dec(_f$content), - timestamp: data.dec(_f$timestamp), - ); - } - - @override - final Function instantiate = _instantiate; - - static ChatMessage fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ChatMessage fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ChatMessageMappable { - String toJson() { - return ChatMessageMapper.ensureInitialized().encodeJson( - this as ChatMessage, - ); - } - - Map toMap() { - return ChatMessageMapper.ensureInitialized().encodeMap( - this as ChatMessage, - ); - } - - ChatMessageCopyWith get copyWith => - _ChatMessageCopyWithImpl( - this as ChatMessage, - $identity, - $identity, - ); - @override - String toString() { - return ChatMessageMapper.ensureInitialized().stringifyValue( - this as ChatMessage, - ); - } - - @override - bool operator ==(Object other) { - return ChatMessageMapper.ensureInitialized().equalsValue( - this as ChatMessage, - other, - ); - } - - @override - int get hashCode { - return ChatMessageMapper.ensureInitialized().hashValue(this as ChatMessage); - } -} - -/// @nodoc -extension ChatMessageValueCopy<$R, $Out> - on ObjectCopyWith<$R, ChatMessage, $Out> { - ChatMessageCopyWith<$R, ChatMessage, $Out> get $asChatMessage => - $base.as((v, t, t2) => _ChatMessageCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ChatMessageCopyWith<$R, $In extends ChatMessage, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({int? author, String? content, DateTime? timestamp}); - ChatMessageCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _ChatMessageCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ChatMessage, $Out> - implements ChatMessageCopyWith<$R, ChatMessage, $Out> { - _ChatMessageCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ChatMessageMapper.ensureInitialized(); - @override - $R call({int? author, String? content, DateTime? timestamp}) => $apply( - FieldCopyWithData({ - if (author != null) #author: author, - if (content != null) #content: content, - if (timestamp != null) #timestamp: timestamp, - }), - ); - @override - ChatMessage $make(CopyWithData data) => ChatMessage( - author: data.get(#author, or: $value.author), - content: data.get(#content, or: $value.content), - timestamp: data.get(#timestamp, or: $value.timestamp), - ); - - @override - ChatMessageCopyWith<$R2, ChatMessage, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ChatMessageCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'chat.dart'; + +/// @nodoc +class ChatMessageMapper extends ClassMapperBase { + ChatMessageMapper._(); + + static ChatMessageMapper? _instance; + static ChatMessageMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ChatMessageMapper._()); + } + return _instance!; + } + + @override + final String id = 'ChatMessage'; + + static int _$author(ChatMessage v) => v.author; + static const Field _f$author = Field('author', _$author); + static String _$content(ChatMessage v) => v.content; + static const Field _f$content = Field( + 'content', + _$content, + ); + static DateTime _$timestamp(ChatMessage v) => v.timestamp; + static const Field _f$timestamp = Field( + 'timestamp', + _$timestamp, + ); + + @override + final MappableFields fields = const { + #author: _f$author, + #content: _f$content, + #timestamp: _f$timestamp, + }; + + static ChatMessage _instantiate(DecodingData data) { + return ChatMessage( + author: data.dec(_f$author), + content: data.dec(_f$content), + timestamp: data.dec(_f$timestamp), + ); + } + + @override + final Function instantiate = _instantiate; + + static ChatMessage fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ChatMessage fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ChatMessageMappable { + String toJson() { + return ChatMessageMapper.ensureInitialized().encodeJson( + this as ChatMessage, + ); + } + + Map toMap() { + return ChatMessageMapper.ensureInitialized().encodeMap( + this as ChatMessage, + ); + } + + ChatMessageCopyWith get copyWith => + _ChatMessageCopyWithImpl( + this as ChatMessage, + $identity, + $identity, + ); + @override + String toString() { + return ChatMessageMapper.ensureInitialized().stringifyValue( + this as ChatMessage, + ); + } + + @override + bool operator ==(Object other) { + return ChatMessageMapper.ensureInitialized().equalsValue( + this as ChatMessage, + other, + ); + } + + @override + int get hashCode { + return ChatMessageMapper.ensureInitialized().hashValue(this as ChatMessage); + } +} + +/// @nodoc +extension ChatMessageValueCopy<$R, $Out> + on ObjectCopyWith<$R, ChatMessage, $Out> { + ChatMessageCopyWith<$R, ChatMessage, $Out> get $asChatMessage => + $base.as((v, t, t2) => _ChatMessageCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ChatMessageCopyWith<$R, $In extends ChatMessage, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({int? author, String? content, DateTime? timestamp}); + ChatMessageCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _ChatMessageCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ChatMessage, $Out> + implements ChatMessageCopyWith<$R, ChatMessage, $Out> { + _ChatMessageCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ChatMessageMapper.ensureInitialized(); + @override + $R call({int? author, String? content, DateTime? timestamp}) => $apply( + FieldCopyWithData({ + if (author != null) #author: author, + if (content != null) #content: content, + if (timestamp != null) #timestamp: timestamp, + }), + ); + @override + ChatMessage $make(CopyWithData data) => ChatMessage( + author: data.get(#author, or: $value.author), + content: data.get(#content, or: $value.content), + timestamp: data.get(#timestamp, or: $value.timestamp), + ); + + @override + ChatMessageCopyWith<$R2, ChatMessage, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ChatMessageCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/deck.dart b/api/lib/src/models/deck.dart index 035d7ace..120892f8 100644 --- a/api/lib/src/models/deck.dart +++ b/api/lib/src/models/deck.dart @@ -1,36 +1,36 @@ -import 'package:dart_mappable/dart_mappable.dart'; -import 'vector.dart'; - -part 'deck.mapper.dart'; - -@MappableClass() -class DeckDefinition with DeckDefinitionMappable { - final List figures; - final List boards; - - DeckDefinition({this.figures = const [], this.boards = const []}); -} - -@MappableClass() -class FigureDeckDefinition with FigureDeckDefinitionMappable { - final String name; - final String? variation; - final VectorDefinition position; - - FigureDeckDefinition({ - required this.name, - this.variation, - this.position = VectorDefinition.zero, - }); -} - -@MappableClass() -class BoardDeckDefinition with BoardDeckDefinitionMappable { - final String name; - final VectorDefinition position; - - BoardDeckDefinition({ - required this.name, - this.position = VectorDefinition.zero, - }); -} +import 'package:dart_mappable/dart_mappable.dart'; +import 'vector.dart'; + +part 'deck.mapper.dart'; + +@MappableClass() +class DeckDefinition with DeckDefinitionMappable { + final List figures; + final List boards; + + DeckDefinition({this.figures = const [], this.boards = const []}); +} + +@MappableClass() +class FigureDeckDefinition with FigureDeckDefinitionMappable { + final String name; + final String? variation; + final VectorDefinition position; + + FigureDeckDefinition({ + required this.name, + this.variation, + this.position = VectorDefinition.zero, + }); +} + +@MappableClass() +class BoardDeckDefinition with BoardDeckDefinitionMappable { + final String name; + final VectorDefinition position; + + BoardDeckDefinition({ + required this.name, + this.position = VectorDefinition.zero, + }); +} diff --git a/api/lib/src/models/deck.mapper.dart b/api/lib/src/models/deck.mapper.dart index 7680ad69..4619863d 100644 --- a/api/lib/src/models/deck.mapper.dart +++ b/api/lib/src/models/deck.mapper.dart @@ -1,502 +1,502 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'deck.dart'; - -/// @nodoc -class DeckDefinitionMapper extends ClassMapperBase { - DeckDefinitionMapper._(); - - static DeckDefinitionMapper? _instance; - static DeckDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DeckDefinitionMapper._()); - FigureDeckDefinitionMapper.ensureInitialized(); - BoardDeckDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'DeckDefinition'; - - static List _$figures(DeckDefinition v) => v.figures; - static const Field> _f$figures = - Field('figures', _$figures, opt: true, def: const []); - static List _$boards(DeckDefinition v) => v.boards; - static const Field> _f$boards = - Field('boards', _$boards, opt: true, def: const []); - - @override - final MappableFields fields = const { - #figures: _f$figures, - #boards: _f$boards, - }; - - static DeckDefinition _instantiate(DecodingData data) { - return DeckDefinition( - figures: data.dec(_f$figures), - boards: data.dec(_f$boards), - ); - } - - @override - final Function instantiate = _instantiate; - - static DeckDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DeckDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DeckDefinitionMappable { - String toJson() { - return DeckDefinitionMapper.ensureInitialized().encodeJson( - this as DeckDefinition, - ); - } - - Map toMap() { - return DeckDefinitionMapper.ensureInitialized().encodeMap( - this as DeckDefinition, - ); - } - - DeckDefinitionCopyWith - get copyWith => _DeckDefinitionCopyWithImpl( - this as DeckDefinition, - $identity, - $identity, - ); - @override - String toString() { - return DeckDefinitionMapper.ensureInitialized().stringifyValue( - this as DeckDefinition, - ); - } - - @override - bool operator ==(Object other) { - return DeckDefinitionMapper.ensureInitialized().equalsValue( - this as DeckDefinition, - other, - ); - } - - @override - int get hashCode { - return DeckDefinitionMapper.ensureInitialized().hashValue( - this as DeckDefinition, - ); - } -} - -/// @nodoc -extension DeckDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, DeckDefinition, $Out> { - DeckDefinitionCopyWith<$R, DeckDefinition, $Out> get $asDeckDefinition => - $base.as((v, t, t2) => _DeckDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class DeckDefinitionCopyWith<$R, $In extends DeckDefinition, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ListCopyWith< - $R, - FigureDeckDefinition, - FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, FigureDeckDefinition> - > - get figures; - ListCopyWith< - $R, - BoardDeckDefinition, - BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, BoardDeckDefinition> - > - get boards; - $R call({ - List? figures, - List? boards, - }); - DeckDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _DeckDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DeckDefinition, $Out> - implements DeckDefinitionCopyWith<$R, DeckDefinition, $Out> { - _DeckDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - DeckDefinitionMapper.ensureInitialized(); - @override - ListCopyWith< - $R, - FigureDeckDefinition, - FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, FigureDeckDefinition> - > - get figures => ListCopyWith( - $value.figures, - (v, t) => v.copyWith.$chain(t), - (v) => call(figures: v), - ); - @override - ListCopyWith< - $R, - BoardDeckDefinition, - BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, BoardDeckDefinition> - > - get boards => ListCopyWith( - $value.boards, - (v, t) => v.copyWith.$chain(t), - (v) => call(boards: v), - ); - @override - $R call({ - List? figures, - List? boards, - }) => $apply( - FieldCopyWithData({ - if (figures != null) #figures: figures, - if (boards != null) #boards: boards, - }), - ); - @override - DeckDefinition $make(CopyWithData data) => DeckDefinition( - figures: data.get(#figures, or: $value.figures), - boards: data.get(#boards, or: $value.boards), - ); - - @override - DeckDefinitionCopyWith<$R2, DeckDefinition, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _DeckDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class FigureDeckDefinitionMapper extends ClassMapperBase { - FigureDeckDefinitionMapper._(); - - static FigureDeckDefinitionMapper? _instance; - static FigureDeckDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = FigureDeckDefinitionMapper._()); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'FigureDeckDefinition'; - - static String _$name(FigureDeckDefinition v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - ); - static String? _$variation(FigureDeckDefinition v) => v.variation; - static const Field _f$variation = Field( - 'variation', - _$variation, - opt: true, - ); - static VectorDefinition _$position(FigureDeckDefinition v) => v.position; - static const Field _f$position = - Field('position', _$position, opt: true, def: VectorDefinition.zero); - - @override - final MappableFields fields = const { - #name: _f$name, - #variation: _f$variation, - #position: _f$position, - }; - - static FigureDeckDefinition _instantiate(DecodingData data) { - return FigureDeckDefinition( - name: data.dec(_f$name), - variation: data.dec(_f$variation), - position: data.dec(_f$position), - ); - } - - @override - final Function instantiate = _instantiate; - - static FigureDeckDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static FigureDeckDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin FigureDeckDefinitionMappable { - String toJson() { - return FigureDeckDefinitionMapper.ensureInitialized() - .encodeJson(this as FigureDeckDefinition); - } - - Map toMap() { - return FigureDeckDefinitionMapper.ensureInitialized() - .encodeMap(this as FigureDeckDefinition); - } - - FigureDeckDefinitionCopyWith< - FigureDeckDefinition, - FigureDeckDefinition, - FigureDeckDefinition - > - get copyWith => - _FigureDeckDefinitionCopyWithImpl< - FigureDeckDefinition, - FigureDeckDefinition - >(this as FigureDeckDefinition, $identity, $identity); - @override - String toString() { - return FigureDeckDefinitionMapper.ensureInitialized().stringifyValue( - this as FigureDeckDefinition, - ); - } - - @override - bool operator ==(Object other) { - return FigureDeckDefinitionMapper.ensureInitialized().equalsValue( - this as FigureDeckDefinition, - other, - ); - } - - @override - int get hashCode { - return FigureDeckDefinitionMapper.ensureInitialized().hashValue( - this as FigureDeckDefinition, - ); - } -} - -/// @nodoc -extension FigureDeckDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, FigureDeckDefinition, $Out> { - FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, $Out> - get $asFigureDeckDefinition => $base.as( - (v, t, t2) => _FigureDeckDefinitionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class FigureDeckDefinitionCopyWith< - $R, - $In extends FigureDeckDefinition, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get position; - $R call({String? name, String? variation, VectorDefinition? position}); - FigureDeckDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _FigureDeckDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, FigureDeckDefinition, $Out> - implements FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, $Out> { - _FigureDeckDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - FigureDeckDefinitionMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> - get position => $value.position.copyWith.$chain((v) => call(position: v)); - @override - $R call({ - String? name, - Object? variation = $none, - VectorDefinition? position, - }) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (variation != $none) #variation: variation, - if (position != null) #position: position, - }), - ); - @override - FigureDeckDefinition $make(CopyWithData data) => FigureDeckDefinition( - name: data.get(#name, or: $value.name), - variation: data.get(#variation, or: $value.variation), - position: data.get(#position, or: $value.position), - ); - - @override - FigureDeckDefinitionCopyWith<$R2, FigureDeckDefinition, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _FigureDeckDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardDeckDefinitionMapper extends ClassMapperBase { - BoardDeckDefinitionMapper._(); - - static BoardDeckDefinitionMapper? _instance; - static BoardDeckDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardDeckDefinitionMapper._()); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardDeckDefinition'; - - static String _$name(BoardDeckDefinition v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - ); - static VectorDefinition _$position(BoardDeckDefinition v) => v.position; - static const Field _f$position = Field( - 'position', - _$position, - opt: true, - def: VectorDefinition.zero, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #position: _f$position, - }; - - static BoardDeckDefinition _instantiate(DecodingData data) { - return BoardDeckDefinition( - name: data.dec(_f$name), - position: data.dec(_f$position), - ); - } - - @override - final Function instantiate = _instantiate; - - static BoardDeckDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardDeckDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardDeckDefinitionMappable { - String toJson() { - return BoardDeckDefinitionMapper.ensureInitialized() - .encodeJson(this as BoardDeckDefinition); - } - - Map toMap() { - return BoardDeckDefinitionMapper.ensureInitialized() - .encodeMap(this as BoardDeckDefinition); - } - - BoardDeckDefinitionCopyWith< - BoardDeckDefinition, - BoardDeckDefinition, - BoardDeckDefinition - > - get copyWith => - _BoardDeckDefinitionCopyWithImpl< - BoardDeckDefinition, - BoardDeckDefinition - >(this as BoardDeckDefinition, $identity, $identity); - @override - String toString() { - return BoardDeckDefinitionMapper.ensureInitialized().stringifyValue( - this as BoardDeckDefinition, - ); - } - - @override - bool operator ==(Object other) { - return BoardDeckDefinitionMapper.ensureInitialized().equalsValue( - this as BoardDeckDefinition, - other, - ); - } - - @override - int get hashCode { - return BoardDeckDefinitionMapper.ensureInitialized().hashValue( - this as BoardDeckDefinition, - ); - } -} - -/// @nodoc -extension BoardDeckDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardDeckDefinition, $Out> { - BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, $Out> - get $asBoardDeckDefinition => $base.as( - (v, t, t2) => _BoardDeckDefinitionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BoardDeckDefinitionCopyWith< - $R, - $In extends BoardDeckDefinition, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get position; - $R call({String? name, VectorDefinition? position}); - BoardDeckDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardDeckDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardDeckDefinition, $Out> - implements BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, $Out> { - _BoardDeckDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardDeckDefinitionMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> - get position => $value.position.copyWith.$chain((v) => call(position: v)); - @override - $R call({String? name, VectorDefinition? position}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (position != null) #position: position, - }), - ); - @override - BoardDeckDefinition $make(CopyWithData data) => BoardDeckDefinition( - name: data.get(#name, or: $value.name), - position: data.get(#position, or: $value.position), - ); - - @override - BoardDeckDefinitionCopyWith<$R2, BoardDeckDefinition, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _BoardDeckDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'deck.dart'; + +/// @nodoc +class DeckDefinitionMapper extends ClassMapperBase { + DeckDefinitionMapper._(); + + static DeckDefinitionMapper? _instance; + static DeckDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DeckDefinitionMapper._()); + FigureDeckDefinitionMapper.ensureInitialized(); + BoardDeckDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'DeckDefinition'; + + static List _$figures(DeckDefinition v) => v.figures; + static const Field> _f$figures = + Field('figures', _$figures, opt: true, def: const []); + static List _$boards(DeckDefinition v) => v.boards; + static const Field> _f$boards = + Field('boards', _$boards, opt: true, def: const []); + + @override + final MappableFields fields = const { + #figures: _f$figures, + #boards: _f$boards, + }; + + static DeckDefinition _instantiate(DecodingData data) { + return DeckDefinition( + figures: data.dec(_f$figures), + boards: data.dec(_f$boards), + ); + } + + @override + final Function instantiate = _instantiate; + + static DeckDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DeckDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DeckDefinitionMappable { + String toJson() { + return DeckDefinitionMapper.ensureInitialized().encodeJson( + this as DeckDefinition, + ); + } + + Map toMap() { + return DeckDefinitionMapper.ensureInitialized().encodeMap( + this as DeckDefinition, + ); + } + + DeckDefinitionCopyWith + get copyWith => _DeckDefinitionCopyWithImpl( + this as DeckDefinition, + $identity, + $identity, + ); + @override + String toString() { + return DeckDefinitionMapper.ensureInitialized().stringifyValue( + this as DeckDefinition, + ); + } + + @override + bool operator ==(Object other) { + return DeckDefinitionMapper.ensureInitialized().equalsValue( + this as DeckDefinition, + other, + ); + } + + @override + int get hashCode { + return DeckDefinitionMapper.ensureInitialized().hashValue( + this as DeckDefinition, + ); + } +} + +/// @nodoc +extension DeckDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, DeckDefinition, $Out> { + DeckDefinitionCopyWith<$R, DeckDefinition, $Out> get $asDeckDefinition => + $base.as((v, t, t2) => _DeckDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class DeckDefinitionCopyWith<$R, $In extends DeckDefinition, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ListCopyWith< + $R, + FigureDeckDefinition, + FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, FigureDeckDefinition> + > + get figures; + ListCopyWith< + $R, + BoardDeckDefinition, + BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, BoardDeckDefinition> + > + get boards; + $R call({ + List? figures, + List? boards, + }); + DeckDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _DeckDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DeckDefinition, $Out> + implements DeckDefinitionCopyWith<$R, DeckDefinition, $Out> { + _DeckDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + DeckDefinitionMapper.ensureInitialized(); + @override + ListCopyWith< + $R, + FigureDeckDefinition, + FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, FigureDeckDefinition> + > + get figures => ListCopyWith( + $value.figures, + (v, t) => v.copyWith.$chain(t), + (v) => call(figures: v), + ); + @override + ListCopyWith< + $R, + BoardDeckDefinition, + BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, BoardDeckDefinition> + > + get boards => ListCopyWith( + $value.boards, + (v, t) => v.copyWith.$chain(t), + (v) => call(boards: v), + ); + @override + $R call({ + List? figures, + List? boards, + }) => $apply( + FieldCopyWithData({ + if (figures != null) #figures: figures, + if (boards != null) #boards: boards, + }), + ); + @override + DeckDefinition $make(CopyWithData data) => DeckDefinition( + figures: data.get(#figures, or: $value.figures), + boards: data.get(#boards, or: $value.boards), + ); + + @override + DeckDefinitionCopyWith<$R2, DeckDefinition, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _DeckDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class FigureDeckDefinitionMapper extends ClassMapperBase { + FigureDeckDefinitionMapper._(); + + static FigureDeckDefinitionMapper? _instance; + static FigureDeckDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = FigureDeckDefinitionMapper._()); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'FigureDeckDefinition'; + + static String _$name(FigureDeckDefinition v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + ); + static String? _$variation(FigureDeckDefinition v) => v.variation; + static const Field _f$variation = Field( + 'variation', + _$variation, + opt: true, + ); + static VectorDefinition _$position(FigureDeckDefinition v) => v.position; + static const Field _f$position = + Field('position', _$position, opt: true, def: VectorDefinition.zero); + + @override + final MappableFields fields = const { + #name: _f$name, + #variation: _f$variation, + #position: _f$position, + }; + + static FigureDeckDefinition _instantiate(DecodingData data) { + return FigureDeckDefinition( + name: data.dec(_f$name), + variation: data.dec(_f$variation), + position: data.dec(_f$position), + ); + } + + @override + final Function instantiate = _instantiate; + + static FigureDeckDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static FigureDeckDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin FigureDeckDefinitionMappable { + String toJson() { + return FigureDeckDefinitionMapper.ensureInitialized() + .encodeJson(this as FigureDeckDefinition); + } + + Map toMap() { + return FigureDeckDefinitionMapper.ensureInitialized() + .encodeMap(this as FigureDeckDefinition); + } + + FigureDeckDefinitionCopyWith< + FigureDeckDefinition, + FigureDeckDefinition, + FigureDeckDefinition + > + get copyWith => + _FigureDeckDefinitionCopyWithImpl< + FigureDeckDefinition, + FigureDeckDefinition + >(this as FigureDeckDefinition, $identity, $identity); + @override + String toString() { + return FigureDeckDefinitionMapper.ensureInitialized().stringifyValue( + this as FigureDeckDefinition, + ); + } + + @override + bool operator ==(Object other) { + return FigureDeckDefinitionMapper.ensureInitialized().equalsValue( + this as FigureDeckDefinition, + other, + ); + } + + @override + int get hashCode { + return FigureDeckDefinitionMapper.ensureInitialized().hashValue( + this as FigureDeckDefinition, + ); + } +} + +/// @nodoc +extension FigureDeckDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, FigureDeckDefinition, $Out> { + FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, $Out> + get $asFigureDeckDefinition => $base.as( + (v, t, t2) => _FigureDeckDefinitionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class FigureDeckDefinitionCopyWith< + $R, + $In extends FigureDeckDefinition, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get position; + $R call({String? name, String? variation, VectorDefinition? position}); + FigureDeckDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _FigureDeckDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, FigureDeckDefinition, $Out> + implements FigureDeckDefinitionCopyWith<$R, FigureDeckDefinition, $Out> { + _FigureDeckDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + FigureDeckDefinitionMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> + get position => $value.position.copyWith.$chain((v) => call(position: v)); + @override + $R call({ + String? name, + Object? variation = $none, + VectorDefinition? position, + }) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (variation != $none) #variation: variation, + if (position != null) #position: position, + }), + ); + @override + FigureDeckDefinition $make(CopyWithData data) => FigureDeckDefinition( + name: data.get(#name, or: $value.name), + variation: data.get(#variation, or: $value.variation), + position: data.get(#position, or: $value.position), + ); + + @override + FigureDeckDefinitionCopyWith<$R2, FigureDeckDefinition, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _FigureDeckDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardDeckDefinitionMapper extends ClassMapperBase { + BoardDeckDefinitionMapper._(); + + static BoardDeckDefinitionMapper? _instance; + static BoardDeckDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardDeckDefinitionMapper._()); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardDeckDefinition'; + + static String _$name(BoardDeckDefinition v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + ); + static VectorDefinition _$position(BoardDeckDefinition v) => v.position; + static const Field _f$position = Field( + 'position', + _$position, + opt: true, + def: VectorDefinition.zero, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #position: _f$position, + }; + + static BoardDeckDefinition _instantiate(DecodingData data) { + return BoardDeckDefinition( + name: data.dec(_f$name), + position: data.dec(_f$position), + ); + } + + @override + final Function instantiate = _instantiate; + + static BoardDeckDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardDeckDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardDeckDefinitionMappable { + String toJson() { + return BoardDeckDefinitionMapper.ensureInitialized() + .encodeJson(this as BoardDeckDefinition); + } + + Map toMap() { + return BoardDeckDefinitionMapper.ensureInitialized() + .encodeMap(this as BoardDeckDefinition); + } + + BoardDeckDefinitionCopyWith< + BoardDeckDefinition, + BoardDeckDefinition, + BoardDeckDefinition + > + get copyWith => + _BoardDeckDefinitionCopyWithImpl< + BoardDeckDefinition, + BoardDeckDefinition + >(this as BoardDeckDefinition, $identity, $identity); + @override + String toString() { + return BoardDeckDefinitionMapper.ensureInitialized().stringifyValue( + this as BoardDeckDefinition, + ); + } + + @override + bool operator ==(Object other) { + return BoardDeckDefinitionMapper.ensureInitialized().equalsValue( + this as BoardDeckDefinition, + other, + ); + } + + @override + int get hashCode { + return BoardDeckDefinitionMapper.ensureInitialized().hashValue( + this as BoardDeckDefinition, + ); + } +} + +/// @nodoc +extension BoardDeckDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardDeckDefinition, $Out> { + BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, $Out> + get $asBoardDeckDefinition => $base.as( + (v, t, t2) => _BoardDeckDefinitionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BoardDeckDefinitionCopyWith< + $R, + $In extends BoardDeckDefinition, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get position; + $R call({String? name, VectorDefinition? position}); + BoardDeckDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardDeckDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardDeckDefinition, $Out> + implements BoardDeckDefinitionCopyWith<$R, BoardDeckDefinition, $Out> { + _BoardDeckDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardDeckDefinitionMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> + get position => $value.position.copyWith.$chain((v) => call(position: v)); + @override + $R call({String? name, VectorDefinition? position}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (position != null) #position: position, + }), + ); + @override + BoardDeckDefinition $make(CopyWithData data) => BoardDeckDefinition( + name: data.get(#name, or: $value.name), + position: data.get(#position, or: $value.position), + ); + + @override + BoardDeckDefinitionCopyWith<$R2, BoardDeckDefinition, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _BoardDeckDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/definition.dart b/api/lib/src/models/definition.dart index dc5dfba1..d02b63a6 100644 --- a/api/lib/src/models/definition.dart +++ b/api/lib/src/models/definition.dart @@ -1,52 +1,52 @@ -import 'package:dart_mappable/dart_mappable.dart'; -import 'vector.dart'; -import 'visual.dart'; - -part 'definition.mapper.dart'; - -sealed class GameObjectDefinition {} - -@MappableClass() -class FigureDefinition extends GameObjectDefinition - with FigureDefinitionMappable { - final FigureBackDefinition back; - final bool rollable; - final Map variations; - - FigureDefinition({ - this.variations = const {}, - this.rollable = false, - required this.back, - }); -} - -@MappableClass() -class BoardDefinition extends VisualDefinition with BoardDefinitionMappable { - final VectorDefinition tiles; - - BoardDefinition({ - super.offset, - super.size, - required super.texture, - this.tiles = VectorDefinition.one, - }); -} - -@MappableClass() -class VariationDefinition extends VisualDefinition - with VariationDefinitionMappable { - final String? category; - - VariationDefinition({ - this.category, - required super.texture, - super.offset, - super.size, - }); -} - -@MappableClass() -class FigureBackDefinition extends VisualDefinition - with FigureBackDefinitionMappable { - FigureBackDefinition({required super.texture, super.offset, super.size}); -} +import 'package:dart_mappable/dart_mappable.dart'; +import 'vector.dart'; +import 'visual.dart'; + +part 'definition.mapper.dart'; + +sealed class GameObjectDefinition {} + +@MappableClass() +class FigureDefinition extends GameObjectDefinition + with FigureDefinitionMappable { + final FigureBackDefinition back; + final bool rollable; + final Map variations; + + FigureDefinition({ + this.variations = const {}, + this.rollable = false, + required this.back, + }); +} + +@MappableClass() +class BoardDefinition extends VisualDefinition with BoardDefinitionMappable { + final VectorDefinition tiles; + + BoardDefinition({ + super.offset, + super.size, + required super.texture, + this.tiles = VectorDefinition.one, + }); +} + +@MappableClass() +class VariationDefinition extends VisualDefinition + with VariationDefinitionMappable { + final String? category; + + VariationDefinition({ + this.category, + required super.texture, + super.offset, + super.size, + }); +} + +@MappableClass() +class FigureBackDefinition extends VisualDefinition + with FigureBackDefinitionMappable { + FigureBackDefinition({required super.texture, super.offset, super.size}); +} diff --git a/api/lib/src/models/definition.mapper.dart b/api/lib/src/models/definition.mapper.dart index b2b3c404..d46a0055 100644 --- a/api/lib/src/models/definition.mapper.dart +++ b/api/lib/src/models/definition.mapper.dart @@ -1,743 +1,743 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'definition.dart'; - -/// @nodoc -class FigureDefinitionMapper extends ClassMapperBase { - FigureDefinitionMapper._(); - - static FigureDefinitionMapper? _instance; - static FigureDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = FigureDefinitionMapper._()); - VariationDefinitionMapper.ensureInitialized(); - FigureBackDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'FigureDefinition'; - - static Map _$variations(FigureDefinition v) => - v.variations; - static const Field> - _f$variations = Field('variations', _$variations, opt: true, def: const {}); - static bool _$rollable(FigureDefinition v) => v.rollable; - static const Field _f$rollable = Field( - 'rollable', - _$rollable, - opt: true, - def: false, - ); - static FigureBackDefinition _$back(FigureDefinition v) => v.back; - static const Field _f$back = Field( - 'back', - _$back, - ); - - @override - final MappableFields fields = const { - #variations: _f$variations, - #rollable: _f$rollable, - #back: _f$back, - }; - - static FigureDefinition _instantiate(DecodingData data) { - return FigureDefinition( - variations: data.dec(_f$variations), - rollable: data.dec(_f$rollable), - back: data.dec(_f$back), - ); - } - - @override - final Function instantiate = _instantiate; - - static FigureDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static FigureDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin FigureDefinitionMappable { - String toJson() { - return FigureDefinitionMapper.ensureInitialized() - .encodeJson(this as FigureDefinition); - } - - Map toMap() { - return FigureDefinitionMapper.ensureInitialized() - .encodeMap(this as FigureDefinition); - } - - FigureDefinitionCopyWith - get copyWith => - _FigureDefinitionCopyWithImpl( - this as FigureDefinition, - $identity, - $identity, - ); - @override - String toString() { - return FigureDefinitionMapper.ensureInitialized().stringifyValue( - this as FigureDefinition, - ); - } - - @override - bool operator ==(Object other) { - return FigureDefinitionMapper.ensureInitialized().equalsValue( - this as FigureDefinition, - other, - ); - } - - @override - int get hashCode { - return FigureDefinitionMapper.ensureInitialized().hashValue( - this as FigureDefinition, - ); - } -} - -/// @nodoc -extension FigureDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, FigureDefinition, $Out> { - FigureDefinitionCopyWith<$R, FigureDefinition, $Out> - get $asFigureDefinition => - $base.as((v, t, t2) => _FigureDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class FigureDefinitionCopyWith<$R, $In extends FigureDefinition, $Out> - implements ClassCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - String, - VariationDefinition, - VariationDefinitionCopyWith<$R, VariationDefinition, VariationDefinition> - > - get variations; - FigureBackDefinitionCopyWith<$R, FigureBackDefinition, FigureBackDefinition> - get back; - $R call({ - Map? variations, - bool? rollable, - FigureBackDefinition? back, - }); - FigureDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _FigureDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, FigureDefinition, $Out> - implements FigureDefinitionCopyWith<$R, FigureDefinition, $Out> { - _FigureDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - FigureDefinitionMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - String, - VariationDefinition, - VariationDefinitionCopyWith<$R, VariationDefinition, VariationDefinition> - > - get variations => MapCopyWith( - $value.variations, - (v, t) => v.copyWith.$chain(t), - (v) => call(variations: v), - ); - @override - FigureBackDefinitionCopyWith<$R, FigureBackDefinition, FigureBackDefinition> - get back => $value.back.copyWith.$chain((v) => call(back: v)); - @override - $R call({ - Map? variations, - bool? rollable, - FigureBackDefinition? back, - }) => $apply( - FieldCopyWithData({ - if (variations != null) #variations: variations, - if (rollable != null) #rollable: rollable, - if (back != null) #back: back, - }), - ); - @override - FigureDefinition $make(CopyWithData data) => FigureDefinition( - variations: data.get(#variations, or: $value.variations), - rollable: data.get(#rollable, or: $value.rollable), - back: data.get(#back, or: $value.back), - ); - - @override - FigureDefinitionCopyWith<$R2, FigureDefinition, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _FigureDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class VariationDefinitionMapper extends ClassMapperBase { - VariationDefinitionMapper._(); - - static VariationDefinitionMapper? _instance; - static VariationDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = VariationDefinitionMapper._()); - VisualDefinitionMapper.ensureInitialized(); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'VariationDefinition'; - - static String? _$category(VariationDefinition v) => v.category; - static const Field _f$category = Field( - 'category', - _$category, - opt: true, - ); - static String _$texture(VariationDefinition v) => v.texture; - static const Field _f$texture = Field( - 'texture', - _$texture, - ); - static VectorDefinition _$offset(VariationDefinition v) => v.offset; - static const Field _f$offset = Field( - 'offset', - _$offset, - opt: true, - def: VectorDefinition.zero, - ); - static VectorDefinition? _$size(VariationDefinition v) => v.size; - static const Field _f$size = Field( - 'size', - _$size, - opt: true, - ); - - @override - final MappableFields fields = const { - #category: _f$category, - #texture: _f$texture, - #offset: _f$offset, - #size: _f$size, - }; - - static VariationDefinition _instantiate(DecodingData data) { - return VariationDefinition( - category: data.dec(_f$category), - texture: data.dec(_f$texture), - offset: data.dec(_f$offset), - size: data.dec(_f$size), - ); - } - - @override - final Function instantiate = _instantiate; - - static VariationDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static VariationDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin VariationDefinitionMappable { - String toJson() { - return VariationDefinitionMapper.ensureInitialized() - .encodeJson(this as VariationDefinition); - } - - Map toMap() { - return VariationDefinitionMapper.ensureInitialized() - .encodeMap(this as VariationDefinition); - } - - VariationDefinitionCopyWith< - VariationDefinition, - VariationDefinition, - VariationDefinition - > - get copyWith => - _VariationDefinitionCopyWithImpl< - VariationDefinition, - VariationDefinition - >(this as VariationDefinition, $identity, $identity); - @override - String toString() { - return VariationDefinitionMapper.ensureInitialized().stringifyValue( - this as VariationDefinition, - ); - } - - @override - bool operator ==(Object other) { - return VariationDefinitionMapper.ensureInitialized().equalsValue( - this as VariationDefinition, - other, - ); - } - - @override - int get hashCode { - return VariationDefinitionMapper.ensureInitialized().hashValue( - this as VariationDefinition, - ); - } -} - -/// @nodoc -extension VariationDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, VariationDefinition, $Out> { - VariationDefinitionCopyWith<$R, VariationDefinition, $Out> - get $asVariationDefinition => $base.as( - (v, t, t2) => _VariationDefinitionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class VariationDefinitionCopyWith< - $R, - $In extends VariationDefinition, - $Out -> - implements VisualDefinitionCopyWith<$R, $In, $Out> { - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; - @override - $R call({ - String? category, - String? texture, - VectorDefinition? offset, - VectorDefinition? size, - }); - VariationDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _VariationDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, VariationDefinition, $Out> - implements VariationDefinitionCopyWith<$R, VariationDefinition, $Out> { - _VariationDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - VariationDefinitionMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => - $value.offset.copyWith.$chain((v) => call(offset: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => - $value.size?.copyWith.$chain((v) => call(size: v)); - @override - $R call({ - Object? category = $none, - String? texture, - VectorDefinition? offset, - Object? size = $none, - }) => $apply( - FieldCopyWithData({ - if (category != $none) #category: category, - if (texture != null) #texture: texture, - if (offset != null) #offset: offset, - if (size != $none) #size: size, - }), - ); - @override - VariationDefinition $make(CopyWithData data) => VariationDefinition( - category: data.get(#category, or: $value.category), - texture: data.get(#texture, or: $value.texture), - offset: data.get(#offset, or: $value.offset), - size: data.get(#size, or: $value.size), - ); - - @override - VariationDefinitionCopyWith<$R2, VariationDefinition, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _VariationDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class FigureBackDefinitionMapper extends ClassMapperBase { - FigureBackDefinitionMapper._(); - - static FigureBackDefinitionMapper? _instance; - static FigureBackDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = FigureBackDefinitionMapper._()); - VisualDefinitionMapper.ensureInitialized(); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'FigureBackDefinition'; - - static String _$texture(FigureBackDefinition v) => v.texture; - static const Field _f$texture = Field( - 'texture', - _$texture, - ); - static VectorDefinition _$offset(FigureBackDefinition v) => v.offset; - static const Field _f$offset = Field( - 'offset', - _$offset, - opt: true, - def: VectorDefinition.zero, - ); - static VectorDefinition? _$size(FigureBackDefinition v) => v.size; - static const Field _f$size = Field( - 'size', - _$size, - opt: true, - ); - - @override - final MappableFields fields = const { - #texture: _f$texture, - #offset: _f$offset, - #size: _f$size, - }; - - static FigureBackDefinition _instantiate(DecodingData data) { - return FigureBackDefinition( - texture: data.dec(_f$texture), - offset: data.dec(_f$offset), - size: data.dec(_f$size), - ); - } - - @override - final Function instantiate = _instantiate; - - static FigureBackDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static FigureBackDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin FigureBackDefinitionMappable { - String toJson() { - return FigureBackDefinitionMapper.ensureInitialized() - .encodeJson(this as FigureBackDefinition); - } - - Map toMap() { - return FigureBackDefinitionMapper.ensureInitialized() - .encodeMap(this as FigureBackDefinition); - } - - FigureBackDefinitionCopyWith< - FigureBackDefinition, - FigureBackDefinition, - FigureBackDefinition - > - get copyWith => - _FigureBackDefinitionCopyWithImpl< - FigureBackDefinition, - FigureBackDefinition - >(this as FigureBackDefinition, $identity, $identity); - @override - String toString() { - return FigureBackDefinitionMapper.ensureInitialized().stringifyValue( - this as FigureBackDefinition, - ); - } - - @override - bool operator ==(Object other) { - return FigureBackDefinitionMapper.ensureInitialized().equalsValue( - this as FigureBackDefinition, - other, - ); - } - - @override - int get hashCode { - return FigureBackDefinitionMapper.ensureInitialized().hashValue( - this as FigureBackDefinition, - ); - } -} - -/// @nodoc -extension FigureBackDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, FigureBackDefinition, $Out> { - FigureBackDefinitionCopyWith<$R, FigureBackDefinition, $Out> - get $asFigureBackDefinition => $base.as( - (v, t, t2) => _FigureBackDefinitionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class FigureBackDefinitionCopyWith< - $R, - $In extends FigureBackDefinition, - $Out -> - implements VisualDefinitionCopyWith<$R, $In, $Out> { - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; - @override - $R call({String? texture, VectorDefinition? offset, VectorDefinition? size}); - FigureBackDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _FigureBackDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, FigureBackDefinition, $Out> - implements FigureBackDefinitionCopyWith<$R, FigureBackDefinition, $Out> { - _FigureBackDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - FigureBackDefinitionMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => - $value.offset.copyWith.$chain((v) => call(offset: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => - $value.size?.copyWith.$chain((v) => call(size: v)); - @override - $R call({String? texture, VectorDefinition? offset, Object? size = $none}) => - $apply( - FieldCopyWithData({ - if (texture != null) #texture: texture, - if (offset != null) #offset: offset, - if (size != $none) #size: size, - }), - ); - @override - FigureBackDefinition $make(CopyWithData data) => FigureBackDefinition( - texture: data.get(#texture, or: $value.texture), - offset: data.get(#offset, or: $value.offset), - size: data.get(#size, or: $value.size), - ); - - @override - FigureBackDefinitionCopyWith<$R2, FigureBackDefinition, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _FigureBackDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardDefinitionMapper extends ClassMapperBase { - BoardDefinitionMapper._(); - - static BoardDefinitionMapper? _instance; - static BoardDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardDefinitionMapper._()); - VisualDefinitionMapper.ensureInitialized(); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardDefinition'; - - static VectorDefinition _$offset(BoardDefinition v) => v.offset; - static const Field _f$offset = Field( - 'offset', - _$offset, - opt: true, - def: VectorDefinition.zero, - ); - static VectorDefinition? _$size(BoardDefinition v) => v.size; - static const Field _f$size = Field( - 'size', - _$size, - opt: true, - ); - static String _$texture(BoardDefinition v) => v.texture; - static const Field _f$texture = Field( - 'texture', - _$texture, - ); - static VectorDefinition _$tiles(BoardDefinition v) => v.tiles; - static const Field _f$tiles = Field( - 'tiles', - _$tiles, - opt: true, - def: VectorDefinition.one, - ); - - @override - final MappableFields fields = const { - #offset: _f$offset, - #size: _f$size, - #texture: _f$texture, - #tiles: _f$tiles, - }; - - static BoardDefinition _instantiate(DecodingData data) { - return BoardDefinition( - offset: data.dec(_f$offset), - size: data.dec(_f$size), - texture: data.dec(_f$texture), - tiles: data.dec(_f$tiles), - ); - } - - @override - final Function instantiate = _instantiate; - - static BoardDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardDefinitionMappable { - String toJson() { - return BoardDefinitionMapper.ensureInitialized() - .encodeJson(this as BoardDefinition); - } - - Map toMap() { - return BoardDefinitionMapper.ensureInitialized().encodeMap( - this as BoardDefinition, - ); - } - - BoardDefinitionCopyWith - get copyWith => - _BoardDefinitionCopyWithImpl( - this as BoardDefinition, - $identity, - $identity, - ); - @override - String toString() { - return BoardDefinitionMapper.ensureInitialized().stringifyValue( - this as BoardDefinition, - ); - } - - @override - bool operator ==(Object other) { - return BoardDefinitionMapper.ensureInitialized().equalsValue( - this as BoardDefinition, - other, - ); - } - - @override - int get hashCode { - return BoardDefinitionMapper.ensureInitialized().hashValue( - this as BoardDefinition, - ); - } -} - -/// @nodoc -extension BoardDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardDefinition, $Out> { - BoardDefinitionCopyWith<$R, BoardDefinition, $Out> get $asBoardDefinition => - $base.as((v, t, t2) => _BoardDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class BoardDefinitionCopyWith<$R, $In extends BoardDefinition, $Out> - implements VisualDefinitionCopyWith<$R, $In, $Out> { - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tiles; - @override - $R call({ - VectorDefinition? offset, - VectorDefinition? size, - String? texture, - VectorDefinition? tiles, - }); - BoardDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardDefinition, $Out> - implements BoardDefinitionCopyWith<$R, BoardDefinition, $Out> { - _BoardDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardDefinitionMapper.ensureInitialized(); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => - $value.offset.copyWith.$chain((v) => call(offset: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => - $value.size?.copyWith.$chain((v) => call(size: v)); - @override - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tiles => - $value.tiles.copyWith.$chain((v) => call(tiles: v)); - @override - $R call({ - VectorDefinition? offset, - Object? size = $none, - String? texture, - VectorDefinition? tiles, - }) => $apply( - FieldCopyWithData({ - if (offset != null) #offset: offset, - if (size != $none) #size: size, - if (texture != null) #texture: texture, - if (tiles != null) #tiles: tiles, - }), - ); - @override - BoardDefinition $make(CopyWithData data) => BoardDefinition( - offset: data.get(#offset, or: $value.offset), - size: data.get(#size, or: $value.size), - texture: data.get(#texture, or: $value.texture), - tiles: data.get(#tiles, or: $value.tiles), - ); - - @override - BoardDefinitionCopyWith<$R2, BoardDefinition, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'definition.dart'; + +/// @nodoc +class FigureDefinitionMapper extends ClassMapperBase { + FigureDefinitionMapper._(); + + static FigureDefinitionMapper? _instance; + static FigureDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = FigureDefinitionMapper._()); + VariationDefinitionMapper.ensureInitialized(); + FigureBackDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'FigureDefinition'; + + static Map _$variations(FigureDefinition v) => + v.variations; + static const Field> + _f$variations = Field('variations', _$variations, opt: true, def: const {}); + static bool _$rollable(FigureDefinition v) => v.rollable; + static const Field _f$rollable = Field( + 'rollable', + _$rollable, + opt: true, + def: false, + ); + static FigureBackDefinition _$back(FigureDefinition v) => v.back; + static const Field _f$back = Field( + 'back', + _$back, + ); + + @override + final MappableFields fields = const { + #variations: _f$variations, + #rollable: _f$rollable, + #back: _f$back, + }; + + static FigureDefinition _instantiate(DecodingData data) { + return FigureDefinition( + variations: data.dec(_f$variations), + rollable: data.dec(_f$rollable), + back: data.dec(_f$back), + ); + } + + @override + final Function instantiate = _instantiate; + + static FigureDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static FigureDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin FigureDefinitionMappable { + String toJson() { + return FigureDefinitionMapper.ensureInitialized() + .encodeJson(this as FigureDefinition); + } + + Map toMap() { + return FigureDefinitionMapper.ensureInitialized() + .encodeMap(this as FigureDefinition); + } + + FigureDefinitionCopyWith + get copyWith => + _FigureDefinitionCopyWithImpl( + this as FigureDefinition, + $identity, + $identity, + ); + @override + String toString() { + return FigureDefinitionMapper.ensureInitialized().stringifyValue( + this as FigureDefinition, + ); + } + + @override + bool operator ==(Object other) { + return FigureDefinitionMapper.ensureInitialized().equalsValue( + this as FigureDefinition, + other, + ); + } + + @override + int get hashCode { + return FigureDefinitionMapper.ensureInitialized().hashValue( + this as FigureDefinition, + ); + } +} + +/// @nodoc +extension FigureDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, FigureDefinition, $Out> { + FigureDefinitionCopyWith<$R, FigureDefinition, $Out> + get $asFigureDefinition => + $base.as((v, t, t2) => _FigureDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class FigureDefinitionCopyWith<$R, $In extends FigureDefinition, $Out> + implements ClassCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + String, + VariationDefinition, + VariationDefinitionCopyWith<$R, VariationDefinition, VariationDefinition> + > + get variations; + FigureBackDefinitionCopyWith<$R, FigureBackDefinition, FigureBackDefinition> + get back; + $R call({ + Map? variations, + bool? rollable, + FigureBackDefinition? back, + }); + FigureDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _FigureDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, FigureDefinition, $Out> + implements FigureDefinitionCopyWith<$R, FigureDefinition, $Out> { + _FigureDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + FigureDefinitionMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + String, + VariationDefinition, + VariationDefinitionCopyWith<$R, VariationDefinition, VariationDefinition> + > + get variations => MapCopyWith( + $value.variations, + (v, t) => v.copyWith.$chain(t), + (v) => call(variations: v), + ); + @override + FigureBackDefinitionCopyWith<$R, FigureBackDefinition, FigureBackDefinition> + get back => $value.back.copyWith.$chain((v) => call(back: v)); + @override + $R call({ + Map? variations, + bool? rollable, + FigureBackDefinition? back, + }) => $apply( + FieldCopyWithData({ + if (variations != null) #variations: variations, + if (rollable != null) #rollable: rollable, + if (back != null) #back: back, + }), + ); + @override + FigureDefinition $make(CopyWithData data) => FigureDefinition( + variations: data.get(#variations, or: $value.variations), + rollable: data.get(#rollable, or: $value.rollable), + back: data.get(#back, or: $value.back), + ); + + @override + FigureDefinitionCopyWith<$R2, FigureDefinition, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _FigureDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class VariationDefinitionMapper extends ClassMapperBase { + VariationDefinitionMapper._(); + + static VariationDefinitionMapper? _instance; + static VariationDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = VariationDefinitionMapper._()); + VisualDefinitionMapper.ensureInitialized(); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'VariationDefinition'; + + static String? _$category(VariationDefinition v) => v.category; + static const Field _f$category = Field( + 'category', + _$category, + opt: true, + ); + static String _$texture(VariationDefinition v) => v.texture; + static const Field _f$texture = Field( + 'texture', + _$texture, + ); + static VectorDefinition _$offset(VariationDefinition v) => v.offset; + static const Field _f$offset = Field( + 'offset', + _$offset, + opt: true, + def: VectorDefinition.zero, + ); + static VectorDefinition? _$size(VariationDefinition v) => v.size; + static const Field _f$size = Field( + 'size', + _$size, + opt: true, + ); + + @override + final MappableFields fields = const { + #category: _f$category, + #texture: _f$texture, + #offset: _f$offset, + #size: _f$size, + }; + + static VariationDefinition _instantiate(DecodingData data) { + return VariationDefinition( + category: data.dec(_f$category), + texture: data.dec(_f$texture), + offset: data.dec(_f$offset), + size: data.dec(_f$size), + ); + } + + @override + final Function instantiate = _instantiate; + + static VariationDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static VariationDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin VariationDefinitionMappable { + String toJson() { + return VariationDefinitionMapper.ensureInitialized() + .encodeJson(this as VariationDefinition); + } + + Map toMap() { + return VariationDefinitionMapper.ensureInitialized() + .encodeMap(this as VariationDefinition); + } + + VariationDefinitionCopyWith< + VariationDefinition, + VariationDefinition, + VariationDefinition + > + get copyWith => + _VariationDefinitionCopyWithImpl< + VariationDefinition, + VariationDefinition + >(this as VariationDefinition, $identity, $identity); + @override + String toString() { + return VariationDefinitionMapper.ensureInitialized().stringifyValue( + this as VariationDefinition, + ); + } + + @override + bool operator ==(Object other) { + return VariationDefinitionMapper.ensureInitialized().equalsValue( + this as VariationDefinition, + other, + ); + } + + @override + int get hashCode { + return VariationDefinitionMapper.ensureInitialized().hashValue( + this as VariationDefinition, + ); + } +} + +/// @nodoc +extension VariationDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, VariationDefinition, $Out> { + VariationDefinitionCopyWith<$R, VariationDefinition, $Out> + get $asVariationDefinition => $base.as( + (v, t, t2) => _VariationDefinitionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class VariationDefinitionCopyWith< + $R, + $In extends VariationDefinition, + $Out +> + implements VisualDefinitionCopyWith<$R, $In, $Out> { + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; + @override + $R call({ + String? category, + String? texture, + VectorDefinition? offset, + VectorDefinition? size, + }); + VariationDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _VariationDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, VariationDefinition, $Out> + implements VariationDefinitionCopyWith<$R, VariationDefinition, $Out> { + _VariationDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + VariationDefinitionMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => + $value.offset.copyWith.$chain((v) => call(offset: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => + $value.size?.copyWith.$chain((v) => call(size: v)); + @override + $R call({ + Object? category = $none, + String? texture, + VectorDefinition? offset, + Object? size = $none, + }) => $apply( + FieldCopyWithData({ + if (category != $none) #category: category, + if (texture != null) #texture: texture, + if (offset != null) #offset: offset, + if (size != $none) #size: size, + }), + ); + @override + VariationDefinition $make(CopyWithData data) => VariationDefinition( + category: data.get(#category, or: $value.category), + texture: data.get(#texture, or: $value.texture), + offset: data.get(#offset, or: $value.offset), + size: data.get(#size, or: $value.size), + ); + + @override + VariationDefinitionCopyWith<$R2, VariationDefinition, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _VariationDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class FigureBackDefinitionMapper extends ClassMapperBase { + FigureBackDefinitionMapper._(); + + static FigureBackDefinitionMapper? _instance; + static FigureBackDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = FigureBackDefinitionMapper._()); + VisualDefinitionMapper.ensureInitialized(); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'FigureBackDefinition'; + + static String _$texture(FigureBackDefinition v) => v.texture; + static const Field _f$texture = Field( + 'texture', + _$texture, + ); + static VectorDefinition _$offset(FigureBackDefinition v) => v.offset; + static const Field _f$offset = Field( + 'offset', + _$offset, + opt: true, + def: VectorDefinition.zero, + ); + static VectorDefinition? _$size(FigureBackDefinition v) => v.size; + static const Field _f$size = Field( + 'size', + _$size, + opt: true, + ); + + @override + final MappableFields fields = const { + #texture: _f$texture, + #offset: _f$offset, + #size: _f$size, + }; + + static FigureBackDefinition _instantiate(DecodingData data) { + return FigureBackDefinition( + texture: data.dec(_f$texture), + offset: data.dec(_f$offset), + size: data.dec(_f$size), + ); + } + + @override + final Function instantiate = _instantiate; + + static FigureBackDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static FigureBackDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin FigureBackDefinitionMappable { + String toJson() { + return FigureBackDefinitionMapper.ensureInitialized() + .encodeJson(this as FigureBackDefinition); + } + + Map toMap() { + return FigureBackDefinitionMapper.ensureInitialized() + .encodeMap(this as FigureBackDefinition); + } + + FigureBackDefinitionCopyWith< + FigureBackDefinition, + FigureBackDefinition, + FigureBackDefinition + > + get copyWith => + _FigureBackDefinitionCopyWithImpl< + FigureBackDefinition, + FigureBackDefinition + >(this as FigureBackDefinition, $identity, $identity); + @override + String toString() { + return FigureBackDefinitionMapper.ensureInitialized().stringifyValue( + this as FigureBackDefinition, + ); + } + + @override + bool operator ==(Object other) { + return FigureBackDefinitionMapper.ensureInitialized().equalsValue( + this as FigureBackDefinition, + other, + ); + } + + @override + int get hashCode { + return FigureBackDefinitionMapper.ensureInitialized().hashValue( + this as FigureBackDefinition, + ); + } +} + +/// @nodoc +extension FigureBackDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, FigureBackDefinition, $Out> { + FigureBackDefinitionCopyWith<$R, FigureBackDefinition, $Out> + get $asFigureBackDefinition => $base.as( + (v, t, t2) => _FigureBackDefinitionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class FigureBackDefinitionCopyWith< + $R, + $In extends FigureBackDefinition, + $Out +> + implements VisualDefinitionCopyWith<$R, $In, $Out> { + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; + @override + $R call({String? texture, VectorDefinition? offset, VectorDefinition? size}); + FigureBackDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _FigureBackDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, FigureBackDefinition, $Out> + implements FigureBackDefinitionCopyWith<$R, FigureBackDefinition, $Out> { + _FigureBackDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + FigureBackDefinitionMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => + $value.offset.copyWith.$chain((v) => call(offset: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => + $value.size?.copyWith.$chain((v) => call(size: v)); + @override + $R call({String? texture, VectorDefinition? offset, Object? size = $none}) => + $apply( + FieldCopyWithData({ + if (texture != null) #texture: texture, + if (offset != null) #offset: offset, + if (size != $none) #size: size, + }), + ); + @override + FigureBackDefinition $make(CopyWithData data) => FigureBackDefinition( + texture: data.get(#texture, or: $value.texture), + offset: data.get(#offset, or: $value.offset), + size: data.get(#size, or: $value.size), + ); + + @override + FigureBackDefinitionCopyWith<$R2, FigureBackDefinition, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _FigureBackDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardDefinitionMapper extends ClassMapperBase { + BoardDefinitionMapper._(); + + static BoardDefinitionMapper? _instance; + static BoardDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardDefinitionMapper._()); + VisualDefinitionMapper.ensureInitialized(); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardDefinition'; + + static VectorDefinition _$offset(BoardDefinition v) => v.offset; + static const Field _f$offset = Field( + 'offset', + _$offset, + opt: true, + def: VectorDefinition.zero, + ); + static VectorDefinition? _$size(BoardDefinition v) => v.size; + static const Field _f$size = Field( + 'size', + _$size, + opt: true, + ); + static String _$texture(BoardDefinition v) => v.texture; + static const Field _f$texture = Field( + 'texture', + _$texture, + ); + static VectorDefinition _$tiles(BoardDefinition v) => v.tiles; + static const Field _f$tiles = Field( + 'tiles', + _$tiles, + opt: true, + def: VectorDefinition.one, + ); + + @override + final MappableFields fields = const { + #offset: _f$offset, + #size: _f$size, + #texture: _f$texture, + #tiles: _f$tiles, + }; + + static BoardDefinition _instantiate(DecodingData data) { + return BoardDefinition( + offset: data.dec(_f$offset), + size: data.dec(_f$size), + texture: data.dec(_f$texture), + tiles: data.dec(_f$tiles), + ); + } + + @override + final Function instantiate = _instantiate; + + static BoardDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardDefinitionMappable { + String toJson() { + return BoardDefinitionMapper.ensureInitialized() + .encodeJson(this as BoardDefinition); + } + + Map toMap() { + return BoardDefinitionMapper.ensureInitialized().encodeMap( + this as BoardDefinition, + ); + } + + BoardDefinitionCopyWith + get copyWith => + _BoardDefinitionCopyWithImpl( + this as BoardDefinition, + $identity, + $identity, + ); + @override + String toString() { + return BoardDefinitionMapper.ensureInitialized().stringifyValue( + this as BoardDefinition, + ); + } + + @override + bool operator ==(Object other) { + return BoardDefinitionMapper.ensureInitialized().equalsValue( + this as BoardDefinition, + other, + ); + } + + @override + int get hashCode { + return BoardDefinitionMapper.ensureInitialized().hashValue( + this as BoardDefinition, + ); + } +} + +/// @nodoc +extension BoardDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardDefinition, $Out> { + BoardDefinitionCopyWith<$R, BoardDefinition, $Out> get $asBoardDefinition => + $base.as((v, t, t2) => _BoardDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class BoardDefinitionCopyWith<$R, $In extends BoardDefinition, $Out> + implements VisualDefinitionCopyWith<$R, $In, $Out> { + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tiles; + @override + $R call({ + VectorDefinition? offset, + VectorDefinition? size, + String? texture, + VectorDefinition? tiles, + }); + BoardDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardDefinition, $Out> + implements BoardDefinitionCopyWith<$R, BoardDefinition, $Out> { + _BoardDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardDefinitionMapper.ensureInitialized(); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset => + $value.offset.copyWith.$chain((v) => call(offset: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size => + $value.size?.copyWith.$chain((v) => call(size: v)); + @override + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get tiles => + $value.tiles.copyWith.$chain((v) => call(tiles: v)); + @override + $R call({ + VectorDefinition? offset, + Object? size = $none, + String? texture, + VectorDefinition? tiles, + }) => $apply( + FieldCopyWithData({ + if (offset != null) #offset: offset, + if (size != $none) #size: size, + if (texture != null) #texture: texture, + if (tiles != null) #tiles: tiles, + }), + ); + @override + BoardDefinition $make(CopyWithData data) => BoardDefinition( + offset: data.get(#offset, or: $value.offset), + size: data.get(#size, or: $value.size), + texture: data.get(#texture, or: $value.texture), + tiles: data.get(#tiles, or: $value.tiles), + ); + + @override + BoardDefinitionCopyWith<$R2, BoardDefinition, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/dialog.dart b/api/lib/src/models/dialog.dart index 512b9a1b..3419ca12 100644 --- a/api/lib/src/models/dialog.dart +++ b/api/lib/src/models/dialog.dart @@ -1,237 +1,237 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -part 'dialog.mapper.dart'; - -@MappableClass() -final class GameDialog with GameDialogMappable { - final String title; - final String id; - final List components; - final List? actions; - final String? image; - - GameDialog({ - required this.id, - required this.title, - this.image, - this.components = const [], - this.actions, - }); - - GameDialog withImage(String image) => copyWith(image: image); - - GameDialog markdown(String content) => - copyWith.components.add(GameDialogMarkdownComponent(content)); - - GameDialog textField( - String label, { - String? id, - String? placeholder, - bool multiline = false, - bool password = false, - }) => copyWith.components.add( - GameDialogTextFieldComponent( - label, - id: id, - placeholder: placeholder, - multiline: multiline, - password: password, - ), - ); - - GameDialog checkbox(String label, {String? id, bool initialValue = false}) => - copyWith.components.add( - GameDialogCheckboxComponent(label, id: id, initialValue: initialValue), - ); - - GameDialog dropdown( - String label, - List options, { - String? id, - String? initialValue, - }) => copyWith.components.add( - GameDialogDropdownComponent( - label, - options, - id: id, - initialValue: initialValue, - ), - ); - - GameDialog action(GameDialogButton action) => - copyWith(actions: [...(actions ?? []), action]); - - bool isValid() => - (actions?.length ?? 1) <= 10 && - components.length <= 20 && - components.every((e) { - switch (e) { - case GameDialogMarkdownComponent(): - return e.content.length <= 5000; - case GameDialogTextFieldComponent(): - return e.label.length <= 50 && - (e.id?.length ?? 0) <= 100 && - (e.placeholder?.length ?? 0) <= 50; - case GameDialogCheckboxComponent(): - return e.label.length <= 50 && (e.id?.length ?? 0) <= 100; - case GameDialogDropdownComponent(): - return e.label.length <= 50 && - (e.id?.length ?? 0) <= 100 && - e.options.length <= 20 && - e.options.every((o) => o.isValid()); - } - }) && - (actions ?? []).every( - (e) => e.label.length <= 50 && (e.id?.length ?? 0) <= 100, - ); -} - -@MappableClass() -sealed class GameDialogComponent with GameDialogComponentMappable {} - -@MappableClass() -final class GameDialogMarkdownComponent extends GameDialogComponent - with GameDialogMarkdownComponentMappable { - final String content; - - GameDialogMarkdownComponent(this.content); -} - -@MappableClass() -final class GameDialogTextFieldComponent extends GameDialogComponent - with GameDialogTextFieldComponentMappable { - final String label; - final String? id; - final String? placeholder; - final bool multiline; - final bool password; - - GameDialogTextFieldComponent( - this.label, { - this.id, - this.placeholder, - this.multiline = false, - this.password = false, - }); - - String get idOrLabel => id ?? label; -} - -@MappableClass() -final class GameDialogCheckboxComponent extends GameDialogComponent - with GameDialogCheckboxComponentMappable { - final String label; - final String? id; - final bool initialValue; - - GameDialogCheckboxComponent(this.label, {this.id, this.initialValue = false}); - - String get idOrLabel => id ?? label; -} - -@MappableClass() -final class GameDialogDropdownComponent extends GameDialogComponent - with GameDialogDropdownComponentMappable { - final String label; - final String? id; - final List options; - final String? initialValue; - - GameDialogDropdownComponent( - this.label, - this.options, { - this.id, - this.initialValue, - }); - - String get idOrLabel => id ?? label; -} - -@MappableClass() -final class GameDialogDropdownOption with GameDialogDropdownOptionMappable { - final String? label; - final String value; - - GameDialogDropdownOption({this.label, required this.value}); - - bool isValid() => (label?.length ?? 0) <= 50 && value.length <= 50; - - String get idOrLabel => label ?? value; -} - -@MappableClass() -final class GameDialogButton with GameDialogButtonMappable { - final String label; - final String? id; - - GameDialogButton(this.label, {this.id}); - - String get idOrLabel => id ?? label; -} - -@MappableClass() -base class GameDialogValue with GameDialogValueMappable { - final String buttonPressed; - final Map values; - - GameDialogValue([this.values = const {}, this.buttonPressed = '']); - - bool hasValue(String key) => values.containsKey(key); - GameDialogComponentValue getValue(String key) => - values[key] ?? GameDialogComponentValue(component: -1); -} - -@MappableClass() -base class GameDialogComponentValue with GameDialogComponentValueMappable { - final int component; - - GameDialogComponentValue({required this.component}); - String getAsString() => ''; - bool getAsBool() => false; - int getAsInt() => 0; -} - -@MappableClass() -final class GameDialogTextFieldValue extends GameDialogComponentValue - with GameDialogTextFieldValueMappable { - final String value; - - GameDialogTextFieldValue({required this.value, required super.component}); - - @override - String getAsString() => value; - @override - bool getAsBool() => value.isNotEmpty; - @override - int getAsInt() => int.tryParse(value) ?? 0; -} - -@MappableClass() -final class GameDialogCheckboxValue extends GameDialogComponentValue - with GameDialogCheckboxValueMappable { - final bool value; - - GameDialogCheckboxValue({required this.value, required super.component}); - - @override - String getAsString() => value.toString(); - @override - bool getAsBool() => value; - @override - int getAsInt() => value ? 1 : 0; -} - -@MappableClass() -final class GameDialogDropdownValue extends GameDialogComponentValue - with GameDialogDropdownValueMappable { - final String value; - - GameDialogDropdownValue({required this.value, required super.component}); - - @override - String getAsString() => value; - @override - bool getAsBool() => value.isNotEmpty; - @override - int getAsInt() => int.tryParse(value) ?? 0; -} +import 'package:dart_mappable/dart_mappable.dart'; + +part 'dialog.mapper.dart'; + +@MappableClass() +final class GameDialog with GameDialogMappable { + final String title; + final String id; + final List components; + final List? actions; + final String? image; + + GameDialog({ + required this.id, + required this.title, + this.image, + this.components = const [], + this.actions, + }); + + GameDialog withImage(String image) => copyWith(image: image); + + GameDialog markdown(String content) => + copyWith.components.add(GameDialogMarkdownComponent(content)); + + GameDialog textField( + String label, { + String? id, + String? placeholder, + bool multiline = false, + bool password = false, + }) => copyWith.components.add( + GameDialogTextFieldComponent( + label, + id: id, + placeholder: placeholder, + multiline: multiline, + password: password, + ), + ); + + GameDialog checkbox(String label, {String? id, bool initialValue = false}) => + copyWith.components.add( + GameDialogCheckboxComponent(label, id: id, initialValue: initialValue), + ); + + GameDialog dropdown( + String label, + List options, { + String? id, + String? initialValue, + }) => copyWith.components.add( + GameDialogDropdownComponent( + label, + options, + id: id, + initialValue: initialValue, + ), + ); + + GameDialog action(GameDialogButton action) => + copyWith(actions: [...(actions ?? []), action]); + + bool isValid() => + (actions?.length ?? 1) <= 10 && + components.length <= 20 && + components.every((e) { + switch (e) { + case GameDialogMarkdownComponent(): + return e.content.length <= 5000; + case GameDialogTextFieldComponent(): + return e.label.length <= 50 && + (e.id?.length ?? 0) <= 100 && + (e.placeholder?.length ?? 0) <= 50; + case GameDialogCheckboxComponent(): + return e.label.length <= 50 && (e.id?.length ?? 0) <= 100; + case GameDialogDropdownComponent(): + return e.label.length <= 50 && + (e.id?.length ?? 0) <= 100 && + e.options.length <= 20 && + e.options.every((o) => o.isValid()); + } + }) && + (actions ?? []).every( + (e) => e.label.length <= 50 && (e.id?.length ?? 0) <= 100, + ); +} + +@MappableClass() +sealed class GameDialogComponent with GameDialogComponentMappable {} + +@MappableClass() +final class GameDialogMarkdownComponent extends GameDialogComponent + with GameDialogMarkdownComponentMappable { + final String content; + + GameDialogMarkdownComponent(this.content); +} + +@MappableClass() +final class GameDialogTextFieldComponent extends GameDialogComponent + with GameDialogTextFieldComponentMappable { + final String label; + final String? id; + final String? placeholder; + final bool multiline; + final bool password; + + GameDialogTextFieldComponent( + this.label, { + this.id, + this.placeholder, + this.multiline = false, + this.password = false, + }); + + String get idOrLabel => id ?? label; +} + +@MappableClass() +final class GameDialogCheckboxComponent extends GameDialogComponent + with GameDialogCheckboxComponentMappable { + final String label; + final String? id; + final bool initialValue; + + GameDialogCheckboxComponent(this.label, {this.id, this.initialValue = false}); + + String get idOrLabel => id ?? label; +} + +@MappableClass() +final class GameDialogDropdownComponent extends GameDialogComponent + with GameDialogDropdownComponentMappable { + final String label; + final String? id; + final List options; + final String? initialValue; + + GameDialogDropdownComponent( + this.label, + this.options, { + this.id, + this.initialValue, + }); + + String get idOrLabel => id ?? label; +} + +@MappableClass() +final class GameDialogDropdownOption with GameDialogDropdownOptionMappable { + final String? label; + final String value; + + GameDialogDropdownOption({this.label, required this.value}); + + bool isValid() => (label?.length ?? 0) <= 50 && value.length <= 50; + + String get idOrLabel => label ?? value; +} + +@MappableClass() +final class GameDialogButton with GameDialogButtonMappable { + final String label; + final String? id; + + GameDialogButton(this.label, {this.id}); + + String get idOrLabel => id ?? label; +} + +@MappableClass() +base class GameDialogValue with GameDialogValueMappable { + final String buttonPressed; + final Map values; + + GameDialogValue([this.values = const {}, this.buttonPressed = '']); + + bool hasValue(String key) => values.containsKey(key); + GameDialogComponentValue getValue(String key) => + values[key] ?? GameDialogComponentValue(component: -1); +} + +@MappableClass() +base class GameDialogComponentValue with GameDialogComponentValueMappable { + final int component; + + GameDialogComponentValue({required this.component}); + String getAsString() => ''; + bool getAsBool() => false; + int getAsInt() => 0; +} + +@MappableClass() +final class GameDialogTextFieldValue extends GameDialogComponentValue + with GameDialogTextFieldValueMappable { + final String value; + + GameDialogTextFieldValue({required this.value, required super.component}); + + @override + String getAsString() => value; + @override + bool getAsBool() => value.isNotEmpty; + @override + int getAsInt() => int.tryParse(value) ?? 0; +} + +@MappableClass() +final class GameDialogCheckboxValue extends GameDialogComponentValue + with GameDialogCheckboxValueMappable { + final bool value; + + GameDialogCheckboxValue({required this.value, required super.component}); + + @override + String getAsString() => value.toString(); + @override + bool getAsBool() => value; + @override + int getAsInt() => value ? 1 : 0; +} + +@MappableClass() +final class GameDialogDropdownValue extends GameDialogComponentValue + with GameDialogDropdownValueMappable { + final String value; + + GameDialogDropdownValue({required this.value, required super.component}); + + @override + String getAsString() => value; + @override + bool getAsBool() => value.isNotEmpty; + @override + int getAsInt() => int.tryParse(value) ?? 0; +} diff --git a/api/lib/src/models/dialog.mapper.dart b/api/lib/src/models/dialog.mapper.dart index 3f7ae197..8757a795 100644 --- a/api/lib/src/models/dialog.mapper.dart +++ b/api/lib/src/models/dialog.mapper.dart @@ -1,2084 +1,2084 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'dialog.dart'; - -/// @nodoc -class GameDialogMapper extends ClassMapperBase { - GameDialogMapper._(); - - static GameDialogMapper? _instance; - static GameDialogMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameDialogMapper._()); - GameDialogComponentMapper.ensureInitialized(); - GameDialogButtonMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialog'; - - static String _$id(GameDialog v) => v.id; - static const Field _f$id = Field('id', _$id); - static String _$title(GameDialog v) => v.title; - static const Field _f$title = Field('title', _$title); - static String? _$image(GameDialog v) => v.image; - static const Field _f$image = Field( - 'image', - _$image, - opt: true, - ); - static List _$components(GameDialog v) => v.components; - static const Field> _f$components = - Field('components', _$components, opt: true, def: const []); - static List? _$actions(GameDialog v) => v.actions; - static const Field> _f$actions = Field( - 'actions', - _$actions, - opt: true, - ); - - @override - final MappableFields fields = const { - #id: _f$id, - #title: _f$title, - #image: _f$image, - #components: _f$components, - #actions: _f$actions, - }; - - static GameDialog _instantiate(DecodingData data) { - return GameDialog( - id: data.dec(_f$id), - title: data.dec(_f$title), - image: data.dec(_f$image), - components: data.dec(_f$components), - actions: data.dec(_f$actions), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialog fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialog fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogMappable { - String toJson() { - return GameDialogMapper.ensureInitialized().encodeJson( - this as GameDialog, - ); - } - - Map toMap() { - return GameDialogMapper.ensureInitialized().encodeMap( - this as GameDialog, - ); - } - - GameDialogCopyWith get copyWith => - _GameDialogCopyWithImpl( - this as GameDialog, - $identity, - $identity, - ); - @override - String toString() { - return GameDialogMapper.ensureInitialized().stringifyValue( - this as GameDialog, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogMapper.ensureInitialized().equalsValue( - this as GameDialog, - other, - ); - } - - @override - int get hashCode { - return GameDialogMapper.ensureInitialized().hashValue(this as GameDialog); - } -} - -/// @nodoc -extension GameDialogValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialog, $Out> { - GameDialogCopyWith<$R, GameDialog, $Out> get $asGameDialog => - $base.as((v, t, t2) => _GameDialogCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameDialogCopyWith<$R, $In extends GameDialog, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ListCopyWith< - $R, - GameDialogComponent, - GameDialogComponentCopyWith<$R, GameDialogComponent, GameDialogComponent> - > - get components; - ListCopyWith< - $R, - GameDialogButton, - GameDialogButtonCopyWith<$R, GameDialogButton, GameDialogButton> - >? - get actions; - $R call({ - String? id, - String? title, - String? image, - List? components, - List? actions, - }); - GameDialogCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _GameDialogCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialog, $Out> - implements GameDialogCopyWith<$R, GameDialog, $Out> { - _GameDialogCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogMapper.ensureInitialized(); - @override - ListCopyWith< - $R, - GameDialogComponent, - GameDialogComponentCopyWith<$R, GameDialogComponent, GameDialogComponent> - > - get components => ListCopyWith( - $value.components, - (v, t) => v.copyWith.$chain(t), - (v) => call(components: v), - ); - @override - ListCopyWith< - $R, - GameDialogButton, - GameDialogButtonCopyWith<$R, GameDialogButton, GameDialogButton> - >? - get actions => $value.actions != null - ? ListCopyWith( - $value.actions!, - (v, t) => v.copyWith.$chain(t), - (v) => call(actions: v), - ) - : null; - @override - $R call({ - String? id, - String? title, - Object? image = $none, - List? components, - Object? actions = $none, - }) => $apply( - FieldCopyWithData({ - if (id != null) #id: id, - if (title != null) #title: title, - if (image != $none) #image: image, - if (components != null) #components: components, - if (actions != $none) #actions: actions, - }), - ); - @override - GameDialog $make(CopyWithData data) => GameDialog( - id: data.get(#id, or: $value.id), - title: data.get(#title, or: $value.title), - image: data.get(#image, or: $value.image), - components: data.get(#components, or: $value.components), - actions: data.get(#actions, or: $value.actions), - ); - - @override - GameDialogCopyWith<$R2, GameDialog, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameDialogCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogComponentMapper extends ClassMapperBase { - GameDialogComponentMapper._(); - - static GameDialogComponentMapper? _instance; - static GameDialogComponentMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameDialogComponentMapper._()); - GameDialogMarkdownComponentMapper.ensureInitialized(); - GameDialogTextFieldComponentMapper.ensureInitialized(); - GameDialogCheckboxComponentMapper.ensureInitialized(); - GameDialogDropdownComponentMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogComponent'; - - @override - final MappableFields fields = const {}; - - static GameDialogComponent _instantiate(DecodingData data) { - throw MapperException.missingConstructor('GameDialogComponent'); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogComponent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogComponent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogComponentMappable { - String toJson(); - Map toMap(); - GameDialogComponentCopyWith< - GameDialogComponent, - GameDialogComponent, - GameDialogComponent - > - get copyWith; -} - -/// @nodoc -abstract class GameDialogComponentCopyWith< - $R, - $In extends GameDialogComponent, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - $R call(); - GameDialogComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class GameDialogButtonMapper extends ClassMapperBase { - GameDialogButtonMapper._(); - - static GameDialogButtonMapper? _instance; - static GameDialogButtonMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameDialogButtonMapper._()); - } - return _instance!; - } - - @override - final String id = 'GameDialogButton'; - - static String _$label(GameDialogButton v) => v.label; - static const Field _f$label = Field( - 'label', - _$label, - ); - static String? _$id(GameDialogButton v) => v.id; - static const Field _f$id = Field( - 'id', - _$id, - opt: true, - ); - - @override - final MappableFields fields = const { - #label: _f$label, - #id: _f$id, - }; - - static GameDialogButton _instantiate(DecodingData data) { - return GameDialogButton(data.dec(_f$label), id: data.dec(_f$id)); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogButton fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogButton fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogButtonMappable { - String toJson() { - return GameDialogButtonMapper.ensureInitialized() - .encodeJson(this as GameDialogButton); - } - - Map toMap() { - return GameDialogButtonMapper.ensureInitialized() - .encodeMap(this as GameDialogButton); - } - - GameDialogButtonCopyWith - get copyWith => - _GameDialogButtonCopyWithImpl( - this as GameDialogButton, - $identity, - $identity, - ); - @override - String toString() { - return GameDialogButtonMapper.ensureInitialized().stringifyValue( - this as GameDialogButton, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogButtonMapper.ensureInitialized().equalsValue( - this as GameDialogButton, - other, - ); - } - - @override - int get hashCode { - return GameDialogButtonMapper.ensureInitialized().hashValue( - this as GameDialogButton, - ); - } -} - -/// @nodoc -extension GameDialogButtonValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogButton, $Out> { - GameDialogButtonCopyWith<$R, GameDialogButton, $Out> - get $asGameDialogButton => - $base.as((v, t, t2) => _GameDialogButtonCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameDialogButtonCopyWith<$R, $In extends GameDialogButton, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? label, String? id}); - GameDialogButtonCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogButtonCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogButton, $Out> - implements GameDialogButtonCopyWith<$R, GameDialogButton, $Out> { - _GameDialogButtonCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogButtonMapper.ensureInitialized(); - @override - $R call({String? label, Object? id = $none}) => $apply( - FieldCopyWithData({ - if (label != null) #label: label, - if (id != $none) #id: id, - }), - ); - @override - GameDialogButton $make(CopyWithData data) => GameDialogButton( - data.get(#label, or: $value.label), - id: data.get(#id, or: $value.id), - ); - - @override - GameDialogButtonCopyWith<$R2, GameDialogButton, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameDialogButtonCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogMarkdownComponentMapper - extends ClassMapperBase { - GameDialogMarkdownComponentMapper._(); - - static GameDialogMarkdownComponentMapper? _instance; - static GameDialogMarkdownComponentMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogMarkdownComponentMapper._(), - ); - GameDialogComponentMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogMarkdownComponent'; - - static String _$content(GameDialogMarkdownComponent v) => v.content; - static const Field _f$content = Field( - 'content', - _$content, - ); - - @override - final MappableFields fields = const { - #content: _f$content, - }; - - static GameDialogMarkdownComponent _instantiate(DecodingData data) { - return GameDialogMarkdownComponent(data.dec(_f$content)); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogMarkdownComponent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogMarkdownComponent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogMarkdownComponentMappable { - String toJson() { - return GameDialogMarkdownComponentMapper.ensureInitialized() - .encodeJson( - this as GameDialogMarkdownComponent, - ); - } - - Map toMap() { - return GameDialogMarkdownComponentMapper.ensureInitialized() - .encodeMap( - this as GameDialogMarkdownComponent, - ); - } - - GameDialogMarkdownComponentCopyWith< - GameDialogMarkdownComponent, - GameDialogMarkdownComponent, - GameDialogMarkdownComponent - > - get copyWith => - _GameDialogMarkdownComponentCopyWithImpl< - GameDialogMarkdownComponent, - GameDialogMarkdownComponent - >(this as GameDialogMarkdownComponent, $identity, $identity); - @override - String toString() { - return GameDialogMarkdownComponentMapper.ensureInitialized().stringifyValue( - this as GameDialogMarkdownComponent, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogMarkdownComponentMapper.ensureInitialized().equalsValue( - this as GameDialogMarkdownComponent, - other, - ); - } - - @override - int get hashCode { - return GameDialogMarkdownComponentMapper.ensureInitialized().hashValue( - this as GameDialogMarkdownComponent, - ); - } -} - -/// @nodoc -extension GameDialogMarkdownComponentValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogMarkdownComponent, $Out> { - GameDialogMarkdownComponentCopyWith<$R, GameDialogMarkdownComponent, $Out> - get $asGameDialogMarkdownComponent => $base.as( - (v, t, t2) => _GameDialogMarkdownComponentCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogMarkdownComponentCopyWith< - $R, - $In extends GameDialogMarkdownComponent, - $Out -> - implements GameDialogComponentCopyWith<$R, $In, $Out> { - @override - $R call({String? content}); - GameDialogMarkdownComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogMarkdownComponentCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogMarkdownComponent, $Out> - implements - GameDialogMarkdownComponentCopyWith< - $R, - GameDialogMarkdownComponent, - $Out - > { - _GameDialogMarkdownComponentCopyWithImpl( - super.value, - super.then, - super.then2, - ); - - @override - late final ClassMapperBase $mapper = - GameDialogMarkdownComponentMapper.ensureInitialized(); - @override - $R call({String? content}) => - $apply(FieldCopyWithData({if (content != null) #content: content})); - @override - GameDialogMarkdownComponent $make(CopyWithData data) => - GameDialogMarkdownComponent(data.get(#content, or: $value.content)); - - @override - GameDialogMarkdownComponentCopyWith<$R2, GameDialogMarkdownComponent, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogMarkdownComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogTextFieldComponentMapper - extends ClassMapperBase { - GameDialogTextFieldComponentMapper._(); - - static GameDialogTextFieldComponentMapper? _instance; - static GameDialogTextFieldComponentMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogTextFieldComponentMapper._(), - ); - GameDialogComponentMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogTextFieldComponent'; - - static String _$label(GameDialogTextFieldComponent v) => v.label; - static const Field _f$label = Field( - 'label', - _$label, - ); - static String? _$id(GameDialogTextFieldComponent v) => v.id; - static const Field _f$id = Field( - 'id', - _$id, - opt: true, - ); - static String? _$placeholder(GameDialogTextFieldComponent v) => v.placeholder; - static const Field _f$placeholder = - Field('placeholder', _$placeholder, opt: true); - static bool _$multiline(GameDialogTextFieldComponent v) => v.multiline; - static const Field _f$multiline = Field( - 'multiline', - _$multiline, - opt: true, - def: false, - ); - static bool _$password(GameDialogTextFieldComponent v) => v.password; - static const Field _f$password = Field( - 'password', - _$password, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #label: _f$label, - #id: _f$id, - #placeholder: _f$placeholder, - #multiline: _f$multiline, - #password: _f$password, - }; - - static GameDialogTextFieldComponent _instantiate(DecodingData data) { - return GameDialogTextFieldComponent( - data.dec(_f$label), - id: data.dec(_f$id), - placeholder: data.dec(_f$placeholder), - multiline: data.dec(_f$multiline), - password: data.dec(_f$password), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogTextFieldComponent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogTextFieldComponent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogTextFieldComponentMappable { - String toJson() { - return GameDialogTextFieldComponentMapper.ensureInitialized() - .encodeJson( - this as GameDialogTextFieldComponent, - ); - } - - Map toMap() { - return GameDialogTextFieldComponentMapper.ensureInitialized() - .encodeMap( - this as GameDialogTextFieldComponent, - ); - } - - GameDialogTextFieldComponentCopyWith< - GameDialogTextFieldComponent, - GameDialogTextFieldComponent, - GameDialogTextFieldComponent - > - get copyWith => - _GameDialogTextFieldComponentCopyWithImpl< - GameDialogTextFieldComponent, - GameDialogTextFieldComponent - >(this as GameDialogTextFieldComponent, $identity, $identity); - @override - String toString() { - return GameDialogTextFieldComponentMapper.ensureInitialized() - .stringifyValue(this as GameDialogTextFieldComponent); - } - - @override - bool operator ==(Object other) { - return GameDialogTextFieldComponentMapper.ensureInitialized().equalsValue( - this as GameDialogTextFieldComponent, - other, - ); - } - - @override - int get hashCode { - return GameDialogTextFieldComponentMapper.ensureInitialized().hashValue( - this as GameDialogTextFieldComponent, - ); - } -} - -/// @nodoc -extension GameDialogTextFieldComponentValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogTextFieldComponent, $Out> { - GameDialogTextFieldComponentCopyWith<$R, GameDialogTextFieldComponent, $Out> - get $asGameDialogTextFieldComponent => $base.as( - (v, t, t2) => _GameDialogTextFieldComponentCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogTextFieldComponentCopyWith< - $R, - $In extends GameDialogTextFieldComponent, - $Out -> - implements GameDialogComponentCopyWith<$R, $In, $Out> { - @override - $R call({ - String? label, - String? id, - String? placeholder, - bool? multiline, - bool? password, - }); - GameDialogTextFieldComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogTextFieldComponentCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogTextFieldComponent, $Out> - implements - GameDialogTextFieldComponentCopyWith< - $R, - GameDialogTextFieldComponent, - $Out - > { - _GameDialogTextFieldComponentCopyWithImpl( - super.value, - super.then, - super.then2, - ); - - @override - late final ClassMapperBase $mapper = - GameDialogTextFieldComponentMapper.ensureInitialized(); - @override - $R call({ - String? label, - Object? id = $none, - Object? placeholder = $none, - bool? multiline, - bool? password, - }) => $apply( - FieldCopyWithData({ - if (label != null) #label: label, - if (id != $none) #id: id, - if (placeholder != $none) #placeholder: placeholder, - if (multiline != null) #multiline: multiline, - if (password != null) #password: password, - }), - ); - @override - GameDialogTextFieldComponent $make(CopyWithData data) => - GameDialogTextFieldComponent( - data.get(#label, or: $value.label), - id: data.get(#id, or: $value.id), - placeholder: data.get(#placeholder, or: $value.placeholder), - multiline: data.get(#multiline, or: $value.multiline), - password: data.get(#password, or: $value.password), - ); - - @override - GameDialogTextFieldComponentCopyWith<$R2, GameDialogTextFieldComponent, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogTextFieldComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogCheckboxComponentMapper - extends ClassMapperBase { - GameDialogCheckboxComponentMapper._(); - - static GameDialogCheckboxComponentMapper? _instance; - static GameDialogCheckboxComponentMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogCheckboxComponentMapper._(), - ); - GameDialogComponentMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogCheckboxComponent'; - - static String _$label(GameDialogCheckboxComponent v) => v.label; - static const Field _f$label = Field( - 'label', - _$label, - ); - static String? _$id(GameDialogCheckboxComponent v) => v.id; - static const Field _f$id = Field( - 'id', - _$id, - opt: true, - ); - static bool _$initialValue(GameDialogCheckboxComponent v) => v.initialValue; - static const Field _f$initialValue = Field( - 'initialValue', - _$initialValue, - opt: true, - def: false, - ); - - @override - final MappableFields fields = const { - #label: _f$label, - #id: _f$id, - #initialValue: _f$initialValue, - }; - - static GameDialogCheckboxComponent _instantiate(DecodingData data) { - return GameDialogCheckboxComponent( - data.dec(_f$label), - id: data.dec(_f$id), - initialValue: data.dec(_f$initialValue), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogCheckboxComponent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogCheckboxComponent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogCheckboxComponentMappable { - String toJson() { - return GameDialogCheckboxComponentMapper.ensureInitialized() - .encodeJson( - this as GameDialogCheckboxComponent, - ); - } - - Map toMap() { - return GameDialogCheckboxComponentMapper.ensureInitialized() - .encodeMap( - this as GameDialogCheckboxComponent, - ); - } - - GameDialogCheckboxComponentCopyWith< - GameDialogCheckboxComponent, - GameDialogCheckboxComponent, - GameDialogCheckboxComponent - > - get copyWith => - _GameDialogCheckboxComponentCopyWithImpl< - GameDialogCheckboxComponent, - GameDialogCheckboxComponent - >(this as GameDialogCheckboxComponent, $identity, $identity); - @override - String toString() { - return GameDialogCheckboxComponentMapper.ensureInitialized().stringifyValue( - this as GameDialogCheckboxComponent, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogCheckboxComponentMapper.ensureInitialized().equalsValue( - this as GameDialogCheckboxComponent, - other, - ); - } - - @override - int get hashCode { - return GameDialogCheckboxComponentMapper.ensureInitialized().hashValue( - this as GameDialogCheckboxComponent, - ); - } -} - -/// @nodoc -extension GameDialogCheckboxComponentValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogCheckboxComponent, $Out> { - GameDialogCheckboxComponentCopyWith<$R, GameDialogCheckboxComponent, $Out> - get $asGameDialogCheckboxComponent => $base.as( - (v, t, t2) => _GameDialogCheckboxComponentCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogCheckboxComponentCopyWith< - $R, - $In extends GameDialogCheckboxComponent, - $Out -> - implements GameDialogComponentCopyWith<$R, $In, $Out> { - @override - $R call({String? label, String? id, bool? initialValue}); - GameDialogCheckboxComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogCheckboxComponentCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogCheckboxComponent, $Out> - implements - GameDialogCheckboxComponentCopyWith< - $R, - GameDialogCheckboxComponent, - $Out - > { - _GameDialogCheckboxComponentCopyWithImpl( - super.value, - super.then, - super.then2, - ); - - @override - late final ClassMapperBase $mapper = - GameDialogCheckboxComponentMapper.ensureInitialized(); - @override - $R call({String? label, Object? id = $none, bool? initialValue}) => $apply( - FieldCopyWithData({ - if (label != null) #label: label, - if (id != $none) #id: id, - if (initialValue != null) #initialValue: initialValue, - }), - ); - @override - GameDialogCheckboxComponent $make(CopyWithData data) => - GameDialogCheckboxComponent( - data.get(#label, or: $value.label), - id: data.get(#id, or: $value.id), - initialValue: data.get(#initialValue, or: $value.initialValue), - ); - - @override - GameDialogCheckboxComponentCopyWith<$R2, GameDialogCheckboxComponent, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogCheckboxComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogDropdownComponentMapper - extends ClassMapperBase { - GameDialogDropdownComponentMapper._(); - - static GameDialogDropdownComponentMapper? _instance; - static GameDialogDropdownComponentMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogDropdownComponentMapper._(), - ); - GameDialogComponentMapper.ensureInitialized(); - GameDialogDropdownOptionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogDropdownComponent'; - - static String _$label(GameDialogDropdownComponent v) => v.label; - static const Field _f$label = Field( - 'label', - _$label, - ); - static List _$options( - GameDialogDropdownComponent v, - ) => v.options; - static const Field< - GameDialogDropdownComponent, - List - > - _f$options = Field('options', _$options); - static String? _$id(GameDialogDropdownComponent v) => v.id; - static const Field _f$id = Field( - 'id', - _$id, - opt: true, - ); - static String? _$initialValue(GameDialogDropdownComponent v) => - v.initialValue; - static const Field _f$initialValue = - Field('initialValue', _$initialValue, opt: true); - - @override - final MappableFields fields = const { - #label: _f$label, - #options: _f$options, - #id: _f$id, - #initialValue: _f$initialValue, - }; - - static GameDialogDropdownComponent _instantiate(DecodingData data) { - return GameDialogDropdownComponent( - data.dec(_f$label), - data.dec(_f$options), - id: data.dec(_f$id), - initialValue: data.dec(_f$initialValue), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogDropdownComponent fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogDropdownComponent fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogDropdownComponentMappable { - String toJson() { - return GameDialogDropdownComponentMapper.ensureInitialized() - .encodeJson( - this as GameDialogDropdownComponent, - ); - } - - Map toMap() { - return GameDialogDropdownComponentMapper.ensureInitialized() - .encodeMap( - this as GameDialogDropdownComponent, - ); - } - - GameDialogDropdownComponentCopyWith< - GameDialogDropdownComponent, - GameDialogDropdownComponent, - GameDialogDropdownComponent - > - get copyWith => - _GameDialogDropdownComponentCopyWithImpl< - GameDialogDropdownComponent, - GameDialogDropdownComponent - >(this as GameDialogDropdownComponent, $identity, $identity); - @override - String toString() { - return GameDialogDropdownComponentMapper.ensureInitialized().stringifyValue( - this as GameDialogDropdownComponent, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogDropdownComponentMapper.ensureInitialized().equalsValue( - this as GameDialogDropdownComponent, - other, - ); - } - - @override - int get hashCode { - return GameDialogDropdownComponentMapper.ensureInitialized().hashValue( - this as GameDialogDropdownComponent, - ); - } -} - -/// @nodoc -extension GameDialogDropdownComponentValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogDropdownComponent, $Out> { - GameDialogDropdownComponentCopyWith<$R, GameDialogDropdownComponent, $Out> - get $asGameDialogDropdownComponent => $base.as( - (v, t, t2) => _GameDialogDropdownComponentCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogDropdownComponentCopyWith< - $R, - $In extends GameDialogDropdownComponent, - $Out -> - implements GameDialogComponentCopyWith<$R, $In, $Out> { - ListCopyWith< - $R, - GameDialogDropdownOption, - GameDialogDropdownOptionCopyWith< - $R, - GameDialogDropdownOption, - GameDialogDropdownOption - > - > - get options; - @override - $R call({ - String? label, - List? options, - String? id, - String? initialValue, - }); - GameDialogDropdownComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogDropdownComponentCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogDropdownComponent, $Out> - implements - GameDialogDropdownComponentCopyWith< - $R, - GameDialogDropdownComponent, - $Out - > { - _GameDialogDropdownComponentCopyWithImpl( - super.value, - super.then, - super.then2, - ); - - @override - late final ClassMapperBase $mapper = - GameDialogDropdownComponentMapper.ensureInitialized(); - @override - ListCopyWith< - $R, - GameDialogDropdownOption, - GameDialogDropdownOptionCopyWith< - $R, - GameDialogDropdownOption, - GameDialogDropdownOption - > - > - get options => ListCopyWith( - $value.options, - (v, t) => v.copyWith.$chain(t), - (v) => call(options: v), - ); - @override - $R call({ - String? label, - List? options, - Object? id = $none, - Object? initialValue = $none, - }) => $apply( - FieldCopyWithData({ - if (label != null) #label: label, - if (options != null) #options: options, - if (id != $none) #id: id, - if (initialValue != $none) #initialValue: initialValue, - }), - ); - @override - GameDialogDropdownComponent $make(CopyWithData data) => - GameDialogDropdownComponent( - data.get(#label, or: $value.label), - data.get(#options, or: $value.options), - id: data.get(#id, or: $value.id), - initialValue: data.get(#initialValue, or: $value.initialValue), - ); - - @override - GameDialogDropdownComponentCopyWith<$R2, GameDialogDropdownComponent, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogDropdownComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogDropdownOptionMapper - extends ClassMapperBase { - GameDialogDropdownOptionMapper._(); - - static GameDialogDropdownOptionMapper? _instance; - static GameDialogDropdownOptionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogDropdownOptionMapper._(), - ); - } - return _instance!; - } - - @override - final String id = 'GameDialogDropdownOption'; - - static String? _$label(GameDialogDropdownOption v) => v.label; - static const Field _f$label = Field( - 'label', - _$label, - opt: true, - ); - static String _$value(GameDialogDropdownOption v) => v.value; - static const Field _f$value = Field( - 'value', - _$value, - ); - - @override - final MappableFields fields = const { - #label: _f$label, - #value: _f$value, - }; - - static GameDialogDropdownOption _instantiate(DecodingData data) { - return GameDialogDropdownOption( - label: data.dec(_f$label), - value: data.dec(_f$value), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogDropdownOption fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogDropdownOption fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogDropdownOptionMappable { - String toJson() { - return GameDialogDropdownOptionMapper.ensureInitialized() - .encodeJson(this as GameDialogDropdownOption); - } - - Map toMap() { - return GameDialogDropdownOptionMapper.ensureInitialized() - .encodeMap(this as GameDialogDropdownOption); - } - - GameDialogDropdownOptionCopyWith< - GameDialogDropdownOption, - GameDialogDropdownOption, - GameDialogDropdownOption - > - get copyWith => - _GameDialogDropdownOptionCopyWithImpl< - GameDialogDropdownOption, - GameDialogDropdownOption - >(this as GameDialogDropdownOption, $identity, $identity); - @override - String toString() { - return GameDialogDropdownOptionMapper.ensureInitialized().stringifyValue( - this as GameDialogDropdownOption, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogDropdownOptionMapper.ensureInitialized().equalsValue( - this as GameDialogDropdownOption, - other, - ); - } - - @override - int get hashCode { - return GameDialogDropdownOptionMapper.ensureInitialized().hashValue( - this as GameDialogDropdownOption, - ); - } -} - -/// @nodoc -extension GameDialogDropdownOptionValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogDropdownOption, $Out> { - GameDialogDropdownOptionCopyWith<$R, GameDialogDropdownOption, $Out> - get $asGameDialogDropdownOption => $base.as( - (v, t, t2) => _GameDialogDropdownOptionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogDropdownOptionCopyWith< - $R, - $In extends GameDialogDropdownOption, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? label, String? value}); - GameDialogDropdownOptionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogDropdownOptionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogDropdownOption, $Out> - implements - GameDialogDropdownOptionCopyWith<$R, GameDialogDropdownOption, $Out> { - _GameDialogDropdownOptionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogDropdownOptionMapper.ensureInitialized(); - @override - $R call({Object? label = $none, String? value}) => $apply( - FieldCopyWithData({ - if (label != $none) #label: label, - if (value != null) #value: value, - }), - ); - @override - GameDialogDropdownOption $make(CopyWithData data) => GameDialogDropdownOption( - label: data.get(#label, or: $value.label), - value: data.get(#value, or: $value.value), - ); - - @override - GameDialogDropdownOptionCopyWith<$R2, GameDialogDropdownOption, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogDropdownOptionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogValueMapper extends ClassMapperBase { - GameDialogValueMapper._(); - - static GameDialogValueMapper? _instance; - static GameDialogValueMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameDialogValueMapper._()); - GameDialogComponentValueMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogValue'; - - static Map _$values(GameDialogValue v) => - v.values; - static const Field> - _f$values = Field('values', _$values, opt: true, def: const {}); - static String _$buttonPressed(GameDialogValue v) => v.buttonPressed; - static const Field _f$buttonPressed = Field( - 'buttonPressed', - _$buttonPressed, - opt: true, - def: '', - ); - - @override - final MappableFields fields = const { - #values: _f$values, - #buttonPressed: _f$buttonPressed, - }; - - static GameDialogValue _instantiate(DecodingData data) { - return GameDialogValue(data.dec(_f$values), data.dec(_f$buttonPressed)); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogValue fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogValue fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogValueMappable { - String toJson() { - return GameDialogValueMapper.ensureInitialized() - .encodeJson(this as GameDialogValue); - } - - Map toMap() { - return GameDialogValueMapper.ensureInitialized().encodeMap( - this as GameDialogValue, - ); - } - - GameDialogValueCopyWith - get copyWith => - _GameDialogValueCopyWithImpl( - this as GameDialogValue, - $identity, - $identity, - ); - @override - String toString() { - return GameDialogValueMapper.ensureInitialized().stringifyValue( - this as GameDialogValue, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogValueMapper.ensureInitialized().equalsValue( - this as GameDialogValue, - other, - ); - } - - @override - int get hashCode { - return GameDialogValueMapper.ensureInitialized().hashValue( - this as GameDialogValue, - ); - } -} - -/// @nodoc -extension GameDialogValueValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogValue, $Out> { - GameDialogValueCopyWith<$R, GameDialogValue, $Out> get $asGameDialogValue => - $base.as((v, t, t2) => _GameDialogValueCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameDialogValueCopyWith<$R, $In extends GameDialogValue, $Out> - implements ClassCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - String, - GameDialogComponentValue, - GameDialogComponentValueCopyWith< - $R, - GameDialogComponentValue, - GameDialogComponentValue - > - > - get values; - $R call({ - Map? values, - String? buttonPressed, - }); - GameDialogValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogValueCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogValue, $Out> - implements GameDialogValueCopyWith<$R, GameDialogValue, $Out> { - _GameDialogValueCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogValueMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - String, - GameDialogComponentValue, - GameDialogComponentValueCopyWith< - $R, - GameDialogComponentValue, - GameDialogComponentValue - > - > - get values => MapCopyWith( - $value.values, - (v, t) => v.copyWith.$chain(t), - (v) => call(values: v), - ); - @override - $R call({ - Map? values, - String? buttonPressed, - }) => $apply( - FieldCopyWithData({ - if (values != null) #values: values, - if (buttonPressed != null) #buttonPressed: buttonPressed, - }), - ); - @override - GameDialogValue $make(CopyWithData data) => GameDialogValue( - data.get(#values, or: $value.values), - data.get(#buttonPressed, or: $value.buttonPressed), - ); - - @override - GameDialogValueCopyWith<$R2, GameDialogValue, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameDialogValueCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogComponentValueMapper - extends ClassMapperBase { - GameDialogComponentValueMapper._(); - - static GameDialogComponentValueMapper? _instance; - static GameDialogComponentValueMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogComponentValueMapper._(), - ); - GameDialogTextFieldValueMapper.ensureInitialized(); - GameDialogCheckboxValueMapper.ensureInitialized(); - GameDialogDropdownValueMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogComponentValue'; - - static int _$component(GameDialogComponentValue v) => v.component; - static const Field _f$component = Field( - 'component', - _$component, - ); - - @override - final MappableFields fields = const { - #component: _f$component, - }; - - static GameDialogComponentValue _instantiate(DecodingData data) { - return GameDialogComponentValue(component: data.dec(_f$component)); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogComponentValue fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogComponentValue fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogComponentValueMappable { - String toJson() { - return GameDialogComponentValueMapper.ensureInitialized() - .encodeJson(this as GameDialogComponentValue); - } - - Map toMap() { - return GameDialogComponentValueMapper.ensureInitialized() - .encodeMap(this as GameDialogComponentValue); - } - - GameDialogComponentValueCopyWith< - GameDialogComponentValue, - GameDialogComponentValue, - GameDialogComponentValue - > - get copyWith => - _GameDialogComponentValueCopyWithImpl< - GameDialogComponentValue, - GameDialogComponentValue - >(this as GameDialogComponentValue, $identity, $identity); - @override - String toString() { - return GameDialogComponentValueMapper.ensureInitialized().stringifyValue( - this as GameDialogComponentValue, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogComponentValueMapper.ensureInitialized().equalsValue( - this as GameDialogComponentValue, - other, - ); - } - - @override - int get hashCode { - return GameDialogComponentValueMapper.ensureInitialized().hashValue( - this as GameDialogComponentValue, - ); - } -} - -/// @nodoc -extension GameDialogComponentValueValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogComponentValue, $Out> { - GameDialogComponentValueCopyWith<$R, GameDialogComponentValue, $Out> - get $asGameDialogComponentValue => $base.as( - (v, t, t2) => _GameDialogComponentValueCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogComponentValueCopyWith< - $R, - $In extends GameDialogComponentValue, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - $R call({int? component}); - GameDialogComponentValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogComponentValueCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogComponentValue, $Out> - implements - GameDialogComponentValueCopyWith<$R, GameDialogComponentValue, $Out> { - _GameDialogComponentValueCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogComponentValueMapper.ensureInitialized(); - @override - $R call({int? component}) => - $apply(FieldCopyWithData({if (component != null) #component: component})); - @override - GameDialogComponentValue $make(CopyWithData data) => GameDialogComponentValue( - component: data.get(#component, or: $value.component), - ); - - @override - GameDialogComponentValueCopyWith<$R2, GameDialogComponentValue, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogComponentValueCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogTextFieldValueMapper - extends ClassMapperBase { - GameDialogTextFieldValueMapper._(); - - static GameDialogTextFieldValueMapper? _instance; - static GameDialogTextFieldValueMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogTextFieldValueMapper._(), - ); - GameDialogComponentValueMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogTextFieldValue'; - - static String _$value(GameDialogTextFieldValue v) => v.value; - static const Field _f$value = Field( - 'value', - _$value, - ); - static int _$component(GameDialogTextFieldValue v) => v.component; - static const Field _f$component = Field( - 'component', - _$component, - ); - - @override - final MappableFields fields = const { - #value: _f$value, - #component: _f$component, - }; - - static GameDialogTextFieldValue _instantiate(DecodingData data) { - return GameDialogTextFieldValue( - value: data.dec(_f$value), - component: data.dec(_f$component), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogTextFieldValue fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogTextFieldValue fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogTextFieldValueMappable { - String toJson() { - return GameDialogTextFieldValueMapper.ensureInitialized() - .encodeJson(this as GameDialogTextFieldValue); - } - - Map toMap() { - return GameDialogTextFieldValueMapper.ensureInitialized() - .encodeMap(this as GameDialogTextFieldValue); - } - - GameDialogTextFieldValueCopyWith< - GameDialogTextFieldValue, - GameDialogTextFieldValue, - GameDialogTextFieldValue - > - get copyWith => - _GameDialogTextFieldValueCopyWithImpl< - GameDialogTextFieldValue, - GameDialogTextFieldValue - >(this as GameDialogTextFieldValue, $identity, $identity); - @override - String toString() { - return GameDialogTextFieldValueMapper.ensureInitialized().stringifyValue( - this as GameDialogTextFieldValue, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogTextFieldValueMapper.ensureInitialized().equalsValue( - this as GameDialogTextFieldValue, - other, - ); - } - - @override - int get hashCode { - return GameDialogTextFieldValueMapper.ensureInitialized().hashValue( - this as GameDialogTextFieldValue, - ); - } -} - -/// @nodoc -extension GameDialogTextFieldValueValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogTextFieldValue, $Out> { - GameDialogTextFieldValueCopyWith<$R, GameDialogTextFieldValue, $Out> - get $asGameDialogTextFieldValue => $base.as( - (v, t, t2) => _GameDialogTextFieldValueCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogTextFieldValueCopyWith< - $R, - $In extends GameDialogTextFieldValue, - $Out -> - implements GameDialogComponentValueCopyWith<$R, $In, $Out> { - @override - $R call({String? value, int? component}); - GameDialogTextFieldValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogTextFieldValueCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogTextFieldValue, $Out> - implements - GameDialogTextFieldValueCopyWith<$R, GameDialogTextFieldValue, $Out> { - _GameDialogTextFieldValueCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogTextFieldValueMapper.ensureInitialized(); - @override - $R call({String? value, int? component}) => $apply( - FieldCopyWithData({ - if (value != null) #value: value, - if (component != null) #component: component, - }), - ); - @override - GameDialogTextFieldValue $make(CopyWithData data) => GameDialogTextFieldValue( - value: data.get(#value, or: $value.value), - component: data.get(#component, or: $value.component), - ); - - @override - GameDialogTextFieldValueCopyWith<$R2, GameDialogTextFieldValue, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogTextFieldValueCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogCheckboxValueMapper - extends ClassMapperBase { - GameDialogCheckboxValueMapper._(); - - static GameDialogCheckboxValueMapper? _instance; - static GameDialogCheckboxValueMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogCheckboxValueMapper._(), - ); - GameDialogComponentValueMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogCheckboxValue'; - - static bool _$value(GameDialogCheckboxValue v) => v.value; - static const Field _f$value = Field( - 'value', - _$value, - ); - static int _$component(GameDialogCheckboxValue v) => v.component; - static const Field _f$component = Field( - 'component', - _$component, - ); - - @override - final MappableFields fields = const { - #value: _f$value, - #component: _f$component, - }; - - static GameDialogCheckboxValue _instantiate(DecodingData data) { - return GameDialogCheckboxValue( - value: data.dec(_f$value), - component: data.dec(_f$component), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogCheckboxValue fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogCheckboxValue fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogCheckboxValueMappable { - String toJson() { - return GameDialogCheckboxValueMapper.ensureInitialized() - .encodeJson(this as GameDialogCheckboxValue); - } - - Map toMap() { - return GameDialogCheckboxValueMapper.ensureInitialized() - .encodeMap(this as GameDialogCheckboxValue); - } - - GameDialogCheckboxValueCopyWith< - GameDialogCheckboxValue, - GameDialogCheckboxValue, - GameDialogCheckboxValue - > - get copyWith => - _GameDialogCheckboxValueCopyWithImpl< - GameDialogCheckboxValue, - GameDialogCheckboxValue - >(this as GameDialogCheckboxValue, $identity, $identity); - @override - String toString() { - return GameDialogCheckboxValueMapper.ensureInitialized().stringifyValue( - this as GameDialogCheckboxValue, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogCheckboxValueMapper.ensureInitialized().equalsValue( - this as GameDialogCheckboxValue, - other, - ); - } - - @override - int get hashCode { - return GameDialogCheckboxValueMapper.ensureInitialized().hashValue( - this as GameDialogCheckboxValue, - ); - } -} - -/// @nodoc -extension GameDialogCheckboxValueValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogCheckboxValue, $Out> { - GameDialogCheckboxValueCopyWith<$R, GameDialogCheckboxValue, $Out> - get $asGameDialogCheckboxValue => $base.as( - (v, t, t2) => _GameDialogCheckboxValueCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogCheckboxValueCopyWith< - $R, - $In extends GameDialogCheckboxValue, - $Out -> - implements GameDialogComponentValueCopyWith<$R, $In, $Out> { - @override - $R call({bool? value, int? component}); - GameDialogCheckboxValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogCheckboxValueCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogCheckboxValue, $Out> - implements - GameDialogCheckboxValueCopyWith<$R, GameDialogCheckboxValue, $Out> { - _GameDialogCheckboxValueCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogCheckboxValueMapper.ensureInitialized(); - @override - $R call({bool? value, int? component}) => $apply( - FieldCopyWithData({ - if (value != null) #value: value, - if (component != null) #component: component, - }), - ); - @override - GameDialogCheckboxValue $make(CopyWithData data) => GameDialogCheckboxValue( - value: data.get(#value, or: $value.value), - component: data.get(#component, or: $value.component), - ); - - @override - GameDialogCheckboxValueCopyWith<$R2, GameDialogCheckboxValue, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogCheckboxValueCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameDialogDropdownValueMapper - extends ClassMapperBase { - GameDialogDropdownValueMapper._(); - - static GameDialogDropdownValueMapper? _instance; - static GameDialogDropdownValueMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = GameDialogDropdownValueMapper._(), - ); - GameDialogComponentValueMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameDialogDropdownValue'; - - static String _$value(GameDialogDropdownValue v) => v.value; - static const Field _f$value = Field( - 'value', - _$value, - ); - static int _$component(GameDialogDropdownValue v) => v.component; - static const Field _f$component = Field( - 'component', - _$component, - ); - - @override - final MappableFields fields = const { - #value: _f$value, - #component: _f$component, - }; - - static GameDialogDropdownValue _instantiate(DecodingData data) { - return GameDialogDropdownValue( - value: data.dec(_f$value), - component: data.dec(_f$component), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameDialogDropdownValue fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameDialogDropdownValue fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameDialogDropdownValueMappable { - String toJson() { - return GameDialogDropdownValueMapper.ensureInitialized() - .encodeJson(this as GameDialogDropdownValue); - } - - Map toMap() { - return GameDialogDropdownValueMapper.ensureInitialized() - .encodeMap(this as GameDialogDropdownValue); - } - - GameDialogDropdownValueCopyWith< - GameDialogDropdownValue, - GameDialogDropdownValue, - GameDialogDropdownValue - > - get copyWith => - _GameDialogDropdownValueCopyWithImpl< - GameDialogDropdownValue, - GameDialogDropdownValue - >(this as GameDialogDropdownValue, $identity, $identity); - @override - String toString() { - return GameDialogDropdownValueMapper.ensureInitialized().stringifyValue( - this as GameDialogDropdownValue, - ); - } - - @override - bool operator ==(Object other) { - return GameDialogDropdownValueMapper.ensureInitialized().equalsValue( - this as GameDialogDropdownValue, - other, - ); - } - - @override - int get hashCode { - return GameDialogDropdownValueMapper.ensureInitialized().hashValue( - this as GameDialogDropdownValue, - ); - } -} - -/// @nodoc -extension GameDialogDropdownValueValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameDialogDropdownValue, $Out> { - GameDialogDropdownValueCopyWith<$R, GameDialogDropdownValue, $Out> - get $asGameDialogDropdownValue => $base.as( - (v, t, t2) => _GameDialogDropdownValueCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GameDialogDropdownValueCopyWith< - $R, - $In extends GameDialogDropdownValue, - $Out -> - implements GameDialogComponentValueCopyWith<$R, $In, $Out> { - @override - $R call({String? value, int? component}); - GameDialogDropdownValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GameDialogDropdownValueCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameDialogDropdownValue, $Out> - implements - GameDialogDropdownValueCopyWith<$R, GameDialogDropdownValue, $Out> { - _GameDialogDropdownValueCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameDialogDropdownValueMapper.ensureInitialized(); - @override - $R call({String? value, int? component}) => $apply( - FieldCopyWithData({ - if (value != null) #value: value, - if (component != null) #component: component, - }), - ); - @override - GameDialogDropdownValue $make(CopyWithData data) => GameDialogDropdownValue( - value: data.get(#value, or: $value.value), - component: data.get(#component, or: $value.component), - ); - - @override - GameDialogDropdownValueCopyWith<$R2, GameDialogDropdownValue, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GameDialogDropdownValueCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'dialog.dart'; + +/// @nodoc +class GameDialogMapper extends ClassMapperBase { + GameDialogMapper._(); + + static GameDialogMapper? _instance; + static GameDialogMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameDialogMapper._()); + GameDialogComponentMapper.ensureInitialized(); + GameDialogButtonMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialog'; + + static String _$id(GameDialog v) => v.id; + static const Field _f$id = Field('id', _$id); + static String _$title(GameDialog v) => v.title; + static const Field _f$title = Field('title', _$title); + static String? _$image(GameDialog v) => v.image; + static const Field _f$image = Field( + 'image', + _$image, + opt: true, + ); + static List _$components(GameDialog v) => v.components; + static const Field> _f$components = + Field('components', _$components, opt: true, def: const []); + static List? _$actions(GameDialog v) => v.actions; + static const Field> _f$actions = Field( + 'actions', + _$actions, + opt: true, + ); + + @override + final MappableFields fields = const { + #id: _f$id, + #title: _f$title, + #image: _f$image, + #components: _f$components, + #actions: _f$actions, + }; + + static GameDialog _instantiate(DecodingData data) { + return GameDialog( + id: data.dec(_f$id), + title: data.dec(_f$title), + image: data.dec(_f$image), + components: data.dec(_f$components), + actions: data.dec(_f$actions), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialog fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialog fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogMappable { + String toJson() { + return GameDialogMapper.ensureInitialized().encodeJson( + this as GameDialog, + ); + } + + Map toMap() { + return GameDialogMapper.ensureInitialized().encodeMap( + this as GameDialog, + ); + } + + GameDialogCopyWith get copyWith => + _GameDialogCopyWithImpl( + this as GameDialog, + $identity, + $identity, + ); + @override + String toString() { + return GameDialogMapper.ensureInitialized().stringifyValue( + this as GameDialog, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogMapper.ensureInitialized().equalsValue( + this as GameDialog, + other, + ); + } + + @override + int get hashCode { + return GameDialogMapper.ensureInitialized().hashValue(this as GameDialog); + } +} + +/// @nodoc +extension GameDialogValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialog, $Out> { + GameDialogCopyWith<$R, GameDialog, $Out> get $asGameDialog => + $base.as((v, t, t2) => _GameDialogCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameDialogCopyWith<$R, $In extends GameDialog, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ListCopyWith< + $R, + GameDialogComponent, + GameDialogComponentCopyWith<$R, GameDialogComponent, GameDialogComponent> + > + get components; + ListCopyWith< + $R, + GameDialogButton, + GameDialogButtonCopyWith<$R, GameDialogButton, GameDialogButton> + >? + get actions; + $R call({ + String? id, + String? title, + String? image, + List? components, + List? actions, + }); + GameDialogCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _GameDialogCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialog, $Out> + implements GameDialogCopyWith<$R, GameDialog, $Out> { + _GameDialogCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogMapper.ensureInitialized(); + @override + ListCopyWith< + $R, + GameDialogComponent, + GameDialogComponentCopyWith<$R, GameDialogComponent, GameDialogComponent> + > + get components => ListCopyWith( + $value.components, + (v, t) => v.copyWith.$chain(t), + (v) => call(components: v), + ); + @override + ListCopyWith< + $R, + GameDialogButton, + GameDialogButtonCopyWith<$R, GameDialogButton, GameDialogButton> + >? + get actions => $value.actions != null + ? ListCopyWith( + $value.actions!, + (v, t) => v.copyWith.$chain(t), + (v) => call(actions: v), + ) + : null; + @override + $R call({ + String? id, + String? title, + Object? image = $none, + List? components, + Object? actions = $none, + }) => $apply( + FieldCopyWithData({ + if (id != null) #id: id, + if (title != null) #title: title, + if (image != $none) #image: image, + if (components != null) #components: components, + if (actions != $none) #actions: actions, + }), + ); + @override + GameDialog $make(CopyWithData data) => GameDialog( + id: data.get(#id, or: $value.id), + title: data.get(#title, or: $value.title), + image: data.get(#image, or: $value.image), + components: data.get(#components, or: $value.components), + actions: data.get(#actions, or: $value.actions), + ); + + @override + GameDialogCopyWith<$R2, GameDialog, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameDialogCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogComponentMapper extends ClassMapperBase { + GameDialogComponentMapper._(); + + static GameDialogComponentMapper? _instance; + static GameDialogComponentMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameDialogComponentMapper._()); + GameDialogMarkdownComponentMapper.ensureInitialized(); + GameDialogTextFieldComponentMapper.ensureInitialized(); + GameDialogCheckboxComponentMapper.ensureInitialized(); + GameDialogDropdownComponentMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogComponent'; + + @override + final MappableFields fields = const {}; + + static GameDialogComponent _instantiate(DecodingData data) { + throw MapperException.missingConstructor('GameDialogComponent'); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogComponent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogComponent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogComponentMappable { + String toJson(); + Map toMap(); + GameDialogComponentCopyWith< + GameDialogComponent, + GameDialogComponent, + GameDialogComponent + > + get copyWith; +} + +/// @nodoc +abstract class GameDialogComponentCopyWith< + $R, + $In extends GameDialogComponent, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + $R call(); + GameDialogComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class GameDialogButtonMapper extends ClassMapperBase { + GameDialogButtonMapper._(); + + static GameDialogButtonMapper? _instance; + static GameDialogButtonMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameDialogButtonMapper._()); + } + return _instance!; + } + + @override + final String id = 'GameDialogButton'; + + static String _$label(GameDialogButton v) => v.label; + static const Field _f$label = Field( + 'label', + _$label, + ); + static String? _$id(GameDialogButton v) => v.id; + static const Field _f$id = Field( + 'id', + _$id, + opt: true, + ); + + @override + final MappableFields fields = const { + #label: _f$label, + #id: _f$id, + }; + + static GameDialogButton _instantiate(DecodingData data) { + return GameDialogButton(data.dec(_f$label), id: data.dec(_f$id)); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogButton fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogButton fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogButtonMappable { + String toJson() { + return GameDialogButtonMapper.ensureInitialized() + .encodeJson(this as GameDialogButton); + } + + Map toMap() { + return GameDialogButtonMapper.ensureInitialized() + .encodeMap(this as GameDialogButton); + } + + GameDialogButtonCopyWith + get copyWith => + _GameDialogButtonCopyWithImpl( + this as GameDialogButton, + $identity, + $identity, + ); + @override + String toString() { + return GameDialogButtonMapper.ensureInitialized().stringifyValue( + this as GameDialogButton, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogButtonMapper.ensureInitialized().equalsValue( + this as GameDialogButton, + other, + ); + } + + @override + int get hashCode { + return GameDialogButtonMapper.ensureInitialized().hashValue( + this as GameDialogButton, + ); + } +} + +/// @nodoc +extension GameDialogButtonValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogButton, $Out> { + GameDialogButtonCopyWith<$R, GameDialogButton, $Out> + get $asGameDialogButton => + $base.as((v, t, t2) => _GameDialogButtonCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameDialogButtonCopyWith<$R, $In extends GameDialogButton, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? label, String? id}); + GameDialogButtonCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogButtonCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogButton, $Out> + implements GameDialogButtonCopyWith<$R, GameDialogButton, $Out> { + _GameDialogButtonCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogButtonMapper.ensureInitialized(); + @override + $R call({String? label, Object? id = $none}) => $apply( + FieldCopyWithData({ + if (label != null) #label: label, + if (id != $none) #id: id, + }), + ); + @override + GameDialogButton $make(CopyWithData data) => GameDialogButton( + data.get(#label, or: $value.label), + id: data.get(#id, or: $value.id), + ); + + @override + GameDialogButtonCopyWith<$R2, GameDialogButton, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameDialogButtonCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogMarkdownComponentMapper + extends ClassMapperBase { + GameDialogMarkdownComponentMapper._(); + + static GameDialogMarkdownComponentMapper? _instance; + static GameDialogMarkdownComponentMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogMarkdownComponentMapper._(), + ); + GameDialogComponentMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogMarkdownComponent'; + + static String _$content(GameDialogMarkdownComponent v) => v.content; + static const Field _f$content = Field( + 'content', + _$content, + ); + + @override + final MappableFields fields = const { + #content: _f$content, + }; + + static GameDialogMarkdownComponent _instantiate(DecodingData data) { + return GameDialogMarkdownComponent(data.dec(_f$content)); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogMarkdownComponent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogMarkdownComponent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogMarkdownComponentMappable { + String toJson() { + return GameDialogMarkdownComponentMapper.ensureInitialized() + .encodeJson( + this as GameDialogMarkdownComponent, + ); + } + + Map toMap() { + return GameDialogMarkdownComponentMapper.ensureInitialized() + .encodeMap( + this as GameDialogMarkdownComponent, + ); + } + + GameDialogMarkdownComponentCopyWith< + GameDialogMarkdownComponent, + GameDialogMarkdownComponent, + GameDialogMarkdownComponent + > + get copyWith => + _GameDialogMarkdownComponentCopyWithImpl< + GameDialogMarkdownComponent, + GameDialogMarkdownComponent + >(this as GameDialogMarkdownComponent, $identity, $identity); + @override + String toString() { + return GameDialogMarkdownComponentMapper.ensureInitialized().stringifyValue( + this as GameDialogMarkdownComponent, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogMarkdownComponentMapper.ensureInitialized().equalsValue( + this as GameDialogMarkdownComponent, + other, + ); + } + + @override + int get hashCode { + return GameDialogMarkdownComponentMapper.ensureInitialized().hashValue( + this as GameDialogMarkdownComponent, + ); + } +} + +/// @nodoc +extension GameDialogMarkdownComponentValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogMarkdownComponent, $Out> { + GameDialogMarkdownComponentCopyWith<$R, GameDialogMarkdownComponent, $Out> + get $asGameDialogMarkdownComponent => $base.as( + (v, t, t2) => _GameDialogMarkdownComponentCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogMarkdownComponentCopyWith< + $R, + $In extends GameDialogMarkdownComponent, + $Out +> + implements GameDialogComponentCopyWith<$R, $In, $Out> { + @override + $R call({String? content}); + GameDialogMarkdownComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogMarkdownComponentCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogMarkdownComponent, $Out> + implements + GameDialogMarkdownComponentCopyWith< + $R, + GameDialogMarkdownComponent, + $Out + > { + _GameDialogMarkdownComponentCopyWithImpl( + super.value, + super.then, + super.then2, + ); + + @override + late final ClassMapperBase $mapper = + GameDialogMarkdownComponentMapper.ensureInitialized(); + @override + $R call({String? content}) => + $apply(FieldCopyWithData({if (content != null) #content: content})); + @override + GameDialogMarkdownComponent $make(CopyWithData data) => + GameDialogMarkdownComponent(data.get(#content, or: $value.content)); + + @override + GameDialogMarkdownComponentCopyWith<$R2, GameDialogMarkdownComponent, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogMarkdownComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogTextFieldComponentMapper + extends ClassMapperBase { + GameDialogTextFieldComponentMapper._(); + + static GameDialogTextFieldComponentMapper? _instance; + static GameDialogTextFieldComponentMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogTextFieldComponentMapper._(), + ); + GameDialogComponentMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogTextFieldComponent'; + + static String _$label(GameDialogTextFieldComponent v) => v.label; + static const Field _f$label = Field( + 'label', + _$label, + ); + static String? _$id(GameDialogTextFieldComponent v) => v.id; + static const Field _f$id = Field( + 'id', + _$id, + opt: true, + ); + static String? _$placeholder(GameDialogTextFieldComponent v) => v.placeholder; + static const Field _f$placeholder = + Field('placeholder', _$placeholder, opt: true); + static bool _$multiline(GameDialogTextFieldComponent v) => v.multiline; + static const Field _f$multiline = Field( + 'multiline', + _$multiline, + opt: true, + def: false, + ); + static bool _$password(GameDialogTextFieldComponent v) => v.password; + static const Field _f$password = Field( + 'password', + _$password, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #label: _f$label, + #id: _f$id, + #placeholder: _f$placeholder, + #multiline: _f$multiline, + #password: _f$password, + }; + + static GameDialogTextFieldComponent _instantiate(DecodingData data) { + return GameDialogTextFieldComponent( + data.dec(_f$label), + id: data.dec(_f$id), + placeholder: data.dec(_f$placeholder), + multiline: data.dec(_f$multiline), + password: data.dec(_f$password), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogTextFieldComponent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogTextFieldComponent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogTextFieldComponentMappable { + String toJson() { + return GameDialogTextFieldComponentMapper.ensureInitialized() + .encodeJson( + this as GameDialogTextFieldComponent, + ); + } + + Map toMap() { + return GameDialogTextFieldComponentMapper.ensureInitialized() + .encodeMap( + this as GameDialogTextFieldComponent, + ); + } + + GameDialogTextFieldComponentCopyWith< + GameDialogTextFieldComponent, + GameDialogTextFieldComponent, + GameDialogTextFieldComponent + > + get copyWith => + _GameDialogTextFieldComponentCopyWithImpl< + GameDialogTextFieldComponent, + GameDialogTextFieldComponent + >(this as GameDialogTextFieldComponent, $identity, $identity); + @override + String toString() { + return GameDialogTextFieldComponentMapper.ensureInitialized() + .stringifyValue(this as GameDialogTextFieldComponent); + } + + @override + bool operator ==(Object other) { + return GameDialogTextFieldComponentMapper.ensureInitialized().equalsValue( + this as GameDialogTextFieldComponent, + other, + ); + } + + @override + int get hashCode { + return GameDialogTextFieldComponentMapper.ensureInitialized().hashValue( + this as GameDialogTextFieldComponent, + ); + } +} + +/// @nodoc +extension GameDialogTextFieldComponentValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogTextFieldComponent, $Out> { + GameDialogTextFieldComponentCopyWith<$R, GameDialogTextFieldComponent, $Out> + get $asGameDialogTextFieldComponent => $base.as( + (v, t, t2) => _GameDialogTextFieldComponentCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogTextFieldComponentCopyWith< + $R, + $In extends GameDialogTextFieldComponent, + $Out +> + implements GameDialogComponentCopyWith<$R, $In, $Out> { + @override + $R call({ + String? label, + String? id, + String? placeholder, + bool? multiline, + bool? password, + }); + GameDialogTextFieldComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogTextFieldComponentCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogTextFieldComponent, $Out> + implements + GameDialogTextFieldComponentCopyWith< + $R, + GameDialogTextFieldComponent, + $Out + > { + _GameDialogTextFieldComponentCopyWithImpl( + super.value, + super.then, + super.then2, + ); + + @override + late final ClassMapperBase $mapper = + GameDialogTextFieldComponentMapper.ensureInitialized(); + @override + $R call({ + String? label, + Object? id = $none, + Object? placeholder = $none, + bool? multiline, + bool? password, + }) => $apply( + FieldCopyWithData({ + if (label != null) #label: label, + if (id != $none) #id: id, + if (placeholder != $none) #placeholder: placeholder, + if (multiline != null) #multiline: multiline, + if (password != null) #password: password, + }), + ); + @override + GameDialogTextFieldComponent $make(CopyWithData data) => + GameDialogTextFieldComponent( + data.get(#label, or: $value.label), + id: data.get(#id, or: $value.id), + placeholder: data.get(#placeholder, or: $value.placeholder), + multiline: data.get(#multiline, or: $value.multiline), + password: data.get(#password, or: $value.password), + ); + + @override + GameDialogTextFieldComponentCopyWith<$R2, GameDialogTextFieldComponent, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogTextFieldComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogCheckboxComponentMapper + extends ClassMapperBase { + GameDialogCheckboxComponentMapper._(); + + static GameDialogCheckboxComponentMapper? _instance; + static GameDialogCheckboxComponentMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogCheckboxComponentMapper._(), + ); + GameDialogComponentMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogCheckboxComponent'; + + static String _$label(GameDialogCheckboxComponent v) => v.label; + static const Field _f$label = Field( + 'label', + _$label, + ); + static String? _$id(GameDialogCheckboxComponent v) => v.id; + static const Field _f$id = Field( + 'id', + _$id, + opt: true, + ); + static bool _$initialValue(GameDialogCheckboxComponent v) => v.initialValue; + static const Field _f$initialValue = Field( + 'initialValue', + _$initialValue, + opt: true, + def: false, + ); + + @override + final MappableFields fields = const { + #label: _f$label, + #id: _f$id, + #initialValue: _f$initialValue, + }; + + static GameDialogCheckboxComponent _instantiate(DecodingData data) { + return GameDialogCheckboxComponent( + data.dec(_f$label), + id: data.dec(_f$id), + initialValue: data.dec(_f$initialValue), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogCheckboxComponent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogCheckboxComponent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogCheckboxComponentMappable { + String toJson() { + return GameDialogCheckboxComponentMapper.ensureInitialized() + .encodeJson( + this as GameDialogCheckboxComponent, + ); + } + + Map toMap() { + return GameDialogCheckboxComponentMapper.ensureInitialized() + .encodeMap( + this as GameDialogCheckboxComponent, + ); + } + + GameDialogCheckboxComponentCopyWith< + GameDialogCheckboxComponent, + GameDialogCheckboxComponent, + GameDialogCheckboxComponent + > + get copyWith => + _GameDialogCheckboxComponentCopyWithImpl< + GameDialogCheckboxComponent, + GameDialogCheckboxComponent + >(this as GameDialogCheckboxComponent, $identity, $identity); + @override + String toString() { + return GameDialogCheckboxComponentMapper.ensureInitialized().stringifyValue( + this as GameDialogCheckboxComponent, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogCheckboxComponentMapper.ensureInitialized().equalsValue( + this as GameDialogCheckboxComponent, + other, + ); + } + + @override + int get hashCode { + return GameDialogCheckboxComponentMapper.ensureInitialized().hashValue( + this as GameDialogCheckboxComponent, + ); + } +} + +/// @nodoc +extension GameDialogCheckboxComponentValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogCheckboxComponent, $Out> { + GameDialogCheckboxComponentCopyWith<$R, GameDialogCheckboxComponent, $Out> + get $asGameDialogCheckboxComponent => $base.as( + (v, t, t2) => _GameDialogCheckboxComponentCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogCheckboxComponentCopyWith< + $R, + $In extends GameDialogCheckboxComponent, + $Out +> + implements GameDialogComponentCopyWith<$R, $In, $Out> { + @override + $R call({String? label, String? id, bool? initialValue}); + GameDialogCheckboxComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogCheckboxComponentCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogCheckboxComponent, $Out> + implements + GameDialogCheckboxComponentCopyWith< + $R, + GameDialogCheckboxComponent, + $Out + > { + _GameDialogCheckboxComponentCopyWithImpl( + super.value, + super.then, + super.then2, + ); + + @override + late final ClassMapperBase $mapper = + GameDialogCheckboxComponentMapper.ensureInitialized(); + @override + $R call({String? label, Object? id = $none, bool? initialValue}) => $apply( + FieldCopyWithData({ + if (label != null) #label: label, + if (id != $none) #id: id, + if (initialValue != null) #initialValue: initialValue, + }), + ); + @override + GameDialogCheckboxComponent $make(CopyWithData data) => + GameDialogCheckboxComponent( + data.get(#label, or: $value.label), + id: data.get(#id, or: $value.id), + initialValue: data.get(#initialValue, or: $value.initialValue), + ); + + @override + GameDialogCheckboxComponentCopyWith<$R2, GameDialogCheckboxComponent, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogCheckboxComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogDropdownComponentMapper + extends ClassMapperBase { + GameDialogDropdownComponentMapper._(); + + static GameDialogDropdownComponentMapper? _instance; + static GameDialogDropdownComponentMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogDropdownComponentMapper._(), + ); + GameDialogComponentMapper.ensureInitialized(); + GameDialogDropdownOptionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogDropdownComponent'; + + static String _$label(GameDialogDropdownComponent v) => v.label; + static const Field _f$label = Field( + 'label', + _$label, + ); + static List _$options( + GameDialogDropdownComponent v, + ) => v.options; + static const Field< + GameDialogDropdownComponent, + List + > + _f$options = Field('options', _$options); + static String? _$id(GameDialogDropdownComponent v) => v.id; + static const Field _f$id = Field( + 'id', + _$id, + opt: true, + ); + static String? _$initialValue(GameDialogDropdownComponent v) => + v.initialValue; + static const Field _f$initialValue = + Field('initialValue', _$initialValue, opt: true); + + @override + final MappableFields fields = const { + #label: _f$label, + #options: _f$options, + #id: _f$id, + #initialValue: _f$initialValue, + }; + + static GameDialogDropdownComponent _instantiate(DecodingData data) { + return GameDialogDropdownComponent( + data.dec(_f$label), + data.dec(_f$options), + id: data.dec(_f$id), + initialValue: data.dec(_f$initialValue), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogDropdownComponent fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogDropdownComponent fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogDropdownComponentMappable { + String toJson() { + return GameDialogDropdownComponentMapper.ensureInitialized() + .encodeJson( + this as GameDialogDropdownComponent, + ); + } + + Map toMap() { + return GameDialogDropdownComponentMapper.ensureInitialized() + .encodeMap( + this as GameDialogDropdownComponent, + ); + } + + GameDialogDropdownComponentCopyWith< + GameDialogDropdownComponent, + GameDialogDropdownComponent, + GameDialogDropdownComponent + > + get copyWith => + _GameDialogDropdownComponentCopyWithImpl< + GameDialogDropdownComponent, + GameDialogDropdownComponent + >(this as GameDialogDropdownComponent, $identity, $identity); + @override + String toString() { + return GameDialogDropdownComponentMapper.ensureInitialized().stringifyValue( + this as GameDialogDropdownComponent, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogDropdownComponentMapper.ensureInitialized().equalsValue( + this as GameDialogDropdownComponent, + other, + ); + } + + @override + int get hashCode { + return GameDialogDropdownComponentMapper.ensureInitialized().hashValue( + this as GameDialogDropdownComponent, + ); + } +} + +/// @nodoc +extension GameDialogDropdownComponentValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogDropdownComponent, $Out> { + GameDialogDropdownComponentCopyWith<$R, GameDialogDropdownComponent, $Out> + get $asGameDialogDropdownComponent => $base.as( + (v, t, t2) => _GameDialogDropdownComponentCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogDropdownComponentCopyWith< + $R, + $In extends GameDialogDropdownComponent, + $Out +> + implements GameDialogComponentCopyWith<$R, $In, $Out> { + ListCopyWith< + $R, + GameDialogDropdownOption, + GameDialogDropdownOptionCopyWith< + $R, + GameDialogDropdownOption, + GameDialogDropdownOption + > + > + get options; + @override + $R call({ + String? label, + List? options, + String? id, + String? initialValue, + }); + GameDialogDropdownComponentCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogDropdownComponentCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogDropdownComponent, $Out> + implements + GameDialogDropdownComponentCopyWith< + $R, + GameDialogDropdownComponent, + $Out + > { + _GameDialogDropdownComponentCopyWithImpl( + super.value, + super.then, + super.then2, + ); + + @override + late final ClassMapperBase $mapper = + GameDialogDropdownComponentMapper.ensureInitialized(); + @override + ListCopyWith< + $R, + GameDialogDropdownOption, + GameDialogDropdownOptionCopyWith< + $R, + GameDialogDropdownOption, + GameDialogDropdownOption + > + > + get options => ListCopyWith( + $value.options, + (v, t) => v.copyWith.$chain(t), + (v) => call(options: v), + ); + @override + $R call({ + String? label, + List? options, + Object? id = $none, + Object? initialValue = $none, + }) => $apply( + FieldCopyWithData({ + if (label != null) #label: label, + if (options != null) #options: options, + if (id != $none) #id: id, + if (initialValue != $none) #initialValue: initialValue, + }), + ); + @override + GameDialogDropdownComponent $make(CopyWithData data) => + GameDialogDropdownComponent( + data.get(#label, or: $value.label), + data.get(#options, or: $value.options), + id: data.get(#id, or: $value.id), + initialValue: data.get(#initialValue, or: $value.initialValue), + ); + + @override + GameDialogDropdownComponentCopyWith<$R2, GameDialogDropdownComponent, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogDropdownComponentCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogDropdownOptionMapper + extends ClassMapperBase { + GameDialogDropdownOptionMapper._(); + + static GameDialogDropdownOptionMapper? _instance; + static GameDialogDropdownOptionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogDropdownOptionMapper._(), + ); + } + return _instance!; + } + + @override + final String id = 'GameDialogDropdownOption'; + + static String? _$label(GameDialogDropdownOption v) => v.label; + static const Field _f$label = Field( + 'label', + _$label, + opt: true, + ); + static String _$value(GameDialogDropdownOption v) => v.value; + static const Field _f$value = Field( + 'value', + _$value, + ); + + @override + final MappableFields fields = const { + #label: _f$label, + #value: _f$value, + }; + + static GameDialogDropdownOption _instantiate(DecodingData data) { + return GameDialogDropdownOption( + label: data.dec(_f$label), + value: data.dec(_f$value), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogDropdownOption fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogDropdownOption fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogDropdownOptionMappable { + String toJson() { + return GameDialogDropdownOptionMapper.ensureInitialized() + .encodeJson(this as GameDialogDropdownOption); + } + + Map toMap() { + return GameDialogDropdownOptionMapper.ensureInitialized() + .encodeMap(this as GameDialogDropdownOption); + } + + GameDialogDropdownOptionCopyWith< + GameDialogDropdownOption, + GameDialogDropdownOption, + GameDialogDropdownOption + > + get copyWith => + _GameDialogDropdownOptionCopyWithImpl< + GameDialogDropdownOption, + GameDialogDropdownOption + >(this as GameDialogDropdownOption, $identity, $identity); + @override + String toString() { + return GameDialogDropdownOptionMapper.ensureInitialized().stringifyValue( + this as GameDialogDropdownOption, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogDropdownOptionMapper.ensureInitialized().equalsValue( + this as GameDialogDropdownOption, + other, + ); + } + + @override + int get hashCode { + return GameDialogDropdownOptionMapper.ensureInitialized().hashValue( + this as GameDialogDropdownOption, + ); + } +} + +/// @nodoc +extension GameDialogDropdownOptionValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogDropdownOption, $Out> { + GameDialogDropdownOptionCopyWith<$R, GameDialogDropdownOption, $Out> + get $asGameDialogDropdownOption => $base.as( + (v, t, t2) => _GameDialogDropdownOptionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogDropdownOptionCopyWith< + $R, + $In extends GameDialogDropdownOption, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? label, String? value}); + GameDialogDropdownOptionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogDropdownOptionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogDropdownOption, $Out> + implements + GameDialogDropdownOptionCopyWith<$R, GameDialogDropdownOption, $Out> { + _GameDialogDropdownOptionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogDropdownOptionMapper.ensureInitialized(); + @override + $R call({Object? label = $none, String? value}) => $apply( + FieldCopyWithData({ + if (label != $none) #label: label, + if (value != null) #value: value, + }), + ); + @override + GameDialogDropdownOption $make(CopyWithData data) => GameDialogDropdownOption( + label: data.get(#label, or: $value.label), + value: data.get(#value, or: $value.value), + ); + + @override + GameDialogDropdownOptionCopyWith<$R2, GameDialogDropdownOption, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogDropdownOptionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogValueMapper extends ClassMapperBase { + GameDialogValueMapper._(); + + static GameDialogValueMapper? _instance; + static GameDialogValueMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameDialogValueMapper._()); + GameDialogComponentValueMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogValue'; + + static Map _$values(GameDialogValue v) => + v.values; + static const Field> + _f$values = Field('values', _$values, opt: true, def: const {}); + static String _$buttonPressed(GameDialogValue v) => v.buttonPressed; + static const Field _f$buttonPressed = Field( + 'buttonPressed', + _$buttonPressed, + opt: true, + def: '', + ); + + @override + final MappableFields fields = const { + #values: _f$values, + #buttonPressed: _f$buttonPressed, + }; + + static GameDialogValue _instantiate(DecodingData data) { + return GameDialogValue(data.dec(_f$values), data.dec(_f$buttonPressed)); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogValue fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogValue fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogValueMappable { + String toJson() { + return GameDialogValueMapper.ensureInitialized() + .encodeJson(this as GameDialogValue); + } + + Map toMap() { + return GameDialogValueMapper.ensureInitialized().encodeMap( + this as GameDialogValue, + ); + } + + GameDialogValueCopyWith + get copyWith => + _GameDialogValueCopyWithImpl( + this as GameDialogValue, + $identity, + $identity, + ); + @override + String toString() { + return GameDialogValueMapper.ensureInitialized().stringifyValue( + this as GameDialogValue, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogValueMapper.ensureInitialized().equalsValue( + this as GameDialogValue, + other, + ); + } + + @override + int get hashCode { + return GameDialogValueMapper.ensureInitialized().hashValue( + this as GameDialogValue, + ); + } +} + +/// @nodoc +extension GameDialogValueValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogValue, $Out> { + GameDialogValueCopyWith<$R, GameDialogValue, $Out> get $asGameDialogValue => + $base.as((v, t, t2) => _GameDialogValueCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameDialogValueCopyWith<$R, $In extends GameDialogValue, $Out> + implements ClassCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + String, + GameDialogComponentValue, + GameDialogComponentValueCopyWith< + $R, + GameDialogComponentValue, + GameDialogComponentValue + > + > + get values; + $R call({ + Map? values, + String? buttonPressed, + }); + GameDialogValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogValueCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogValue, $Out> + implements GameDialogValueCopyWith<$R, GameDialogValue, $Out> { + _GameDialogValueCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogValueMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + String, + GameDialogComponentValue, + GameDialogComponentValueCopyWith< + $R, + GameDialogComponentValue, + GameDialogComponentValue + > + > + get values => MapCopyWith( + $value.values, + (v, t) => v.copyWith.$chain(t), + (v) => call(values: v), + ); + @override + $R call({ + Map? values, + String? buttonPressed, + }) => $apply( + FieldCopyWithData({ + if (values != null) #values: values, + if (buttonPressed != null) #buttonPressed: buttonPressed, + }), + ); + @override + GameDialogValue $make(CopyWithData data) => GameDialogValue( + data.get(#values, or: $value.values), + data.get(#buttonPressed, or: $value.buttonPressed), + ); + + @override + GameDialogValueCopyWith<$R2, GameDialogValue, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameDialogValueCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogComponentValueMapper + extends ClassMapperBase { + GameDialogComponentValueMapper._(); + + static GameDialogComponentValueMapper? _instance; + static GameDialogComponentValueMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogComponentValueMapper._(), + ); + GameDialogTextFieldValueMapper.ensureInitialized(); + GameDialogCheckboxValueMapper.ensureInitialized(); + GameDialogDropdownValueMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogComponentValue'; + + static int _$component(GameDialogComponentValue v) => v.component; + static const Field _f$component = Field( + 'component', + _$component, + ); + + @override + final MappableFields fields = const { + #component: _f$component, + }; + + static GameDialogComponentValue _instantiate(DecodingData data) { + return GameDialogComponentValue(component: data.dec(_f$component)); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogComponentValue fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogComponentValue fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogComponentValueMappable { + String toJson() { + return GameDialogComponentValueMapper.ensureInitialized() + .encodeJson(this as GameDialogComponentValue); + } + + Map toMap() { + return GameDialogComponentValueMapper.ensureInitialized() + .encodeMap(this as GameDialogComponentValue); + } + + GameDialogComponentValueCopyWith< + GameDialogComponentValue, + GameDialogComponentValue, + GameDialogComponentValue + > + get copyWith => + _GameDialogComponentValueCopyWithImpl< + GameDialogComponentValue, + GameDialogComponentValue + >(this as GameDialogComponentValue, $identity, $identity); + @override + String toString() { + return GameDialogComponentValueMapper.ensureInitialized().stringifyValue( + this as GameDialogComponentValue, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogComponentValueMapper.ensureInitialized().equalsValue( + this as GameDialogComponentValue, + other, + ); + } + + @override + int get hashCode { + return GameDialogComponentValueMapper.ensureInitialized().hashValue( + this as GameDialogComponentValue, + ); + } +} + +/// @nodoc +extension GameDialogComponentValueValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogComponentValue, $Out> { + GameDialogComponentValueCopyWith<$R, GameDialogComponentValue, $Out> + get $asGameDialogComponentValue => $base.as( + (v, t, t2) => _GameDialogComponentValueCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogComponentValueCopyWith< + $R, + $In extends GameDialogComponentValue, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + $R call({int? component}); + GameDialogComponentValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogComponentValueCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogComponentValue, $Out> + implements + GameDialogComponentValueCopyWith<$R, GameDialogComponentValue, $Out> { + _GameDialogComponentValueCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogComponentValueMapper.ensureInitialized(); + @override + $R call({int? component}) => + $apply(FieldCopyWithData({if (component != null) #component: component})); + @override + GameDialogComponentValue $make(CopyWithData data) => GameDialogComponentValue( + component: data.get(#component, or: $value.component), + ); + + @override + GameDialogComponentValueCopyWith<$R2, GameDialogComponentValue, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogComponentValueCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogTextFieldValueMapper + extends ClassMapperBase { + GameDialogTextFieldValueMapper._(); + + static GameDialogTextFieldValueMapper? _instance; + static GameDialogTextFieldValueMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogTextFieldValueMapper._(), + ); + GameDialogComponentValueMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogTextFieldValue'; + + static String _$value(GameDialogTextFieldValue v) => v.value; + static const Field _f$value = Field( + 'value', + _$value, + ); + static int _$component(GameDialogTextFieldValue v) => v.component; + static const Field _f$component = Field( + 'component', + _$component, + ); + + @override + final MappableFields fields = const { + #value: _f$value, + #component: _f$component, + }; + + static GameDialogTextFieldValue _instantiate(DecodingData data) { + return GameDialogTextFieldValue( + value: data.dec(_f$value), + component: data.dec(_f$component), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogTextFieldValue fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogTextFieldValue fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogTextFieldValueMappable { + String toJson() { + return GameDialogTextFieldValueMapper.ensureInitialized() + .encodeJson(this as GameDialogTextFieldValue); + } + + Map toMap() { + return GameDialogTextFieldValueMapper.ensureInitialized() + .encodeMap(this as GameDialogTextFieldValue); + } + + GameDialogTextFieldValueCopyWith< + GameDialogTextFieldValue, + GameDialogTextFieldValue, + GameDialogTextFieldValue + > + get copyWith => + _GameDialogTextFieldValueCopyWithImpl< + GameDialogTextFieldValue, + GameDialogTextFieldValue + >(this as GameDialogTextFieldValue, $identity, $identity); + @override + String toString() { + return GameDialogTextFieldValueMapper.ensureInitialized().stringifyValue( + this as GameDialogTextFieldValue, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogTextFieldValueMapper.ensureInitialized().equalsValue( + this as GameDialogTextFieldValue, + other, + ); + } + + @override + int get hashCode { + return GameDialogTextFieldValueMapper.ensureInitialized().hashValue( + this as GameDialogTextFieldValue, + ); + } +} + +/// @nodoc +extension GameDialogTextFieldValueValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogTextFieldValue, $Out> { + GameDialogTextFieldValueCopyWith<$R, GameDialogTextFieldValue, $Out> + get $asGameDialogTextFieldValue => $base.as( + (v, t, t2) => _GameDialogTextFieldValueCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogTextFieldValueCopyWith< + $R, + $In extends GameDialogTextFieldValue, + $Out +> + implements GameDialogComponentValueCopyWith<$R, $In, $Out> { + @override + $R call({String? value, int? component}); + GameDialogTextFieldValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogTextFieldValueCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogTextFieldValue, $Out> + implements + GameDialogTextFieldValueCopyWith<$R, GameDialogTextFieldValue, $Out> { + _GameDialogTextFieldValueCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogTextFieldValueMapper.ensureInitialized(); + @override + $R call({String? value, int? component}) => $apply( + FieldCopyWithData({ + if (value != null) #value: value, + if (component != null) #component: component, + }), + ); + @override + GameDialogTextFieldValue $make(CopyWithData data) => GameDialogTextFieldValue( + value: data.get(#value, or: $value.value), + component: data.get(#component, or: $value.component), + ); + + @override + GameDialogTextFieldValueCopyWith<$R2, GameDialogTextFieldValue, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogTextFieldValueCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogCheckboxValueMapper + extends ClassMapperBase { + GameDialogCheckboxValueMapper._(); + + static GameDialogCheckboxValueMapper? _instance; + static GameDialogCheckboxValueMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogCheckboxValueMapper._(), + ); + GameDialogComponentValueMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogCheckboxValue'; + + static bool _$value(GameDialogCheckboxValue v) => v.value; + static const Field _f$value = Field( + 'value', + _$value, + ); + static int _$component(GameDialogCheckboxValue v) => v.component; + static const Field _f$component = Field( + 'component', + _$component, + ); + + @override + final MappableFields fields = const { + #value: _f$value, + #component: _f$component, + }; + + static GameDialogCheckboxValue _instantiate(DecodingData data) { + return GameDialogCheckboxValue( + value: data.dec(_f$value), + component: data.dec(_f$component), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogCheckboxValue fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogCheckboxValue fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogCheckboxValueMappable { + String toJson() { + return GameDialogCheckboxValueMapper.ensureInitialized() + .encodeJson(this as GameDialogCheckboxValue); + } + + Map toMap() { + return GameDialogCheckboxValueMapper.ensureInitialized() + .encodeMap(this as GameDialogCheckboxValue); + } + + GameDialogCheckboxValueCopyWith< + GameDialogCheckboxValue, + GameDialogCheckboxValue, + GameDialogCheckboxValue + > + get copyWith => + _GameDialogCheckboxValueCopyWithImpl< + GameDialogCheckboxValue, + GameDialogCheckboxValue + >(this as GameDialogCheckboxValue, $identity, $identity); + @override + String toString() { + return GameDialogCheckboxValueMapper.ensureInitialized().stringifyValue( + this as GameDialogCheckboxValue, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogCheckboxValueMapper.ensureInitialized().equalsValue( + this as GameDialogCheckboxValue, + other, + ); + } + + @override + int get hashCode { + return GameDialogCheckboxValueMapper.ensureInitialized().hashValue( + this as GameDialogCheckboxValue, + ); + } +} + +/// @nodoc +extension GameDialogCheckboxValueValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogCheckboxValue, $Out> { + GameDialogCheckboxValueCopyWith<$R, GameDialogCheckboxValue, $Out> + get $asGameDialogCheckboxValue => $base.as( + (v, t, t2) => _GameDialogCheckboxValueCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogCheckboxValueCopyWith< + $R, + $In extends GameDialogCheckboxValue, + $Out +> + implements GameDialogComponentValueCopyWith<$R, $In, $Out> { + @override + $R call({bool? value, int? component}); + GameDialogCheckboxValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogCheckboxValueCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogCheckboxValue, $Out> + implements + GameDialogCheckboxValueCopyWith<$R, GameDialogCheckboxValue, $Out> { + _GameDialogCheckboxValueCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogCheckboxValueMapper.ensureInitialized(); + @override + $R call({bool? value, int? component}) => $apply( + FieldCopyWithData({ + if (value != null) #value: value, + if (component != null) #component: component, + }), + ); + @override + GameDialogCheckboxValue $make(CopyWithData data) => GameDialogCheckboxValue( + value: data.get(#value, or: $value.value), + component: data.get(#component, or: $value.component), + ); + + @override + GameDialogCheckboxValueCopyWith<$R2, GameDialogCheckboxValue, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogCheckboxValueCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameDialogDropdownValueMapper + extends ClassMapperBase { + GameDialogDropdownValueMapper._(); + + static GameDialogDropdownValueMapper? _instance; + static GameDialogDropdownValueMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = GameDialogDropdownValueMapper._(), + ); + GameDialogComponentValueMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameDialogDropdownValue'; + + static String _$value(GameDialogDropdownValue v) => v.value; + static const Field _f$value = Field( + 'value', + _$value, + ); + static int _$component(GameDialogDropdownValue v) => v.component; + static const Field _f$component = Field( + 'component', + _$component, + ); + + @override + final MappableFields fields = const { + #value: _f$value, + #component: _f$component, + }; + + static GameDialogDropdownValue _instantiate(DecodingData data) { + return GameDialogDropdownValue( + value: data.dec(_f$value), + component: data.dec(_f$component), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameDialogDropdownValue fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameDialogDropdownValue fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameDialogDropdownValueMappable { + String toJson() { + return GameDialogDropdownValueMapper.ensureInitialized() + .encodeJson(this as GameDialogDropdownValue); + } + + Map toMap() { + return GameDialogDropdownValueMapper.ensureInitialized() + .encodeMap(this as GameDialogDropdownValue); + } + + GameDialogDropdownValueCopyWith< + GameDialogDropdownValue, + GameDialogDropdownValue, + GameDialogDropdownValue + > + get copyWith => + _GameDialogDropdownValueCopyWithImpl< + GameDialogDropdownValue, + GameDialogDropdownValue + >(this as GameDialogDropdownValue, $identity, $identity); + @override + String toString() { + return GameDialogDropdownValueMapper.ensureInitialized().stringifyValue( + this as GameDialogDropdownValue, + ); + } + + @override + bool operator ==(Object other) { + return GameDialogDropdownValueMapper.ensureInitialized().equalsValue( + this as GameDialogDropdownValue, + other, + ); + } + + @override + int get hashCode { + return GameDialogDropdownValueMapper.ensureInitialized().hashValue( + this as GameDialogDropdownValue, + ); + } +} + +/// @nodoc +extension GameDialogDropdownValueValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameDialogDropdownValue, $Out> { + GameDialogDropdownValueCopyWith<$R, GameDialogDropdownValue, $Out> + get $asGameDialogDropdownValue => $base.as( + (v, t, t2) => _GameDialogDropdownValueCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GameDialogDropdownValueCopyWith< + $R, + $In extends GameDialogDropdownValue, + $Out +> + implements GameDialogComponentValueCopyWith<$R, $In, $Out> { + @override + $R call({String? value, int? component}); + GameDialogDropdownValueCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GameDialogDropdownValueCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameDialogDropdownValue, $Out> + implements + GameDialogDropdownValueCopyWith<$R, GameDialogDropdownValue, $Out> { + _GameDialogDropdownValueCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameDialogDropdownValueMapper.ensureInitialized(); + @override + $R call({String? value, int? component}) => $apply( + FieldCopyWithData({ + if (value != null) #value: value, + if (component != null) #component: component, + }), + ); + @override + GameDialogDropdownValue $make(CopyWithData data) => GameDialogDropdownValue( + value: data.get(#value, or: $value.value), + component: data.get(#component, or: $value.component), + ); + + @override + GameDialogDropdownValueCopyWith<$R2, GameDialogDropdownValue, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GameDialogDropdownValueCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/info.dart b/api/lib/src/models/info.dart index 1f194ded..51643676 100644 --- a/api/lib/src/models/info.dart +++ b/api/lib/src/models/info.dart @@ -1,51 +1,51 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -import 'vector.dart'; -import 'waypoint.dart'; - -part 'info.mapper.dart'; - -@MappableClass() -class GameInfo with GameInfoMappable { - final Map teams; - final List packs; - final ItemLocation? gameMode; - final List waypoints; - - const GameInfo({ - this.teams = const {}, - this.packs = const [], - this.gameMode, - this.waypoints = const [], - }); -} - -@MappableEnum() -enum TeamColor { - pink, - red, - orange, - yellow, - green, - blue, - indigo, - purple, - brown, - white, - black, -} - -@MappableClass() -class GameTeam with GameTeamMappable { - final String description; - final TeamColor? color; - final Set claimedCells; - final List waypoints; - - GameTeam({ - this.description = '', - this.color, - this.claimedCells = const {}, - this.waypoints = const [], - }); -} +import 'package:dart_mappable/dart_mappable.dart'; + +import 'vector.dart'; +import 'waypoint.dart'; + +part 'info.mapper.dart'; + +@MappableClass() +class GameInfo with GameInfoMappable { + final Map teams; + final List packs; + final ItemLocation? gameMode; + final List waypoints; + + const GameInfo({ + this.teams = const {}, + this.packs = const [], + this.gameMode, + this.waypoints = const [], + }); +} + +@MappableEnum() +enum TeamColor { + pink, + red, + orange, + yellow, + green, + blue, + indigo, + purple, + brown, + white, + black, +} + +@MappableClass() +class GameTeam with GameTeamMappable { + final String description; + final TeamColor? color; + final Set claimedCells; + final List waypoints; + + GameTeam({ + this.description = '', + this.color, + this.claimedCells = const {}, + this.waypoints = const [], + }); +} diff --git a/api/lib/src/models/info.mapper.dart b/api/lib/src/models/info.mapper.dart index eb57ec3f..20a77f7e 100644 --- a/api/lib/src/models/info.mapper.dart +++ b/api/lib/src/models/info.mapper.dart @@ -1,470 +1,470 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'info.dart'; - -/// @nodoc - -class TeamColorMapper extends EnumMapper { - TeamColorMapper._(); - - static TeamColorMapper? _instance; - static TeamColorMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = TeamColorMapper._()); - } - return _instance!; - } - - static TeamColor fromValue(dynamic value) { - ensureInitialized(); - return MapperContainer.globals.fromValue(value); - } - - @override - TeamColor decode(dynamic value) { - switch (value) { - case r'pink': - return TeamColor.pink; - case r'red': - return TeamColor.red; - case r'orange': - return TeamColor.orange; - case r'yellow': - return TeamColor.yellow; - case r'green': - return TeamColor.green; - case r'blue': - return TeamColor.blue; - case r'indigo': - return TeamColor.indigo; - case r'purple': - return TeamColor.purple; - case r'brown': - return TeamColor.brown; - case r'white': - return TeamColor.white; - case r'black': - return TeamColor.black; - default: - throw MapperException.unknownEnumValue(value); - } - } - - @override - dynamic encode(TeamColor self) { - switch (self) { - case TeamColor.pink: - return r'pink'; - case TeamColor.red: - return r'red'; - case TeamColor.orange: - return r'orange'; - case TeamColor.yellow: - return r'yellow'; - case TeamColor.green: - return r'green'; - case TeamColor.blue: - return r'blue'; - case TeamColor.indigo: - return r'indigo'; - case TeamColor.purple: - return r'purple'; - case TeamColor.brown: - return r'brown'; - case TeamColor.white: - return r'white'; - case TeamColor.black: - return r'black'; - } - } -} - -/// @nodoc - -extension TeamColorMapperExtension on TeamColor { - String toValue() { - TeamColorMapper.ensureInitialized(); - return MapperContainer.globals.toValue(this) as String; - } -} - -/// @nodoc -class GameInfoMapper extends ClassMapperBase { - GameInfoMapper._(); - - static GameInfoMapper? _instance; - static GameInfoMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameInfoMapper._()); - GameTeamMapper.ensureInitialized(); - ItemLocationMapper.ensureInitialized(); - WaypointMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameInfo'; - - static Map _$teams(GameInfo v) => v.teams; - static const Field> _f$teams = Field( - 'teams', - _$teams, - opt: true, - def: const {}, - ); - static List _$packs(GameInfo v) => v.packs; - static const Field> _f$packs = Field( - 'packs', - _$packs, - opt: true, - def: const [], - ); - static ItemLocation? _$gameMode(GameInfo v) => v.gameMode; - static const Field _f$gameMode = Field( - 'gameMode', - _$gameMode, - opt: true, - ); - static List _$waypoints(GameInfo v) => v.waypoints; - static const Field> _f$waypoints = Field( - 'waypoints', - _$waypoints, - opt: true, - def: const [], - ); - - @override - final MappableFields fields = const { - #teams: _f$teams, - #packs: _f$packs, - #gameMode: _f$gameMode, - #waypoints: _f$waypoints, - }; - - static GameInfo _instantiate(DecodingData data) { - return GameInfo( - teams: data.dec(_f$teams), - packs: data.dec(_f$packs), - gameMode: data.dec(_f$gameMode), - waypoints: data.dec(_f$waypoints), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameInfo fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameInfo fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameInfoMappable { - String toJson() { - return GameInfoMapper.ensureInitialized().encodeJson( - this as GameInfo, - ); - } - - Map toMap() { - return GameInfoMapper.ensureInitialized().encodeMap( - this as GameInfo, - ); - } - - GameInfoCopyWith get copyWith => - _GameInfoCopyWithImpl( - this as GameInfo, - $identity, - $identity, - ); - @override - String toString() { - return GameInfoMapper.ensureInitialized().stringifyValue(this as GameInfo); - } - - @override - bool operator ==(Object other) { - return GameInfoMapper.ensureInitialized().equalsValue( - this as GameInfo, - other, - ); - } - - @override - int get hashCode { - return GameInfoMapper.ensureInitialized().hashValue(this as GameInfo); - } -} - -/// @nodoc -extension GameInfoValueCopy<$R, $Out> on ObjectCopyWith<$R, GameInfo, $Out> { - GameInfoCopyWith<$R, GameInfo, $Out> get $asGameInfo => - $base.as((v, t, t2) => _GameInfoCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameInfoCopyWith<$R, $In extends GameInfo, $Out> - implements ClassCopyWith<$R, $In, $Out> { - MapCopyWith<$R, String, GameTeam, GameTeamCopyWith<$R, GameTeam, GameTeam>> - get teams; - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs; - ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get gameMode; - ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> - get waypoints; - $R call({ - Map? teams, - List? packs, - ItemLocation? gameMode, - List? waypoints, - }); - GameInfoCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _GameInfoCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameInfo, $Out> - implements GameInfoCopyWith<$R, GameInfo, $Out> { - _GameInfoCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameInfoMapper.ensureInitialized(); - @override - MapCopyWith<$R, String, GameTeam, GameTeamCopyWith<$R, GameTeam, GameTeam>> - get teams => MapCopyWith( - $value.teams, - (v, t) => v.copyWith.$chain(t), - (v) => call(teams: v), - ); - @override - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs => - ListCopyWith( - $value.packs, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(packs: v), - ); - @override - ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get gameMode => - $value.gameMode?.copyWith.$chain((v) => call(gameMode: v)); - @override - ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> - get waypoints => ListCopyWith( - $value.waypoints, - (v, t) => v.copyWith.$chain(t), - (v) => call(waypoints: v), - ); - @override - $R call({ - Map? teams, - List? packs, - Object? gameMode = $none, - List? waypoints, - }) => $apply( - FieldCopyWithData({ - if (teams != null) #teams: teams, - if (packs != null) #packs: packs, - if (gameMode != $none) #gameMode: gameMode, - if (waypoints != null) #waypoints: waypoints, - }), - ); - @override - GameInfo $make(CopyWithData data) => GameInfo( - teams: data.get(#teams, or: $value.teams), - packs: data.get(#packs, or: $value.packs), - gameMode: data.get(#gameMode, or: $value.gameMode), - waypoints: data.get(#waypoints, or: $value.waypoints), - ); - - @override - GameInfoCopyWith<$R2, GameInfo, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameInfoCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GameTeamMapper extends ClassMapperBase { - GameTeamMapper._(); - - static GameTeamMapper? _instance; - static GameTeamMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameTeamMapper._()); - TeamColorMapper.ensureInitialized(); - GlobalVectorDefinitionMapper.ensureInitialized(); - WaypointMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameTeam'; - - static String _$description(GameTeam v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - def: '', - ); - static TeamColor? _$color(GameTeam v) => v.color; - static const Field _f$color = Field( - 'color', - _$color, - opt: true, - ); - static Set _$claimedCells(GameTeam v) => - v.claimedCells; - static const Field> _f$claimedCells = - Field('claimedCells', _$claimedCells, opt: true, def: const {}); - static List _$waypoints(GameTeam v) => v.waypoints; - static const Field> _f$waypoints = Field( - 'waypoints', - _$waypoints, - opt: true, - def: const [], - ); - - @override - final MappableFields fields = const { - #description: _f$description, - #color: _f$color, - #claimedCells: _f$claimedCells, - #waypoints: _f$waypoints, - }; - - static GameTeam _instantiate(DecodingData data) { - return GameTeam( - description: data.dec(_f$description), - color: data.dec(_f$color), - claimedCells: data.dec(_f$claimedCells), - waypoints: data.dec(_f$waypoints), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameTeam fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameTeam fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameTeamMappable { - String toJson() { - return GameTeamMapper.ensureInitialized().encodeJson( - this as GameTeam, - ); - } - - Map toMap() { - return GameTeamMapper.ensureInitialized().encodeMap( - this as GameTeam, - ); - } - - GameTeamCopyWith get copyWith => - _GameTeamCopyWithImpl( - this as GameTeam, - $identity, - $identity, - ); - @override - String toString() { - return GameTeamMapper.ensureInitialized().stringifyValue(this as GameTeam); - } - - @override - bool operator ==(Object other) { - return GameTeamMapper.ensureInitialized().equalsValue( - this as GameTeam, - other, - ); - } - - @override - int get hashCode { - return GameTeamMapper.ensureInitialized().hashValue(this as GameTeam); - } -} - -/// @nodoc -extension GameTeamValueCopy<$R, $Out> on ObjectCopyWith<$R, GameTeam, $Out> { - GameTeamCopyWith<$R, GameTeam, $Out> get $asGameTeam => - $base.as((v, t, t2) => _GameTeamCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameTeamCopyWith<$R, $In extends GameTeam, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> - get waypoints; - $R call({ - String? description, - TeamColor? color, - Set? claimedCells, - List? waypoints, - }); - GameTeamCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _GameTeamCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameTeam, $Out> - implements GameTeamCopyWith<$R, GameTeam, $Out> { - _GameTeamCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameTeamMapper.ensureInitialized(); - @override - ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> - get waypoints => ListCopyWith( - $value.waypoints, - (v, t) => v.copyWith.$chain(t), - (v) => call(waypoints: v), - ); - @override - $R call({ - String? description, - Object? color = $none, - Set? claimedCells, - List? waypoints, - }) => $apply( - FieldCopyWithData({ - if (description != null) #description: description, - if (color != $none) #color: color, - if (claimedCells != null) #claimedCells: claimedCells, - if (waypoints != null) #waypoints: waypoints, - }), - ); - @override - GameTeam $make(CopyWithData data) => GameTeam( - description: data.get(#description, or: $value.description), - color: data.get(#color, or: $value.color), - claimedCells: data.get(#claimedCells, or: $value.claimedCells), - waypoints: data.get(#waypoints, or: $value.waypoints), - ); - - @override - GameTeamCopyWith<$R2, GameTeam, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameTeamCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'info.dart'; + +/// @nodoc + +class TeamColorMapper extends EnumMapper { + TeamColorMapper._(); + + static TeamColorMapper? _instance; + static TeamColorMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = TeamColorMapper._()); + } + return _instance!; + } + + static TeamColor fromValue(dynamic value) { + ensureInitialized(); + return MapperContainer.globals.fromValue(value); + } + + @override + TeamColor decode(dynamic value) { + switch (value) { + case r'pink': + return TeamColor.pink; + case r'red': + return TeamColor.red; + case r'orange': + return TeamColor.orange; + case r'yellow': + return TeamColor.yellow; + case r'green': + return TeamColor.green; + case r'blue': + return TeamColor.blue; + case r'indigo': + return TeamColor.indigo; + case r'purple': + return TeamColor.purple; + case r'brown': + return TeamColor.brown; + case r'white': + return TeamColor.white; + case r'black': + return TeamColor.black; + default: + throw MapperException.unknownEnumValue(value); + } + } + + @override + dynamic encode(TeamColor self) { + switch (self) { + case TeamColor.pink: + return r'pink'; + case TeamColor.red: + return r'red'; + case TeamColor.orange: + return r'orange'; + case TeamColor.yellow: + return r'yellow'; + case TeamColor.green: + return r'green'; + case TeamColor.blue: + return r'blue'; + case TeamColor.indigo: + return r'indigo'; + case TeamColor.purple: + return r'purple'; + case TeamColor.brown: + return r'brown'; + case TeamColor.white: + return r'white'; + case TeamColor.black: + return r'black'; + } + } +} + +/// @nodoc + +extension TeamColorMapperExtension on TeamColor { + String toValue() { + TeamColorMapper.ensureInitialized(); + return MapperContainer.globals.toValue(this) as String; + } +} + +/// @nodoc +class GameInfoMapper extends ClassMapperBase { + GameInfoMapper._(); + + static GameInfoMapper? _instance; + static GameInfoMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameInfoMapper._()); + GameTeamMapper.ensureInitialized(); + ItemLocationMapper.ensureInitialized(); + WaypointMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameInfo'; + + static Map _$teams(GameInfo v) => v.teams; + static const Field> _f$teams = Field( + 'teams', + _$teams, + opt: true, + def: const {}, + ); + static List _$packs(GameInfo v) => v.packs; + static const Field> _f$packs = Field( + 'packs', + _$packs, + opt: true, + def: const [], + ); + static ItemLocation? _$gameMode(GameInfo v) => v.gameMode; + static const Field _f$gameMode = Field( + 'gameMode', + _$gameMode, + opt: true, + ); + static List _$waypoints(GameInfo v) => v.waypoints; + static const Field> _f$waypoints = Field( + 'waypoints', + _$waypoints, + opt: true, + def: const [], + ); + + @override + final MappableFields fields = const { + #teams: _f$teams, + #packs: _f$packs, + #gameMode: _f$gameMode, + #waypoints: _f$waypoints, + }; + + static GameInfo _instantiate(DecodingData data) { + return GameInfo( + teams: data.dec(_f$teams), + packs: data.dec(_f$packs), + gameMode: data.dec(_f$gameMode), + waypoints: data.dec(_f$waypoints), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameInfo fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameInfo fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameInfoMappable { + String toJson() { + return GameInfoMapper.ensureInitialized().encodeJson( + this as GameInfo, + ); + } + + Map toMap() { + return GameInfoMapper.ensureInitialized().encodeMap( + this as GameInfo, + ); + } + + GameInfoCopyWith get copyWith => + _GameInfoCopyWithImpl( + this as GameInfo, + $identity, + $identity, + ); + @override + String toString() { + return GameInfoMapper.ensureInitialized().stringifyValue(this as GameInfo); + } + + @override + bool operator ==(Object other) { + return GameInfoMapper.ensureInitialized().equalsValue( + this as GameInfo, + other, + ); + } + + @override + int get hashCode { + return GameInfoMapper.ensureInitialized().hashValue(this as GameInfo); + } +} + +/// @nodoc +extension GameInfoValueCopy<$R, $Out> on ObjectCopyWith<$R, GameInfo, $Out> { + GameInfoCopyWith<$R, GameInfo, $Out> get $asGameInfo => + $base.as((v, t, t2) => _GameInfoCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameInfoCopyWith<$R, $In extends GameInfo, $Out> + implements ClassCopyWith<$R, $In, $Out> { + MapCopyWith<$R, String, GameTeam, GameTeamCopyWith<$R, GameTeam, GameTeam>> + get teams; + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs; + ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get gameMode; + ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> + get waypoints; + $R call({ + Map? teams, + List? packs, + ItemLocation? gameMode, + List? waypoints, + }); + GameInfoCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _GameInfoCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameInfo, $Out> + implements GameInfoCopyWith<$R, GameInfo, $Out> { + _GameInfoCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameInfoMapper.ensureInitialized(); + @override + MapCopyWith<$R, String, GameTeam, GameTeamCopyWith<$R, GameTeam, GameTeam>> + get teams => MapCopyWith( + $value.teams, + (v, t) => v.copyWith.$chain(t), + (v) => call(teams: v), + ); + @override + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get packs => + ListCopyWith( + $value.packs, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(packs: v), + ); + @override + ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get gameMode => + $value.gameMode?.copyWith.$chain((v) => call(gameMode: v)); + @override + ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> + get waypoints => ListCopyWith( + $value.waypoints, + (v, t) => v.copyWith.$chain(t), + (v) => call(waypoints: v), + ); + @override + $R call({ + Map? teams, + List? packs, + Object? gameMode = $none, + List? waypoints, + }) => $apply( + FieldCopyWithData({ + if (teams != null) #teams: teams, + if (packs != null) #packs: packs, + if (gameMode != $none) #gameMode: gameMode, + if (waypoints != null) #waypoints: waypoints, + }), + ); + @override + GameInfo $make(CopyWithData data) => GameInfo( + teams: data.get(#teams, or: $value.teams), + packs: data.get(#packs, or: $value.packs), + gameMode: data.get(#gameMode, or: $value.gameMode), + waypoints: data.get(#waypoints, or: $value.waypoints), + ); + + @override + GameInfoCopyWith<$R2, GameInfo, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameInfoCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GameTeamMapper extends ClassMapperBase { + GameTeamMapper._(); + + static GameTeamMapper? _instance; + static GameTeamMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameTeamMapper._()); + TeamColorMapper.ensureInitialized(); + GlobalVectorDefinitionMapper.ensureInitialized(); + WaypointMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameTeam'; + + static String _$description(GameTeam v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + def: '', + ); + static TeamColor? _$color(GameTeam v) => v.color; + static const Field _f$color = Field( + 'color', + _$color, + opt: true, + ); + static Set _$claimedCells(GameTeam v) => + v.claimedCells; + static const Field> _f$claimedCells = + Field('claimedCells', _$claimedCells, opt: true, def: const {}); + static List _$waypoints(GameTeam v) => v.waypoints; + static const Field> _f$waypoints = Field( + 'waypoints', + _$waypoints, + opt: true, + def: const [], + ); + + @override + final MappableFields fields = const { + #description: _f$description, + #color: _f$color, + #claimedCells: _f$claimedCells, + #waypoints: _f$waypoints, + }; + + static GameTeam _instantiate(DecodingData data) { + return GameTeam( + description: data.dec(_f$description), + color: data.dec(_f$color), + claimedCells: data.dec(_f$claimedCells), + waypoints: data.dec(_f$waypoints), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameTeam fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameTeam fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameTeamMappable { + String toJson() { + return GameTeamMapper.ensureInitialized().encodeJson( + this as GameTeam, + ); + } + + Map toMap() { + return GameTeamMapper.ensureInitialized().encodeMap( + this as GameTeam, + ); + } + + GameTeamCopyWith get copyWith => + _GameTeamCopyWithImpl( + this as GameTeam, + $identity, + $identity, + ); + @override + String toString() { + return GameTeamMapper.ensureInitialized().stringifyValue(this as GameTeam); + } + + @override + bool operator ==(Object other) { + return GameTeamMapper.ensureInitialized().equalsValue( + this as GameTeam, + other, + ); + } + + @override + int get hashCode { + return GameTeamMapper.ensureInitialized().hashValue(this as GameTeam); + } +} + +/// @nodoc +extension GameTeamValueCopy<$R, $Out> on ObjectCopyWith<$R, GameTeam, $Out> { + GameTeamCopyWith<$R, GameTeam, $Out> get $asGameTeam => + $base.as((v, t, t2) => _GameTeamCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameTeamCopyWith<$R, $In extends GameTeam, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> + get waypoints; + $R call({ + String? description, + TeamColor? color, + Set? claimedCells, + List? waypoints, + }); + GameTeamCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _GameTeamCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameTeam, $Out> + implements GameTeamCopyWith<$R, GameTeam, $Out> { + _GameTeamCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameTeamMapper.ensureInitialized(); + @override + ListCopyWith<$R, Waypoint, WaypointCopyWith<$R, Waypoint, Waypoint>> + get waypoints => ListCopyWith( + $value.waypoints, + (v, t) => v.copyWith.$chain(t), + (v) => call(waypoints: v), + ); + @override + $R call({ + String? description, + Object? color = $none, + Set? claimedCells, + List? waypoints, + }) => $apply( + FieldCopyWithData({ + if (description != null) #description: description, + if (color != $none) #color: color, + if (claimedCells != null) #claimedCells: claimedCells, + if (waypoints != null) #waypoints: waypoints, + }), + ); + @override + GameTeam $make(CopyWithData data) => GameTeam( + description: data.get(#description, or: $value.description), + color: data.get(#color, or: $value.color), + claimedCells: data.get(#claimedCells, or: $value.claimedCells), + waypoints: data.get(#waypoints, or: $value.waypoints), + ); + + @override + GameTeamCopyWith<$R2, GameTeam, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameTeamCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/kick.dart b/api/lib/src/models/kick.dart index 7ee30ea6..c37047bb 100644 --- a/api/lib/src/models/kick.dart +++ b/api/lib/src/models/kick.dart @@ -1,42 +1,42 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -part 'kick.mapper.dart'; - -@MappableEnum() -enum KickReason { - kick, - ban, - notWhitelisted, - notRegistered, - challengeFailed, - pleaseLink, -} - -@MappableClass(hook: KickMessageHook()) -final class KickMessage with KickMessageMappable { - final String? message; - final String? link; - final KickReason? reason; - - const KickMessage({this.message, this.link, this.reason}); - - factory KickMessage.fromString(String message) { - try { - return KickMessageMapper.fromJson(message); - } catch (_) { - return KickMessage(message: message); - } - } -} - -class KickMessageHook extends MappingHook { - const KickMessageHook(); - - @override - Object? beforeDecode(Object? value) { - if (value is String) { - return {'message': value}; - } - return super.beforeDecode(value); - } -} +import 'package:dart_mappable/dart_mappable.dart'; + +part 'kick.mapper.dart'; + +@MappableEnum() +enum KickReason { + kick, + ban, + notWhitelisted, + notRegistered, + challengeFailed, + pleaseLink, +} + +@MappableClass(hook: KickMessageHook()) +final class KickMessage with KickMessageMappable { + final String? message; + final String? link; + final KickReason? reason; + + const KickMessage({this.message, this.link, this.reason}); + + factory KickMessage.fromString(String message) { + try { + return KickMessageMapper.fromJson(message); + } catch (_) { + return KickMessage(message: message); + } + } +} + +class KickMessageHook extends MappingHook { + const KickMessageHook(); + + @override + Object? beforeDecode(Object? value) { + if (value is String) { + return {'message': value}; + } + return super.beforeDecode(value); + } +} diff --git a/api/lib/src/models/kick.mapper.dart b/api/lib/src/models/kick.mapper.dart index 1f38315b..f87ae48f 100644 --- a/api/lib/src/models/kick.mapper.dart +++ b/api/lib/src/models/kick.mapper.dart @@ -1,229 +1,229 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'kick.dart'; - -/// @nodoc - -class KickReasonMapper extends EnumMapper { - KickReasonMapper._(); - - static KickReasonMapper? _instance; - static KickReasonMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = KickReasonMapper._()); - } - return _instance!; - } - - static KickReason fromValue(dynamic value) { - ensureInitialized(); - return MapperContainer.globals.fromValue(value); - } - - @override - KickReason decode(dynamic value) { - switch (value) { - case r'kick': - return KickReason.kick; - case r'ban': - return KickReason.ban; - case r'notWhitelisted': - return KickReason.notWhitelisted; - case r'notRegistered': - return KickReason.notRegistered; - case r'challengeFailed': - return KickReason.challengeFailed; - case r'pleaseLink': - return KickReason.pleaseLink; - default: - throw MapperException.unknownEnumValue(value); - } - } - - @override - dynamic encode(KickReason self) { - switch (self) { - case KickReason.kick: - return r'kick'; - case KickReason.ban: - return r'ban'; - case KickReason.notWhitelisted: - return r'notWhitelisted'; - case KickReason.notRegistered: - return r'notRegistered'; - case KickReason.challengeFailed: - return r'challengeFailed'; - case KickReason.pleaseLink: - return r'pleaseLink'; - } - } -} - -/// @nodoc - -extension KickReasonMapperExtension on KickReason { - String toValue() { - KickReasonMapper.ensureInitialized(); - return MapperContainer.globals.toValue(this) as String; - } -} - -/// @nodoc -class KickMessageMapper extends ClassMapperBase { - KickMessageMapper._(); - - static KickMessageMapper? _instance; - static KickMessageMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = KickMessageMapper._()); - KickReasonMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'KickMessage'; - - static String? _$message(KickMessage v) => v.message; - static const Field _f$message = Field( - 'message', - _$message, - opt: true, - ); - static String? _$link(KickMessage v) => v.link; - static const Field _f$link = Field( - 'link', - _$link, - opt: true, - ); - static KickReason? _$reason(KickMessage v) => v.reason; - static const Field _f$reason = Field( - 'reason', - _$reason, - opt: true, - ); - - @override - final MappableFields fields = const { - #message: _f$message, - #link: _f$link, - #reason: _f$reason, - }; - - @override - final MappingHook hook = const KickMessageHook(); - static KickMessage _instantiate(DecodingData data) { - return KickMessage( - message: data.dec(_f$message), - link: data.dec(_f$link), - reason: data.dec(_f$reason), - ); - } - - @override - final Function instantiate = _instantiate; - - static KickMessage fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static KickMessage fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin KickMessageMappable { - String toJson() { - return KickMessageMapper.ensureInitialized().encodeJson( - this as KickMessage, - ); - } - - Map toMap() { - return KickMessageMapper.ensureInitialized().encodeMap( - this as KickMessage, - ); - } - - KickMessageCopyWith get copyWith => - _KickMessageCopyWithImpl( - this as KickMessage, - $identity, - $identity, - ); - @override - String toString() { - return KickMessageMapper.ensureInitialized().stringifyValue( - this as KickMessage, - ); - } - - @override - bool operator ==(Object other) { - return KickMessageMapper.ensureInitialized().equalsValue( - this as KickMessage, - other, - ); - } - - @override - int get hashCode { - return KickMessageMapper.ensureInitialized().hashValue(this as KickMessage); - } -} - -/// @nodoc -extension KickMessageValueCopy<$R, $Out> - on ObjectCopyWith<$R, KickMessage, $Out> { - KickMessageCopyWith<$R, KickMessage, $Out> get $asKickMessage => - $base.as((v, t, t2) => _KickMessageCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class KickMessageCopyWith<$R, $In extends KickMessage, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? message, String? link, KickReason? reason}); - KickMessageCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _KickMessageCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, KickMessage, $Out> - implements KickMessageCopyWith<$R, KickMessage, $Out> { - _KickMessageCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - KickMessageMapper.ensureInitialized(); - @override - $R call({ - Object? message = $none, - Object? link = $none, - Object? reason = $none, - }) => $apply( - FieldCopyWithData({ - if (message != $none) #message: message, - if (link != $none) #link: link, - if (reason != $none) #reason: reason, - }), - ); - @override - KickMessage $make(CopyWithData data) => KickMessage( - message: data.get(#message, or: $value.message), - link: data.get(#link, or: $value.link), - reason: data.get(#reason, or: $value.reason), - ); - - @override - KickMessageCopyWith<$R2, KickMessage, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _KickMessageCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'kick.dart'; + +/// @nodoc + +class KickReasonMapper extends EnumMapper { + KickReasonMapper._(); + + static KickReasonMapper? _instance; + static KickReasonMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = KickReasonMapper._()); + } + return _instance!; + } + + static KickReason fromValue(dynamic value) { + ensureInitialized(); + return MapperContainer.globals.fromValue(value); + } + + @override + KickReason decode(dynamic value) { + switch (value) { + case r'kick': + return KickReason.kick; + case r'ban': + return KickReason.ban; + case r'notWhitelisted': + return KickReason.notWhitelisted; + case r'notRegistered': + return KickReason.notRegistered; + case r'challengeFailed': + return KickReason.challengeFailed; + case r'pleaseLink': + return KickReason.pleaseLink; + default: + throw MapperException.unknownEnumValue(value); + } + } + + @override + dynamic encode(KickReason self) { + switch (self) { + case KickReason.kick: + return r'kick'; + case KickReason.ban: + return r'ban'; + case KickReason.notWhitelisted: + return r'notWhitelisted'; + case KickReason.notRegistered: + return r'notRegistered'; + case KickReason.challengeFailed: + return r'challengeFailed'; + case KickReason.pleaseLink: + return r'pleaseLink'; + } + } +} + +/// @nodoc + +extension KickReasonMapperExtension on KickReason { + String toValue() { + KickReasonMapper.ensureInitialized(); + return MapperContainer.globals.toValue(this) as String; + } +} + +/// @nodoc +class KickMessageMapper extends ClassMapperBase { + KickMessageMapper._(); + + static KickMessageMapper? _instance; + static KickMessageMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = KickMessageMapper._()); + KickReasonMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'KickMessage'; + + static String? _$message(KickMessage v) => v.message; + static const Field _f$message = Field( + 'message', + _$message, + opt: true, + ); + static String? _$link(KickMessage v) => v.link; + static const Field _f$link = Field( + 'link', + _$link, + opt: true, + ); + static KickReason? _$reason(KickMessage v) => v.reason; + static const Field _f$reason = Field( + 'reason', + _$reason, + opt: true, + ); + + @override + final MappableFields fields = const { + #message: _f$message, + #link: _f$link, + #reason: _f$reason, + }; + + @override + final MappingHook hook = const KickMessageHook(); + static KickMessage _instantiate(DecodingData data) { + return KickMessage( + message: data.dec(_f$message), + link: data.dec(_f$link), + reason: data.dec(_f$reason), + ); + } + + @override + final Function instantiate = _instantiate; + + static KickMessage fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static KickMessage fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin KickMessageMappable { + String toJson() { + return KickMessageMapper.ensureInitialized().encodeJson( + this as KickMessage, + ); + } + + Map toMap() { + return KickMessageMapper.ensureInitialized().encodeMap( + this as KickMessage, + ); + } + + KickMessageCopyWith get copyWith => + _KickMessageCopyWithImpl( + this as KickMessage, + $identity, + $identity, + ); + @override + String toString() { + return KickMessageMapper.ensureInitialized().stringifyValue( + this as KickMessage, + ); + } + + @override + bool operator ==(Object other) { + return KickMessageMapper.ensureInitialized().equalsValue( + this as KickMessage, + other, + ); + } + + @override + int get hashCode { + return KickMessageMapper.ensureInitialized().hashValue(this as KickMessage); + } +} + +/// @nodoc +extension KickMessageValueCopy<$R, $Out> + on ObjectCopyWith<$R, KickMessage, $Out> { + KickMessageCopyWith<$R, KickMessage, $Out> get $asKickMessage => + $base.as((v, t, t2) => _KickMessageCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class KickMessageCopyWith<$R, $In extends KickMessage, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? message, String? link, KickReason? reason}); + KickMessageCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _KickMessageCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, KickMessage, $Out> + implements KickMessageCopyWith<$R, KickMessage, $Out> { + _KickMessageCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + KickMessageMapper.ensureInitialized(); + @override + $R call({ + Object? message = $none, + Object? link = $none, + Object? reason = $none, + }) => $apply( + FieldCopyWithData({ + if (message != $none) #message: message, + if (link != $none) #link: link, + if (reason != $none) #reason: reason, + }), + ); + @override + KickMessage $make(CopyWithData data) => KickMessage( + message: data.get(#message, or: $value.message), + link: data.get(#link, or: $value.link), + reason: data.get(#reason, or: $value.reason), + ); + + @override + KickMessageCopyWith<$R2, KickMessage, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _KickMessageCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/meta.dart b/api/lib/src/models/meta.dart index 4a81a9f7..b4a6daa4 100644 --- a/api/lib/src/models/meta.dart +++ b/api/lib/src/models/meta.dart @@ -1,88 +1,88 @@ -import 'dart:typed_data'; - -import 'package:cryptography_plus/cryptography_plus.dart'; -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:setonix_api/src/helpers/crypto.dart'; - -part 'meta.mapper.dart'; - -const kFileVersion = 0; - -@MappableEnum() -enum SetonixFileType { pack, game, template, accounts } - -@MappableClass() -final class FileMetadata with FileMetadataMappable { - final SetonixFileType type; - final String name; - final String description; - final String author; - final String version; - final Set dependencies; - final int fileVersion; - - const FileMetadata({ - this.type = SetonixFileType.pack, - this.name = '', - this.description = '', - this.author = '', - this.version = '', - this.dependencies = const {}, - this.fileVersion = kFileVersion, - }); -} - -@MappableClass() -final class SignatureMetadata with SignatureMetadataMappable { - final String id; - final FileMetadata metadata; - final List downloadUrls; - - SignatureMetadata({ - required this.id, - required this.metadata, - this.downloadUrls = const [], - }); - - bool supports(SignatureMetadata other) { - return id == other.id; - } -} - -@MappableClass() -final class DataMetadata with DataMetadataMappable { - final bool manuallyAdded; - final DateTime addedAt; - final Map serversLastUsed; - - DataMetadata({ - this.manuallyAdded = true, - required this.addedAt, - this.serversLastUsed = const {}, - }); - - DateTime lastUsed() { - return serversLastUsed.values.fold(addedAt, (a, b) => a.isAfter(b) ? a : b); - } -} - -final class SetonixAccount { - final Uint8List privateKey; - final Uint8List publicKey; - final String name; - - SetonixAccount({ - required this.privateKey, - required this.publicKey, - required this.name, - }); - - KeyPair get keyPair => SimpleKeyPairData( - privateKey, - publicKey: SimplePublicKey(publicKey, type: KeyPairType.ed25519), - type: KeyPairType.ed25519, - ); - - String getFingerprint({bool short = false, bool pretty = false}) => - generateFingerprint(publicKey, short: short, pretty: pretty); -} +import 'dart:typed_data'; + +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:setonix_api/src/helpers/crypto.dart'; + +part 'meta.mapper.dart'; + +const kFileVersion = 0; + +@MappableEnum() +enum SetonixFileType { pack, game, template, accounts } + +@MappableClass() +final class FileMetadata with FileMetadataMappable { + final SetonixFileType type; + final String name; + final String description; + final String author; + final String version; + final Set dependencies; + final int fileVersion; + + const FileMetadata({ + this.type = SetonixFileType.pack, + this.name = '', + this.description = '', + this.author = '', + this.version = '', + this.dependencies = const {}, + this.fileVersion = kFileVersion, + }); +} + +@MappableClass() +final class SignatureMetadata with SignatureMetadataMappable { + final String id; + final FileMetadata metadata; + final List downloadUrls; + + SignatureMetadata({ + required this.id, + required this.metadata, + this.downloadUrls = const [], + }); + + bool supports(SignatureMetadata other) { + return id == other.id; + } +} + +@MappableClass() +final class DataMetadata with DataMetadataMappable { + final bool manuallyAdded; + final DateTime addedAt; + final Map serversLastUsed; + + DataMetadata({ + this.manuallyAdded = true, + required this.addedAt, + this.serversLastUsed = const {}, + }); + + DateTime lastUsed() { + return serversLastUsed.values.fold(addedAt, (a, b) => a.isAfter(b) ? a : b); + } +} + +final class SetonixAccount { + final Uint8List privateKey; + final Uint8List publicKey; + final String name; + + SetonixAccount({ + required this.privateKey, + required this.publicKey, + required this.name, + }); + + KeyPair get keyPair => SimpleKeyPairData( + privateKey, + publicKey: SimplePublicKey(publicKey, type: KeyPairType.ed25519), + type: KeyPairType.ed25519, + ); + + String getFingerprint({bool short = false, bool pretty = false}) => + generateFingerprint(publicKey, short: short, pretty: pretty); +} diff --git a/api/lib/src/models/meta.mapper.dart b/api/lib/src/models/meta.mapper.dart index 7c3c160f..fd44401c 100644 --- a/api/lib/src/models/meta.mapper.dart +++ b/api/lib/src/models/meta.mapper.dart @@ -1,612 +1,612 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'meta.dart'; - -/// @nodoc - -class SetonixFileTypeMapper extends EnumMapper { - SetonixFileTypeMapper._(); - - static SetonixFileTypeMapper? _instance; - static SetonixFileTypeMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = SetonixFileTypeMapper._()); - } - return _instance!; - } - - static SetonixFileType fromValue(dynamic value) { - ensureInitialized(); - return MapperContainer.globals.fromValue(value); - } - - @override - SetonixFileType decode(dynamic value) { - switch (value) { - case r'pack': - return SetonixFileType.pack; - case r'game': - return SetonixFileType.game; - case r'template': - return SetonixFileType.template; - case r'accounts': - return SetonixFileType.accounts; - default: - throw MapperException.unknownEnumValue(value); - } - } - - @override - dynamic encode(SetonixFileType self) { - switch (self) { - case SetonixFileType.pack: - return r'pack'; - case SetonixFileType.game: - return r'game'; - case SetonixFileType.template: - return r'template'; - case SetonixFileType.accounts: - return r'accounts'; - } - } -} - -/// @nodoc - -extension SetonixFileTypeMapperExtension on SetonixFileType { - String toValue() { - SetonixFileTypeMapper.ensureInitialized(); - return MapperContainer.globals.toValue(this) as String; - } -} - -/// @nodoc -class FileMetadataMapper extends ClassMapperBase { - FileMetadataMapper._(); - - static FileMetadataMapper? _instance; - static FileMetadataMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = FileMetadataMapper._()); - SetonixFileTypeMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'FileMetadata'; - - static SetonixFileType _$type(FileMetadata v) => v.type; - static const Field _f$type = Field( - 'type', - _$type, - opt: true, - def: SetonixFileType.pack, - ); - static String _$name(FileMetadata v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - opt: true, - def: '', - ); - static String _$description(FileMetadata v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - def: '', - ); - static String _$author(FileMetadata v) => v.author; - static const Field _f$author = Field( - 'author', - _$author, - opt: true, - def: '', - ); - static String _$version(FileMetadata v) => v.version; - static const Field _f$version = Field( - 'version', - _$version, - opt: true, - def: '', - ); - static Set _$dependencies(FileMetadata v) => v.dependencies; - static const Field> _f$dependencies = Field( - 'dependencies', - _$dependencies, - opt: true, - def: const {}, - ); - static int _$fileVersion(FileMetadata v) => v.fileVersion; - static const Field _f$fileVersion = Field( - 'fileVersion', - _$fileVersion, - opt: true, - def: kFileVersion, - ); - - @override - final MappableFields fields = const { - #type: _f$type, - #name: _f$name, - #description: _f$description, - #author: _f$author, - #version: _f$version, - #dependencies: _f$dependencies, - #fileVersion: _f$fileVersion, - }; - - static FileMetadata _instantiate(DecodingData data) { - return FileMetadata( - type: data.dec(_f$type), - name: data.dec(_f$name), - description: data.dec(_f$description), - author: data.dec(_f$author), - version: data.dec(_f$version), - dependencies: data.dec(_f$dependencies), - fileVersion: data.dec(_f$fileVersion), - ); - } - - @override - final Function instantiate = _instantiate; - - static FileMetadata fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static FileMetadata fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin FileMetadataMappable { - String toJson() { - return FileMetadataMapper.ensureInitialized().encodeJson( - this as FileMetadata, - ); - } - - Map toMap() { - return FileMetadataMapper.ensureInitialized().encodeMap( - this as FileMetadata, - ); - } - - FileMetadataCopyWith get copyWith => - _FileMetadataCopyWithImpl( - this as FileMetadata, - $identity, - $identity, - ); - @override - String toString() { - return FileMetadataMapper.ensureInitialized().stringifyValue( - this as FileMetadata, - ); - } - - @override - bool operator ==(Object other) { - return FileMetadataMapper.ensureInitialized().equalsValue( - this as FileMetadata, - other, - ); - } - - @override - int get hashCode { - return FileMetadataMapper.ensureInitialized().hashValue( - this as FileMetadata, - ); - } -} - -/// @nodoc -extension FileMetadataValueCopy<$R, $Out> - on ObjectCopyWith<$R, FileMetadata, $Out> { - FileMetadataCopyWith<$R, FileMetadata, $Out> get $asFileMetadata => - $base.as((v, t, t2) => _FileMetadataCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class FileMetadataCopyWith<$R, $In extends FileMetadata, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({ - SetonixFileType? type, - String? name, - String? description, - String? author, - String? version, - Set? dependencies, - int? fileVersion, - }); - FileMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _FileMetadataCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, FileMetadata, $Out> - implements FileMetadataCopyWith<$R, FileMetadata, $Out> { - _FileMetadataCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - FileMetadataMapper.ensureInitialized(); - @override - $R call({ - SetonixFileType? type, - String? name, - String? description, - String? author, - String? version, - Set? dependencies, - int? fileVersion, - }) => $apply( - FieldCopyWithData({ - if (type != null) #type: type, - if (name != null) #name: name, - if (description != null) #description: description, - if (author != null) #author: author, - if (version != null) #version: version, - if (dependencies != null) #dependencies: dependencies, - if (fileVersion != null) #fileVersion: fileVersion, - }), - ); - @override - FileMetadata $make(CopyWithData data) => FileMetadata( - type: data.get(#type, or: $value.type), - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - author: data.get(#author, or: $value.author), - version: data.get(#version, or: $value.version), - dependencies: data.get(#dependencies, or: $value.dependencies), - fileVersion: data.get(#fileVersion, or: $value.fileVersion), - ); - - @override - FileMetadataCopyWith<$R2, FileMetadata, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _FileMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class SignatureMetadataMapper extends ClassMapperBase { - SignatureMetadataMapper._(); - - static SignatureMetadataMapper? _instance; - static SignatureMetadataMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = SignatureMetadataMapper._()); - FileMetadataMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'SignatureMetadata'; - - static String _$id(SignatureMetadata v) => v.id; - static const Field _f$id = Field('id', _$id); - static FileMetadata _$metadata(SignatureMetadata v) => v.metadata; - static const Field _f$metadata = Field( - 'metadata', - _$metadata, - ); - static List _$downloadUrls(SignatureMetadata v) => v.downloadUrls; - static const Field> _f$downloadUrls = Field( - 'downloadUrls', - _$downloadUrls, - opt: true, - def: const [], - ); - - @override - final MappableFields fields = const { - #id: _f$id, - #metadata: _f$metadata, - #downloadUrls: _f$downloadUrls, - }; - - static SignatureMetadata _instantiate(DecodingData data) { - return SignatureMetadata( - id: data.dec(_f$id), - metadata: data.dec(_f$metadata), - downloadUrls: data.dec(_f$downloadUrls), - ); - } - - @override - final Function instantiate = _instantiate; - - static SignatureMetadata fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static SignatureMetadata fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin SignatureMetadataMappable { - String toJson() { - return SignatureMetadataMapper.ensureInitialized() - .encodeJson(this as SignatureMetadata); - } - - Map toMap() { - return SignatureMetadataMapper.ensureInitialized() - .encodeMap(this as SignatureMetadata); - } - - SignatureMetadataCopyWith< - SignatureMetadata, - SignatureMetadata, - SignatureMetadata - > - get copyWith => - _SignatureMetadataCopyWithImpl( - this as SignatureMetadata, - $identity, - $identity, - ); - @override - String toString() { - return SignatureMetadataMapper.ensureInitialized().stringifyValue( - this as SignatureMetadata, - ); - } - - @override - bool operator ==(Object other) { - return SignatureMetadataMapper.ensureInitialized().equalsValue( - this as SignatureMetadata, - other, - ); - } - - @override - int get hashCode { - return SignatureMetadataMapper.ensureInitialized().hashValue( - this as SignatureMetadata, - ); - } -} - -/// @nodoc -extension SignatureMetadataValueCopy<$R, $Out> - on ObjectCopyWith<$R, SignatureMetadata, $Out> { - SignatureMetadataCopyWith<$R, SignatureMetadata, $Out> - get $asSignatureMetadata => $base.as( - (v, t, t2) => _SignatureMetadataCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class SignatureMetadataCopyWith< - $R, - $In extends SignatureMetadata, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata; - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get downloadUrls; - $R call({String? id, FileMetadata? metadata, List? downloadUrls}); - SignatureMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _SignatureMetadataCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, SignatureMetadata, $Out> - implements SignatureMetadataCopyWith<$R, SignatureMetadata, $Out> { - _SignatureMetadataCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - SignatureMetadataMapper.ensureInitialized(); - @override - FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata => - $value.metadata.copyWith.$chain((v) => call(metadata: v)); - @override - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> - get downloadUrls => ListCopyWith( - $value.downloadUrls, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(downloadUrls: v), - ); - @override - $R call({String? id, FileMetadata? metadata, List? downloadUrls}) => - $apply( - FieldCopyWithData({ - if (id != null) #id: id, - if (metadata != null) #metadata: metadata, - if (downloadUrls != null) #downloadUrls: downloadUrls, - }), - ); - @override - SignatureMetadata $make(CopyWithData data) => SignatureMetadata( - id: data.get(#id, or: $value.id), - metadata: data.get(#metadata, or: $value.metadata), - downloadUrls: data.get(#downloadUrls, or: $value.downloadUrls), - ); - - @override - SignatureMetadataCopyWith<$R2, SignatureMetadata, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _SignatureMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DataMetadataMapper extends ClassMapperBase { - DataMetadataMapper._(); - - static DataMetadataMapper? _instance; - static DataMetadataMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DataMetadataMapper._()); - } - return _instance!; - } - - @override - final String id = 'DataMetadata'; - - static bool _$manuallyAdded(DataMetadata v) => v.manuallyAdded; - static const Field _f$manuallyAdded = Field( - 'manuallyAdded', - _$manuallyAdded, - opt: true, - def: true, - ); - static DateTime _$addedAt(DataMetadata v) => v.addedAt; - static const Field _f$addedAt = Field( - 'addedAt', - _$addedAt, - ); - static Map _$serversLastUsed(DataMetadata v) => - v.serversLastUsed; - static const Field> _f$serversLastUsed = - Field('serversLastUsed', _$serversLastUsed, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #manuallyAdded: _f$manuallyAdded, - #addedAt: _f$addedAt, - #serversLastUsed: _f$serversLastUsed, - }; - - static DataMetadata _instantiate(DecodingData data) { - return DataMetadata( - manuallyAdded: data.dec(_f$manuallyAdded), - addedAt: data.dec(_f$addedAt), - serversLastUsed: data.dec(_f$serversLastUsed), - ); - } - - @override - final Function instantiate = _instantiate; - - static DataMetadata fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DataMetadata fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DataMetadataMappable { - String toJson() { - return DataMetadataMapper.ensureInitialized().encodeJson( - this as DataMetadata, - ); - } - - Map toMap() { - return DataMetadataMapper.ensureInitialized().encodeMap( - this as DataMetadata, - ); - } - - DataMetadataCopyWith get copyWith => - _DataMetadataCopyWithImpl( - this as DataMetadata, - $identity, - $identity, - ); - @override - String toString() { - return DataMetadataMapper.ensureInitialized().stringifyValue( - this as DataMetadata, - ); - } - - @override - bool operator ==(Object other) { - return DataMetadataMapper.ensureInitialized().equalsValue( - this as DataMetadata, - other, - ); - } - - @override - int get hashCode { - return DataMetadataMapper.ensureInitialized().hashValue( - this as DataMetadata, - ); - } -} - -/// @nodoc -extension DataMetadataValueCopy<$R, $Out> - on ObjectCopyWith<$R, DataMetadata, $Out> { - DataMetadataCopyWith<$R, DataMetadata, $Out> get $asDataMetadata => - $base.as((v, t, t2) => _DataMetadataCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class DataMetadataCopyWith<$R, $In extends DataMetadata, $Out> - implements ClassCopyWith<$R, $In, $Out> { - MapCopyWith<$R, String, DateTime, ObjectCopyWith<$R, DateTime, DateTime>> - get serversLastUsed; - $R call({ - bool? manuallyAdded, - DateTime? addedAt, - Map? serversLastUsed, - }); - DataMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _DataMetadataCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DataMetadata, $Out> - implements DataMetadataCopyWith<$R, DataMetadata, $Out> { - _DataMetadataCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - DataMetadataMapper.ensureInitialized(); - @override - MapCopyWith<$R, String, DateTime, ObjectCopyWith<$R, DateTime, DateTime>> - get serversLastUsed => MapCopyWith( - $value.serversLastUsed, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(serversLastUsed: v), - ); - @override - $R call({ - bool? manuallyAdded, - DateTime? addedAt, - Map? serversLastUsed, - }) => $apply( - FieldCopyWithData({ - if (manuallyAdded != null) #manuallyAdded: manuallyAdded, - if (addedAt != null) #addedAt: addedAt, - if (serversLastUsed != null) #serversLastUsed: serversLastUsed, - }), - ); - @override - DataMetadata $make(CopyWithData data) => DataMetadata( - manuallyAdded: data.get(#manuallyAdded, or: $value.manuallyAdded), - addedAt: data.get(#addedAt, or: $value.addedAt), - serversLastUsed: data.get(#serversLastUsed, or: $value.serversLastUsed), - ); - - @override - DataMetadataCopyWith<$R2, DataMetadata, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _DataMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'meta.dart'; + +/// @nodoc + +class SetonixFileTypeMapper extends EnumMapper { + SetonixFileTypeMapper._(); + + static SetonixFileTypeMapper? _instance; + static SetonixFileTypeMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = SetonixFileTypeMapper._()); + } + return _instance!; + } + + static SetonixFileType fromValue(dynamic value) { + ensureInitialized(); + return MapperContainer.globals.fromValue(value); + } + + @override + SetonixFileType decode(dynamic value) { + switch (value) { + case r'pack': + return SetonixFileType.pack; + case r'game': + return SetonixFileType.game; + case r'template': + return SetonixFileType.template; + case r'accounts': + return SetonixFileType.accounts; + default: + throw MapperException.unknownEnumValue(value); + } + } + + @override + dynamic encode(SetonixFileType self) { + switch (self) { + case SetonixFileType.pack: + return r'pack'; + case SetonixFileType.game: + return r'game'; + case SetonixFileType.template: + return r'template'; + case SetonixFileType.accounts: + return r'accounts'; + } + } +} + +/// @nodoc + +extension SetonixFileTypeMapperExtension on SetonixFileType { + String toValue() { + SetonixFileTypeMapper.ensureInitialized(); + return MapperContainer.globals.toValue(this) as String; + } +} + +/// @nodoc +class FileMetadataMapper extends ClassMapperBase { + FileMetadataMapper._(); + + static FileMetadataMapper? _instance; + static FileMetadataMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = FileMetadataMapper._()); + SetonixFileTypeMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'FileMetadata'; + + static SetonixFileType _$type(FileMetadata v) => v.type; + static const Field _f$type = Field( + 'type', + _$type, + opt: true, + def: SetonixFileType.pack, + ); + static String _$name(FileMetadata v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + opt: true, + def: '', + ); + static String _$description(FileMetadata v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + def: '', + ); + static String _$author(FileMetadata v) => v.author; + static const Field _f$author = Field( + 'author', + _$author, + opt: true, + def: '', + ); + static String _$version(FileMetadata v) => v.version; + static const Field _f$version = Field( + 'version', + _$version, + opt: true, + def: '', + ); + static Set _$dependencies(FileMetadata v) => v.dependencies; + static const Field> _f$dependencies = Field( + 'dependencies', + _$dependencies, + opt: true, + def: const {}, + ); + static int _$fileVersion(FileMetadata v) => v.fileVersion; + static const Field _f$fileVersion = Field( + 'fileVersion', + _$fileVersion, + opt: true, + def: kFileVersion, + ); + + @override + final MappableFields fields = const { + #type: _f$type, + #name: _f$name, + #description: _f$description, + #author: _f$author, + #version: _f$version, + #dependencies: _f$dependencies, + #fileVersion: _f$fileVersion, + }; + + static FileMetadata _instantiate(DecodingData data) { + return FileMetadata( + type: data.dec(_f$type), + name: data.dec(_f$name), + description: data.dec(_f$description), + author: data.dec(_f$author), + version: data.dec(_f$version), + dependencies: data.dec(_f$dependencies), + fileVersion: data.dec(_f$fileVersion), + ); + } + + @override + final Function instantiate = _instantiate; + + static FileMetadata fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static FileMetadata fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin FileMetadataMappable { + String toJson() { + return FileMetadataMapper.ensureInitialized().encodeJson( + this as FileMetadata, + ); + } + + Map toMap() { + return FileMetadataMapper.ensureInitialized().encodeMap( + this as FileMetadata, + ); + } + + FileMetadataCopyWith get copyWith => + _FileMetadataCopyWithImpl( + this as FileMetadata, + $identity, + $identity, + ); + @override + String toString() { + return FileMetadataMapper.ensureInitialized().stringifyValue( + this as FileMetadata, + ); + } + + @override + bool operator ==(Object other) { + return FileMetadataMapper.ensureInitialized().equalsValue( + this as FileMetadata, + other, + ); + } + + @override + int get hashCode { + return FileMetadataMapper.ensureInitialized().hashValue( + this as FileMetadata, + ); + } +} + +/// @nodoc +extension FileMetadataValueCopy<$R, $Out> + on ObjectCopyWith<$R, FileMetadata, $Out> { + FileMetadataCopyWith<$R, FileMetadata, $Out> get $asFileMetadata => + $base.as((v, t, t2) => _FileMetadataCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class FileMetadataCopyWith<$R, $In extends FileMetadata, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({ + SetonixFileType? type, + String? name, + String? description, + String? author, + String? version, + Set? dependencies, + int? fileVersion, + }); + FileMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _FileMetadataCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, FileMetadata, $Out> + implements FileMetadataCopyWith<$R, FileMetadata, $Out> { + _FileMetadataCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + FileMetadataMapper.ensureInitialized(); + @override + $R call({ + SetonixFileType? type, + String? name, + String? description, + String? author, + String? version, + Set? dependencies, + int? fileVersion, + }) => $apply( + FieldCopyWithData({ + if (type != null) #type: type, + if (name != null) #name: name, + if (description != null) #description: description, + if (author != null) #author: author, + if (version != null) #version: version, + if (dependencies != null) #dependencies: dependencies, + if (fileVersion != null) #fileVersion: fileVersion, + }), + ); + @override + FileMetadata $make(CopyWithData data) => FileMetadata( + type: data.get(#type, or: $value.type), + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + author: data.get(#author, or: $value.author), + version: data.get(#version, or: $value.version), + dependencies: data.get(#dependencies, or: $value.dependencies), + fileVersion: data.get(#fileVersion, or: $value.fileVersion), + ); + + @override + FileMetadataCopyWith<$R2, FileMetadata, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _FileMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class SignatureMetadataMapper extends ClassMapperBase { + SignatureMetadataMapper._(); + + static SignatureMetadataMapper? _instance; + static SignatureMetadataMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = SignatureMetadataMapper._()); + FileMetadataMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'SignatureMetadata'; + + static String _$id(SignatureMetadata v) => v.id; + static const Field _f$id = Field('id', _$id); + static FileMetadata _$metadata(SignatureMetadata v) => v.metadata; + static const Field _f$metadata = Field( + 'metadata', + _$metadata, + ); + static List _$downloadUrls(SignatureMetadata v) => v.downloadUrls; + static const Field> _f$downloadUrls = Field( + 'downloadUrls', + _$downloadUrls, + opt: true, + def: const [], + ); + + @override + final MappableFields fields = const { + #id: _f$id, + #metadata: _f$metadata, + #downloadUrls: _f$downloadUrls, + }; + + static SignatureMetadata _instantiate(DecodingData data) { + return SignatureMetadata( + id: data.dec(_f$id), + metadata: data.dec(_f$metadata), + downloadUrls: data.dec(_f$downloadUrls), + ); + } + + @override + final Function instantiate = _instantiate; + + static SignatureMetadata fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static SignatureMetadata fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin SignatureMetadataMappable { + String toJson() { + return SignatureMetadataMapper.ensureInitialized() + .encodeJson(this as SignatureMetadata); + } + + Map toMap() { + return SignatureMetadataMapper.ensureInitialized() + .encodeMap(this as SignatureMetadata); + } + + SignatureMetadataCopyWith< + SignatureMetadata, + SignatureMetadata, + SignatureMetadata + > + get copyWith => + _SignatureMetadataCopyWithImpl( + this as SignatureMetadata, + $identity, + $identity, + ); + @override + String toString() { + return SignatureMetadataMapper.ensureInitialized().stringifyValue( + this as SignatureMetadata, + ); + } + + @override + bool operator ==(Object other) { + return SignatureMetadataMapper.ensureInitialized().equalsValue( + this as SignatureMetadata, + other, + ); + } + + @override + int get hashCode { + return SignatureMetadataMapper.ensureInitialized().hashValue( + this as SignatureMetadata, + ); + } +} + +/// @nodoc +extension SignatureMetadataValueCopy<$R, $Out> + on ObjectCopyWith<$R, SignatureMetadata, $Out> { + SignatureMetadataCopyWith<$R, SignatureMetadata, $Out> + get $asSignatureMetadata => $base.as( + (v, t, t2) => _SignatureMetadataCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class SignatureMetadataCopyWith< + $R, + $In extends SignatureMetadata, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata; + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get downloadUrls; + $R call({String? id, FileMetadata? metadata, List? downloadUrls}); + SignatureMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _SignatureMetadataCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, SignatureMetadata, $Out> + implements SignatureMetadataCopyWith<$R, SignatureMetadata, $Out> { + _SignatureMetadataCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + SignatureMetadataMapper.ensureInitialized(); + @override + FileMetadataCopyWith<$R, FileMetadata, FileMetadata> get metadata => + $value.metadata.copyWith.$chain((v) => call(metadata: v)); + @override + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> + get downloadUrls => ListCopyWith( + $value.downloadUrls, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(downloadUrls: v), + ); + @override + $R call({String? id, FileMetadata? metadata, List? downloadUrls}) => + $apply( + FieldCopyWithData({ + if (id != null) #id: id, + if (metadata != null) #metadata: metadata, + if (downloadUrls != null) #downloadUrls: downloadUrls, + }), + ); + @override + SignatureMetadata $make(CopyWithData data) => SignatureMetadata( + id: data.get(#id, or: $value.id), + metadata: data.get(#metadata, or: $value.metadata), + downloadUrls: data.get(#downloadUrls, or: $value.downloadUrls), + ); + + @override + SignatureMetadataCopyWith<$R2, SignatureMetadata, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _SignatureMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DataMetadataMapper extends ClassMapperBase { + DataMetadataMapper._(); + + static DataMetadataMapper? _instance; + static DataMetadataMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DataMetadataMapper._()); + } + return _instance!; + } + + @override + final String id = 'DataMetadata'; + + static bool _$manuallyAdded(DataMetadata v) => v.manuallyAdded; + static const Field _f$manuallyAdded = Field( + 'manuallyAdded', + _$manuallyAdded, + opt: true, + def: true, + ); + static DateTime _$addedAt(DataMetadata v) => v.addedAt; + static const Field _f$addedAt = Field( + 'addedAt', + _$addedAt, + ); + static Map _$serversLastUsed(DataMetadata v) => + v.serversLastUsed; + static const Field> _f$serversLastUsed = + Field('serversLastUsed', _$serversLastUsed, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #manuallyAdded: _f$manuallyAdded, + #addedAt: _f$addedAt, + #serversLastUsed: _f$serversLastUsed, + }; + + static DataMetadata _instantiate(DecodingData data) { + return DataMetadata( + manuallyAdded: data.dec(_f$manuallyAdded), + addedAt: data.dec(_f$addedAt), + serversLastUsed: data.dec(_f$serversLastUsed), + ); + } + + @override + final Function instantiate = _instantiate; + + static DataMetadata fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DataMetadata fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DataMetadataMappable { + String toJson() { + return DataMetadataMapper.ensureInitialized().encodeJson( + this as DataMetadata, + ); + } + + Map toMap() { + return DataMetadataMapper.ensureInitialized().encodeMap( + this as DataMetadata, + ); + } + + DataMetadataCopyWith get copyWith => + _DataMetadataCopyWithImpl( + this as DataMetadata, + $identity, + $identity, + ); + @override + String toString() { + return DataMetadataMapper.ensureInitialized().stringifyValue( + this as DataMetadata, + ); + } + + @override + bool operator ==(Object other) { + return DataMetadataMapper.ensureInitialized().equalsValue( + this as DataMetadata, + other, + ); + } + + @override + int get hashCode { + return DataMetadataMapper.ensureInitialized().hashValue( + this as DataMetadata, + ); + } +} + +/// @nodoc +extension DataMetadataValueCopy<$R, $Out> + on ObjectCopyWith<$R, DataMetadata, $Out> { + DataMetadataCopyWith<$R, DataMetadata, $Out> get $asDataMetadata => + $base.as((v, t, t2) => _DataMetadataCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class DataMetadataCopyWith<$R, $In extends DataMetadata, $Out> + implements ClassCopyWith<$R, $In, $Out> { + MapCopyWith<$R, String, DateTime, ObjectCopyWith<$R, DateTime, DateTime>> + get serversLastUsed; + $R call({ + bool? manuallyAdded, + DateTime? addedAt, + Map? serversLastUsed, + }); + DataMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _DataMetadataCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DataMetadata, $Out> + implements DataMetadataCopyWith<$R, DataMetadata, $Out> { + _DataMetadataCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + DataMetadataMapper.ensureInitialized(); + @override + MapCopyWith<$R, String, DateTime, ObjectCopyWith<$R, DateTime, DateTime>> + get serversLastUsed => MapCopyWith( + $value.serversLastUsed, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(serversLastUsed: v), + ); + @override + $R call({ + bool? manuallyAdded, + DateTime? addedAt, + Map? serversLastUsed, + }) => $apply( + FieldCopyWithData({ + if (manuallyAdded != null) #manuallyAdded: manuallyAdded, + if (addedAt != null) #addedAt: addedAt, + if (serversLastUsed != null) #serversLastUsed: serversLastUsed, + }), + ); + @override + DataMetadata $make(CopyWithData data) => DataMetadata( + manuallyAdded: data.get(#manuallyAdded, or: $value.manuallyAdded), + addedAt: data.get(#addedAt, or: $value.addedAt), + serversLastUsed: data.get(#serversLastUsed, or: $value.serversLastUsed), + ); + + @override + DataMetadataCopyWith<$R2, DataMetadata, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _DataMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/table.mapper.dart b/api/lib/src/models/table.mapper.dart index 083d3f04..89fc937f 100644 --- a/api/lib/src/models/table.mapper.dart +++ b/api/lib/src/models/table.mapper.dart @@ -1,182 +1,182 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'table.dart'; - -/// @nodoc -class GameTableMapper extends ClassMapperBase { - GameTableMapper._(); - - static GameTableMapper? _instance; - static GameTableMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameTableMapper._()); - IgnoreEqualityBoxMapper.ensureInitialized(); - VectorDefinitionMapper.ensureInitialized(); - TableCellMapper.ensureInitialized(); - ItemLocationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameTable'; - - static IgnoreEqualityBox> _$cellsBox( - GameTable v, - ) => v.cellsBox; - static const Field< - GameTable, - IgnoreEqualityBox> - > - _f$cellsBox = Field( - 'cellsBox', - _$cellsBox, - key: r'cells', - opt: true, - def: const IgnoreEqualityBox({}), - ); - static ItemLocation? _$background(GameTable v) => v.background; - static const Field _f$background = Field( - 'background', - _$background, - opt: true, - ); - - @override - final MappableFields fields = const { - #cellsBox: _f$cellsBox, - #background: _f$background, - }; - - static GameTable _instantiate(DecodingData data) { - return GameTable( - cellsBox: data.dec(_f$cellsBox), - background: data.dec(_f$background), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameTable fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameTable fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameTableMappable { - String toJson() { - return GameTableMapper.ensureInitialized().encodeJson( - this as GameTable, - ); - } - - Map toMap() { - return GameTableMapper.ensureInitialized().encodeMap( - this as GameTable, - ); - } - - GameTableCopyWith get copyWith => - _GameTableCopyWithImpl( - this as GameTable, - $identity, - $identity, - ); - @override - String toString() { - return GameTableMapper.ensureInitialized().stringifyValue( - this as GameTable, - ); - } - - @override - bool operator ==(Object other) { - return GameTableMapper.ensureInitialized().equalsValue( - this as GameTable, - other, - ); - } - - @override - int get hashCode { - return GameTableMapper.ensureInitialized().hashValue(this as GameTable); - } -} - -/// @nodoc -extension GameTableValueCopy<$R, $Out> on ObjectCopyWith<$R, GameTable, $Out> { - GameTableCopyWith<$R, GameTable, $Out> get $asGameTable => - $base.as((v, t, t2) => _GameTableCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameTableCopyWith<$R, $In extends GameTable, $Out> - implements ClassCopyWith<$R, $In, $Out> { - IgnoreEqualityBoxCopyWith< - $R, - IgnoreEqualityBox>, - IgnoreEqualityBox>, - Map - > - get cellsBox; - ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get background; - $R call({ - IgnoreEqualityBox>? cellsBox, - ItemLocation? background, - }); - GameTableCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _GameTableCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameTable, $Out> - implements GameTableCopyWith<$R, GameTable, $Out> { - _GameTableCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameTableMapper.ensureInitialized(); - @override - IgnoreEqualityBoxCopyWith< - $R, - IgnoreEqualityBox>, - IgnoreEqualityBox>, - Map - > - get cellsBox => $value.cellsBox.copyWith.$chain((v) => call(cellsBox: v)); - @override - ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get background => - $value.background?.copyWith.$chain((v) => call(background: v)); - @override - $R call({ - IgnoreEqualityBox>? cellsBox, - Object? background = $none, - }) => $apply( - FieldCopyWithData({ - if (cellsBox != null) #cellsBox: cellsBox, - if (background != $none) #background: background, - }), - ); - @override - GameTable $make(CopyWithData data) => GameTable( - cellsBox: data.get(#cellsBox, or: $value.cellsBox), - background: data.get(#background, or: $value.background), - ); - - @override - GameTableCopyWith<$R2, GameTable, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameTableCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'table.dart'; + +/// @nodoc +class GameTableMapper extends ClassMapperBase { + GameTableMapper._(); + + static GameTableMapper? _instance; + static GameTableMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameTableMapper._()); + IgnoreEqualityBoxMapper.ensureInitialized(); + VectorDefinitionMapper.ensureInitialized(); + TableCellMapper.ensureInitialized(); + ItemLocationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameTable'; + + static IgnoreEqualityBox> _$cellsBox( + GameTable v, + ) => v.cellsBox; + static const Field< + GameTable, + IgnoreEqualityBox> + > + _f$cellsBox = Field( + 'cellsBox', + _$cellsBox, + key: r'cells', + opt: true, + def: const IgnoreEqualityBox({}), + ); + static ItemLocation? _$background(GameTable v) => v.background; + static const Field _f$background = Field( + 'background', + _$background, + opt: true, + ); + + @override + final MappableFields fields = const { + #cellsBox: _f$cellsBox, + #background: _f$background, + }; + + static GameTable _instantiate(DecodingData data) { + return GameTable( + cellsBox: data.dec(_f$cellsBox), + background: data.dec(_f$background), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameTable fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameTable fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameTableMappable { + String toJson() { + return GameTableMapper.ensureInitialized().encodeJson( + this as GameTable, + ); + } + + Map toMap() { + return GameTableMapper.ensureInitialized().encodeMap( + this as GameTable, + ); + } + + GameTableCopyWith get copyWith => + _GameTableCopyWithImpl( + this as GameTable, + $identity, + $identity, + ); + @override + String toString() { + return GameTableMapper.ensureInitialized().stringifyValue( + this as GameTable, + ); + } + + @override + bool operator ==(Object other) { + return GameTableMapper.ensureInitialized().equalsValue( + this as GameTable, + other, + ); + } + + @override + int get hashCode { + return GameTableMapper.ensureInitialized().hashValue(this as GameTable); + } +} + +/// @nodoc +extension GameTableValueCopy<$R, $Out> on ObjectCopyWith<$R, GameTable, $Out> { + GameTableCopyWith<$R, GameTable, $Out> get $asGameTable => + $base.as((v, t, t2) => _GameTableCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameTableCopyWith<$R, $In extends GameTable, $Out> + implements ClassCopyWith<$R, $In, $Out> { + IgnoreEqualityBoxCopyWith< + $R, + IgnoreEqualityBox>, + IgnoreEqualityBox>, + Map + > + get cellsBox; + ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get background; + $R call({ + IgnoreEqualityBox>? cellsBox, + ItemLocation? background, + }); + GameTableCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _GameTableCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameTable, $Out> + implements GameTableCopyWith<$R, GameTable, $Out> { + _GameTableCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameTableMapper.ensureInitialized(); + @override + IgnoreEqualityBoxCopyWith< + $R, + IgnoreEqualityBox>, + IgnoreEqualityBox>, + Map + > + get cellsBox => $value.cellsBox.copyWith.$chain((v) => call(cellsBox: v)); + @override + ItemLocationCopyWith<$R, ItemLocation, ItemLocation>? get background => + $value.background?.copyWith.$chain((v) => call(background: v)); + @override + $R call({ + IgnoreEqualityBox>? cellsBox, + Object? background = $none, + }) => $apply( + FieldCopyWithData({ + if (cellsBox != null) #cellsBox: cellsBox, + if (background != $none) #background: background, + }), + ); + @override + GameTable $make(CopyWithData data) => GameTable( + cellsBox: data.get(#cellsBox, or: $value.cellsBox), + background: data.get(#background, or: $value.background), + ); + + @override + GameTableCopyWith<$R2, GameTable, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameTableCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/toolbar.dart b/api/lib/src/models/toolbar.dart index 6a25321c..33e9c56b 100644 --- a/api/lib/src/models/toolbar.dart +++ b/api/lib/src/models/toolbar.dart @@ -1,24 +1,24 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -part "toolbar.mapper.dart"; - -@MappableClass() -final class GameToolbar with GameToolbarMappable { - final bool editable; - final List actions; - - const GameToolbar({this.editable = true, this.actions = const []}); -} - -@MappableClass() -final class ToolbarAction with ToolbarActionMappable { - final String id; - final String label; - final bool enabled; - - const ToolbarAction({ - required this.id, - required this.label, - this.enabled = true, - }); -} +import 'package:dart_mappable/dart_mappable.dart'; + +part "toolbar.mapper.dart"; + +@MappableClass() +final class GameToolbar with GameToolbarMappable { + final bool editable; + final List actions; + + const GameToolbar({this.editable = true, this.actions = const []}); +} + +@MappableClass() +final class ToolbarAction with ToolbarActionMappable { + final String id; + final String label; + final bool enabled; + + const ToolbarAction({ + required this.id, + required this.label, + this.enabled = true, + }); +} diff --git a/api/lib/src/models/toolbar.mapper.dart b/api/lib/src/models/toolbar.mapper.dart index 20217ce8..91393163 100644 --- a/api/lib/src/models/toolbar.mapper.dart +++ b/api/lib/src/models/toolbar.mapper.dart @@ -1,307 +1,307 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'toolbar.dart'; - -/// @nodoc -class GameToolbarMapper extends ClassMapperBase { - GameToolbarMapper._(); - - static GameToolbarMapper? _instance; - static GameToolbarMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GameToolbarMapper._()); - ToolbarActionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'GameToolbar'; - - static bool _$editable(GameToolbar v) => v.editable; - static const Field _f$editable = Field( - 'editable', - _$editable, - opt: true, - def: true, - ); - static List _$actions(GameToolbar v) => v.actions; - static const Field> _f$actions = Field( - 'actions', - _$actions, - opt: true, - def: const [], - ); - - @override - final MappableFields fields = const { - #editable: _f$editable, - #actions: _f$actions, - }; - - static GameToolbar _instantiate(DecodingData data) { - return GameToolbar( - editable: data.dec(_f$editable), - actions: data.dec(_f$actions), - ); - } - - @override - final Function instantiate = _instantiate; - - static GameToolbar fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GameToolbar fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GameToolbarMappable { - String toJson() { - return GameToolbarMapper.ensureInitialized().encodeJson( - this as GameToolbar, - ); - } - - Map toMap() { - return GameToolbarMapper.ensureInitialized().encodeMap( - this as GameToolbar, - ); - } - - GameToolbarCopyWith get copyWith => - _GameToolbarCopyWithImpl( - this as GameToolbar, - $identity, - $identity, - ); - @override - String toString() { - return GameToolbarMapper.ensureInitialized().stringifyValue( - this as GameToolbar, - ); - } - - @override - bool operator ==(Object other) { - return GameToolbarMapper.ensureInitialized().equalsValue( - this as GameToolbar, - other, - ); - } - - @override - int get hashCode { - return GameToolbarMapper.ensureInitialized().hashValue(this as GameToolbar); - } -} - -/// @nodoc -extension GameToolbarValueCopy<$R, $Out> - on ObjectCopyWith<$R, GameToolbar, $Out> { - GameToolbarCopyWith<$R, GameToolbar, $Out> get $asGameToolbar => - $base.as((v, t, t2) => _GameToolbarCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class GameToolbarCopyWith<$R, $In extends GameToolbar, $Out> - implements ClassCopyWith<$R, $In, $Out> { - ListCopyWith< - $R, - ToolbarAction, - ToolbarActionCopyWith<$R, ToolbarAction, ToolbarAction> - > - get actions; - $R call({bool? editable, List? actions}); - GameToolbarCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _GameToolbarCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GameToolbar, $Out> - implements GameToolbarCopyWith<$R, GameToolbar, $Out> { - _GameToolbarCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GameToolbarMapper.ensureInitialized(); - @override - ListCopyWith< - $R, - ToolbarAction, - ToolbarActionCopyWith<$R, ToolbarAction, ToolbarAction> - > - get actions => ListCopyWith( - $value.actions, - (v, t) => v.copyWith.$chain(t), - (v) => call(actions: v), - ); - @override - $R call({bool? editable, List? actions}) => $apply( - FieldCopyWithData({ - if (editable != null) #editable: editable, - if (actions != null) #actions: actions, - }), - ); - @override - GameToolbar $make(CopyWithData data) => GameToolbar( - editable: data.get(#editable, or: $value.editable), - actions: data.get(#actions, or: $value.actions), - ); - - @override - GameToolbarCopyWith<$R2, GameToolbar, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _GameToolbarCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ToolbarActionMapper extends ClassMapperBase { - ToolbarActionMapper._(); - - static ToolbarActionMapper? _instance; - static ToolbarActionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ToolbarActionMapper._()); - } - return _instance!; - } - - @override - final String id = 'ToolbarAction'; - - static String _$id(ToolbarAction v) => v.id; - static const Field _f$id = Field('id', _$id); - static String _$label(ToolbarAction v) => v.label; - static const Field _f$label = Field('label', _$label); - static bool _$enabled(ToolbarAction v) => v.enabled; - static const Field _f$enabled = Field( - 'enabled', - _$enabled, - opt: true, - def: true, - ); - - @override - final MappableFields fields = const { - #id: _f$id, - #label: _f$label, - #enabled: _f$enabled, - }; - - static ToolbarAction _instantiate(DecodingData data) { - return ToolbarAction( - id: data.dec(_f$id), - label: data.dec(_f$label), - enabled: data.dec(_f$enabled), - ); - } - - @override - final Function instantiate = _instantiate; - - static ToolbarAction fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ToolbarAction fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ToolbarActionMappable { - String toJson() { - return ToolbarActionMapper.ensureInitialized().encodeJson( - this as ToolbarAction, - ); - } - - Map toMap() { - return ToolbarActionMapper.ensureInitialized().encodeMap( - this as ToolbarAction, - ); - } - - ToolbarActionCopyWith - get copyWith => _ToolbarActionCopyWithImpl( - this as ToolbarAction, - $identity, - $identity, - ); - @override - String toString() { - return ToolbarActionMapper.ensureInitialized().stringifyValue( - this as ToolbarAction, - ); - } - - @override - bool operator ==(Object other) { - return ToolbarActionMapper.ensureInitialized().equalsValue( - this as ToolbarAction, - other, - ); - } - - @override - int get hashCode { - return ToolbarActionMapper.ensureInitialized().hashValue( - this as ToolbarAction, - ); - } -} - -/// @nodoc -extension ToolbarActionValueCopy<$R, $Out> - on ObjectCopyWith<$R, ToolbarAction, $Out> { - ToolbarActionCopyWith<$R, ToolbarAction, $Out> get $asToolbarAction => - $base.as((v, t, t2) => _ToolbarActionCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ToolbarActionCopyWith<$R, $In extends ToolbarAction, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? id, String? label, bool? enabled}); - ToolbarActionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _ToolbarActionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ToolbarAction, $Out> - implements ToolbarActionCopyWith<$R, ToolbarAction, $Out> { - _ToolbarActionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ToolbarActionMapper.ensureInitialized(); - @override - $R call({String? id, String? label, bool? enabled}) => $apply( - FieldCopyWithData({ - if (id != null) #id: id, - if (label != null) #label: label, - if (enabled != null) #enabled: enabled, - }), - ); - @override - ToolbarAction $make(CopyWithData data) => ToolbarAction( - id: data.get(#id, or: $value.id), - label: data.get(#label, or: $value.label), - enabled: data.get(#enabled, or: $value.enabled), - ); - - @override - ToolbarActionCopyWith<$R2, ToolbarAction, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ToolbarActionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'toolbar.dart'; + +/// @nodoc +class GameToolbarMapper extends ClassMapperBase { + GameToolbarMapper._(); + + static GameToolbarMapper? _instance; + static GameToolbarMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GameToolbarMapper._()); + ToolbarActionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'GameToolbar'; + + static bool _$editable(GameToolbar v) => v.editable; + static const Field _f$editable = Field( + 'editable', + _$editable, + opt: true, + def: true, + ); + static List _$actions(GameToolbar v) => v.actions; + static const Field> _f$actions = Field( + 'actions', + _$actions, + opt: true, + def: const [], + ); + + @override + final MappableFields fields = const { + #editable: _f$editable, + #actions: _f$actions, + }; + + static GameToolbar _instantiate(DecodingData data) { + return GameToolbar( + editable: data.dec(_f$editable), + actions: data.dec(_f$actions), + ); + } + + @override + final Function instantiate = _instantiate; + + static GameToolbar fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GameToolbar fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GameToolbarMappable { + String toJson() { + return GameToolbarMapper.ensureInitialized().encodeJson( + this as GameToolbar, + ); + } + + Map toMap() { + return GameToolbarMapper.ensureInitialized().encodeMap( + this as GameToolbar, + ); + } + + GameToolbarCopyWith get copyWith => + _GameToolbarCopyWithImpl( + this as GameToolbar, + $identity, + $identity, + ); + @override + String toString() { + return GameToolbarMapper.ensureInitialized().stringifyValue( + this as GameToolbar, + ); + } + + @override + bool operator ==(Object other) { + return GameToolbarMapper.ensureInitialized().equalsValue( + this as GameToolbar, + other, + ); + } + + @override + int get hashCode { + return GameToolbarMapper.ensureInitialized().hashValue(this as GameToolbar); + } +} + +/// @nodoc +extension GameToolbarValueCopy<$R, $Out> + on ObjectCopyWith<$R, GameToolbar, $Out> { + GameToolbarCopyWith<$R, GameToolbar, $Out> get $asGameToolbar => + $base.as((v, t, t2) => _GameToolbarCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class GameToolbarCopyWith<$R, $In extends GameToolbar, $Out> + implements ClassCopyWith<$R, $In, $Out> { + ListCopyWith< + $R, + ToolbarAction, + ToolbarActionCopyWith<$R, ToolbarAction, ToolbarAction> + > + get actions; + $R call({bool? editable, List? actions}); + GameToolbarCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _GameToolbarCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GameToolbar, $Out> + implements GameToolbarCopyWith<$R, GameToolbar, $Out> { + _GameToolbarCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GameToolbarMapper.ensureInitialized(); + @override + ListCopyWith< + $R, + ToolbarAction, + ToolbarActionCopyWith<$R, ToolbarAction, ToolbarAction> + > + get actions => ListCopyWith( + $value.actions, + (v, t) => v.copyWith.$chain(t), + (v) => call(actions: v), + ); + @override + $R call({bool? editable, List? actions}) => $apply( + FieldCopyWithData({ + if (editable != null) #editable: editable, + if (actions != null) #actions: actions, + }), + ); + @override + GameToolbar $make(CopyWithData data) => GameToolbar( + editable: data.get(#editable, or: $value.editable), + actions: data.get(#actions, or: $value.actions), + ); + + @override + GameToolbarCopyWith<$R2, GameToolbar, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _GameToolbarCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ToolbarActionMapper extends ClassMapperBase { + ToolbarActionMapper._(); + + static ToolbarActionMapper? _instance; + static ToolbarActionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ToolbarActionMapper._()); + } + return _instance!; + } + + @override + final String id = 'ToolbarAction'; + + static String _$id(ToolbarAction v) => v.id; + static const Field _f$id = Field('id', _$id); + static String _$label(ToolbarAction v) => v.label; + static const Field _f$label = Field('label', _$label); + static bool _$enabled(ToolbarAction v) => v.enabled; + static const Field _f$enabled = Field( + 'enabled', + _$enabled, + opt: true, + def: true, + ); + + @override + final MappableFields fields = const { + #id: _f$id, + #label: _f$label, + #enabled: _f$enabled, + }; + + static ToolbarAction _instantiate(DecodingData data) { + return ToolbarAction( + id: data.dec(_f$id), + label: data.dec(_f$label), + enabled: data.dec(_f$enabled), + ); + } + + @override + final Function instantiate = _instantiate; + + static ToolbarAction fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ToolbarAction fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ToolbarActionMappable { + String toJson() { + return ToolbarActionMapper.ensureInitialized().encodeJson( + this as ToolbarAction, + ); + } + + Map toMap() { + return ToolbarActionMapper.ensureInitialized().encodeMap( + this as ToolbarAction, + ); + } + + ToolbarActionCopyWith + get copyWith => _ToolbarActionCopyWithImpl( + this as ToolbarAction, + $identity, + $identity, + ); + @override + String toString() { + return ToolbarActionMapper.ensureInitialized().stringifyValue( + this as ToolbarAction, + ); + } + + @override + bool operator ==(Object other) { + return ToolbarActionMapper.ensureInitialized().equalsValue( + this as ToolbarAction, + other, + ); + } + + @override + int get hashCode { + return ToolbarActionMapper.ensureInitialized().hashValue( + this as ToolbarAction, + ); + } +} + +/// @nodoc +extension ToolbarActionValueCopy<$R, $Out> + on ObjectCopyWith<$R, ToolbarAction, $Out> { + ToolbarActionCopyWith<$R, ToolbarAction, $Out> get $asToolbarAction => + $base.as((v, t, t2) => _ToolbarActionCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ToolbarActionCopyWith<$R, $In extends ToolbarAction, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? id, String? label, bool? enabled}); + ToolbarActionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _ToolbarActionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ToolbarAction, $Out> + implements ToolbarActionCopyWith<$R, ToolbarAction, $Out> { + _ToolbarActionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ToolbarActionMapper.ensureInitialized(); + @override + $R call({String? id, String? label, bool? enabled}) => $apply( + FieldCopyWithData({ + if (id != null) #id: id, + if (label != null) #label: label, + if (enabled != null) #enabled: enabled, + }), + ); + @override + ToolbarAction $make(CopyWithData data) => ToolbarAction( + id: data.get(#id, or: $value.id), + label: data.get(#label, or: $value.label), + enabled: data.get(#enabled, or: $value.enabled), + ); + + @override + ToolbarActionCopyWith<$R2, ToolbarAction, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ToolbarActionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/translation.dart b/api/lib/src/models/translation.dart index a288e172..5f2b17ac 100644 --- a/api/lib/src/models/translation.dart +++ b/api/lib/src/models/translation.dart @@ -1,134 +1,134 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -part 'translation.mapper.dart'; - -const kFallbackLocale = 'en'; - -String? getDefaultLocale() => null; - -class TranslationsStore { - final String? Function() getLocale; - final Map translations; - - TranslationsStore({ - Iterable> translations = const [], - this.getLocale = getDefaultLocale, - }) : translations = Map.fromEntries(translations); - - PackTranslation getTranslation([String? locale]) => - (locale == null ? translations[kFallbackLocale] : translations[locale]) ?? - translations[getLocale()] ?? - PackTranslation(); - - T findTranslation( - T? Function(PackTranslation) finder, - T fallback, [ - String? locale, - ]) => finder(getTranslation(locale)) ?? finder(getTranslation()) ?? fallback; - - DeckTranslation getDeckTranslation(String key, [String? locale]) => - findTranslation((t) => t.decks[key], DeckTranslation(name: key), locale); - - FigureTranslation getFigureTranslation(String key, [String? locale]) => - findTranslation( - (t) => t.figures[key], - FigureTranslation(name: key), - locale, - ); - - FigureVariationTranslation getFigureVariationTranslation( - String figureKey, - String key, [ - String? locale, - ]) => findTranslation( - (t) => t.figures[figureKey]?.variations[key], - FigureVariationTranslation(name: key), - locale, - ); - - BackgroundTranslation getBackgroundTranslation( - String key, [ - String? locale, - ]) => findTranslation( - (t) => t.backgrounds[key], - BackgroundTranslation(name: key), - locale, - ); - - BoardTranslation getBoardTranslation(String key, [String? locale]) => - findTranslation( - (t) => t.boards[key], - BoardTranslation(name: key), - locale, - ); - - ModeTranslation getModeTranslation(String key, [String? locale]) => - findTranslation((t) => t.modes[key], ModeTranslation(name: key), locale); -} - -@MappableClass() -class PackTranslation with PackTranslationMappable { - final Map decks; - final Map backgrounds; - final Map figures; - final Map boards; - final Map modes; - - PackTranslation({ - this.decks = const {}, - this.figures = const {}, - this.backgrounds = const {}, - this.boards = const {}, - this.modes = const {}, - }); -} - -@MappableClass() -sealed class DescriptiveTranslation with DescriptiveTranslationMappable { - final String name; - final String? description; - - DescriptiveTranslation({required this.name, this.description}); -} - -@MappableClass() -class DeckTranslation extends DescriptiveTranslation - with DeckTranslationMappable { - DeckTranslation({required super.name, super.description}); -} - -@MappableClass() -class BackgroundTranslation extends DescriptiveTranslation - with BackgroundTranslationMappable { - BackgroundTranslation({required super.name, super.description}); -} - -@MappableClass() -class FigureVariationTranslation extends DescriptiveTranslation - with FigureVariationTranslationMappable { - FigureVariationTranslation({required super.name, super.description}); -} - -@MappableClass() -class FigureTranslation extends DescriptiveTranslation - with FigureTranslationMappable { - final Map variations; - - FigureTranslation({ - required super.name, - super.description, - this.variations = const {}, - }); -} - -@MappableClass() -class BoardTranslation extends DescriptiveTranslation - with BoardTranslationMappable { - BoardTranslation({required super.name, super.description}); -} - -@MappableClass() -class ModeTranslation extends DescriptiveTranslation - with ModeTranslationMappable { - ModeTranslation({required super.name, super.description}); -} +import 'package:dart_mappable/dart_mappable.dart'; + +part 'translation.mapper.dart'; + +const kFallbackLocale = 'en'; + +String? getDefaultLocale() => null; + +class TranslationsStore { + final String? Function() getLocale; + final Map translations; + + TranslationsStore({ + Iterable> translations = const [], + this.getLocale = getDefaultLocale, + }) : translations = Map.fromEntries(translations); + + PackTranslation getTranslation([String? locale]) => + (locale == null ? translations[kFallbackLocale] : translations[locale]) ?? + translations[getLocale()] ?? + PackTranslation(); + + T findTranslation( + T? Function(PackTranslation) finder, + T fallback, [ + String? locale, + ]) => finder(getTranslation(locale)) ?? finder(getTranslation()) ?? fallback; + + DeckTranslation getDeckTranslation(String key, [String? locale]) => + findTranslation((t) => t.decks[key], DeckTranslation(name: key), locale); + + FigureTranslation getFigureTranslation(String key, [String? locale]) => + findTranslation( + (t) => t.figures[key], + FigureTranslation(name: key), + locale, + ); + + FigureVariationTranslation getFigureVariationTranslation( + String figureKey, + String key, [ + String? locale, + ]) => findTranslation( + (t) => t.figures[figureKey]?.variations[key], + FigureVariationTranslation(name: key), + locale, + ); + + BackgroundTranslation getBackgroundTranslation( + String key, [ + String? locale, + ]) => findTranslation( + (t) => t.backgrounds[key], + BackgroundTranslation(name: key), + locale, + ); + + BoardTranslation getBoardTranslation(String key, [String? locale]) => + findTranslation( + (t) => t.boards[key], + BoardTranslation(name: key), + locale, + ); + + ModeTranslation getModeTranslation(String key, [String? locale]) => + findTranslation((t) => t.modes[key], ModeTranslation(name: key), locale); +} + +@MappableClass() +class PackTranslation with PackTranslationMappable { + final Map decks; + final Map backgrounds; + final Map figures; + final Map boards; + final Map modes; + + PackTranslation({ + this.decks = const {}, + this.figures = const {}, + this.backgrounds = const {}, + this.boards = const {}, + this.modes = const {}, + }); +} + +@MappableClass() +sealed class DescriptiveTranslation with DescriptiveTranslationMappable { + final String name; + final String? description; + + DescriptiveTranslation({required this.name, this.description}); +} + +@MappableClass() +class DeckTranslation extends DescriptiveTranslation + with DeckTranslationMappable { + DeckTranslation({required super.name, super.description}); +} + +@MappableClass() +class BackgroundTranslation extends DescriptiveTranslation + with BackgroundTranslationMappable { + BackgroundTranslation({required super.name, super.description}); +} + +@MappableClass() +class FigureVariationTranslation extends DescriptiveTranslation + with FigureVariationTranslationMappable { + FigureVariationTranslation({required super.name, super.description}); +} + +@MappableClass() +class FigureTranslation extends DescriptiveTranslation + with FigureTranslationMappable { + final Map variations; + + FigureTranslation({ + required super.name, + super.description, + this.variations = const {}, + }); +} + +@MappableClass() +class BoardTranslation extends DescriptiveTranslation + with BoardTranslationMappable { + BoardTranslation({required super.name, super.description}); +} + +@MappableClass() +class ModeTranslation extends DescriptiveTranslation + with ModeTranslationMappable { + ModeTranslation({required super.name, super.description}); +} diff --git a/api/lib/src/models/translation.mapper.dart b/api/lib/src/models/translation.mapper.dart index 9510417d..12723781 100644 --- a/api/lib/src/models/translation.mapper.dart +++ b/api/lib/src/models/translation.mapper.dart @@ -1,1291 +1,1291 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'translation.dart'; - -/// @nodoc -class PackTranslationMapper extends ClassMapperBase { - PackTranslationMapper._(); - - static PackTranslationMapper? _instance; - static PackTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = PackTranslationMapper._()); - DeckTranslationMapper.ensureInitialized(); - FigureTranslationMapper.ensureInitialized(); - BackgroundTranslationMapper.ensureInitialized(); - BoardTranslationMapper.ensureInitialized(); - ModeTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'PackTranslation'; - - static Map _$decks(PackTranslation v) => v.decks; - static const Field> _f$decks = - Field('decks', _$decks, opt: true, def: const {}); - static Map _$figures(PackTranslation v) => - v.figures; - static const Field> - _f$figures = Field('figures', _$figures, opt: true, def: const {}); - static Map _$backgrounds(PackTranslation v) => - v.backgrounds; - static const Field> - _f$backgrounds = Field( - 'backgrounds', - _$backgrounds, - opt: true, - def: const {}, - ); - static Map _$boards(PackTranslation v) => v.boards; - static const Field> _f$boards = - Field('boards', _$boards, opt: true, def: const {}); - static Map _$modes(PackTranslation v) => v.modes; - static const Field> _f$modes = - Field('modes', _$modes, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #decks: _f$decks, - #figures: _f$figures, - #backgrounds: _f$backgrounds, - #boards: _f$boards, - #modes: _f$modes, - }; - - static PackTranslation _instantiate(DecodingData data) { - return PackTranslation( - decks: data.dec(_f$decks), - figures: data.dec(_f$figures), - backgrounds: data.dec(_f$backgrounds), - boards: data.dec(_f$boards), - modes: data.dec(_f$modes), - ); - } - - @override - final Function instantiate = _instantiate; - - static PackTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static PackTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin PackTranslationMappable { - String toJson() { - return PackTranslationMapper.ensureInitialized() - .encodeJson(this as PackTranslation); - } - - Map toMap() { - return PackTranslationMapper.ensureInitialized().encodeMap( - this as PackTranslation, - ); - } - - PackTranslationCopyWith - get copyWith => - _PackTranslationCopyWithImpl( - this as PackTranslation, - $identity, - $identity, - ); - @override - String toString() { - return PackTranslationMapper.ensureInitialized().stringifyValue( - this as PackTranslation, - ); - } - - @override - bool operator ==(Object other) { - return PackTranslationMapper.ensureInitialized().equalsValue( - this as PackTranslation, - other, - ); - } - - @override - int get hashCode { - return PackTranslationMapper.ensureInitialized().hashValue( - this as PackTranslation, - ); - } -} - -/// @nodoc -extension PackTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, PackTranslation, $Out> { - PackTranslationCopyWith<$R, PackTranslation, $Out> get $asPackTranslation => - $base.as((v, t, t2) => _PackTranslationCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class PackTranslationCopyWith<$R, $In extends PackTranslation, $Out> - implements ClassCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - String, - DeckTranslation, - DeckTranslationCopyWith<$R, DeckTranslation, DeckTranslation> - > - get decks; - MapCopyWith< - $R, - String, - FigureTranslation, - FigureTranslationCopyWith<$R, FigureTranslation, FigureTranslation> - > - get figures; - MapCopyWith< - $R, - String, - BackgroundTranslation, - BackgroundTranslationCopyWith< - $R, - BackgroundTranslation, - BackgroundTranslation - > - > - get backgrounds; - MapCopyWith< - $R, - String, - BoardTranslation, - BoardTranslationCopyWith<$R, BoardTranslation, BoardTranslation> - > - get boards; - MapCopyWith< - $R, - String, - ModeTranslation, - ModeTranslationCopyWith<$R, ModeTranslation, ModeTranslation> - > - get modes; - $R call({ - Map? decks, - Map? figures, - Map? backgrounds, - Map? boards, - Map? modes, - }); - PackTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _PackTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, PackTranslation, $Out> - implements PackTranslationCopyWith<$R, PackTranslation, $Out> { - _PackTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - PackTranslationMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - String, - DeckTranslation, - DeckTranslationCopyWith<$R, DeckTranslation, DeckTranslation> - > - get decks => MapCopyWith( - $value.decks, - (v, t) => v.copyWith.$chain(t), - (v) => call(decks: v), - ); - @override - MapCopyWith< - $R, - String, - FigureTranslation, - FigureTranslationCopyWith<$R, FigureTranslation, FigureTranslation> - > - get figures => MapCopyWith( - $value.figures, - (v, t) => v.copyWith.$chain(t), - (v) => call(figures: v), - ); - @override - MapCopyWith< - $R, - String, - BackgroundTranslation, - BackgroundTranslationCopyWith< - $R, - BackgroundTranslation, - BackgroundTranslation - > - > - get backgrounds => MapCopyWith( - $value.backgrounds, - (v, t) => v.copyWith.$chain(t), - (v) => call(backgrounds: v), - ); - @override - MapCopyWith< - $R, - String, - BoardTranslation, - BoardTranslationCopyWith<$R, BoardTranslation, BoardTranslation> - > - get boards => MapCopyWith( - $value.boards, - (v, t) => v.copyWith.$chain(t), - (v) => call(boards: v), - ); - @override - MapCopyWith< - $R, - String, - ModeTranslation, - ModeTranslationCopyWith<$R, ModeTranslation, ModeTranslation> - > - get modes => MapCopyWith( - $value.modes, - (v, t) => v.copyWith.$chain(t), - (v) => call(modes: v), - ); - @override - $R call({ - Map? decks, - Map? figures, - Map? backgrounds, - Map? boards, - Map? modes, - }) => $apply( - FieldCopyWithData({ - if (decks != null) #decks: decks, - if (figures != null) #figures: figures, - if (backgrounds != null) #backgrounds: backgrounds, - if (boards != null) #boards: boards, - if (modes != null) #modes: modes, - }), - ); - @override - PackTranslation $make(CopyWithData data) => PackTranslation( - decks: data.get(#decks, or: $value.decks), - figures: data.get(#figures, or: $value.figures), - backgrounds: data.get(#backgrounds, or: $value.backgrounds), - boards: data.get(#boards, or: $value.boards), - modes: data.get(#modes, or: $value.modes), - ); - - @override - PackTranslationCopyWith<$R2, PackTranslation, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _PackTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DeckTranslationMapper extends ClassMapperBase { - DeckTranslationMapper._(); - - static DeckTranslationMapper? _instance; - static DeckTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DeckTranslationMapper._()); - DescriptiveTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'DeckTranslation'; - - static String _$name(DeckTranslation v) => v.name; - static const Field _f$name = Field('name', _$name); - static String? _$description(DeckTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - }; - - static DeckTranslation _instantiate(DecodingData data) { - return DeckTranslation( - name: data.dec(_f$name), - description: data.dec(_f$description), - ); - } - - @override - final Function instantiate = _instantiate; - - static DeckTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DeckTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DeckTranslationMappable { - String toJson() { - return DeckTranslationMapper.ensureInitialized() - .encodeJson(this as DeckTranslation); - } - - Map toMap() { - return DeckTranslationMapper.ensureInitialized().encodeMap( - this as DeckTranslation, - ); - } - - DeckTranslationCopyWith - get copyWith => - _DeckTranslationCopyWithImpl( - this as DeckTranslation, - $identity, - $identity, - ); - @override - String toString() { - return DeckTranslationMapper.ensureInitialized().stringifyValue( - this as DeckTranslation, - ); - } - - @override - bool operator ==(Object other) { - return DeckTranslationMapper.ensureInitialized().equalsValue( - this as DeckTranslation, - other, - ); - } - - @override - int get hashCode { - return DeckTranslationMapper.ensureInitialized().hashValue( - this as DeckTranslation, - ); - } -} - -/// @nodoc -extension DeckTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, DeckTranslation, $Out> { - DeckTranslationCopyWith<$R, DeckTranslation, $Out> get $asDeckTranslation => - $base.as((v, t, t2) => _DeckTranslationCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class DeckTranslationCopyWith<$R, $In extends DeckTranslation, $Out> - implements DescriptiveTranslationCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? description}); - DeckTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _DeckTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, DeckTranslation, $Out> - implements DeckTranslationCopyWith<$R, DeckTranslation, $Out> { - _DeckTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - DeckTranslationMapper.ensureInitialized(); - @override - $R call({String? name, Object? description = $none}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (description != $none) #description: description, - }), - ); - @override - DeckTranslation $make(CopyWithData data) => DeckTranslation( - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - ); - - @override - DeckTranslationCopyWith<$R2, DeckTranslation, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _DeckTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class DescriptiveTranslationMapper - extends ClassMapperBase { - DescriptiveTranslationMapper._(); - - static DescriptiveTranslationMapper? _instance; - static DescriptiveTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = DescriptiveTranslationMapper._()); - DeckTranslationMapper.ensureInitialized(); - FigureTranslationMapper.ensureInitialized(); - FigureVariationTranslationMapper.ensureInitialized(); - BackgroundTranslationMapper.ensureInitialized(); - BoardTranslationMapper.ensureInitialized(); - ModeTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'DescriptiveTranslation'; - - static String _$name(DescriptiveTranslation v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - ); - static String? _$description(DescriptiveTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - }; - - static DescriptiveTranslation _instantiate(DecodingData data) { - throw MapperException.missingConstructor('DescriptiveTranslation'); - } - - @override - final Function instantiate = _instantiate; - - static DescriptiveTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static DescriptiveTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin DescriptiveTranslationMappable { - String toJson(); - Map toMap(); - DescriptiveTranslationCopyWith< - DescriptiveTranslation, - DescriptiveTranslation, - DescriptiveTranslation - > - get copyWith; -} - -/// @nodoc -abstract class DescriptiveTranslationCopyWith< - $R, - $In extends DescriptiveTranslation, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? name, String? description}); - DescriptiveTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class FigureTranslationMapper extends ClassMapperBase { - FigureTranslationMapper._(); - - static FigureTranslationMapper? _instance; - static FigureTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = FigureTranslationMapper._()); - DescriptiveTranslationMapper.ensureInitialized(); - FigureVariationTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'FigureTranslation'; - - static String _$name(FigureTranslation v) => v.name; - static const Field _f$name = Field('name', _$name); - static String? _$description(FigureTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - static Map _$variations( - FigureTranslation v, - ) => v.variations; - static const Field> - _f$variations = Field('variations', _$variations, opt: true, def: const {}); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - #variations: _f$variations, - }; - - static FigureTranslation _instantiate(DecodingData data) { - return FigureTranslation( - name: data.dec(_f$name), - description: data.dec(_f$description), - variations: data.dec(_f$variations), - ); - } - - @override - final Function instantiate = _instantiate; - - static FigureTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static FigureTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin FigureTranslationMappable { - String toJson() { - return FigureTranslationMapper.ensureInitialized() - .encodeJson(this as FigureTranslation); - } - - Map toMap() { - return FigureTranslationMapper.ensureInitialized() - .encodeMap(this as FigureTranslation); - } - - FigureTranslationCopyWith< - FigureTranslation, - FigureTranslation, - FigureTranslation - > - get copyWith => - _FigureTranslationCopyWithImpl( - this as FigureTranslation, - $identity, - $identity, - ); - @override - String toString() { - return FigureTranslationMapper.ensureInitialized().stringifyValue( - this as FigureTranslation, - ); - } - - @override - bool operator ==(Object other) { - return FigureTranslationMapper.ensureInitialized().equalsValue( - this as FigureTranslation, - other, - ); - } - - @override - int get hashCode { - return FigureTranslationMapper.ensureInitialized().hashValue( - this as FigureTranslation, - ); - } -} - -/// @nodoc -extension FigureTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, FigureTranslation, $Out> { - FigureTranslationCopyWith<$R, FigureTranslation, $Out> - get $asFigureTranslation => $base.as( - (v, t, t2) => _FigureTranslationCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class FigureTranslationCopyWith< - $R, - $In extends FigureTranslation, - $Out -> - implements DescriptiveTranslationCopyWith<$R, $In, $Out> { - MapCopyWith< - $R, - String, - FigureVariationTranslation, - FigureVariationTranslationCopyWith< - $R, - FigureVariationTranslation, - FigureVariationTranslation - > - > - get variations; - @override - $R call({ - String? name, - String? description, - Map? variations, - }); - FigureTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _FigureTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, FigureTranslation, $Out> - implements FigureTranslationCopyWith<$R, FigureTranslation, $Out> { - _FigureTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - FigureTranslationMapper.ensureInitialized(); - @override - MapCopyWith< - $R, - String, - FigureVariationTranslation, - FigureVariationTranslationCopyWith< - $R, - FigureVariationTranslation, - FigureVariationTranslation - > - > - get variations => MapCopyWith( - $value.variations, - (v, t) => v.copyWith.$chain(t), - (v) => call(variations: v), - ); - @override - $R call({ - String? name, - Object? description = $none, - Map? variations, - }) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (description != $none) #description: description, - if (variations != null) #variations: variations, - }), - ); - @override - FigureTranslation $make(CopyWithData data) => FigureTranslation( - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - variations: data.get(#variations, or: $value.variations), - ); - - @override - FigureTranslationCopyWith<$R2, FigureTranslation, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _FigureTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class FigureVariationTranslationMapper - extends ClassMapperBase { - FigureVariationTranslationMapper._(); - - static FigureVariationTranslationMapper? _instance; - static FigureVariationTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use( - _instance = FigureVariationTranslationMapper._(), - ); - DescriptiveTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'FigureVariationTranslation'; - - static String _$name(FigureVariationTranslation v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - ); - static String? _$description(FigureVariationTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - }; - - static FigureVariationTranslation _instantiate(DecodingData data) { - return FigureVariationTranslation( - name: data.dec(_f$name), - description: data.dec(_f$description), - ); - } - - @override - final Function instantiate = _instantiate; - - static FigureVariationTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static FigureVariationTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin FigureVariationTranslationMappable { - String toJson() { - return FigureVariationTranslationMapper.ensureInitialized() - .encodeJson( - this as FigureVariationTranslation, - ); - } - - Map toMap() { - return FigureVariationTranslationMapper.ensureInitialized() - .encodeMap( - this as FigureVariationTranslation, - ); - } - - FigureVariationTranslationCopyWith< - FigureVariationTranslation, - FigureVariationTranslation, - FigureVariationTranslation - > - get copyWith => - _FigureVariationTranslationCopyWithImpl< - FigureVariationTranslation, - FigureVariationTranslation - >(this as FigureVariationTranslation, $identity, $identity); - @override - String toString() { - return FigureVariationTranslationMapper.ensureInitialized().stringifyValue( - this as FigureVariationTranslation, - ); - } - - @override - bool operator ==(Object other) { - return FigureVariationTranslationMapper.ensureInitialized().equalsValue( - this as FigureVariationTranslation, - other, - ); - } - - @override - int get hashCode { - return FigureVariationTranslationMapper.ensureInitialized().hashValue( - this as FigureVariationTranslation, - ); - } -} - -/// @nodoc -extension FigureVariationTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, FigureVariationTranslation, $Out> { - FigureVariationTranslationCopyWith<$R, FigureVariationTranslation, $Out> - get $asFigureVariationTranslation => $base.as( - (v, t, t2) => _FigureVariationTranslationCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class FigureVariationTranslationCopyWith< - $R, - $In extends FigureVariationTranslation, - $Out -> - implements DescriptiveTranslationCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? description}); - FigureVariationTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _FigureVariationTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, FigureVariationTranslation, $Out> - implements - FigureVariationTranslationCopyWith< - $R, - FigureVariationTranslation, - $Out - > { - _FigureVariationTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - FigureVariationTranslationMapper.ensureInitialized(); - @override - $R call({String? name, Object? description = $none}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (description != $none) #description: description, - }), - ); - @override - FigureVariationTranslation $make(CopyWithData data) => - FigureVariationTranslation( - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - ); - - @override - FigureVariationTranslationCopyWith<$R2, FigureVariationTranslation, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _FigureVariationTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BackgroundTranslationMapper - extends ClassMapperBase { - BackgroundTranslationMapper._(); - - static BackgroundTranslationMapper? _instance; - static BackgroundTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BackgroundTranslationMapper._()); - DescriptiveTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BackgroundTranslation'; - - static String _$name(BackgroundTranslation v) => v.name; - static const Field _f$name = Field( - 'name', - _$name, - ); - static String? _$description(BackgroundTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - }; - - static BackgroundTranslation _instantiate(DecodingData data) { - return BackgroundTranslation( - name: data.dec(_f$name), - description: data.dec(_f$description), - ); - } - - @override - final Function instantiate = _instantiate; - - static BackgroundTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BackgroundTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BackgroundTranslationMappable { - String toJson() { - return BackgroundTranslationMapper.ensureInitialized() - .encodeJson(this as BackgroundTranslation); - } - - Map toMap() { - return BackgroundTranslationMapper.ensureInitialized() - .encodeMap(this as BackgroundTranslation); - } - - BackgroundTranslationCopyWith< - BackgroundTranslation, - BackgroundTranslation, - BackgroundTranslation - > - get copyWith => - _BackgroundTranslationCopyWithImpl< - BackgroundTranslation, - BackgroundTranslation - >(this as BackgroundTranslation, $identity, $identity); - @override - String toString() { - return BackgroundTranslationMapper.ensureInitialized().stringifyValue( - this as BackgroundTranslation, - ); - } - - @override - bool operator ==(Object other) { - return BackgroundTranslationMapper.ensureInitialized().equalsValue( - this as BackgroundTranslation, - other, - ); - } - - @override - int get hashCode { - return BackgroundTranslationMapper.ensureInitialized().hashValue( - this as BackgroundTranslation, - ); - } -} - -/// @nodoc -extension BackgroundTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, BackgroundTranslation, $Out> { - BackgroundTranslationCopyWith<$R, BackgroundTranslation, $Out> - get $asBackgroundTranslation => $base.as( - (v, t, t2) => _BackgroundTranslationCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class BackgroundTranslationCopyWith< - $R, - $In extends BackgroundTranslation, - $Out -> - implements DescriptiveTranslationCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? description}); - BackgroundTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BackgroundTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BackgroundTranslation, $Out> - implements BackgroundTranslationCopyWith<$R, BackgroundTranslation, $Out> { - _BackgroundTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BackgroundTranslationMapper.ensureInitialized(); - @override - $R call({String? name, Object? description = $none}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (description != $none) #description: description, - }), - ); - @override - BackgroundTranslation $make(CopyWithData data) => BackgroundTranslation( - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - ); - - @override - BackgroundTranslationCopyWith<$R2, BackgroundTranslation, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _BackgroundTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class BoardTranslationMapper extends ClassMapperBase { - BoardTranslationMapper._(); - - static BoardTranslationMapper? _instance; - static BoardTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = BoardTranslationMapper._()); - DescriptiveTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'BoardTranslation'; - - static String _$name(BoardTranslation v) => v.name; - static const Field _f$name = Field('name', _$name); - static String? _$description(BoardTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - }; - - static BoardTranslation _instantiate(DecodingData data) { - return BoardTranslation( - name: data.dec(_f$name), - description: data.dec(_f$description), - ); - } - - @override - final Function instantiate = _instantiate; - - static BoardTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static BoardTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin BoardTranslationMappable { - String toJson() { - return BoardTranslationMapper.ensureInitialized() - .encodeJson(this as BoardTranslation); - } - - Map toMap() { - return BoardTranslationMapper.ensureInitialized() - .encodeMap(this as BoardTranslation); - } - - BoardTranslationCopyWith - get copyWith => - _BoardTranslationCopyWithImpl( - this as BoardTranslation, - $identity, - $identity, - ); - @override - String toString() { - return BoardTranslationMapper.ensureInitialized().stringifyValue( - this as BoardTranslation, - ); - } - - @override - bool operator ==(Object other) { - return BoardTranslationMapper.ensureInitialized().equalsValue( - this as BoardTranslation, - other, - ); - } - - @override - int get hashCode { - return BoardTranslationMapper.ensureInitialized().hashValue( - this as BoardTranslation, - ); - } -} - -/// @nodoc -extension BoardTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, BoardTranslation, $Out> { - BoardTranslationCopyWith<$R, BoardTranslation, $Out> - get $asBoardTranslation => - $base.as((v, t, t2) => _BoardTranslationCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class BoardTranslationCopyWith<$R, $In extends BoardTranslation, $Out> - implements DescriptiveTranslationCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? description}); - BoardTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _BoardTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, BoardTranslation, $Out> - implements BoardTranslationCopyWith<$R, BoardTranslation, $Out> { - _BoardTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - BoardTranslationMapper.ensureInitialized(); - @override - $R call({String? name, Object? description = $none}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (description != $none) #description: description, - }), - ); - @override - BoardTranslation $make(CopyWithData data) => BoardTranslation( - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - ); - - @override - BoardTranslationCopyWith<$R2, BoardTranslation, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _BoardTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ModeTranslationMapper extends ClassMapperBase { - ModeTranslationMapper._(); - - static ModeTranslationMapper? _instance; - static ModeTranslationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ModeTranslationMapper._()); - DescriptiveTranslationMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'ModeTranslation'; - - static String _$name(ModeTranslation v) => v.name; - static const Field _f$name = Field('name', _$name); - static String? _$description(ModeTranslation v) => v.description; - static const Field _f$description = Field( - 'description', - _$description, - opt: true, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #description: _f$description, - }; - - static ModeTranslation _instantiate(DecodingData data) { - return ModeTranslation( - name: data.dec(_f$name), - description: data.dec(_f$description), - ); - } - - @override - final Function instantiate = _instantiate; - - static ModeTranslation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ModeTranslation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ModeTranslationMappable { - String toJson() { - return ModeTranslationMapper.ensureInitialized() - .encodeJson(this as ModeTranslation); - } - - Map toMap() { - return ModeTranslationMapper.ensureInitialized().encodeMap( - this as ModeTranslation, - ); - } - - ModeTranslationCopyWith - get copyWith => - _ModeTranslationCopyWithImpl( - this as ModeTranslation, - $identity, - $identity, - ); - @override - String toString() { - return ModeTranslationMapper.ensureInitialized().stringifyValue( - this as ModeTranslation, - ); - } - - @override - bool operator ==(Object other) { - return ModeTranslationMapper.ensureInitialized().equalsValue( - this as ModeTranslation, - other, - ); - } - - @override - int get hashCode { - return ModeTranslationMapper.ensureInitialized().hashValue( - this as ModeTranslation, - ); - } -} - -/// @nodoc -extension ModeTranslationValueCopy<$R, $Out> - on ObjectCopyWith<$R, ModeTranslation, $Out> { - ModeTranslationCopyWith<$R, ModeTranslation, $Out> get $asModeTranslation => - $base.as((v, t, t2) => _ModeTranslationCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ModeTranslationCopyWith<$R, $In extends ModeTranslation, $Out> - implements DescriptiveTranslationCopyWith<$R, $In, $Out> { - @override - $R call({String? name, String? description}); - ModeTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ModeTranslationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ModeTranslation, $Out> - implements ModeTranslationCopyWith<$R, ModeTranslation, $Out> { - _ModeTranslationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ModeTranslationMapper.ensureInitialized(); - @override - $R call({String? name, Object? description = $none}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (description != $none) #description: description, - }), - ); - @override - ModeTranslation $make(CopyWithData data) => ModeTranslation( - name: data.get(#name, or: $value.name), - description: data.get(#description, or: $value.description), - ); - - @override - ModeTranslationCopyWith<$R2, ModeTranslation, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ModeTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'translation.dart'; + +/// @nodoc +class PackTranslationMapper extends ClassMapperBase { + PackTranslationMapper._(); + + static PackTranslationMapper? _instance; + static PackTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = PackTranslationMapper._()); + DeckTranslationMapper.ensureInitialized(); + FigureTranslationMapper.ensureInitialized(); + BackgroundTranslationMapper.ensureInitialized(); + BoardTranslationMapper.ensureInitialized(); + ModeTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'PackTranslation'; + + static Map _$decks(PackTranslation v) => v.decks; + static const Field> _f$decks = + Field('decks', _$decks, opt: true, def: const {}); + static Map _$figures(PackTranslation v) => + v.figures; + static const Field> + _f$figures = Field('figures', _$figures, opt: true, def: const {}); + static Map _$backgrounds(PackTranslation v) => + v.backgrounds; + static const Field> + _f$backgrounds = Field( + 'backgrounds', + _$backgrounds, + opt: true, + def: const {}, + ); + static Map _$boards(PackTranslation v) => v.boards; + static const Field> _f$boards = + Field('boards', _$boards, opt: true, def: const {}); + static Map _$modes(PackTranslation v) => v.modes; + static const Field> _f$modes = + Field('modes', _$modes, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #decks: _f$decks, + #figures: _f$figures, + #backgrounds: _f$backgrounds, + #boards: _f$boards, + #modes: _f$modes, + }; + + static PackTranslation _instantiate(DecodingData data) { + return PackTranslation( + decks: data.dec(_f$decks), + figures: data.dec(_f$figures), + backgrounds: data.dec(_f$backgrounds), + boards: data.dec(_f$boards), + modes: data.dec(_f$modes), + ); + } + + @override + final Function instantiate = _instantiate; + + static PackTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static PackTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin PackTranslationMappable { + String toJson() { + return PackTranslationMapper.ensureInitialized() + .encodeJson(this as PackTranslation); + } + + Map toMap() { + return PackTranslationMapper.ensureInitialized().encodeMap( + this as PackTranslation, + ); + } + + PackTranslationCopyWith + get copyWith => + _PackTranslationCopyWithImpl( + this as PackTranslation, + $identity, + $identity, + ); + @override + String toString() { + return PackTranslationMapper.ensureInitialized().stringifyValue( + this as PackTranslation, + ); + } + + @override + bool operator ==(Object other) { + return PackTranslationMapper.ensureInitialized().equalsValue( + this as PackTranslation, + other, + ); + } + + @override + int get hashCode { + return PackTranslationMapper.ensureInitialized().hashValue( + this as PackTranslation, + ); + } +} + +/// @nodoc +extension PackTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, PackTranslation, $Out> { + PackTranslationCopyWith<$R, PackTranslation, $Out> get $asPackTranslation => + $base.as((v, t, t2) => _PackTranslationCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class PackTranslationCopyWith<$R, $In extends PackTranslation, $Out> + implements ClassCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + String, + DeckTranslation, + DeckTranslationCopyWith<$R, DeckTranslation, DeckTranslation> + > + get decks; + MapCopyWith< + $R, + String, + FigureTranslation, + FigureTranslationCopyWith<$R, FigureTranslation, FigureTranslation> + > + get figures; + MapCopyWith< + $R, + String, + BackgroundTranslation, + BackgroundTranslationCopyWith< + $R, + BackgroundTranslation, + BackgroundTranslation + > + > + get backgrounds; + MapCopyWith< + $R, + String, + BoardTranslation, + BoardTranslationCopyWith<$R, BoardTranslation, BoardTranslation> + > + get boards; + MapCopyWith< + $R, + String, + ModeTranslation, + ModeTranslationCopyWith<$R, ModeTranslation, ModeTranslation> + > + get modes; + $R call({ + Map? decks, + Map? figures, + Map? backgrounds, + Map? boards, + Map? modes, + }); + PackTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _PackTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, PackTranslation, $Out> + implements PackTranslationCopyWith<$R, PackTranslation, $Out> { + _PackTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + PackTranslationMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + String, + DeckTranslation, + DeckTranslationCopyWith<$R, DeckTranslation, DeckTranslation> + > + get decks => MapCopyWith( + $value.decks, + (v, t) => v.copyWith.$chain(t), + (v) => call(decks: v), + ); + @override + MapCopyWith< + $R, + String, + FigureTranslation, + FigureTranslationCopyWith<$R, FigureTranslation, FigureTranslation> + > + get figures => MapCopyWith( + $value.figures, + (v, t) => v.copyWith.$chain(t), + (v) => call(figures: v), + ); + @override + MapCopyWith< + $R, + String, + BackgroundTranslation, + BackgroundTranslationCopyWith< + $R, + BackgroundTranslation, + BackgroundTranslation + > + > + get backgrounds => MapCopyWith( + $value.backgrounds, + (v, t) => v.copyWith.$chain(t), + (v) => call(backgrounds: v), + ); + @override + MapCopyWith< + $R, + String, + BoardTranslation, + BoardTranslationCopyWith<$R, BoardTranslation, BoardTranslation> + > + get boards => MapCopyWith( + $value.boards, + (v, t) => v.copyWith.$chain(t), + (v) => call(boards: v), + ); + @override + MapCopyWith< + $R, + String, + ModeTranslation, + ModeTranslationCopyWith<$R, ModeTranslation, ModeTranslation> + > + get modes => MapCopyWith( + $value.modes, + (v, t) => v.copyWith.$chain(t), + (v) => call(modes: v), + ); + @override + $R call({ + Map? decks, + Map? figures, + Map? backgrounds, + Map? boards, + Map? modes, + }) => $apply( + FieldCopyWithData({ + if (decks != null) #decks: decks, + if (figures != null) #figures: figures, + if (backgrounds != null) #backgrounds: backgrounds, + if (boards != null) #boards: boards, + if (modes != null) #modes: modes, + }), + ); + @override + PackTranslation $make(CopyWithData data) => PackTranslation( + decks: data.get(#decks, or: $value.decks), + figures: data.get(#figures, or: $value.figures), + backgrounds: data.get(#backgrounds, or: $value.backgrounds), + boards: data.get(#boards, or: $value.boards), + modes: data.get(#modes, or: $value.modes), + ); + + @override + PackTranslationCopyWith<$R2, PackTranslation, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _PackTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DeckTranslationMapper extends ClassMapperBase { + DeckTranslationMapper._(); + + static DeckTranslationMapper? _instance; + static DeckTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DeckTranslationMapper._()); + DescriptiveTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'DeckTranslation'; + + static String _$name(DeckTranslation v) => v.name; + static const Field _f$name = Field('name', _$name); + static String? _$description(DeckTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + }; + + static DeckTranslation _instantiate(DecodingData data) { + return DeckTranslation( + name: data.dec(_f$name), + description: data.dec(_f$description), + ); + } + + @override + final Function instantiate = _instantiate; + + static DeckTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DeckTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DeckTranslationMappable { + String toJson() { + return DeckTranslationMapper.ensureInitialized() + .encodeJson(this as DeckTranslation); + } + + Map toMap() { + return DeckTranslationMapper.ensureInitialized().encodeMap( + this as DeckTranslation, + ); + } + + DeckTranslationCopyWith + get copyWith => + _DeckTranslationCopyWithImpl( + this as DeckTranslation, + $identity, + $identity, + ); + @override + String toString() { + return DeckTranslationMapper.ensureInitialized().stringifyValue( + this as DeckTranslation, + ); + } + + @override + bool operator ==(Object other) { + return DeckTranslationMapper.ensureInitialized().equalsValue( + this as DeckTranslation, + other, + ); + } + + @override + int get hashCode { + return DeckTranslationMapper.ensureInitialized().hashValue( + this as DeckTranslation, + ); + } +} + +/// @nodoc +extension DeckTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, DeckTranslation, $Out> { + DeckTranslationCopyWith<$R, DeckTranslation, $Out> get $asDeckTranslation => + $base.as((v, t, t2) => _DeckTranslationCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class DeckTranslationCopyWith<$R, $In extends DeckTranslation, $Out> + implements DescriptiveTranslationCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? description}); + DeckTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _DeckTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, DeckTranslation, $Out> + implements DeckTranslationCopyWith<$R, DeckTranslation, $Out> { + _DeckTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + DeckTranslationMapper.ensureInitialized(); + @override + $R call({String? name, Object? description = $none}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (description != $none) #description: description, + }), + ); + @override + DeckTranslation $make(CopyWithData data) => DeckTranslation( + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + ); + + @override + DeckTranslationCopyWith<$R2, DeckTranslation, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _DeckTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class DescriptiveTranslationMapper + extends ClassMapperBase { + DescriptiveTranslationMapper._(); + + static DescriptiveTranslationMapper? _instance; + static DescriptiveTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = DescriptiveTranslationMapper._()); + DeckTranslationMapper.ensureInitialized(); + FigureTranslationMapper.ensureInitialized(); + FigureVariationTranslationMapper.ensureInitialized(); + BackgroundTranslationMapper.ensureInitialized(); + BoardTranslationMapper.ensureInitialized(); + ModeTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'DescriptiveTranslation'; + + static String _$name(DescriptiveTranslation v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + ); + static String? _$description(DescriptiveTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + }; + + static DescriptiveTranslation _instantiate(DecodingData data) { + throw MapperException.missingConstructor('DescriptiveTranslation'); + } + + @override + final Function instantiate = _instantiate; + + static DescriptiveTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static DescriptiveTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin DescriptiveTranslationMappable { + String toJson(); + Map toMap(); + DescriptiveTranslationCopyWith< + DescriptiveTranslation, + DescriptiveTranslation, + DescriptiveTranslation + > + get copyWith; +} + +/// @nodoc +abstract class DescriptiveTranslationCopyWith< + $R, + $In extends DescriptiveTranslation, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? name, String? description}); + DescriptiveTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class FigureTranslationMapper extends ClassMapperBase { + FigureTranslationMapper._(); + + static FigureTranslationMapper? _instance; + static FigureTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = FigureTranslationMapper._()); + DescriptiveTranslationMapper.ensureInitialized(); + FigureVariationTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'FigureTranslation'; + + static String _$name(FigureTranslation v) => v.name; + static const Field _f$name = Field('name', _$name); + static String? _$description(FigureTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + static Map _$variations( + FigureTranslation v, + ) => v.variations; + static const Field> + _f$variations = Field('variations', _$variations, opt: true, def: const {}); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + #variations: _f$variations, + }; + + static FigureTranslation _instantiate(DecodingData data) { + return FigureTranslation( + name: data.dec(_f$name), + description: data.dec(_f$description), + variations: data.dec(_f$variations), + ); + } + + @override + final Function instantiate = _instantiate; + + static FigureTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static FigureTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin FigureTranslationMappable { + String toJson() { + return FigureTranslationMapper.ensureInitialized() + .encodeJson(this as FigureTranslation); + } + + Map toMap() { + return FigureTranslationMapper.ensureInitialized() + .encodeMap(this as FigureTranslation); + } + + FigureTranslationCopyWith< + FigureTranslation, + FigureTranslation, + FigureTranslation + > + get copyWith => + _FigureTranslationCopyWithImpl( + this as FigureTranslation, + $identity, + $identity, + ); + @override + String toString() { + return FigureTranslationMapper.ensureInitialized().stringifyValue( + this as FigureTranslation, + ); + } + + @override + bool operator ==(Object other) { + return FigureTranslationMapper.ensureInitialized().equalsValue( + this as FigureTranslation, + other, + ); + } + + @override + int get hashCode { + return FigureTranslationMapper.ensureInitialized().hashValue( + this as FigureTranslation, + ); + } +} + +/// @nodoc +extension FigureTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, FigureTranslation, $Out> { + FigureTranslationCopyWith<$R, FigureTranslation, $Out> + get $asFigureTranslation => $base.as( + (v, t, t2) => _FigureTranslationCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class FigureTranslationCopyWith< + $R, + $In extends FigureTranslation, + $Out +> + implements DescriptiveTranslationCopyWith<$R, $In, $Out> { + MapCopyWith< + $R, + String, + FigureVariationTranslation, + FigureVariationTranslationCopyWith< + $R, + FigureVariationTranslation, + FigureVariationTranslation + > + > + get variations; + @override + $R call({ + String? name, + String? description, + Map? variations, + }); + FigureTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _FigureTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, FigureTranslation, $Out> + implements FigureTranslationCopyWith<$R, FigureTranslation, $Out> { + _FigureTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + FigureTranslationMapper.ensureInitialized(); + @override + MapCopyWith< + $R, + String, + FigureVariationTranslation, + FigureVariationTranslationCopyWith< + $R, + FigureVariationTranslation, + FigureVariationTranslation + > + > + get variations => MapCopyWith( + $value.variations, + (v, t) => v.copyWith.$chain(t), + (v) => call(variations: v), + ); + @override + $R call({ + String? name, + Object? description = $none, + Map? variations, + }) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (description != $none) #description: description, + if (variations != null) #variations: variations, + }), + ); + @override + FigureTranslation $make(CopyWithData data) => FigureTranslation( + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + variations: data.get(#variations, or: $value.variations), + ); + + @override + FigureTranslationCopyWith<$R2, FigureTranslation, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _FigureTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class FigureVariationTranslationMapper + extends ClassMapperBase { + FigureVariationTranslationMapper._(); + + static FigureVariationTranslationMapper? _instance; + static FigureVariationTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use( + _instance = FigureVariationTranslationMapper._(), + ); + DescriptiveTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'FigureVariationTranslation'; + + static String _$name(FigureVariationTranslation v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + ); + static String? _$description(FigureVariationTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + }; + + static FigureVariationTranslation _instantiate(DecodingData data) { + return FigureVariationTranslation( + name: data.dec(_f$name), + description: data.dec(_f$description), + ); + } + + @override + final Function instantiate = _instantiate; + + static FigureVariationTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static FigureVariationTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin FigureVariationTranslationMappable { + String toJson() { + return FigureVariationTranslationMapper.ensureInitialized() + .encodeJson( + this as FigureVariationTranslation, + ); + } + + Map toMap() { + return FigureVariationTranslationMapper.ensureInitialized() + .encodeMap( + this as FigureVariationTranslation, + ); + } + + FigureVariationTranslationCopyWith< + FigureVariationTranslation, + FigureVariationTranslation, + FigureVariationTranslation + > + get copyWith => + _FigureVariationTranslationCopyWithImpl< + FigureVariationTranslation, + FigureVariationTranslation + >(this as FigureVariationTranslation, $identity, $identity); + @override + String toString() { + return FigureVariationTranslationMapper.ensureInitialized().stringifyValue( + this as FigureVariationTranslation, + ); + } + + @override + bool operator ==(Object other) { + return FigureVariationTranslationMapper.ensureInitialized().equalsValue( + this as FigureVariationTranslation, + other, + ); + } + + @override + int get hashCode { + return FigureVariationTranslationMapper.ensureInitialized().hashValue( + this as FigureVariationTranslation, + ); + } +} + +/// @nodoc +extension FigureVariationTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, FigureVariationTranslation, $Out> { + FigureVariationTranslationCopyWith<$R, FigureVariationTranslation, $Out> + get $asFigureVariationTranslation => $base.as( + (v, t, t2) => _FigureVariationTranslationCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class FigureVariationTranslationCopyWith< + $R, + $In extends FigureVariationTranslation, + $Out +> + implements DescriptiveTranslationCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? description}); + FigureVariationTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _FigureVariationTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, FigureVariationTranslation, $Out> + implements + FigureVariationTranslationCopyWith< + $R, + FigureVariationTranslation, + $Out + > { + _FigureVariationTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + FigureVariationTranslationMapper.ensureInitialized(); + @override + $R call({String? name, Object? description = $none}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (description != $none) #description: description, + }), + ); + @override + FigureVariationTranslation $make(CopyWithData data) => + FigureVariationTranslation( + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + ); + + @override + FigureVariationTranslationCopyWith<$R2, FigureVariationTranslation, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _FigureVariationTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BackgroundTranslationMapper + extends ClassMapperBase { + BackgroundTranslationMapper._(); + + static BackgroundTranslationMapper? _instance; + static BackgroundTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BackgroundTranslationMapper._()); + DescriptiveTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BackgroundTranslation'; + + static String _$name(BackgroundTranslation v) => v.name; + static const Field _f$name = Field( + 'name', + _$name, + ); + static String? _$description(BackgroundTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + }; + + static BackgroundTranslation _instantiate(DecodingData data) { + return BackgroundTranslation( + name: data.dec(_f$name), + description: data.dec(_f$description), + ); + } + + @override + final Function instantiate = _instantiate; + + static BackgroundTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BackgroundTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BackgroundTranslationMappable { + String toJson() { + return BackgroundTranslationMapper.ensureInitialized() + .encodeJson(this as BackgroundTranslation); + } + + Map toMap() { + return BackgroundTranslationMapper.ensureInitialized() + .encodeMap(this as BackgroundTranslation); + } + + BackgroundTranslationCopyWith< + BackgroundTranslation, + BackgroundTranslation, + BackgroundTranslation + > + get copyWith => + _BackgroundTranslationCopyWithImpl< + BackgroundTranslation, + BackgroundTranslation + >(this as BackgroundTranslation, $identity, $identity); + @override + String toString() { + return BackgroundTranslationMapper.ensureInitialized().stringifyValue( + this as BackgroundTranslation, + ); + } + + @override + bool operator ==(Object other) { + return BackgroundTranslationMapper.ensureInitialized().equalsValue( + this as BackgroundTranslation, + other, + ); + } + + @override + int get hashCode { + return BackgroundTranslationMapper.ensureInitialized().hashValue( + this as BackgroundTranslation, + ); + } +} + +/// @nodoc +extension BackgroundTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, BackgroundTranslation, $Out> { + BackgroundTranslationCopyWith<$R, BackgroundTranslation, $Out> + get $asBackgroundTranslation => $base.as( + (v, t, t2) => _BackgroundTranslationCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class BackgroundTranslationCopyWith< + $R, + $In extends BackgroundTranslation, + $Out +> + implements DescriptiveTranslationCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? description}); + BackgroundTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BackgroundTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BackgroundTranslation, $Out> + implements BackgroundTranslationCopyWith<$R, BackgroundTranslation, $Out> { + _BackgroundTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BackgroundTranslationMapper.ensureInitialized(); + @override + $R call({String? name, Object? description = $none}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (description != $none) #description: description, + }), + ); + @override + BackgroundTranslation $make(CopyWithData data) => BackgroundTranslation( + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + ); + + @override + BackgroundTranslationCopyWith<$R2, BackgroundTranslation, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _BackgroundTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class BoardTranslationMapper extends ClassMapperBase { + BoardTranslationMapper._(); + + static BoardTranslationMapper? _instance; + static BoardTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = BoardTranslationMapper._()); + DescriptiveTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'BoardTranslation'; + + static String _$name(BoardTranslation v) => v.name; + static const Field _f$name = Field('name', _$name); + static String? _$description(BoardTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + }; + + static BoardTranslation _instantiate(DecodingData data) { + return BoardTranslation( + name: data.dec(_f$name), + description: data.dec(_f$description), + ); + } + + @override + final Function instantiate = _instantiate; + + static BoardTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static BoardTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin BoardTranslationMappable { + String toJson() { + return BoardTranslationMapper.ensureInitialized() + .encodeJson(this as BoardTranslation); + } + + Map toMap() { + return BoardTranslationMapper.ensureInitialized() + .encodeMap(this as BoardTranslation); + } + + BoardTranslationCopyWith + get copyWith => + _BoardTranslationCopyWithImpl( + this as BoardTranslation, + $identity, + $identity, + ); + @override + String toString() { + return BoardTranslationMapper.ensureInitialized().stringifyValue( + this as BoardTranslation, + ); + } + + @override + bool operator ==(Object other) { + return BoardTranslationMapper.ensureInitialized().equalsValue( + this as BoardTranslation, + other, + ); + } + + @override + int get hashCode { + return BoardTranslationMapper.ensureInitialized().hashValue( + this as BoardTranslation, + ); + } +} + +/// @nodoc +extension BoardTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, BoardTranslation, $Out> { + BoardTranslationCopyWith<$R, BoardTranslation, $Out> + get $asBoardTranslation => + $base.as((v, t, t2) => _BoardTranslationCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class BoardTranslationCopyWith<$R, $In extends BoardTranslation, $Out> + implements DescriptiveTranslationCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? description}); + BoardTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _BoardTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, BoardTranslation, $Out> + implements BoardTranslationCopyWith<$R, BoardTranslation, $Out> { + _BoardTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + BoardTranslationMapper.ensureInitialized(); + @override + $R call({String? name, Object? description = $none}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (description != $none) #description: description, + }), + ); + @override + BoardTranslation $make(CopyWithData data) => BoardTranslation( + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + ); + + @override + BoardTranslationCopyWith<$R2, BoardTranslation, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _BoardTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ModeTranslationMapper extends ClassMapperBase { + ModeTranslationMapper._(); + + static ModeTranslationMapper? _instance; + static ModeTranslationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ModeTranslationMapper._()); + DescriptiveTranslationMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'ModeTranslation'; + + static String _$name(ModeTranslation v) => v.name; + static const Field _f$name = Field('name', _$name); + static String? _$description(ModeTranslation v) => v.description; + static const Field _f$description = Field( + 'description', + _$description, + opt: true, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #description: _f$description, + }; + + static ModeTranslation _instantiate(DecodingData data) { + return ModeTranslation( + name: data.dec(_f$name), + description: data.dec(_f$description), + ); + } + + @override + final Function instantiate = _instantiate; + + static ModeTranslation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ModeTranslation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ModeTranslationMappable { + String toJson() { + return ModeTranslationMapper.ensureInitialized() + .encodeJson(this as ModeTranslation); + } + + Map toMap() { + return ModeTranslationMapper.ensureInitialized().encodeMap( + this as ModeTranslation, + ); + } + + ModeTranslationCopyWith + get copyWith => + _ModeTranslationCopyWithImpl( + this as ModeTranslation, + $identity, + $identity, + ); + @override + String toString() { + return ModeTranslationMapper.ensureInitialized().stringifyValue( + this as ModeTranslation, + ); + } + + @override + bool operator ==(Object other) { + return ModeTranslationMapper.ensureInitialized().equalsValue( + this as ModeTranslation, + other, + ); + } + + @override + int get hashCode { + return ModeTranslationMapper.ensureInitialized().hashValue( + this as ModeTranslation, + ); + } +} + +/// @nodoc +extension ModeTranslationValueCopy<$R, $Out> + on ObjectCopyWith<$R, ModeTranslation, $Out> { + ModeTranslationCopyWith<$R, ModeTranslation, $Out> get $asModeTranslation => + $base.as((v, t, t2) => _ModeTranslationCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ModeTranslationCopyWith<$R, $In extends ModeTranslation, $Out> + implements DescriptiveTranslationCopyWith<$R, $In, $Out> { + @override + $R call({String? name, String? description}); + ModeTranslationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ModeTranslationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ModeTranslation, $Out> + implements ModeTranslationCopyWith<$R, ModeTranslation, $Out> { + _ModeTranslationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ModeTranslationMapper.ensureInitialized(); + @override + $R call({String? name, Object? description = $none}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (description != $none) #description: description, + }), + ); + @override + ModeTranslation $make(CopyWithData data) => ModeTranslation( + name: data.get(#name, or: $value.name), + description: data.get(#description, or: $value.description), + ); + + @override + ModeTranslationCopyWith<$R2, ModeTranslation, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ModeTranslationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/vector.dart b/api/lib/src/models/vector.dart index 07001c82..aa680372 100644 --- a/api/lib/src/models/vector.dart +++ b/api/lib/src/models/vector.dart @@ -1,125 +1,125 @@ -import 'dart:math'; - -import 'package:dart_mappable/dart_mappable.dart'; - -import '../services/asset.dart'; - -part 'vector.mapper.dart'; - -@MappableClass(hook: VectorDefinitionHook()) -class VectorDefinition with VectorDefinitionMappable { - final int x, y; - - const VectorDefinition(this.x, this.y); - - factory VectorDefinition.fromDisplay(String displayString) { - final parts = displayString - .replaceAll('(', '') - .replaceAll(')', '') - .split(',') - .map((e) => e.trim()) - .toList(); - final x = int.parse(parts[0]); - final y = int.parse(parts[1]); - return VectorDefinition(x, y); - } - - static const zero = VectorDefinition(0, 0); - static const one = VectorDefinition(1, 1); - - String toDisplayString() => '($x, $y)'; - - VectorDefinition operator +(VectorDefinition other) => - VectorDefinition(x + other.x, y + other.y); - VectorDefinition operator -(VectorDefinition other) => - VectorDefinition(x - other.x, y - other.y); - - bool inBounds(VectorDefinition first, VectorDefinition last) { - final minX = min(first.x, last.x); - final maxX = max(first.x, last.x); - final minY = min(first.y, last.y); - final maxY = max(first.y, last.y); - return x >= minX && x <= maxX && y >= minY && y <= maxY; - } -} - -class VectorDefinitionHook extends MappingHook { - const VectorDefinitionHook(); - - @override - Object? beforeDecode(Object? value) { - if (value is Iterable) { - return VectorDefinition(value.first as int, value.last as int); - } - if (value is! String) { - return value; - } - return VectorDefinition.fromDisplay(value); - } - - @override - Object? beforeEncode(Object? value) { - if (value is! VectorDefinition) { - return value; - } - return value.toDisplayString(); - } -} - -@MappableClass() -class GlobalVectorDefinition with GlobalVectorDefinitionMappable { - final String table; - final VectorDefinition position; - - GlobalVectorDefinition(this.table, int x, int y) - : position = VectorDefinition(x, y); - - GlobalVectorDefinition.fromLocal(this.table, this.position); - - int get x => position.x; - int get y => position.y; -} - -@MappableClass(hook: ItemLocationHook()) -class ItemLocation with ItemLocationMappable { - final String namespace, id; - - ItemLocation(this.namespace, this.id); - factory ItemLocation.fromString(String location, [String? namespace]) { - namespace ??= kCorePackId; - final splitted = location.split(':'); - if (splitted.length < 2) { - return ItemLocation(namespace, splitted[0]); - } - return ItemLocation(splitted[0], splitted[1]); - } - - bool get isEmpty => namespace.isEmpty && id.isEmpty; - - @override - String toString() => namespace.isEmpty ? id : '$namespace:$id'; -} - -class ItemLocationHook extends MappingHook { - final bool nullOnEmpty; - - const ItemLocationHook({this.nullOnEmpty = true}); - - @override - Object? beforeDecode(Object? value) { - if (value is String) { - return ItemLocation.fromString(value).toMap(); - } - return value; - } - - @override - Object? afterEncode(Object? value) { - if (value is ItemLocation) { - if (value.isEmpty && nullOnEmpty) { - return null; - } - } - return value; - } -} +import 'dart:math'; + +import 'package:dart_mappable/dart_mappable.dart'; + +import '../services/asset.dart'; + +part 'vector.mapper.dart'; + +@MappableClass(hook: VectorDefinitionHook()) +class VectorDefinition with VectorDefinitionMappable { + final int x, y; + + const VectorDefinition(this.x, this.y); + + factory VectorDefinition.fromDisplay(String displayString) { + final parts = displayString + .replaceAll('(', '') + .replaceAll(')', '') + .split(',') + .map((e) => e.trim()) + .toList(); + final x = int.parse(parts[0]); + final y = int.parse(parts[1]); + return VectorDefinition(x, y); + } + + static const zero = VectorDefinition(0, 0); + static const one = VectorDefinition(1, 1); + + String toDisplayString() => '($x, $y)'; + + VectorDefinition operator +(VectorDefinition other) => + VectorDefinition(x + other.x, y + other.y); + VectorDefinition operator -(VectorDefinition other) => + VectorDefinition(x - other.x, y - other.y); + + bool inBounds(VectorDefinition first, VectorDefinition last) { + final minX = min(first.x, last.x); + final maxX = max(first.x, last.x); + final minY = min(first.y, last.y); + final maxY = max(first.y, last.y); + return x >= minX && x <= maxX && y >= minY && y <= maxY; + } +} + +class VectorDefinitionHook extends MappingHook { + const VectorDefinitionHook(); + + @override + Object? beforeDecode(Object? value) { + if (value is Iterable) { + return VectorDefinition(value.first as int, value.last as int); + } + if (value is! String) { + return value; + } + return VectorDefinition.fromDisplay(value); + } + + @override + Object? beforeEncode(Object? value) { + if (value is! VectorDefinition) { + return value; + } + return value.toDisplayString(); + } +} + +@MappableClass() +class GlobalVectorDefinition with GlobalVectorDefinitionMappable { + final String table; + final VectorDefinition position; + + GlobalVectorDefinition(this.table, int x, int y) + : position = VectorDefinition(x, y); + + GlobalVectorDefinition.fromLocal(this.table, this.position); + + int get x => position.x; + int get y => position.y; +} + +@MappableClass(hook: ItemLocationHook()) +class ItemLocation with ItemLocationMappable { + final String namespace, id; + + ItemLocation(this.namespace, this.id); + factory ItemLocation.fromString(String location, [String? namespace]) { + namespace ??= kCorePackId; + final splitted = location.split(':'); + if (splitted.length < 2) { + return ItemLocation(namespace, splitted[0]); + } + return ItemLocation(splitted[0], splitted[1]); + } + + bool get isEmpty => namespace.isEmpty && id.isEmpty; + + @override + String toString() => namespace.isEmpty ? id : '$namespace:$id'; +} + +class ItemLocationHook extends MappingHook { + final bool nullOnEmpty; + + const ItemLocationHook({this.nullOnEmpty = true}); + + @override + Object? beforeDecode(Object? value) { + if (value is String) { + return ItemLocation.fromString(value).toMap(); + } + return value; + } + + @override + Object? afterEncode(Object? value) { + if (value is ItemLocation) { + if (value.isEmpty && nullOnEmpty) { + return null; + } + } + return value; + } +} diff --git a/api/lib/src/models/vector.mapper.dart b/api/lib/src/models/vector.mapper.dart index 7dbd3ed0..a2b96b6d 100644 --- a/api/lib/src/models/vector.mapper.dart +++ b/api/lib/src/models/vector.mapper.dart @@ -1,419 +1,419 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'vector.dart'; - -/// @nodoc -class VectorDefinitionMapper extends ClassMapperBase { - VectorDefinitionMapper._(); - - static VectorDefinitionMapper? _instance; - static VectorDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = VectorDefinitionMapper._()); - } - return _instance!; - } - - @override - final String id = 'VectorDefinition'; - - static int _$x(VectorDefinition v) => v.x; - static const Field _f$x = Field('x', _$x); - static int _$y(VectorDefinition v) => v.y; - static const Field _f$y = Field('y', _$y); - - @override - final MappableFields fields = const {#x: _f$x, #y: _f$y}; - - @override - final MappingHook hook = const VectorDefinitionHook(); - static VectorDefinition _instantiate(DecodingData data) { - return VectorDefinition(data.dec(_f$x), data.dec(_f$y)); - } - - @override - final Function instantiate = _instantiate; - - static VectorDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static VectorDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin VectorDefinitionMappable { - String toJson() { - return VectorDefinitionMapper.ensureInitialized() - .encodeJson(this as VectorDefinition); - } - - Map toMap() { - return VectorDefinitionMapper.ensureInitialized() - .encodeMap(this as VectorDefinition); - } - - VectorDefinitionCopyWith - get copyWith => - _VectorDefinitionCopyWithImpl( - this as VectorDefinition, - $identity, - $identity, - ); - @override - String toString() { - return VectorDefinitionMapper.ensureInitialized().stringifyValue( - this as VectorDefinition, - ); - } - - @override - bool operator ==(Object other) { - return VectorDefinitionMapper.ensureInitialized().equalsValue( - this as VectorDefinition, - other, - ); - } - - @override - int get hashCode { - return VectorDefinitionMapper.ensureInitialized().hashValue( - this as VectorDefinition, - ); - } -} - -/// @nodoc -extension VectorDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, VectorDefinition, $Out> { - VectorDefinitionCopyWith<$R, VectorDefinition, $Out> - get $asVectorDefinition => - $base.as((v, t, t2) => _VectorDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class VectorDefinitionCopyWith<$R, $In extends VectorDefinition, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({int? x, int? y}); - VectorDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _VectorDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, VectorDefinition, $Out> - implements VectorDefinitionCopyWith<$R, VectorDefinition, $Out> { - _VectorDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - VectorDefinitionMapper.ensureInitialized(); - @override - $R call({int? x, int? y}) => - $apply(FieldCopyWithData({if (x != null) #x: x, if (y != null) #y: y})); - @override - VectorDefinition $make(CopyWithData data) => - VectorDefinition(data.get(#x, or: $value.x), data.get(#y, or: $value.y)); - - @override - VectorDefinitionCopyWith<$R2, VectorDefinition, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _VectorDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class GlobalVectorDefinitionMapper - extends ClassMapperBase { - GlobalVectorDefinitionMapper._(); - - static GlobalVectorDefinitionMapper? _instance; - static GlobalVectorDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = GlobalVectorDefinitionMapper._()); - } - return _instance!; - } - - @override - final String id = 'GlobalVectorDefinition'; - - static String _$table(GlobalVectorDefinition v) => v.table; - static const Field _f$table = Field( - 'table', - _$table, - ); - static int _$x(GlobalVectorDefinition v) => v.x; - static const Field _f$x = Field('x', _$x); - static int _$y(GlobalVectorDefinition v) => v.y; - static const Field _f$y = Field('y', _$y); - static VectorDefinition _$position(GlobalVectorDefinition v) => v.position; - static const Field _f$position = - Field('position', _$position, mode: FieldMode.member); - - @override - final MappableFields fields = const { - #table: _f$table, - #x: _f$x, - #y: _f$y, - #position: _f$position, - }; - - static GlobalVectorDefinition _instantiate(DecodingData data) { - return GlobalVectorDefinition( - data.dec(_f$table), - data.dec(_f$x), - data.dec(_f$y), - ); - } - - @override - final Function instantiate = _instantiate; - - static GlobalVectorDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static GlobalVectorDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin GlobalVectorDefinitionMappable { - String toJson() { - return GlobalVectorDefinitionMapper.ensureInitialized() - .encodeJson(this as GlobalVectorDefinition); - } - - Map toMap() { - return GlobalVectorDefinitionMapper.ensureInitialized() - .encodeMap(this as GlobalVectorDefinition); - } - - GlobalVectorDefinitionCopyWith< - GlobalVectorDefinition, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get copyWith => - _GlobalVectorDefinitionCopyWithImpl< - GlobalVectorDefinition, - GlobalVectorDefinition - >(this as GlobalVectorDefinition, $identity, $identity); - @override - String toString() { - return GlobalVectorDefinitionMapper.ensureInitialized().stringifyValue( - this as GlobalVectorDefinition, - ); - } - - @override - bool operator ==(Object other) { - return GlobalVectorDefinitionMapper.ensureInitialized().equalsValue( - this as GlobalVectorDefinition, - other, - ); - } - - @override - int get hashCode { - return GlobalVectorDefinitionMapper.ensureInitialized().hashValue( - this as GlobalVectorDefinition, - ); - } -} - -/// @nodoc -extension GlobalVectorDefinitionValueCopy<$R, $Out> - on ObjectCopyWith<$R, GlobalVectorDefinition, $Out> { - GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition, $Out> - get $asGlobalVectorDefinition => $base.as( - (v, t, t2) => _GlobalVectorDefinitionCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class GlobalVectorDefinitionCopyWith< - $R, - $In extends GlobalVectorDefinition, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? table, int? x, int? y}); - GlobalVectorDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _GlobalVectorDefinitionCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, GlobalVectorDefinition, $Out> - implements - GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition, $Out> { - _GlobalVectorDefinitionCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - GlobalVectorDefinitionMapper.ensureInitialized(); - @override - $R call({String? table, int? x, int? y}) => $apply( - FieldCopyWithData({ - if (table != null) #table: table, - if (x != null) #x: x, - if (y != null) #y: y, - }), - ); - @override - GlobalVectorDefinition $make(CopyWithData data) => GlobalVectorDefinition( - data.get(#table, or: $value.table), - data.get(#x, or: $value.x), - data.get(#y, or: $value.y), - ); - - @override - GlobalVectorDefinitionCopyWith<$R2, GlobalVectorDefinition, $Out2> - $chain<$R2, $Out2>(Then<$Out2, $R2> t) => - _GlobalVectorDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - -/// @nodoc -class ItemLocationMapper extends ClassMapperBase { - ItemLocationMapper._(); - - static ItemLocationMapper? _instance; - static ItemLocationMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ItemLocationMapper._()); - } - return _instance!; - } - - @override - final String id = 'ItemLocation'; - - static String _$namespace(ItemLocation v) => v.namespace; - static const Field _f$namespace = Field( - 'namespace', - _$namespace, - ); - static String _$id(ItemLocation v) => v.id; - static const Field _f$id = Field('id', _$id); - - @override - final MappableFields fields = const { - #namespace: _f$namespace, - #id: _f$id, - }; - - @override - final MappingHook hook = const ItemLocationHook(); - static ItemLocation _instantiate(DecodingData data) { - return ItemLocation(data.dec(_f$namespace), data.dec(_f$id)); - } - - @override - final Function instantiate = _instantiate; - - static ItemLocation fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ItemLocation fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ItemLocationMappable { - String toJson() { - return ItemLocationMapper.ensureInitialized().encodeJson( - this as ItemLocation, - ); - } - - Map toMap() { - return ItemLocationMapper.ensureInitialized().encodeMap( - this as ItemLocation, - ); - } - - ItemLocationCopyWith get copyWith => - _ItemLocationCopyWithImpl( - this as ItemLocation, - $identity, - $identity, - ); - @override - String toString() { - return ItemLocationMapper.ensureInitialized().stringifyValue( - this as ItemLocation, - ); - } - - @override - bool operator ==(Object other) { - return ItemLocationMapper.ensureInitialized().equalsValue( - this as ItemLocation, - other, - ); - } - - @override - int get hashCode { - return ItemLocationMapper.ensureInitialized().hashValue( - this as ItemLocation, - ); - } -} - -/// @nodoc -extension ItemLocationValueCopy<$R, $Out> - on ObjectCopyWith<$R, ItemLocation, $Out> { - ItemLocationCopyWith<$R, ItemLocation, $Out> get $asItemLocation => - $base.as((v, t, t2) => _ItemLocationCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class ItemLocationCopyWith<$R, $In extends ItemLocation, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({String? namespace, String? id}); - ItemLocationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _ItemLocationCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ItemLocation, $Out> - implements ItemLocationCopyWith<$R, ItemLocation, $Out> { - _ItemLocationCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ItemLocationMapper.ensureInitialized(); - @override - $R call({String? namespace, String? id}) => $apply( - FieldCopyWithData({ - if (namespace != null) #namespace: namespace, - if (id != null) #id: id, - }), - ); - @override - ItemLocation $make(CopyWithData data) => ItemLocation( - data.get(#namespace, or: $value.namespace), - data.get(#id, or: $value.id), - ); - - @override - ItemLocationCopyWith<$R2, ItemLocation, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ItemLocationCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'vector.dart'; + +/// @nodoc +class VectorDefinitionMapper extends ClassMapperBase { + VectorDefinitionMapper._(); + + static VectorDefinitionMapper? _instance; + static VectorDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = VectorDefinitionMapper._()); + } + return _instance!; + } + + @override + final String id = 'VectorDefinition'; + + static int _$x(VectorDefinition v) => v.x; + static const Field _f$x = Field('x', _$x); + static int _$y(VectorDefinition v) => v.y; + static const Field _f$y = Field('y', _$y); + + @override + final MappableFields fields = const {#x: _f$x, #y: _f$y}; + + @override + final MappingHook hook = const VectorDefinitionHook(); + static VectorDefinition _instantiate(DecodingData data) { + return VectorDefinition(data.dec(_f$x), data.dec(_f$y)); + } + + @override + final Function instantiate = _instantiate; + + static VectorDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static VectorDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin VectorDefinitionMappable { + String toJson() { + return VectorDefinitionMapper.ensureInitialized() + .encodeJson(this as VectorDefinition); + } + + Map toMap() { + return VectorDefinitionMapper.ensureInitialized() + .encodeMap(this as VectorDefinition); + } + + VectorDefinitionCopyWith + get copyWith => + _VectorDefinitionCopyWithImpl( + this as VectorDefinition, + $identity, + $identity, + ); + @override + String toString() { + return VectorDefinitionMapper.ensureInitialized().stringifyValue( + this as VectorDefinition, + ); + } + + @override + bool operator ==(Object other) { + return VectorDefinitionMapper.ensureInitialized().equalsValue( + this as VectorDefinition, + other, + ); + } + + @override + int get hashCode { + return VectorDefinitionMapper.ensureInitialized().hashValue( + this as VectorDefinition, + ); + } +} + +/// @nodoc +extension VectorDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, VectorDefinition, $Out> { + VectorDefinitionCopyWith<$R, VectorDefinition, $Out> + get $asVectorDefinition => + $base.as((v, t, t2) => _VectorDefinitionCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class VectorDefinitionCopyWith<$R, $In extends VectorDefinition, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({int? x, int? y}); + VectorDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _VectorDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, VectorDefinition, $Out> + implements VectorDefinitionCopyWith<$R, VectorDefinition, $Out> { + _VectorDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + VectorDefinitionMapper.ensureInitialized(); + @override + $R call({int? x, int? y}) => + $apply(FieldCopyWithData({if (x != null) #x: x, if (y != null) #y: y})); + @override + VectorDefinition $make(CopyWithData data) => + VectorDefinition(data.get(#x, or: $value.x), data.get(#y, or: $value.y)); + + @override + VectorDefinitionCopyWith<$R2, VectorDefinition, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _VectorDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class GlobalVectorDefinitionMapper + extends ClassMapperBase { + GlobalVectorDefinitionMapper._(); + + static GlobalVectorDefinitionMapper? _instance; + static GlobalVectorDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = GlobalVectorDefinitionMapper._()); + } + return _instance!; + } + + @override + final String id = 'GlobalVectorDefinition'; + + static String _$table(GlobalVectorDefinition v) => v.table; + static const Field _f$table = Field( + 'table', + _$table, + ); + static int _$x(GlobalVectorDefinition v) => v.x; + static const Field _f$x = Field('x', _$x); + static int _$y(GlobalVectorDefinition v) => v.y; + static const Field _f$y = Field('y', _$y); + static VectorDefinition _$position(GlobalVectorDefinition v) => v.position; + static const Field _f$position = + Field('position', _$position, mode: FieldMode.member); + + @override + final MappableFields fields = const { + #table: _f$table, + #x: _f$x, + #y: _f$y, + #position: _f$position, + }; + + static GlobalVectorDefinition _instantiate(DecodingData data) { + return GlobalVectorDefinition( + data.dec(_f$table), + data.dec(_f$x), + data.dec(_f$y), + ); + } + + @override + final Function instantiate = _instantiate; + + static GlobalVectorDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static GlobalVectorDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin GlobalVectorDefinitionMappable { + String toJson() { + return GlobalVectorDefinitionMapper.ensureInitialized() + .encodeJson(this as GlobalVectorDefinition); + } + + Map toMap() { + return GlobalVectorDefinitionMapper.ensureInitialized() + .encodeMap(this as GlobalVectorDefinition); + } + + GlobalVectorDefinitionCopyWith< + GlobalVectorDefinition, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get copyWith => + _GlobalVectorDefinitionCopyWithImpl< + GlobalVectorDefinition, + GlobalVectorDefinition + >(this as GlobalVectorDefinition, $identity, $identity); + @override + String toString() { + return GlobalVectorDefinitionMapper.ensureInitialized().stringifyValue( + this as GlobalVectorDefinition, + ); + } + + @override + bool operator ==(Object other) { + return GlobalVectorDefinitionMapper.ensureInitialized().equalsValue( + this as GlobalVectorDefinition, + other, + ); + } + + @override + int get hashCode { + return GlobalVectorDefinitionMapper.ensureInitialized().hashValue( + this as GlobalVectorDefinition, + ); + } +} + +/// @nodoc +extension GlobalVectorDefinitionValueCopy<$R, $Out> + on ObjectCopyWith<$R, GlobalVectorDefinition, $Out> { + GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition, $Out> + get $asGlobalVectorDefinition => $base.as( + (v, t, t2) => _GlobalVectorDefinitionCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class GlobalVectorDefinitionCopyWith< + $R, + $In extends GlobalVectorDefinition, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? table, int? x, int? y}); + GlobalVectorDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _GlobalVectorDefinitionCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, GlobalVectorDefinition, $Out> + implements + GlobalVectorDefinitionCopyWith<$R, GlobalVectorDefinition, $Out> { + _GlobalVectorDefinitionCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + GlobalVectorDefinitionMapper.ensureInitialized(); + @override + $R call({String? table, int? x, int? y}) => $apply( + FieldCopyWithData({ + if (table != null) #table: table, + if (x != null) #x: x, + if (y != null) #y: y, + }), + ); + @override + GlobalVectorDefinition $make(CopyWithData data) => GlobalVectorDefinition( + data.get(#table, or: $value.table), + data.get(#x, or: $value.x), + data.get(#y, or: $value.y), + ); + + @override + GlobalVectorDefinitionCopyWith<$R2, GlobalVectorDefinition, $Out2> + $chain<$R2, $Out2>(Then<$Out2, $R2> t) => + _GlobalVectorDefinitionCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + +/// @nodoc +class ItemLocationMapper extends ClassMapperBase { + ItemLocationMapper._(); + + static ItemLocationMapper? _instance; + static ItemLocationMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ItemLocationMapper._()); + } + return _instance!; + } + + @override + final String id = 'ItemLocation'; + + static String _$namespace(ItemLocation v) => v.namespace; + static const Field _f$namespace = Field( + 'namespace', + _$namespace, + ); + static String _$id(ItemLocation v) => v.id; + static const Field _f$id = Field('id', _$id); + + @override + final MappableFields fields = const { + #namespace: _f$namespace, + #id: _f$id, + }; + + @override + final MappingHook hook = const ItemLocationHook(); + static ItemLocation _instantiate(DecodingData data) { + return ItemLocation(data.dec(_f$namespace), data.dec(_f$id)); + } + + @override + final Function instantiate = _instantiate; + + static ItemLocation fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ItemLocation fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ItemLocationMappable { + String toJson() { + return ItemLocationMapper.ensureInitialized().encodeJson( + this as ItemLocation, + ); + } + + Map toMap() { + return ItemLocationMapper.ensureInitialized().encodeMap( + this as ItemLocation, + ); + } + + ItemLocationCopyWith get copyWith => + _ItemLocationCopyWithImpl( + this as ItemLocation, + $identity, + $identity, + ); + @override + String toString() { + return ItemLocationMapper.ensureInitialized().stringifyValue( + this as ItemLocation, + ); + } + + @override + bool operator ==(Object other) { + return ItemLocationMapper.ensureInitialized().equalsValue( + this as ItemLocation, + other, + ); + } + + @override + int get hashCode { + return ItemLocationMapper.ensureInitialized().hashValue( + this as ItemLocation, + ); + } +} + +/// @nodoc +extension ItemLocationValueCopy<$R, $Out> + on ObjectCopyWith<$R, ItemLocation, $Out> { + ItemLocationCopyWith<$R, ItemLocation, $Out> get $asItemLocation => + $base.as((v, t, t2) => _ItemLocationCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class ItemLocationCopyWith<$R, $In extends ItemLocation, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({String? namespace, String? id}); + ItemLocationCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _ItemLocationCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ItemLocation, $Out> + implements ItemLocationCopyWith<$R, ItemLocation, $Out> { + _ItemLocationCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ItemLocationMapper.ensureInitialized(); + @override + $R call({String? namespace, String? id}) => $apply( + FieldCopyWithData({ + if (namespace != null) #namespace: namespace, + if (id != null) #id: id, + }), + ); + @override + ItemLocation $make(CopyWithData data) => ItemLocation( + data.get(#namespace, or: $value.namespace), + data.get(#id, or: $value.id), + ); + + @override + ItemLocationCopyWith<$R2, ItemLocation, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ItemLocationCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/models/visual.dart b/api/lib/src/models/visual.dart index 3f338857..0ec81f4a 100644 --- a/api/lib/src/models/visual.dart +++ b/api/lib/src/models/visual.dart @@ -1,18 +1,18 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -import 'vector.dart'; - -part 'visual.mapper.dart'; - -@MappableClass() -abstract class VisualDefinition with VisualDefinitionMappable { - final String texture; - final VectorDefinition offset; - final VectorDefinition? size; - - VisualDefinition({ - required this.texture, - this.offset = VectorDefinition.zero, - required this.size, - }); -} +import 'package:dart_mappable/dart_mappable.dart'; + +import 'vector.dart'; + +part 'visual.mapper.dart'; + +@MappableClass() +abstract class VisualDefinition with VisualDefinitionMappable { + final String texture; + final VectorDefinition offset; + final VectorDefinition? size; + + VisualDefinition({ + required this.texture, + this.offset = VectorDefinition.zero, + required this.size, + }); +} diff --git a/api/lib/src/models/visual.mapper.dart b/api/lib/src/models/visual.mapper.dart index 1b84c1ab..051a59c8 100644 --- a/api/lib/src/models/visual.mapper.dart +++ b/api/lib/src/models/visual.mapper.dart @@ -1,86 +1,86 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'visual.dart'; - -/// @nodoc -class VisualDefinitionMapper extends ClassMapperBase { - VisualDefinitionMapper._(); - - static VisualDefinitionMapper? _instance; - static VisualDefinitionMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = VisualDefinitionMapper._()); - VectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'VisualDefinition'; - - static String _$texture(VisualDefinition v) => v.texture; - static const Field _f$texture = Field( - 'texture', - _$texture, - ); - static VectorDefinition _$offset(VisualDefinition v) => v.offset; - static const Field _f$offset = Field( - 'offset', - _$offset, - opt: true, - def: VectorDefinition.zero, - ); - static VectorDefinition? _$size(VisualDefinition v) => v.size; - static const Field _f$size = Field( - 'size', - _$size, - ); - - @override - final MappableFields fields = const { - #texture: _f$texture, - #offset: _f$offset, - #size: _f$size, - }; - - static VisualDefinition _instantiate(DecodingData data) { - throw MapperException.missingConstructor('VisualDefinition'); - } - - @override - final Function instantiate = _instantiate; - - static VisualDefinition fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static VisualDefinition fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin VisualDefinitionMappable { - String toJson(); - Map toMap(); - VisualDefinitionCopyWith - get copyWith; -} - -/// @nodoc -abstract class VisualDefinitionCopyWith<$R, $In extends VisualDefinition, $Out> - implements ClassCopyWith<$R, $In, $Out> { - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; - VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; - $R call({String? texture, VectorDefinition? offset, VectorDefinition? size}); - VisualDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'visual.dart'; + +/// @nodoc +class VisualDefinitionMapper extends ClassMapperBase { + VisualDefinitionMapper._(); + + static VisualDefinitionMapper? _instance; + static VisualDefinitionMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = VisualDefinitionMapper._()); + VectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'VisualDefinition'; + + static String _$texture(VisualDefinition v) => v.texture; + static const Field _f$texture = Field( + 'texture', + _$texture, + ); + static VectorDefinition _$offset(VisualDefinition v) => v.offset; + static const Field _f$offset = Field( + 'offset', + _$offset, + opt: true, + def: VectorDefinition.zero, + ); + static VectorDefinition? _$size(VisualDefinition v) => v.size; + static const Field _f$size = Field( + 'size', + _$size, + ); + + @override + final MappableFields fields = const { + #texture: _f$texture, + #offset: _f$offset, + #size: _f$size, + }; + + static VisualDefinition _instantiate(DecodingData data) { + throw MapperException.missingConstructor('VisualDefinition'); + } + + @override + final Function instantiate = _instantiate; + + static VisualDefinition fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static VisualDefinition fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin VisualDefinitionMappable { + String toJson(); + Map toMap(); + VisualDefinitionCopyWith + get copyWith; +} + +/// @nodoc +abstract class VisualDefinitionCopyWith<$R, $In extends VisualDefinition, $Out> + implements ClassCopyWith<$R, $In, $Out> { + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition> get offset; + VectorDefinitionCopyWith<$R, VectorDefinition, VectorDefinition>? get size; + $R call({String? texture, VectorDefinition? offset, VectorDefinition? size}); + VisualDefinitionCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + diff --git a/api/lib/src/models/waypoint.dart b/api/lib/src/models/waypoint.dart index 7f381af2..9e04b585 100644 --- a/api/lib/src/models/waypoint.dart +++ b/api/lib/src/models/waypoint.dart @@ -1,13 +1,13 @@ -import 'package:dart_mappable/dart_mappable.dart'; - -import 'vector.dart'; - -part 'waypoint.mapper.dart'; - -@MappableClass() -final class Waypoint with WaypointMappable { - final String name; - final GlobalVectorDefinition position; - - Waypoint({required this.name, required this.position}); -} +import 'package:dart_mappable/dart_mappable.dart'; + +import 'vector.dart'; + +part 'waypoint.mapper.dart'; + +@MappableClass() +final class Waypoint with WaypointMappable { + final String name; + final GlobalVectorDefinition position; + + Waypoint({required this.name, required this.position}); +} diff --git a/api/lib/src/models/waypoint.mapper.dart b/api/lib/src/models/waypoint.mapper.dart index 2de9191f..6cd893ca 100644 --- a/api/lib/src/models/waypoint.mapper.dart +++ b/api/lib/src/models/waypoint.mapper.dart @@ -1,149 +1,149 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'waypoint.dart'; - -/// @nodoc -class WaypointMapper extends ClassMapperBase { - WaypointMapper._(); - - static WaypointMapper? _instance; - static WaypointMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = WaypointMapper._()); - GlobalVectorDefinitionMapper.ensureInitialized(); - } - return _instance!; - } - - @override - final String id = 'Waypoint'; - - static String _$name(Waypoint v) => v.name; - static const Field _f$name = Field('name', _$name); - static GlobalVectorDefinition _$position(Waypoint v) => v.position; - static const Field _f$position = Field( - 'position', - _$position, - ); - - @override - final MappableFields fields = const { - #name: _f$name, - #position: _f$position, - }; - - static Waypoint _instantiate(DecodingData data) { - return Waypoint(name: data.dec(_f$name), position: data.dec(_f$position)); - } - - @override - final Function instantiate = _instantiate; - - static Waypoint fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static Waypoint fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin WaypointMappable { - String toJson() { - return WaypointMapper.ensureInitialized().encodeJson( - this as Waypoint, - ); - } - - Map toMap() { - return WaypointMapper.ensureInitialized().encodeMap( - this as Waypoint, - ); - } - - WaypointCopyWith get copyWith => - _WaypointCopyWithImpl( - this as Waypoint, - $identity, - $identity, - ); - @override - String toString() { - return WaypointMapper.ensureInitialized().stringifyValue(this as Waypoint); - } - - @override - bool operator ==(Object other) { - return WaypointMapper.ensureInitialized().equalsValue( - this as Waypoint, - other, - ); - } - - @override - int get hashCode { - return WaypointMapper.ensureInitialized().hashValue(this as Waypoint); - } -} - -/// @nodoc -extension WaypointValueCopy<$R, $Out> on ObjectCopyWith<$R, Waypoint, $Out> { - WaypointCopyWith<$R, Waypoint, $Out> get $asWaypoint => - $base.as((v, t, t2) => _WaypointCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class WaypointCopyWith<$R, $In extends Waypoint, $Out> - implements ClassCopyWith<$R, $In, $Out> { - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get position; - $R call({String? name, GlobalVectorDefinition? position}); - WaypointCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _WaypointCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, Waypoint, $Out> - implements WaypointCopyWith<$R, Waypoint, $Out> { - _WaypointCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - WaypointMapper.ensureInitialized(); - @override - GlobalVectorDefinitionCopyWith< - $R, - GlobalVectorDefinition, - GlobalVectorDefinition - > - get position => $value.position.copyWith.$chain((v) => call(position: v)); - @override - $R call({String? name, GlobalVectorDefinition? position}) => $apply( - FieldCopyWithData({ - if (name != null) #name: name, - if (position != null) #position: position, - }), - ); - @override - Waypoint $make(CopyWithData data) => Waypoint( - name: data.get(#name, or: $value.name), - position: data.get(#position, or: $value.position), - ); - - @override - WaypointCopyWith<$R2, Waypoint, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _WaypointCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'waypoint.dart'; + +/// @nodoc +class WaypointMapper extends ClassMapperBase { + WaypointMapper._(); + + static WaypointMapper? _instance; + static WaypointMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = WaypointMapper._()); + GlobalVectorDefinitionMapper.ensureInitialized(); + } + return _instance!; + } + + @override + final String id = 'Waypoint'; + + static String _$name(Waypoint v) => v.name; + static const Field _f$name = Field('name', _$name); + static GlobalVectorDefinition _$position(Waypoint v) => v.position; + static const Field _f$position = Field( + 'position', + _$position, + ); + + @override + final MappableFields fields = const { + #name: _f$name, + #position: _f$position, + }; + + static Waypoint _instantiate(DecodingData data) { + return Waypoint(name: data.dec(_f$name), position: data.dec(_f$position)); + } + + @override + final Function instantiate = _instantiate; + + static Waypoint fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static Waypoint fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin WaypointMappable { + String toJson() { + return WaypointMapper.ensureInitialized().encodeJson( + this as Waypoint, + ); + } + + Map toMap() { + return WaypointMapper.ensureInitialized().encodeMap( + this as Waypoint, + ); + } + + WaypointCopyWith get copyWith => + _WaypointCopyWithImpl( + this as Waypoint, + $identity, + $identity, + ); + @override + String toString() { + return WaypointMapper.ensureInitialized().stringifyValue(this as Waypoint); + } + + @override + bool operator ==(Object other) { + return WaypointMapper.ensureInitialized().equalsValue( + this as Waypoint, + other, + ); + } + + @override + int get hashCode { + return WaypointMapper.ensureInitialized().hashValue(this as Waypoint); + } +} + +/// @nodoc +extension WaypointValueCopy<$R, $Out> on ObjectCopyWith<$R, Waypoint, $Out> { + WaypointCopyWith<$R, Waypoint, $Out> get $asWaypoint => + $base.as((v, t, t2) => _WaypointCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class WaypointCopyWith<$R, $In extends Waypoint, $Out> + implements ClassCopyWith<$R, $In, $Out> { + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get position; + $R call({String? name, GlobalVectorDefinition? position}); + WaypointCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _WaypointCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, Waypoint, $Out> + implements WaypointCopyWith<$R, Waypoint, $Out> { + _WaypointCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + WaypointMapper.ensureInitialized(); + @override + GlobalVectorDefinitionCopyWith< + $R, + GlobalVectorDefinition, + GlobalVectorDefinition + > + get position => $value.position.copyWith.$chain((v) => call(position: v)); + @override + $R call({String? name, GlobalVectorDefinition? position}) => $apply( + FieldCopyWithData({ + if (name != null) #name: name, + if (position != null) #position: position, + }), + ); + @override + Waypoint $make(CopyWithData data) => Waypoint( + name: data.get(#name, or: $value.name), + position: data.get(#position, or: $value.position), + ); + + @override + WaypointCopyWith<$R2, Waypoint, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _WaypointCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/lib/src/services/asset.dart b/api/lib/src/services/asset.dart index 1332ab1d..c94b59b3 100644 --- a/api/lib/src/services/asset.dart +++ b/api/lib/src/services/asset.dart @@ -1,59 +1,59 @@ -import 'package:setonix_api/setonix_api.dart'; - -const kCorePackId = "core"; - -abstract class AssetManager { - SetonixData? getPack(String key); - bool hasPack(String key); - - Iterable> get packs; - - Map createSignature([Set? packs]) { - final signature = {}; - for (final entry in this.packs) { - final name = entry.key == kCorePackId - ? kCorePackId - : entry.value.identifier; - if (!(packs?.contains(name) ?? true)) continue; - signature[entry.key] = SignatureMetadata( - metadata: entry.value.getMetadataOrDefault(), - id: name, - downloadUrls: getDownloadUrls(entry.key) ?? [], - ); - } - return signature; - } - - List? getDownloadUrls(String id) => null; - - BoardDefinition? getBoard(ItemLocation location) => - getPack(location.namespace)?.getBoard(location.id); - - PackItem? getBoardItem(ItemLocation location) => getPack( - location.namespace, - )?.getBoardItem(location.id, location.namespace); - - FigureDefinition? getFigure(ItemLocation location) => - getPack(location.namespace)?.getFigure(location.id); - - PackItem? getFigureItem(ItemLocation location) => getPack( - location.namespace, - )?.getFigureItem(location.id, location.namespace); - - BackgroundDefinition? getBackground(ItemLocation location) => - getPack(location.namespace)?.getBackground(location.id); - - PackItem? getBackgroundItem(ItemLocation location) => - getPack( - location.namespace, - )?.getBackgroundItem(location.id, location.namespace); - - DeckDefinition? getDeck(ItemLocation location) => - getPack(location.namespace)?.getDeck(location.id); - - PackItem? getDeckItem(ItemLocation location) => - getPack(location.namespace)?.getDeckItem(location.id, location.namespace); - - PackItem? getModeItem(ItemLocation location) => - getPack(location.namespace)?.getModeItem(location.id, location.namespace); -} +import 'package:setonix_api/setonix_api.dart'; + +const kCorePackId = "core"; + +abstract class AssetManager { + SetonixData? getPack(String key); + bool hasPack(String key); + + Iterable> get packs; + + Map createSignature([Set? packs]) { + final signature = {}; + for (final entry in this.packs) { + final name = entry.key == kCorePackId + ? kCorePackId + : entry.value.identifier; + if (!(packs?.contains(name) ?? true)) continue; + signature[entry.key] = SignatureMetadata( + metadata: entry.value.getMetadataOrDefault(), + id: name, + downloadUrls: getDownloadUrls(entry.key) ?? [], + ); + } + return signature; + } + + List? getDownloadUrls(String id) => null; + + BoardDefinition? getBoard(ItemLocation location) => + getPack(location.namespace)?.getBoard(location.id); + + PackItem? getBoardItem(ItemLocation location) => getPack( + location.namespace, + )?.getBoardItem(location.id, location.namespace); + + FigureDefinition? getFigure(ItemLocation location) => + getPack(location.namespace)?.getFigure(location.id); + + PackItem? getFigureItem(ItemLocation location) => getPack( + location.namespace, + )?.getFigureItem(location.id, location.namespace); + + BackgroundDefinition? getBackground(ItemLocation location) => + getPack(location.namespace)?.getBackground(location.id); + + PackItem? getBackgroundItem(ItemLocation location) => + getPack( + location.namespace, + )?.getBackgroundItem(location.id, location.namespace); + + DeckDefinition? getDeck(ItemLocation location) => + getPack(location.namespace)?.getDeck(location.id); + + PackItem? getDeckItem(ItemLocation location) => + getPack(location.namespace)?.getDeckItem(location.id, location.namespace); + + PackItem? getModeItem(ItemLocation location) => + getPack(location.namespace)?.getModeItem(location.id, location.namespace); +} diff --git a/api/lib/src/services/challenge.dart b/api/lib/src/services/challenge.dart index cb5a5bf2..b6767aa9 100644 --- a/api/lib/src/services/challenge.dart +++ b/api/lib/src/services/challenge.dart @@ -1,31 +1,31 @@ -import 'dart:math'; -import 'dart:typed_data'; - -import 'package:networker/networker.dart'; - -class ChallengeManager { - final Map _challenges = {}; - - Uint8List? getChallenge(Channel channel) { - return _challenges[channel]; - } - - Uint8List generateNewChallenge(Channel channel) { - final challenge = generateChallenge(); - _challenges[channel] = challenge; - return challenge; - } - - void removeChallenge(Channel channel) { - _challenges.remove(channel); - } -} - -Uint8List generateChallenge() { - final random = Random.secure(); - final bytes = Uint8List(32); - for (var i = 0; i < bytes.length; i++) { - bytes[i] = random.nextInt(256); - } - return bytes; -} +import 'dart:math'; +import 'dart:typed_data'; + +import 'package:networker/networker.dart'; + +class ChallengeManager { + final Map _challenges = {}; + + Uint8List? getChallenge(Channel channel) { + return _challenges[channel]; + } + + Uint8List generateNewChallenge(Channel channel) { + final challenge = generateChallenge(); + _challenges[channel] = challenge; + return challenge; + } + + void removeChallenge(Channel channel) { + _challenges.remove(channel); + } +} + +Uint8List generateChallenge() { + final random = Random.secure(); + final bytes = Uint8List(32); + for (var i = 0; i < bytes.length; i++) { + bytes[i] = random.nextInt(256); + } + return bytes; +} diff --git a/api/lib/src/services/user.dart b/api/lib/src/services/user.dart index dcdb6ac0..096d9dff 100644 --- a/api/lib/src/services/user.dart +++ b/api/lib/src/services/user.dart @@ -1,176 +1,176 @@ -import 'dart:async'; - -import 'package:collection/collection.dart'; -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:networker/networker.dart'; -import 'package:setonix_api/event.dart'; - -part 'user.mapper.dart'; - -@MappableClass(includeCustomMappers: [Base64Uint8ListHook()]) -final class SetonixUser with SetonixUserMappable { - final String? fingerprint; - final String name; - final bool onWhitelist; - final DateTime? createdAt, updatedAt, lastLogin; - - const SetonixUser({ - this.fingerprint, - required this.name, - this.onWhitelist = false, - this.createdAt, - this.updatedAt, - this.lastLogin, - }); -} - -abstract class UserService { - FutureOr getUser(String fingerprint); - FutureOr getUserFromName(String name); - FutureOr updateUser( - String fingerprint, { - String? name, - bool? onWhitelist, - DateTime? lastLogin, - bool createIfNotExists = false, - }); -} - -const kUserReferenceID = '#'; -const kUserReferenceName = '@'; -const kUserReferenceFingerprint = '*'; - -final class UserManager { - final Map _users = {}; - final String guestPrefix; - final UserService? service; - final bool whitelistEnabled; - int _nextGuestId = 1; - - UserManager({ - this.service, - this.whitelistEnabled = SetonixConfig.defaultWhitelistEnabled, - this.guestPrefix = SetonixConfig.defaultGuestPrefix, - }); - - bool containsUserName(String name) => - _users.values.any((u) => u.name == name); - - void removeUser(Channel channel) { - _users.remove(channel); - } - - /// Retrieves the user associated with the channel. - SetonixUser? getUser(Channel channel) => _users[channel]; - - /// Retrieves a user by name. - SetonixUser? getUserByName(String name) { - for (var user in _users.values) { - if (user.name == name) { - return user; - } - } - return null; - } - - String _generateGuestName() { - String name; - do { - name = '$guestPrefix$_nextGuestId'; - _nextGuestId++; - } while (containsUserName(name)); - return name; - } - - Future addUser( - Channel channel, [ - String? fingerprint, - String? name, - ]) async { - SetonixUser? user; - if (fingerprint != null) { - user = await service?.getUser(fingerprint); - if (user == null) { - if (whitelistEnabled) { - throw KickMessage(reason: KickReason.notWhitelisted); - } - } else { - name = user.name; - if (whitelistEnabled && !user.onWhitelist) { - throw KickMessage(reason: KickReason.notWhitelisted); - } - } - } - name ??= _generateGuestName(); - if (containsUserName(name)) { - return null; - } - if (user == null) { - user = SetonixUser(fingerprint: fingerprint, name: name); - if (fingerprint != null) { - await service?.updateUser( - fingerprint, - name: name, - onWhitelist: false, - createIfNotExists: true, - ); - } - } - _users[channel] = user; - return user; - } - - Future changeName(Channel channel, String newName) async { - if (containsUserName(newName)) { - return false; - } - final user = _users[channel]; - if (user == null) { - return false; - } - final fingerprint = user.fingerprint; - final result = fingerprint == null - ? null - : await service?.updateUser(fingerprint, name: newName); - if (result == false) return false; - final updatedUser = user.copyWith(name: newName); - _users[channel] = updatedUser; - return true; - } - - Future getUserByReference(String reference) async { - if (reference.isEmpty) return null; - switch (reference[0]) { - case kUserReferenceID: - final id = reference.substring(1); - if (id.isEmpty) return null; - final idInt = int.tryParse(id); - if (idInt == null) return null; - return getUser(idInt); - case kUserReferenceName: - final name = reference.substring(1); - return getUserByName(name); - case kUserReferenceFingerprint: - final fingerprint = reference.substring(1); - return service?.getUser(fingerprint); - default: - final id = int.tryParse(reference); - if (id != null) { - return getUser(id); - } - final user = getUserByName(reference); - if (user != null) { - return user; - } - return service?.getUserFromName(reference); - } - } - - Future getUserIdByReference(String reference) async { - final user = await getUserByReference(reference); - if (user == null) return null; - return _users.entries.firstWhereOrNull((e) => e.value == user)?.key; - } - - Iterable> getUsers() => _users.entries; -} +import 'dart:async'; + +import 'package:collection/collection.dart'; +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:networker/networker.dart'; +import 'package:setonix_api/event.dart'; + +part 'user.mapper.dart'; + +@MappableClass(includeCustomMappers: [Base64Uint8ListHook()]) +final class SetonixUser with SetonixUserMappable { + final String? fingerprint; + final String name; + final bool onWhitelist; + final DateTime? createdAt, updatedAt, lastLogin; + + const SetonixUser({ + this.fingerprint, + required this.name, + this.onWhitelist = false, + this.createdAt, + this.updatedAt, + this.lastLogin, + }); +} + +abstract class UserService { + FutureOr getUser(String fingerprint); + FutureOr getUserFromName(String name); + FutureOr updateUser( + String fingerprint, { + String? name, + bool? onWhitelist, + DateTime? lastLogin, + bool createIfNotExists = false, + }); +} + +const kUserReferenceID = '#'; +const kUserReferenceName = '@'; +const kUserReferenceFingerprint = '*'; + +final class UserManager { + final Map _users = {}; + final String guestPrefix; + final UserService? service; + final bool whitelistEnabled; + int _nextGuestId = 1; + + UserManager({ + this.service, + this.whitelistEnabled = SetonixConfig.defaultWhitelistEnabled, + this.guestPrefix = SetonixConfig.defaultGuestPrefix, + }); + + bool containsUserName(String name) => + _users.values.any((u) => u.name == name); + + void removeUser(Channel channel) { + _users.remove(channel); + } + + /// Retrieves the user associated with the channel. + SetonixUser? getUser(Channel channel) => _users[channel]; + + /// Retrieves a user by name. + SetonixUser? getUserByName(String name) { + for (var user in _users.values) { + if (user.name == name) { + return user; + } + } + return null; + } + + String _generateGuestName() { + String name; + do { + name = '$guestPrefix$_nextGuestId'; + _nextGuestId++; + } while (containsUserName(name)); + return name; + } + + Future addUser( + Channel channel, [ + String? fingerprint, + String? name, + ]) async { + SetonixUser? user; + if (fingerprint != null) { + user = await service?.getUser(fingerprint); + if (user == null) { + if (whitelistEnabled) { + throw KickMessage(reason: KickReason.notWhitelisted); + } + } else { + name = user.name; + if (whitelistEnabled && !user.onWhitelist) { + throw KickMessage(reason: KickReason.notWhitelisted); + } + } + } + name ??= _generateGuestName(); + if (containsUserName(name)) { + return null; + } + if (user == null) { + user = SetonixUser(fingerprint: fingerprint, name: name); + if (fingerprint != null) { + await service?.updateUser( + fingerprint, + name: name, + onWhitelist: false, + createIfNotExists: true, + ); + } + } + _users[channel] = user; + return user; + } + + Future changeName(Channel channel, String newName) async { + if (containsUserName(newName)) { + return false; + } + final user = _users[channel]; + if (user == null) { + return false; + } + final fingerprint = user.fingerprint; + final result = fingerprint == null + ? null + : await service?.updateUser(fingerprint, name: newName); + if (result == false) return false; + final updatedUser = user.copyWith(name: newName); + _users[channel] = updatedUser; + return true; + } + + Future getUserByReference(String reference) async { + if (reference.isEmpty) return null; + switch (reference[0]) { + case kUserReferenceID: + final id = reference.substring(1); + if (id.isEmpty) return null; + final idInt = int.tryParse(id); + if (idInt == null) return null; + return getUser(idInt); + case kUserReferenceName: + final name = reference.substring(1); + return getUserByName(name); + case kUserReferenceFingerprint: + final fingerprint = reference.substring(1); + return service?.getUser(fingerprint); + default: + final id = int.tryParse(reference); + if (id != null) { + return getUser(id); + } + final user = getUserByName(reference); + if (user != null) { + return user; + } + return service?.getUserFromName(reference); + } + } + + Future getUserIdByReference(String reference) async { + final user = await getUserByReference(reference); + if (user == null) return null; + return _users.entries.firstWhereOrNull((e) => e.value == user)?.key; + } + + Iterable> getUsers() => _users.entries; +} diff --git a/api/lib/src/services/user.mapper.dart b/api/lib/src/services/user.mapper.dart index 7b602b8b..bce4c53a 100644 --- a/api/lib/src/services/user.mapper.dart +++ b/api/lib/src/services/user.mapper.dart @@ -1,198 +1,198 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'user.dart'; - -/// @nodoc -class SetonixUserMapper extends ClassMapperBase { - SetonixUserMapper._(); - - static SetonixUserMapper? _instance; - static SetonixUserMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = SetonixUserMapper._()); - MapperContainer.globals.useAll([Base64Uint8ListHook()]); - } - return _instance!; - } - - @override - final String id = 'SetonixUser'; - - static String? _$fingerprint(SetonixUser v) => v.fingerprint; - static const Field _f$fingerprint = Field( - 'fingerprint', - _$fingerprint, - opt: true, - ); - static String _$name(SetonixUser v) => v.name; - static const Field _f$name = Field('name', _$name); - static bool _$onWhitelist(SetonixUser v) => v.onWhitelist; - static const Field _f$onWhitelist = Field( - 'onWhitelist', - _$onWhitelist, - opt: true, - def: false, - ); - static DateTime? _$createdAt(SetonixUser v) => v.createdAt; - static const Field _f$createdAt = Field( - 'createdAt', - _$createdAt, - opt: true, - ); - static DateTime? _$updatedAt(SetonixUser v) => v.updatedAt; - static const Field _f$updatedAt = Field( - 'updatedAt', - _$updatedAt, - opt: true, - ); - static DateTime? _$lastLogin(SetonixUser v) => v.lastLogin; - static const Field _f$lastLogin = Field( - 'lastLogin', - _$lastLogin, - opt: true, - ); - - @override - final MappableFields fields = const { - #fingerprint: _f$fingerprint, - #name: _f$name, - #onWhitelist: _f$onWhitelist, - #createdAt: _f$createdAt, - #updatedAt: _f$updatedAt, - #lastLogin: _f$lastLogin, - }; - - static SetonixUser _instantiate(DecodingData data) { - return SetonixUser( - fingerprint: data.dec(_f$fingerprint), - name: data.dec(_f$name), - onWhitelist: data.dec(_f$onWhitelist), - createdAt: data.dec(_f$createdAt), - updatedAt: data.dec(_f$updatedAt), - lastLogin: data.dec(_f$lastLogin), - ); - } - - @override - final Function instantiate = _instantiate; - - static SetonixUser fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static SetonixUser fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin SetonixUserMappable { - String toJson() { - return SetonixUserMapper.ensureInitialized().encodeJson( - this as SetonixUser, - ); - } - - Map toMap() { - return SetonixUserMapper.ensureInitialized().encodeMap( - this as SetonixUser, - ); - } - - SetonixUserCopyWith get copyWith => - _SetonixUserCopyWithImpl( - this as SetonixUser, - $identity, - $identity, - ); - @override - String toString() { - return SetonixUserMapper.ensureInitialized().stringifyValue( - this as SetonixUser, - ); - } - - @override - bool operator ==(Object other) { - return SetonixUserMapper.ensureInitialized().equalsValue( - this as SetonixUser, - other, - ); - } - - @override - int get hashCode { - return SetonixUserMapper.ensureInitialized().hashValue(this as SetonixUser); - } -} - -/// @nodoc -extension SetonixUserValueCopy<$R, $Out> - on ObjectCopyWith<$R, SetonixUser, $Out> { - SetonixUserCopyWith<$R, SetonixUser, $Out> get $asSetonixUser => - $base.as((v, t, t2) => _SetonixUserCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class SetonixUserCopyWith<$R, $In extends SetonixUser, $Out> - implements ClassCopyWith<$R, $In, $Out> { - $R call({ - String? fingerprint, - String? name, - bool? onWhitelist, - DateTime? createdAt, - DateTime? updatedAt, - DateTime? lastLogin, - }); - SetonixUserCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _SetonixUserCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, SetonixUser, $Out> - implements SetonixUserCopyWith<$R, SetonixUser, $Out> { - _SetonixUserCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - SetonixUserMapper.ensureInitialized(); - @override - $R call({ - Object? fingerprint = $none, - String? name, - bool? onWhitelist, - Object? createdAt = $none, - Object? updatedAt = $none, - Object? lastLogin = $none, - }) => $apply( - FieldCopyWithData({ - if (fingerprint != $none) #fingerprint: fingerprint, - if (name != null) #name: name, - if (onWhitelist != null) #onWhitelist: onWhitelist, - if (createdAt != $none) #createdAt: createdAt, - if (updatedAt != $none) #updatedAt: updatedAt, - if (lastLogin != $none) #lastLogin: lastLogin, - }), - ); - @override - SetonixUser $make(CopyWithData data) => SetonixUser( - fingerprint: data.get(#fingerprint, or: $value.fingerprint), - name: data.get(#name, or: $value.name), - onWhitelist: data.get(#onWhitelist, or: $value.onWhitelist), - createdAt: data.get(#createdAt, or: $value.createdAt), - updatedAt: data.get(#updatedAt, or: $value.updatedAt), - lastLogin: data.get(#lastLogin, or: $value.lastLogin), - ); - - @override - SetonixUserCopyWith<$R2, SetonixUser, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _SetonixUserCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'user.dart'; + +/// @nodoc +class SetonixUserMapper extends ClassMapperBase { + SetonixUserMapper._(); + + static SetonixUserMapper? _instance; + static SetonixUserMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = SetonixUserMapper._()); + MapperContainer.globals.useAll([Base64Uint8ListHook()]); + } + return _instance!; + } + + @override + final String id = 'SetonixUser'; + + static String? _$fingerprint(SetonixUser v) => v.fingerprint; + static const Field _f$fingerprint = Field( + 'fingerprint', + _$fingerprint, + opt: true, + ); + static String _$name(SetonixUser v) => v.name; + static const Field _f$name = Field('name', _$name); + static bool _$onWhitelist(SetonixUser v) => v.onWhitelist; + static const Field _f$onWhitelist = Field( + 'onWhitelist', + _$onWhitelist, + opt: true, + def: false, + ); + static DateTime? _$createdAt(SetonixUser v) => v.createdAt; + static const Field _f$createdAt = Field( + 'createdAt', + _$createdAt, + opt: true, + ); + static DateTime? _$updatedAt(SetonixUser v) => v.updatedAt; + static const Field _f$updatedAt = Field( + 'updatedAt', + _$updatedAt, + opt: true, + ); + static DateTime? _$lastLogin(SetonixUser v) => v.lastLogin; + static const Field _f$lastLogin = Field( + 'lastLogin', + _$lastLogin, + opt: true, + ); + + @override + final MappableFields fields = const { + #fingerprint: _f$fingerprint, + #name: _f$name, + #onWhitelist: _f$onWhitelist, + #createdAt: _f$createdAt, + #updatedAt: _f$updatedAt, + #lastLogin: _f$lastLogin, + }; + + static SetonixUser _instantiate(DecodingData data) { + return SetonixUser( + fingerprint: data.dec(_f$fingerprint), + name: data.dec(_f$name), + onWhitelist: data.dec(_f$onWhitelist), + createdAt: data.dec(_f$createdAt), + updatedAt: data.dec(_f$updatedAt), + lastLogin: data.dec(_f$lastLogin), + ); + } + + @override + final Function instantiate = _instantiate; + + static SetonixUser fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static SetonixUser fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin SetonixUserMappable { + String toJson() { + return SetonixUserMapper.ensureInitialized().encodeJson( + this as SetonixUser, + ); + } + + Map toMap() { + return SetonixUserMapper.ensureInitialized().encodeMap( + this as SetonixUser, + ); + } + + SetonixUserCopyWith get copyWith => + _SetonixUserCopyWithImpl( + this as SetonixUser, + $identity, + $identity, + ); + @override + String toString() { + return SetonixUserMapper.ensureInitialized().stringifyValue( + this as SetonixUser, + ); + } + + @override + bool operator ==(Object other) { + return SetonixUserMapper.ensureInitialized().equalsValue( + this as SetonixUser, + other, + ); + } + + @override + int get hashCode { + return SetonixUserMapper.ensureInitialized().hashValue(this as SetonixUser); + } +} + +/// @nodoc +extension SetonixUserValueCopy<$R, $Out> + on ObjectCopyWith<$R, SetonixUser, $Out> { + SetonixUserCopyWith<$R, SetonixUser, $Out> get $asSetonixUser => + $base.as((v, t, t2) => _SetonixUserCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class SetonixUserCopyWith<$R, $In extends SetonixUser, $Out> + implements ClassCopyWith<$R, $In, $Out> { + $R call({ + String? fingerprint, + String? name, + bool? onWhitelist, + DateTime? createdAt, + DateTime? updatedAt, + DateTime? lastLogin, + }); + SetonixUserCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _SetonixUserCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, SetonixUser, $Out> + implements SetonixUserCopyWith<$R, SetonixUser, $Out> { + _SetonixUserCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + SetonixUserMapper.ensureInitialized(); + @override + $R call({ + Object? fingerprint = $none, + String? name, + bool? onWhitelist, + Object? createdAt = $none, + Object? updatedAt = $none, + Object? lastLogin = $none, + }) => $apply( + FieldCopyWithData({ + if (fingerprint != $none) #fingerprint: fingerprint, + if (name != null) #name: name, + if (onWhitelist != null) #onWhitelist: onWhitelist, + if (createdAt != $none) #createdAt: createdAt, + if (updatedAt != $none) #updatedAt: updatedAt, + if (lastLogin != $none) #lastLogin: lastLogin, + }), + ); + @override + SetonixUser $make(CopyWithData data) => SetonixUser( + fingerprint: data.get(#fingerprint, or: $value.fingerprint), + name: data.get(#name, or: $value.name), + onWhitelist: data.get(#onWhitelist, or: $value.onWhitelist), + createdAt: data.get(#createdAt, or: $value.createdAt), + updatedAt: data.get(#updatedAt, or: $value.updatedAt), + lastLogin: data.get(#lastLogin, or: $value.lastLogin), + ); + + @override + SetonixUserCopyWith<$R2, SetonixUser, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _SetonixUserCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/api/pubspec.lock b/api/pubspec.lock index 5239c474..7754f031 100644 --- a/api/pubspec.lock +++ b/api/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "563c6992eaeda8625f45b87f6a6a0c547df16565d1c93d8271c7c11057710ca7" + sha256: "1b0e6a07425a3e460666e88bf1c949ccc7bb0116ad562ce94a1eca60fe820725" url: "https://pub.dev" source: hosted - version: "101.0.0" + version: "103.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: aa6a9365901532864cae51208f2a6bb18dd01972ebead19c431efc848f60080b + sha256: "61c04d0c1bfed555c681ea079519933f071a5a026578ff73c4ff0df2d3462e5e" url: "https://pub.dev" source: hosted - version: "13.1.0" + version: "13.3.0" ansicolor: dependency: transitive description: @@ -262,8 +262,8 @@ packages: dependency: "direct main" description: path: "packages/lw_file_system_api" - ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" - resolved-ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" + ref: "37594211585889e35e65dad382d4fdcf29ac69a0" + resolved-ref: "37594211585889e35e65dad382d4fdcf29ac69a0" url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "1.0.0" diff --git a/api/pubspec.yaml b/api/pubspec.yaml index 7ba76b0a..353b7b60 100644 --- a/api/pubspec.yaml +++ b/api/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: git: url: https://github.com/LinwoodDev/dart_pkgs.git path: packages/lw_file_system_api - ref: 5fd8a282404929e54c36a25fd80e43ca3a85bc46 + ref: 37594211585889e35e65dad382d4fdcf29ac69a0 networker: git: url: https://github.com/LinwoodDev/dart_pkgs.git diff --git a/app/.gitignore b/app/.gitignore index 15c0cffd..92f3dbce 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,48 +1,48 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -../.idea/ -.project -.settings - -.vscode - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ -/lib/src/generated - -# Exceptions to above rules. -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages - -# Session related -*.png~ -*.png-autosave.kra -*.tiled-session -/node_modules - -# Runtime related -assets/pack.stnx +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +../.idea/ +.project +.settings + +.vscode + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ +/lib/src/generated + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +# Session related +*.png~ +*.png-autosave.kra +*.tiled-session +/node_modules + +# Runtime related +assets/pack.stnx diff --git a/app/.metadata b/app/.metadata index c2aa44bd..761cf06e 100644 --- a/app/.metadata +++ b/app/.metadata @@ -1,45 +1,45 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "603104015dd692ea3403755b55d07813d5cf8965" - channel: "stable" - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - platform: android - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - platform: ios - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - platform: linux - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - platform: macos - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - platform: web - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - platform: windows - create_revision: 603104015dd692ea3403755b55d07813d5cf8965 - base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "603104015dd692ea3403755b55d07813d5cf8965" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: android + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: ios + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: linux + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: macos + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: web + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: windows + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/app/DmgSetup.json b/app/DmgSetup.json index 4e439d3f..83b3c8b1 100644 --- a/app/DmgSetup.json +++ b/app/DmgSetup.json @@ -1,14 +1,14 @@ -{ - "title": "Linwood Setonix", - "icon": "build/macos/Build/Products/Release/setonix.app/Contents/Resources/AppIcon.icns", - "background-color": "#1b1b1d", - "contents": [ - { "x": 448, "y": 344, "type": "link", "path": "/Applications" }, - { - "x": 192, - "y": 344, - "type": "file", - "path": "build/macos/Build/Products/Release/setonix.app" - } - ] -} +{ + "title": "Linwood Setonix", + "icon": "build/macos/Build/Products/Release/setonix.app/Contents/Resources/AppIcon.icns", + "background-color": "#1b1b1d", + "contents": [ + { "x": 448, "y": 344, "type": "link", "path": "/Applications" }, + { + "x": 192, + "y": 344, + "type": "file", + "path": "build/macos/Build/Products/Release/setonix.app" + } + ] +} diff --git a/app/README.md b/app/README.md index 3039c1d1..a1948d06 100644 --- a/app/README.md +++ b/app/README.md @@ -1,3 +1,3 @@ -# Linwood Setonix - -Read more about it [here](../README.md). +# Linwood Setonix + +Read more about it [here](../README.md). diff --git a/app/SetonixSetup.iss b/app/SetonixSetup.iss index 4244da28..3679b567 100644 --- a/app/SetonixSetup.iss +++ b/app/SetonixSetup.iss @@ -1,70 +1,70 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -#define MyAppName "Setonix" -#ifndef MyAppVersion -#define MyAppVersion "1.0" -#endif -#ifndef MyAppArch -#define MyAppArch "x64" -#endif -#define MyAppPublisher "Linwood" -#define MyAppURL "https://www.linwood.dev" -#define MyAppExeName "setonix.exe" -#define BaseDirRelease "build\windows\" + MyAppArch + "\runner\Release" -#define RunnerSourceDir "windows\runner" - - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{AFEA034B-35A4-44A9-9FAE-33F5A2AE860B} -AppName={#MyAppName} -AppVersion={#MyAppVersion} -AppVerName={#MyAppName} {#MyAppVersion} -AppPublisher={#MyAppPublisher} -AppPublisherURL={#MyAppURL} -AppSupportURL={#MyAppURL} -AppUpdatesURL={#MyAppURL} -DefaultDirName={autopf64}\{#MyAppPublisher}\{#MyAppName} -DefaultGroupName={#MyAppPublisher}\{#MyAppName} -DisableProgramGroupPage=yes -LicenseFile=..\LICENSE -; Uncomment the following line to run in non administrative install mode (install for current user only.) -PrivilegesRequired=lowest -PrivilegesRequiredOverridesAllowed=dialog -OutputDir=build\windows\{#MyAppArch} -OutputBaseFilename=linwood-setonix-windows-setup -SetupIconFile={#RunnerSourceDir}\resources\app_icon.ico -UninstallDisplayIcon={app}\{#MyAppExeName} -Compression=lzma -SolidCompression=yes -ArchitecturesAllowed={#MyAppArch} -ArchitecturesInstallIn64BitMode={#MyAppArch} -WizardStyle=modern -Uninstallable=not WizardIsTaskSelected('portablemode') -ChangesAssociations=yes - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" -Name: "french"; MessagesFile: "compiler:Languages\French.isl" -Name: "german"; MessagesFile: "compiler:Languages\German.isl" - -[Tasks] -Name: "desktopicon"; Description: "Create a Desktop shortcut" -Name: "startmenu"; Description: "Create a Start Menu entry" - - -[Files] -Source: "{#BaseDirRelease}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#BaseDirRelease}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{group}\Visit Website"; Filename: "https://www.linwood.dev/" -Name: "{group}\Setonix Documentation"; Filename: "https://setonix.linwood.dev/" -Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon - -[Run] +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Setonix" +#ifndef MyAppVersion +#define MyAppVersion "1.0" +#endif +#ifndef MyAppArch +#define MyAppArch "x64" +#endif +#define MyAppPublisher "Linwood" +#define MyAppURL "https://www.linwood.dev" +#define MyAppExeName "setonix.exe" +#define BaseDirRelease "build\windows\" + MyAppArch + "\runner\Release" +#define RunnerSourceDir "windows\runner" + + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{AFEA034B-35A4-44A9-9FAE-33F5A2AE860B} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf64}\{#MyAppPublisher}\{#MyAppName} +DefaultGroupName={#MyAppPublisher}\{#MyAppName} +DisableProgramGroupPage=yes +LicenseFile=..\LICENSE +; Uncomment the following line to run in non administrative install mode (install for current user only.) +PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir=build\windows\{#MyAppArch} +OutputBaseFilename=linwood-setonix-windows-setup +SetupIconFile={#RunnerSourceDir}\resources\app_icon.ico +UninstallDisplayIcon={app}\{#MyAppExeName} +Compression=lzma +SolidCompression=yes +ArchitecturesAllowed={#MyAppArch} +ArchitecturesInstallIn64BitMode={#MyAppArch} +WizardStyle=modern +Uninstallable=not WizardIsTaskSelected('portablemode') +ChangesAssociations=yes + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" + +[Tasks] +Name: "desktopicon"; Description: "Create a Desktop shortcut" +Name: "startmenu"; Description: "Create a Start Menu entry" + + +[Files] +Source: "{#BaseDirRelease}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#BaseDirRelease}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\Visit Website"; Filename: "https://www.linwood.dev/" +Name: "{group}\Setonix Documentation"; Filename: "https://setonix.linwood.dev/" +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent \ No newline at end of file diff --git a/app/analysis_options.yaml b/app/analysis_options.yaml index 540329a6..bac04204 100644 --- a/app/analysis_options.yaml +++ b/app/analysis_options.yaml @@ -1,41 +1,41 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml -analyzer: - exclude: - - "**/*.g.dart" - - "**/*.freezed.dart" - - "**/*.mapper.dart" - - "build/**" - - "lib/src/rust/*.dart" - - "lib/src/rust/**/*.dart" - errors: - invalid_annotation_target: ignore -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - use_super_parameters: true - # avoid_print: false # Uncomment to disable the `avoid_print` rule - prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - depend_on_referenced_packages: false # Conflicts with flutter_gen - library_private_types_in_public_api: false # Conflicts with flutter state conventions - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" + - "**/*.mapper.dart" + - "build/**" + - "lib/src/rust/*.dart" + - "lib/src/rust/**/*.dart" + errors: + invalid_annotation_target: ignore +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + use_super_parameters: true + # avoid_print: false # Uncomment to disable the `avoid_print` rule + prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + depend_on_referenced_packages: false # Conflicts with flutter_gen + library_private_types_in_public_api: false # Conflicts with flutter state conventions + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/app/android/.gitignore b/app/android/.gitignore index 6b6c20e6..91968847 100644 --- a/app/android/.gitignore +++ b/app/android/.gitignore @@ -1,14 +1,14 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java -/app/.cxx/ - -# Remember to never publicly share your keystore. -# See https://flutter.dev/to/reference-keystore -key.properties -**/*.keystore -**/*.jks +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +/app/.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/app/android/Gemfile b/app/android/Gemfile index 2e43bbfa..8573d66f 100644 --- a/app/android/Gemfile +++ b/app/android/Gemfile @@ -1,5 +1,5 @@ -source "https://rubygems.org" - -gem "fastlane" -gem "screengrab" -gem "abbrev" +source "https://rubygems.org" + +gem "fastlane" +gem "screengrab" +gem "abbrev" diff --git a/app/android/Gemfile.lock b/app/android/Gemfile.lock index 75df2754..7ba947e0 100644 --- a/app/android/Gemfile.lock +++ b/app/android/Gemfile.lock @@ -8,7 +8,7 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.4.0) - aws-partitions (1.1259.0) + aws-partitions (1.1261.0) aws-sdk-core (3.252.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -20,7 +20,7 @@ GEM aws-sdk-kms (1.129.0) aws-sdk-core (~> 3, >= 3.248.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.225.1) + aws-sdk-s3 (1.226.0) aws-sdk-core (~> 3, >= 3.248.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -148,7 +148,7 @@ GEM base64 (~> 0.2) faraday (>= 1.0, < 3.a) google-cloud-errors (1.6.0) - google-cloud-storage (1.60.0) + google-cloud-storage (1.61.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-core (>= 0.18, < 2) @@ -158,7 +158,7 @@ GEM googleauth (~> 1.9) mini_mime (~> 1.0) google-logging-utils (0.2.0) - googleauth (1.17.0) + googleauth (1.17.1) faraday (>= 1.0, < 3.a) google-cloud-env (~> 2.2) google-logging-utils (~> 0.1) @@ -172,7 +172,7 @@ GEM httpclient (2.9.0) mutex_m jmespath (1.6.2) - json (2.19.8) + json (2.19.9) jwt (3.2.0) base64 logger (1.7.0) @@ -249,16 +249,16 @@ CHECKSUMS artifactory (3.0.17) sha256=3023d5c964c31674090d655a516f38ca75665c15084140c08b7f2841131af263 atomos (0.1.3) sha256=7d43b22f2454a36bace5532d30785b06de3711399cb1c6bf932573eda536789f aws-eventstream (1.4.0) sha256=116bf85c436200d1060811e6f5d2d40c88f65448f2125bc77ffce5121e6e183b - aws-partitions (1.1259.0) sha256=1a61c53f85cee1e69e4ab7946c7350b2237d724acf589023715e7117c03c18c6 + aws-partitions (1.1261.0) sha256=89eda89781c1ea4e1be2a2dcdc72318c62c6171a01cdaeaa0cbecf3cea6f9fdc aws-sdk-core (3.252.0) sha256=09c042cbfc2acf2239441cc9b982ebab2a999bed2ef6bdc51849e7b3d6e48a1c aws-sdk-kms (1.129.0) sha256=363f548df321f4a4fcfd05523384e591060b400f8e65133ed7ef0793155a3343 - aws-sdk-s3 (1.225.1) sha256=d4b23a8db9b0a5548766b52d382b184f47f7e126560acdb731dd46adb5e26512 + aws-sdk-s3 (1.226.0) sha256=e599f431e006ec9b92c61ee0f14d3f658a1f6c8a1d623d2160be927ac958e2bf aws-sigv4 (1.12.1) sha256=6973ff95cb0fd0dc58ba26e90e9510a2219525d07620c8babeb70ef831826c00 babosa (1.0.4) sha256=18dea450f595462ed7cb80595abd76b2e535db8c91b350f6c4b3d73986c5bc99 base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd - bundler (4.0.12) sha256=7f8b757d28dfb636e7b24fba2344ac6dd13b5b24f4b46d62573d483f211825ac + bundler (4.0.14) sha256=d09a0a965cf772266a7e49e83610be7c2f4e49e61134c42a56804bb383cc24b8 claide (1.1.0) sha256=6d3c5c089dde904d96aa30e73306d0d4bd444b1accb9b3125ce14a3c0183f82e colored (1.2) sha256=9d82b47ac589ce7f6cab64b1f194a2009e9fd00c326a5357321f44afab2c1d2c colored2 (3.1.2) sha256=b13c2bd7eeae2cf7356a62501d398e72fde78780bd26aec6a979578293c28b4a @@ -295,14 +295,14 @@ CHECKSUMS google-cloud-core (1.9.0) sha256=ab55409f51488e8deefb6edcc1ce4771dfb5da2fe7b3bc075709a030c2b682a4 google-cloud-env (2.2.2) sha256=94bed40e05a67e9468ce1cb38389fba9a90aa8fc62fc9e173204c1dca59e21e7 google-cloud-errors (1.6.0) sha256=1da8476dd706ad04b9d32e3c4b90d07d3463b37d6407cb56d41342ea7647d0a1 - google-cloud-storage (1.60.0) sha256=b21b752d37945d678a4533be5ef4303f15d33a964d8bc709c7c41c3600f650db + google-cloud-storage (1.61.0) sha256=a77f10f4a603289948b09e81c3e23d762a18733fd69d70a4c1399663fbd96002 google-logging-utils (0.2.0) sha256=675462b4ea5affa825a3442694ca2d75d0069455a1d0956127207498fca3df7b - googleauth (1.17.0) sha256=dbddcaa3b78469fa9392c0e784ab6d8f3f760a1e5f6c6dbbbaa44a612c4198b0 + googleauth (1.17.1) sha256=0f7e6fc70e204cee1b2d71f1e1de2d3b349d432404197fe68ebf7fa23d0821b9 highline (2.0.3) sha256=2ddd5c127d4692721486f91737307236fe005352d12a4202e26c48614f719479 http-cookie (1.0.8) sha256=b14fe0445cf24bf9ae098633e9b8d42e4c07c3c1f700672b09fbfe32ffd41aa6 httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8 jmespath (1.6.2) sha256=238d774a58723d6c090494c8879b5e9918c19485f7e840f2c1c7532cf84ebcb1 - json (2.19.8) sha256=6354310fd76ef69b87d5bd1f38b40d730613baf90b6803d2d0a48f618d32dfaa + json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a jwt (3.2.0) sha256=5419b1fe37b1da0982bd07051f573a8b8789ab724c2aa7e785e4784a3ed217d7 logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 mini_magick (4.13.2) sha256=71d6258e0e8a3d04a9a0a09784d5d857b403a198a51dd4f882510435eb95ddd9 @@ -344,4 +344,4 @@ CHECKSUMS xcpretty-travis-formatter (1.0.1) sha256=aacc332f17cb7b2cba222994e2adc74223db88724fe76341483ad3098e232f93 BUNDLED WITH - 4.0.12 + 4.0.14 diff --git a/app/android/app/src/debug/AndroidManifest.xml b/app/android/app/src/debug/AndroidManifest.xml index 399f6981..8ffe0246 100644 --- a/app/android/app/src/debug/AndroidManifest.xml +++ b/app/android/app/src/debug/AndroidManifest.xml @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/app/android/app/src/main/AndroidManifest.xml b/app/android/app/src/main/AndroidManifest.xml index d9209095..70065ec7 100644 --- a/app/android/app/src/main/AndroidManifest.xml +++ b/app/android/app/src/main/AndroidManifest.xml @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/android/app/src/main/kotlin/dev/linwood/setonix/MainActivity.kt b/app/android/app/src/main/kotlin/dev/linwood/setonix/MainActivity.kt index f47f2e88..3b6699a6 100644 --- a/app/android/app/src/main/kotlin/dev/linwood/setonix/MainActivity.kt +++ b/app/android/app/src/main/kotlin/dev/linwood/setonix/MainActivity.kt @@ -1,5 +1,5 @@ -package dev.linwood.setonix - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() +package dev.linwood.setonix + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/app/android/app/src/main/res/drawable-v21/launch_background.xml b/app/android/app/src/main/res/drawable-v21/launch_background.xml index f74085f3..1cb7aa2f 100644 --- a/app/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/app/android/app/src/main/res/drawable-v21/launch_background.xml @@ -1,12 +1,12 @@ - - - - - - - - + + + + + + + + diff --git a/app/android/app/src/main/res/drawable/ic_launcher_monochrome.xml b/app/android/app/src/main/res/drawable/ic_launcher_monochrome.xml index 1513beda..f7b052c8 100644 --- a/app/android/app/src/main/res/drawable/ic_launcher_monochrome.xml +++ b/app/android/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -1,39 +1,39 @@ - - - - - - - - - + + + + + + + + + diff --git a/app/android/app/src/main/res/drawable/launch_background.xml b/app/android/app/src/main/res/drawable/launch_background.xml index 304732f8..84037589 100644 --- a/app/android/app/src/main/res/drawable/launch_background.xml +++ b/app/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,12 @@ - - - - - - - - + + + + + + + + diff --git a/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 08957b31..44b3e43f 100644 --- a/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,7 +1,7 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 036d09bc..67820c56 100644 --- a/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/app/android/app/src/main/res/values-night/styles.xml b/app/android/app/src/main/res/values-night/styles.xml index 06952be7..360a1605 100644 --- a/app/android/app/src/main/res/values-night/styles.xml +++ b/app/android/app/src/main/res/values-night/styles.xml @@ -1,18 +1,18 @@ - - - - - - - + + + + + + + diff --git a/app/android/app/src/main/res/values/ic_launcher_background.xml b/app/android/app/src/main/res/values/ic_launcher_background.xml index 21fa9fad..e607874a 100644 --- a/app/android/app/src/main/res/values/ic_launcher_background.xml +++ b/app/android/app/src/main/res/values/ic_launcher_background.xml @@ -1,4 +1,4 @@ - - - #2F2F2F + + + #2F2F2F \ No newline at end of file diff --git a/app/android/app/src/main/res/values/styles.xml b/app/android/app/src/main/res/values/styles.xml index cb1ef880..5fac6796 100644 --- a/app/android/app/src/main/res/values/styles.xml +++ b/app/android/app/src/main/res/values/styles.xml @@ -1,18 +1,18 @@ - - - - - - - + + + + + + + diff --git a/app/android/app/src/profile/AndroidManifest.xml b/app/android/app/src/profile/AndroidManifest.xml index 399f6981..8ffe0246 100644 --- a/app/android/app/src/profile/AndroidManifest.xml +++ b/app/android/app/src/profile/AndroidManifest.xml @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/app/android/build.gradle.kts b/app/android/build.gradle.kts index 27e52b04..d5055a02 100644 --- a/app/android/build.gradle.kts +++ b/app/android/build.gradle.kts @@ -1,41 +1,41 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() -rootProject.layout.buildDirectory.value(newBuildDir) - -subprojects { - val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) - project.layout.buildDirectory.value(newSubprojectBuildDir) -} - -subprojects { - afterEvaluate { - if (project.extensions.findByName("android") != null) { - project.extensions.configure("android") { - if (compileSdkVersion == "android-31" || compileSdkVersion == "android-33" || compileSdkVersion == "android-34") { - val appProject = rootProject.project(":app") - val appAndroid = appProject.extensions.findByType(com.android.build.gradle.BaseExtension::class.java) - if (appAndroid != null && appAndroid.compileSdkVersion != null) { - println("Setting compileSdkVersion to ${appAndroid.compileSdkVersion} for ${project.name}") - compileSdkVersion = appAndroid.compileSdkVersion - } else { - println("Could not find compileSdkVersion from app project for ${project.name}") - } - } - } - } - } -} - -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean") { - delete(rootProject.layout.buildDirectory) +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} + +subprojects { + afterEvaluate { + if (project.extensions.findByName("android") != null) { + project.extensions.configure("android") { + if (compileSdkVersion == "android-31" || compileSdkVersion == "android-33" || compileSdkVersion == "android-34") { + val appProject = rootProject.project(":app") + val appAndroid = appProject.extensions.findByType(com.android.build.gradle.BaseExtension::class.java) + if (appAndroid != null && appAndroid.compileSdkVersion != null) { + println("Setting compileSdkVersion to ${appAndroid.compileSdkVersion} for ${project.name}") + compileSdkVersion = appAndroid.compileSdkVersion + } else { + println("Could not find compileSdkVersion from app project for ${project.name}") + } + } + } + } + } +} + +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) } \ No newline at end of file diff --git a/app/android/fastlane/Appfile b/app/android/fastlane/Appfile index b75bb1c2..2a474336 100644 --- a/app/android/fastlane/Appfile +++ b/app/android/fastlane/Appfile @@ -1,2 +1,2 @@ -package_name("dev.linwood.setonix") # e.g. com.krausefx.app -json_key_file("play-store-credentials.json") +package_name("dev.linwood.setonix") # e.g. com.krausefx.app +json_key_file("play-store-credentials.json") diff --git a/app/android/fastlane/Fastfile b/app/android/fastlane/Fastfile index 6db37e7d..e74879a6 100644 --- a/app/android/fastlane/Fastfile +++ b/app/android/fastlane/Fastfile @@ -1,35 +1,35 @@ -# This file contains the fastlane.tools configuration -# You can find the documentation at https://docs.fastlane.tools -# -# For a list of all available actions, check out -# -# https://docs.fastlane.tools/actions -# -# For a list of all available plugins, check out -# -# https://docs.fastlane.tools/plugins/available-plugins -# - -# Uncomment the line if you want fastlane to automatically update itself -# update_fastlane - -default_platform(:android) - -platform :android do - desc "Runs all the tests" - lane :test do - gradle(task: "test") - end - - desc "Submit a new Beta Build to Crashlytics Beta" - lane :beta do - sh "flutter build appbundle -v --release --flavor development" - upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/developmentRelease/app-development-release.aab') - end - - desc "Deploy a new version to the Google Play" - lane :deploy do - sh "flutter build appbundle -v --release --flavor production" - upload_to_play_store(aab: '../build/app/outputs/bundle/productionRelease/app-production-release.aab') - end -end +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + +default_platform(:android) + +platform :android do + desc "Runs all the tests" + lane :test do + gradle(task: "test") + end + + desc "Submit a new Beta Build to Crashlytics Beta" + lane :beta do + sh "flutter build appbundle -v --release --flavor development" + upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/developmentRelease/app-development-release.aab') + end + + desc "Deploy a new version to the Google Play" + lane :deploy do + sh "flutter build appbundle -v --release --flavor production" + upload_to_play_store(aab: '../build/app/outputs/bundle/productionRelease/app-production-release.aab') + end +end diff --git a/app/android/fastlane/README.md b/app/android/fastlane/README.md index 7ec1207f..b281d43a 100644 --- a/app/android/fastlane/README.md +++ b/app/android/fastlane/README.md @@ -1,48 +1,48 @@ -fastlane documentation ----- - -# Installation - -Make sure you have the latest version of the Xcode command line tools installed: - -```sh -xcode-select --install -``` - -For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) - -# Available Actions - -## Android - -### android test - -```sh -[bundle exec] fastlane android test -``` - -Runs all the tests - -### android beta - -```sh -[bundle exec] fastlane android beta -``` - -Submit a new Beta Build to Crashlytics Beta - -### android deploy - -```sh -[bundle exec] fastlane android deploy -``` - -Deploy a new version to the Google Play - ----- - -This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. - -More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). - -The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +## Android + +### android test + +```sh +[bundle exec] fastlane android test +``` + +Runs all the tests + +### android beta + +```sh +[bundle exec] fastlane android beta +``` + +Submit a new Beta Build to Crashlytics Beta + +### android deploy + +```sh +[bundle exec] fastlane android deploy +``` + +Deploy a new version to the Google Play + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/app/android/fastlane/Screengrabfile b/app/android/fastlane/Screengrabfile index 39f83bcd..1302f548 100644 --- a/app/android/fastlane/Screengrabfile +++ b/app/android/fastlane/Screengrabfile @@ -1,15 +1,15 @@ -# remove the leading '#' to uncomment lines - -# app_package_name 'your.app.package' -# use_tests_in_packages ['your.screenshot.tests.package'] - -app_apk_path '../build/app/outputs/apk/production/debug/app-production-debug.apk' -tests_apk_path '../build/app/outputs/apk/androidTest/production/debug/app-production-debug-androidTest.apk' -locales ['en-US', 'fr-FR', 'de-DE'] -test_instrumentation_runner 'androidx.test.runner.AndroidJUnitRunner' -app_package_name 'dev.linwood.setonix' -# clear all previously generated screenshots in your local output directory before creating new ones -clear_previous_screenshots true - -# For more information about all available options run +# remove the leading '#' to uncomment lines + +# app_package_name 'your.app.package' +# use_tests_in_packages ['your.screenshot.tests.package'] + +app_apk_path '../build/app/outputs/apk/production/debug/app-production-debug.apk' +tests_apk_path '../build/app/outputs/apk/androidTest/production/debug/app-production-debug-androidTest.apk' +locales ['en-US', 'fr-FR', 'de-DE'] +test_instrumentation_runner 'androidx.test.runner.AndroidJUnitRunner' +app_package_name 'dev.linwood.setonix' +# clear all previously generated screenshots in your local output directory before creating new ones +clear_previous_screenshots true + +# For more information about all available options run # screengrab --help \ No newline at end of file diff --git a/app/android/gradle/wrapper/gradle-wrapper.properties b/app/android/gradle/wrapper/gradle-wrapper.properties index 78cb6e16..5eae66dc 100644 --- a/app/android/gradle/wrapper/gradle-wrapper.properties +++ b/app/android/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,8 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/app/android/settings.gradle.kts b/app/android/settings.gradle.kts index 7d61e80d..18272fe9 100644 --- a/app/android/settings.gradle.kts +++ b/app/android/settings.gradle.kts @@ -1,25 +1,25 @@ -pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.13.2" apply false - id("org.jetbrains.kotlin.android") version "2.3.20" apply false -} - +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.13.2" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false +} + include(":app") \ No newline at end of file diff --git a/app/assets/fonts/Comfortaa-LICENSE.txt b/app/assets/fonts/Comfortaa-LICENSE.txt index d0b83feb..daa25d00 100644 --- a/app/assets/fonts/Comfortaa-LICENSE.txt +++ b/app/assets/fonts/Comfortaa-LICENSE.txt @@ -1,93 +1,93 @@ -Copyright 2011 The Comfortaa Project Authors (https://github.com/alexeiva/comfortaa), with Reserved Font Name "Comfortaa". - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. +Copyright 2011 The Comfortaa Project Authors (https://github.com/alexeiva/comfortaa), with Reserved Font Name "Comfortaa". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/assets/fonts/Roboto-LICENSE.txt b/app/assets/fonts/Roboto-LICENSE.txt index d6456956..75b52484 100644 --- a/app/assets/fonts/Roboto-LICENSE.txt +++ b/app/assets/fonts/Roboto-LICENSE.txt @@ -1,202 +1,202 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/app/assets/setonix.tiled-project b/app/assets/setonix.tiled-project index d0eb5920..953ae341 100644 --- a/app/assets/setonix.tiled-project +++ b/app/assets/setonix.tiled-project @@ -1,14 +1,14 @@ -{ - "automappingRulesFile": "", - "commands": [ - ], - "compatibilityVersion": 1100, - "extensionsPath": "extensions", - "folders": [ - "." - ], - "properties": [ - ], - "propertyTypes": [ - ] -} +{ + "automappingRulesFile": "", + "commands": [ + ], + "compatibilityVersion": 1100, + "extensionsPath": "extensions", + "folders": [ + "." + ], + "properties": [ + ], + "propertyTypes": [ + ] +} diff --git a/app/devtools_options.yaml b/app/devtools_options.yaml index 091108c4..7e5e4e08 100644 --- a/app/devtools_options.yaml +++ b/app/devtools_options.yaml @@ -1,2 +1,2 @@ -extensions: +extensions: - flame: true \ No newline at end of file diff --git a/app/images/logo.svg b/app/images/logo.svg index fbf392b3..b9cdfa91 100644 --- a/app/images/logo.svg +++ b/app/images/logo.svg @@ -1,92 +1,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/ios/.gitignore b/app/ios/.gitignore index 7a7f9873..ad322bc0 100644 --- a/app/ios/.gitignore +++ b/app/ios/.gitignore @@ -1,34 +1,34 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/app/ios/Flutter/AppFrameworkInfo.plist b/app/ios/Flutter/AppFrameworkInfo.plist index 163000d8..ad4e70a3 100644 --- a/app/ios/Flutter/AppFrameworkInfo.plist +++ b/app/ios/Flutter/AppFrameworkInfo.plist @@ -1,26 +1,26 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 14.0 - - + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 14.0 + + diff --git a/app/ios/Flutter/Debug.xcconfig b/app/ios/Flutter/Debug.xcconfig index 592ceee8..0b2d479c 100644 --- a/app/ios/Flutter/Debug.xcconfig +++ b/app/ios/Flutter/Debug.xcconfig @@ -1 +1 @@ -#include "Generated.xcconfig" +#include "Generated.xcconfig" diff --git a/app/ios/Flutter/Release.xcconfig b/app/ios/Flutter/Release.xcconfig index 592ceee8..0b2d479c 100644 --- a/app/ios/Flutter/Release.xcconfig +++ b/app/ios/Flutter/Release.xcconfig @@ -1 +1 @@ -#include "Generated.xcconfig" +#include "Generated.xcconfig" diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index 7b8ae401..7cb9007e 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -1,616 +1,616 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - 331C8081294A63A400263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C8080294A63A400263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C807D294A63A400263BE5 /* Sources */, - 331C807F294A63A400263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C8086294A63A400263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C8080294A63A400263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - 331C8080294A63A400263BE5 /* RunnerTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C807F294A63A400263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C807D294A63A400263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 331C8088294A63A400263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Debug; - }; - 331C8089294A63A400263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Release; - }; - 331C808A294A63A400263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C8088294A63A400263BE5 /* Debug */, - 331C8089294A63A400263BE5 /* Release */, - 331C808A294A63A400263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6..c4b79bd8 100644 --- a/app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index 18d98100..fc6bf807 100644 --- a/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -1,8 +1,8 @@ - - - - - IDEDidComputeMac32BitWarning - - - + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index f9b0d7c5..af0309c4 100644 --- a/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -1,8 +1,8 @@ - - - - - PreviewsEnabled - - - + + + + + PreviewsEnabled + + + diff --git a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5df..2324e917 100644 --- a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,98 +1,98 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/ios/Runner.xcworkspace/contents.xcworkspacedata b/app/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16..59c6d394 100644 --- a/app/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/app/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index 18d98100..fc6bf807 100644 --- a/app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -1,8 +1,8 @@ - - - - - IDEDidComputeMac32BitWarning - - - + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index f9b0d7c5..af0309c4 100644 --- a/app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -1,8 +1,8 @@ - - - - - PreviewsEnabled - - - + + + + + PreviewsEnabled + + + diff --git a/app/ios/Runner/AppDelegate.swift b/app/ios/Runner/AppDelegate.swift index 9074fee9..0bf9c3ed 100644 --- a/app/ios/Runner/AppDelegate.swift +++ b/app/ios/Runner/AppDelegate.swift @@ -1,13 +1,13 @@ -import Flutter -import UIKit - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} +import Flutter +import UIKit + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fab..1950fd80 100644 --- a/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1,122 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json index 0bedcf2f..d08a4de3 100644 --- a/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ b/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -1,23 +1,23 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md index 89c2725b..65a94b5d 100644 --- a/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ b/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -1,5 +1,5 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/app/ios/Runner/Base.lproj/LaunchScreen.storyboard b/app/ios/Runner/Base.lproj/LaunchScreen.storyboard index f2e259c7..497371ea 100644 --- a/app/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ b/app/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/ios/Runner/Base.lproj/Main.storyboard b/app/ios/Runner/Base.lproj/Main.storyboard index f3c28516..bbb83caa 100644 --- a/app/ios/Runner/Base.lproj/Main.storyboard +++ b/app/ios/Runner/Base.lproj/Main.storyboard @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/ios/Runner/Info.plist b/app/ios/Runner/Info.plist index 55f1b727..64ea61f6 100644 --- a/app/ios/Runner/Info.plist +++ b/app/ios/Runner/Info.plist @@ -1,49 +1,49 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Setonix - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - setonix - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Setonix + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + setonix + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/app/ios/Runner/Runner-Bridging-Header.h b/app/ios/Runner/Runner-Bridging-Header.h index 308a2a56..fae207f9 100644 --- a/app/ios/Runner/Runner-Bridging-Header.h +++ b/app/ios/Runner/Runner-Bridging-Header.h @@ -1 +1 @@ -#import "GeneratedPluginRegistrant.h" +#import "GeneratedPluginRegistrant.h" diff --git a/app/ios/RunnerTests/RunnerTests.swift b/app/ios/RunnerTests/RunnerTests.swift index 86a7c3b1..4d206ded 100644 --- a/app/ios/RunnerTests/RunnerTests.swift +++ b/app/ios/RunnerTests/RunnerTests.swift @@ -1,12 +1,12 @@ -import Flutter -import UIKit -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/app/l10n.yaml b/app/l10n.yaml index 53719e4b..695f6638 100644 --- a/app/l10n.yaml +++ b/app/l10n.yaml @@ -1,5 +1,5 @@ -arb-dir: lib/l10n -template-arb-file: app_en.arb -output-localization-file: app_localizations.dart -nullable-getter: false -output-dir: lib/src/generated/i18n +arb-dir: lib/l10n +template-arb-file: app_en.arb +output-localization-file: app_localizations.dart +nullable-getter: false +output-dir: lib/src/generated/i18n diff --git a/app/lib/api/open.dart b/app/lib/api/open.dart index af89e72a..c05b6671 100644 --- a/app/lib/api/open.dart +++ b/app/lib/api/open.dart @@ -1,165 +1,165 @@ -import 'package:file_picker/file_picker.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/main.dart'; -import 'package:setonix_api/setonix_api.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:url_launcher/url_launcher.dart'; - -const kLaunchHost = 'launch.setonix.linwood.dev'; - -Uri getLaunchUri({ - String? path, - List? pathSegments, - String? fragment, - String? query, - Map? queryParameters, - String? userInfo, -}) => Uri( - scheme: 'https', - host: kLaunchHost, - path: path, - pathSegments: pathSegments, - fragment: fragment, - query: query, - queryParameters: queryParameters, - userInfo: userInfo, -); - -Uri getConnectUri(String url, [String? type]) => getLaunchUri( - pathSegments: ['connect'], - queryParameters: {'url': url, 'type': ?type}, -); - -Uri parseConnectUri(Uri uri) { - if (uri.host != kLaunchHost) { - return uri; - } - final param = uri.queryParameters['url']; - if (param == null) { - return uri; - } - return Uri.parse(param); -} - -Future openReleaseNotes() { - return launchUrl( - Uri( - scheme: 'https', - host: 'go.linwood.dev', - pathSegments: ['setonix', applicationMinorVersion], - ), - mode: LaunchMode.externalApplication, - ); -} - -Future openHelp(List pageLocation, [String? fragment]) { - return launchUrl( - Uri( - scheme: 'https', - host: 'setonix.linwood.dev', - fragment: fragment, - pathSegments: ['docs', 'v1', ...pageLocation], - ), - ); -} - -Future openFile() async { - final result = await FilePicker.pickFiles(allowedExtensions: ['stnx']); - if (result == null) return null; - final file = result.files.firstOrNull; - if (file == null) return null; - final bytes = await file.readAsBytes(); - final data = SetonixFile(bytes); - return data; -} - -String _sanitizeImportedName(String name, String fallback) { - var sanitized = name.trim(); - if (sanitized.isEmpty) { - sanitized = fallback.trim(); - } - sanitized = sanitized.split('/').last.split(r'\').last.trim(); - const suffix = '.stnx'; - if (sanitized.toLowerCase().endsWith(suffix)) { - sanitized = sanitized.substring(0, sanitized.length - suffix.length); - } - if (sanitized.isEmpty || sanitized == '.' || sanitized == '..') { - return DateTime.now().millisecondsSinceEpoch.toString(); - } - return sanitized; -} - -Future importFile( - BuildContext context, - SetonixFileSystem fileSystem, -) async { - final data = await openFile(); - if (data == null) return; - if (context.mounted) return importFileData(context, fileSystem, data); -} - -Future getCorePack() async => SetonixFile( - (await rootBundle.load('assets/pack.stnx')).buffer.asUint8List(), - kCorePackId, -); - -Future importFileData( - BuildContext context, - SetonixFileSystem fileSystem, - SetonixFile file, -) async { - final data = file.load(); - final metadata = data.getMetadataOrDefault(); - final type = metadata.type; - final loc = AppLocalizations.of(context); - final result = await showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text(switch (type) { - SetonixFileType.pack => loc.importPack, - SetonixFileType.game => loc.importGame, - SetonixFileType.template => loc.importTemplate, - SetonixFileType.accounts => loc.importAccounts, - }), - content: Text(switch (type) { - SetonixFileType.pack => loc.importPackDescription, - SetonixFileType.game => loc.importGameDescription, - SetonixFileType.template => loc.importTemplateDescription, - SetonixFileType.accounts => loc.importAccountsDescription, - }), - actions: [ - TextButton.icon( - onPressed: () => Navigator.of(context).pop(false), - label: Text(loc.cancel), - icon: Icon(PhosphorIconsLight.prohibit), - ), - ElevatedButton.icon( - onPressed: () => Navigator.of(context).pop(true), - label: Text(loc.import), - icon: Icon(PhosphorIconsLight.boxArrowDown), - ), - ], - ), - ); - if (!(result ?? false)) return; - final id = file.identifier; - switch (type) { - case SetonixFileType.pack: - await fileSystem.packSystem.updateFile(id, file); - case SetonixFileType.template: - await fileSystem.templateSystem.createFile( - _sanitizeImportedName(metadata.name, file.identifier), - data, - ); - case SetonixFileType.game: - await fileSystem.worldSystem.createFile( - _sanitizeImportedName(metadata.name, file.identifier), - data, - ); - case SetonixFileType.accounts: - await fileSystem.importAccountsFromData(data); - } -} +import 'package:file_picker/file_picker.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/main.dart'; +import 'package:setonix_api/setonix_api.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:url_launcher/url_launcher.dart'; + +const kLaunchHost = 'launch.setonix.linwood.dev'; + +Uri getLaunchUri({ + String? path, + List? pathSegments, + String? fragment, + String? query, + Map? queryParameters, + String? userInfo, +}) => Uri( + scheme: 'https', + host: kLaunchHost, + path: path, + pathSegments: pathSegments, + fragment: fragment, + query: query, + queryParameters: queryParameters, + userInfo: userInfo, +); + +Uri getConnectUri(String url, [String? type]) => getLaunchUri( + pathSegments: ['connect'], + queryParameters: {'url': url, 'type': ?type}, +); + +Uri parseConnectUri(Uri uri) { + if (uri.host != kLaunchHost) { + return uri; + } + final param = uri.queryParameters['url']; + if (param == null) { + return uri; + } + return Uri.parse(param); +} + +Future openReleaseNotes() { + return launchUrl( + Uri( + scheme: 'https', + host: 'go.linwood.dev', + pathSegments: ['setonix', applicationMinorVersion], + ), + mode: LaunchMode.externalApplication, + ); +} + +Future openHelp(List pageLocation, [String? fragment]) { + return launchUrl( + Uri( + scheme: 'https', + host: 'setonix.linwood.dev', + fragment: fragment, + pathSegments: ['docs', 'v1', ...pageLocation], + ), + ); +} + +Future openFile() async { + final result = await FilePicker.pickFiles(allowedExtensions: ['stnx']); + if (result == null) return null; + final file = result.files.firstOrNull; + if (file == null) return null; + final bytes = await file.readAsBytes(); + final data = SetonixFile(bytes); + return data; +} + +String _sanitizeImportedName(String name, String fallback) { + var sanitized = name.trim(); + if (sanitized.isEmpty) { + sanitized = fallback.trim(); + } + sanitized = sanitized.split('/').last.split(r'\').last.trim(); + const suffix = '.stnx'; + if (sanitized.toLowerCase().endsWith(suffix)) { + sanitized = sanitized.substring(0, sanitized.length - suffix.length); + } + if (sanitized.isEmpty || sanitized == '.' || sanitized == '..') { + return DateTime.now().millisecondsSinceEpoch.toString(); + } + return sanitized; +} + +Future importFile( + BuildContext context, + SetonixFileSystem fileSystem, +) async { + final data = await openFile(); + if (data == null) return; + if (context.mounted) return importFileData(context, fileSystem, data); +} + +Future getCorePack() async => SetonixFile( + (await rootBundle.load('assets/pack.stnx')).buffer.asUint8List(), + kCorePackId, +); + +Future importFileData( + BuildContext context, + SetonixFileSystem fileSystem, + SetonixFile file, +) async { + final data = file.load(); + final metadata = data.getMetadataOrDefault(); + final type = metadata.type; + final loc = AppLocalizations.of(context); + final result = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text(switch (type) { + SetonixFileType.pack => loc.importPack, + SetonixFileType.game => loc.importGame, + SetonixFileType.template => loc.importTemplate, + SetonixFileType.accounts => loc.importAccounts, + }), + content: Text(switch (type) { + SetonixFileType.pack => loc.importPackDescription, + SetonixFileType.game => loc.importGameDescription, + SetonixFileType.template => loc.importTemplateDescription, + SetonixFileType.accounts => loc.importAccountsDescription, + }), + actions: [ + TextButton.icon( + onPressed: () => Navigator.of(context).pop(false), + label: Text(loc.cancel), + icon: Icon(PhosphorIconsLight.prohibit), + ), + ElevatedButton.icon( + onPressed: () => Navigator.of(context).pop(true), + label: Text(loc.import), + icon: Icon(PhosphorIconsLight.boxArrowDown), + ), + ], + ), + ); + if (!(result ?? false)) return; + final id = file.identifier; + switch (type) { + case SetonixFileType.pack: + await fileSystem.packSystem.updateFile(id, file); + case SetonixFileType.template: + await fileSystem.templateSystem.createFile( + _sanitizeImportedName(metadata.name, file.identifier), + data, + ); + case SetonixFileType.game: + await fileSystem.worldSystem.createFile( + _sanitizeImportedName(metadata.name, file.identifier), + data, + ); + case SetonixFileType.accounts: + await fileSystem.importAccountsFromData(data); + } +} diff --git a/app/lib/api/save.dart b/app/lib/api/save.dart index 393391c7..7d89210f 100644 --- a/app/lib/api/save.dart +++ b/app/lib/api/save.dart @@ -1,15 +1,15 @@ -import 'package:flutter/material.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:lw_sysapi/lw_sysapi.dart'; -import 'package:setonix_api/setonix_api.dart'; - -Future exportData(BuildContext context, SetonixData data, String name) => - exportFile( - context: context, - bytes: data.exportAsBytes(), - fileExtension: 'stnx', - fileName: name, - label: AppLocalizations.of(context).game, - mimeType: 'application/octet-stream', - uniformTypeIdentifier: 'dev.linwood.setonix.pack', - ); +import 'package:flutter/material.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:lw_sysapi/lw_sysapi.dart'; +import 'package:setonix_api/setonix_api.dart'; + +Future exportData(BuildContext context, SetonixData data, String name) => + exportFile( + context: context, + bytes: data.exportAsBytes(), + fileExtension: 'stnx', + fileName: name, + label: AppLocalizations.of(context).game, + mimeType: 'application/octet-stream', + uniformTypeIdentifier: 'dev.linwood.setonix.pack', + ); diff --git a/app/lib/api/settings.dart b/app/lib/api/settings.dart index 306148cf..209ab2aa 100644 --- a/app/lib/api/settings.dart +++ b/app/lib/api/settings.dart @@ -1,37 +1,37 @@ -import 'dart:ui'; - -import 'package:flutter/material.dart'; - -import '../pages/settings/home.dart'; - -Future openSettings( - BuildContext context, { - SettingsView view = SettingsView.general, -}) => showGeneralDialog( - context: context, - pageBuilder: (context, animation, secondaryAnimation) => ScaffoldMessenger( - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), - child: Dialog( - clipBehavior: Clip.antiAlias, - child: ConstrainedBox( - constraints: const BoxConstraints(maxHeight: 800, maxWidth: 1000), - child: SettingsPage(isDialog: true, view: view), - ), - ), - ), - ), - barrierDismissible: true, - barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, - transitionDuration: const Duration(milliseconds: 200), - transitionBuilder: (context, animation, secondaryAnimation, child) { - // Animate the dialog from bottom to center - return SlideTransition( - position: Tween( - begin: const Offset(0, 1), - end: Offset.zero, - ).chain(CurveTween(curve: Curves.easeOutQuart)).animate(animation), - child: child, - ); - }, -); +import 'dart:ui'; + +import 'package:flutter/material.dart'; + +import '../pages/settings/home.dart'; + +Future openSettings( + BuildContext context, { + SettingsView view = SettingsView.general, +}) => showGeneralDialog( + context: context, + pageBuilder: (context, animation, secondaryAnimation) => ScaffoldMessenger( + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), + child: Dialog( + clipBehavior: Clip.antiAlias, + child: ConstrainedBox( + constraints: const BoxConstraints(maxHeight: 800, maxWidth: 1000), + child: SettingsPage(isDialog: true, view: view), + ), + ), + ), + ), + barrierDismissible: true, + barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, + transitionDuration: const Duration(milliseconds: 200), + transitionBuilder: (context, animation, secondaryAnimation, child) { + // Animate the dialog from bottom to center + return SlideTransition( + position: Tween( + begin: const Offset(0, 1), + end: Offset.zero, + ).chain(CurveTween(curve: Curves.easeOutQuart)).animate(animation), + child: child, + ); + }, +); diff --git a/app/lib/api/storage.dart b/app/lib/api/storage.dart index 93790a01..d6fbc1fc 100644 --- a/app/lib/api/storage.dart +++ b/app/lib/api/storage.dart @@ -1,15 +1,15 @@ -import 'dart:io'; - -import 'package:path_provider/path_provider.dart'; - -const setonixSubDirectory = '/Linwood/Setonix'; - -Future getSetonixDirectory() async { - String? path; - if (Platform.isAndroid) { - path ??= (await getExternalStorageDirectory())?.path; - } - path ??= (await getApplicationDocumentsDirectory()).path; - path += setonixSubDirectory; - return path; -} +import 'dart:io'; + +import 'package:path_provider/path_provider.dart'; + +const setonixSubDirectory = '/Linwood/Setonix'; + +Future getSetonixDirectory() async { + String? path; + if (Platform.isAndroid) { + path ??= (await getExternalStorageDirectory())?.path; + } + path ??= (await getApplicationDocumentsDirectory()).path; + path += setonixSubDirectory; + return path; +} diff --git a/app/lib/bloc/editor.dart b/app/lib/bloc/editor.dart index cef38a50..b7fef8e1 100644 --- a/app/lib/bloc/editor.dart +++ b/app/lib/bloc/editor.dart @@ -1,77 +1,77 @@ -import 'dart:typed_data'; - -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class EditorCubit extends Cubit { - final String path; - final SetonixFileSystem fileSystem; - - EditorCubit(this.path, this.fileSystem, super.initialState); - - void updateMeta(FileMetadata meta) => emit(state.setMetadata(meta)); - - @override - void onChange(Change change) { - super.onChange(change); - - _save(change.nextState); - } - - bool _needsSave = false; - bool _isSaving = false; - - Future _save(SetonixData data) async { - _needsSave = true; - if (_isSaving) { - return; - } - _isSaving = true; - while (_needsSave) { - _needsSave = false; - await fileSystem.editorSystem.updateFile(path, data); - } - _isSaving = false; - } - - void removeFigure(String figure) => emit(state.removeFigure(figure)); - - void setFigure(String figure, FigureDefinition definition) => - emit(state.setFigure(figure, definition)); - - void removeDeck(String deck) => emit(state.removeDeck(deck)); - - void setDeck(String deck, DeckDefinition definition) => - emit(state.setDeck(deck, definition)); - - void removeBackground(String background) => - emit(state.removeBackground(background)); - - void setBackground(String background, BackgroundDefinition definition) => - emit(state.setBackground(background, definition)); - - void setTranslation( - PackTranslation translation, [ - String locale = kFallbackLocale, - ]) => emit(state.setTranslation(translation, locale)); - - void removeTexture(String texture) => emit(state.removeTexture(texture)); - - void setTexture(String name, Uint8List bytes) => - emit(state.setTexture(name, bytes)); - - void removeBoard(String id) => emit(state.removeBoard(id)); - - void setBoard(String id, BoardDefinition definition) => - emit(state.setBoard(id, definition)); - - void removeScript(String id) => emit(state.removeScript(id)); - - void setScript(String id, String content) => - emit(state.setScript(id, content)); - - void removeMode(String id) => emit(state.removeMode(id)); - - void setMode(String id, GameMode mode) => emit(state.setMode(id, mode)); -} +import 'dart:typed_data'; + +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class EditorCubit extends Cubit { + final String path; + final SetonixFileSystem fileSystem; + + EditorCubit(this.path, this.fileSystem, super.initialState); + + void updateMeta(FileMetadata meta) => emit(state.setMetadata(meta)); + + @override + void onChange(Change change) { + super.onChange(change); + + _save(change.nextState); + } + + bool _needsSave = false; + bool _isSaving = false; + + Future _save(SetonixData data) async { + _needsSave = true; + if (_isSaving) { + return; + } + _isSaving = true; + while (_needsSave) { + _needsSave = false; + await fileSystem.editorSystem.updateFile(path, data); + } + _isSaving = false; + } + + void removeFigure(String figure) => emit(state.removeFigure(figure)); + + void setFigure(String figure, FigureDefinition definition) => + emit(state.setFigure(figure, definition)); + + void removeDeck(String deck) => emit(state.removeDeck(deck)); + + void setDeck(String deck, DeckDefinition definition) => + emit(state.setDeck(deck, definition)); + + void removeBackground(String background) => + emit(state.removeBackground(background)); + + void setBackground(String background, BackgroundDefinition definition) => + emit(state.setBackground(background, definition)); + + void setTranslation( + PackTranslation translation, [ + String locale = kFallbackLocale, + ]) => emit(state.setTranslation(translation, locale)); + + void removeTexture(String texture) => emit(state.removeTexture(texture)); + + void setTexture(String name, Uint8List bytes) => + emit(state.setTexture(name, bytes)); + + void removeBoard(String id) => emit(state.removeBoard(id)); + + void setBoard(String id, BoardDefinition definition) => + emit(state.setBoard(id, definition)); + + void removeScript(String id) => emit(state.removeScript(id)); + + void setScript(String id, String content) => + emit(state.setScript(id, content)); + + void removeMode(String id) => emit(state.removeMode(id)); + + void setMode(String id, GameMode mode) => emit(state.setMode(id, mode)); +} diff --git a/app/lib/bloc/world/local.dart b/app/lib/bloc/world/local.dart index dd18bdc3..afb35a1d 100644 --- a/app/lib/bloc/world/local.dart +++ b/app/lib/bloc/world/local.dart @@ -1,72 +1,72 @@ -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:flutter/material.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix_api/setonix_api.dart'; - -part 'local.mapper.dart'; - -@MappableClass() -final class HandChanged extends LocalWorldEvent with HandChangedMappable { - final ItemLocation? deck; - final bool? show; - - HandChanged({this.deck, bool this.show = true}); - HandChanged.hide() : deck = null, show = false; - HandChanged.toggle({this.deck}) : show = null; -} - -@MappableClass() -final class ColorSchemeChanged extends LocalWorldEvent - with ColorSchemeChangedMappable { - final ColorScheme? colorScheme; - - ColorSchemeChanged(this.colorScheme); -} - -@MappableClass() -final class SwitchCellOnMoveChanged extends LocalWorldEvent - with SwitchCellOnMoveChangedMappable { - final bool value; - - SwitchCellOnMoveChanged(this.value); -} - -@MappableClass() -final class WaypointVisibilityChanged extends LocalWorldEvent - with WaypointVisibilityChangedMappable { - final bool value; - - WaypointVisibilityChanged(this.value); -} - -@MappableClass() -final class TableSwitched extends LocalWorldEvent with TableSwitchedMappable { - final String name; - - TableSwitched([this.name = '']); -} - -@MappableClass() -final class DrawerViewChanged extends LocalWorldEvent - with DrawerViewChangedMappable { - final DrawerView view; - - DrawerViewChanged(this.view); -} - -@MappableClass() -final class SearchTermChanged extends LocalWorldEvent - with SearchTermChangedMappable { - final String term; - - SearchTermChanged(this.term); -} - -@MappableClass() -final class ShowDuplicatesChanged extends LocalWorldEvent - with ShowDuplicatesChangedMappable { - final bool? value; - - ShowDuplicatesChanged(this.value); - ShowDuplicatesChanged.toggle() : value = null; -} +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:flutter/material.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix_api/setonix_api.dart'; + +part 'local.mapper.dart'; + +@MappableClass() +final class HandChanged extends LocalWorldEvent with HandChangedMappable { + final ItemLocation? deck; + final bool? show; + + HandChanged({this.deck, bool this.show = true}); + HandChanged.hide() : deck = null, show = false; + HandChanged.toggle({this.deck}) : show = null; +} + +@MappableClass() +final class ColorSchemeChanged extends LocalWorldEvent + with ColorSchemeChangedMappable { + final ColorScheme? colorScheme; + + ColorSchemeChanged(this.colorScheme); +} + +@MappableClass() +final class SwitchCellOnMoveChanged extends LocalWorldEvent + with SwitchCellOnMoveChangedMappable { + final bool value; + + SwitchCellOnMoveChanged(this.value); +} + +@MappableClass() +final class WaypointVisibilityChanged extends LocalWorldEvent + with WaypointVisibilityChangedMappable { + final bool value; + + WaypointVisibilityChanged(this.value); +} + +@MappableClass() +final class TableSwitched extends LocalWorldEvent with TableSwitchedMappable { + final String name; + + TableSwitched([this.name = '']); +} + +@MappableClass() +final class DrawerViewChanged extends LocalWorldEvent + with DrawerViewChangedMappable { + final DrawerView view; + + DrawerViewChanged(this.view); +} + +@MappableClass() +final class SearchTermChanged extends LocalWorldEvent + with SearchTermChangedMappable { + final String term; + + SearchTermChanged(this.term); +} + +@MappableClass() +final class ShowDuplicatesChanged extends LocalWorldEvent + with ShowDuplicatesChangedMappable { + final bool? value; + + ShowDuplicatesChanged(this.value); + ShowDuplicatesChanged.toggle() : value = null; +} diff --git a/app/lib/board/focus.dart b/app/lib/board/focus.dart index 6408076b..2b34ee9b 100644 --- a/app/lib/board/focus.dart +++ b/app/lib/board/focus.dart @@ -1,38 +1,38 @@ -import 'package:flame/components.dart'; - -mixin Focusable on Component { - bool get focused => findParent()?.focusedComponent == this; - - void focus() { - findParent()?.focus(this); - } - - void unfocus() { - findParent()?.unfocus(); - } - - void onFocused() {} - void onUnfocused() {} -} - -class FocusComponent extends Component { - Component? _focusedComponent; - - Component? get focusedComponent => _focusedComponent; - - void focus(Component component) { - final old = _focusedComponent; - if (old is Focusable) { - old.onUnfocused(); - } - _focusedComponent = component; - } - - void unfocus() { - final old = _focusedComponent; - if (old is Focusable) { - old.onUnfocused(); - } - _focusedComponent = null; - } -} +import 'package:flame/components.dart'; + +mixin Focusable on Component { + bool get focused => findParent()?.focusedComponent == this; + + void focus() { + findParent()?.focus(this); + } + + void unfocus() { + findParent()?.unfocus(); + } + + void onFocused() {} + void onUnfocused() {} +} + +class FocusComponent extends Component { + Component? _focusedComponent; + + Component? get focusedComponent => _focusedComponent; + + void focus(Component component) { + final old = _focusedComponent; + if (old is Focusable) { + old.onUnfocused(); + } + _focusedComponent = component; + } + + void unfocus() { + final old = _focusedComponent; + if (old is Focusable) { + old.onUnfocused(); + } + _focusedComponent = null; + } +} diff --git a/app/lib/board/game.dart b/app/lib/board/game.dart index 9a0fde26..c548dcd1 100644 --- a/app/lib/board/game.dart +++ b/app/lib/board/game.dart @@ -1,242 +1,242 @@ -import 'dart:async'; - -import 'package:flame/components.dart'; -import 'package:flame/events.dart'; -import 'package:flame/game.dart'; -import 'package:flame_bloc/flame_bloc.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; -import 'package:setonix/bloc/settings.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/local.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/board/grid.dart'; -import 'package:setonix/board/hand/view.dart'; -import 'package:setonix/helpers/scroll.dart'; -import 'package:setonix/helpers/vector.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class BoardGame extends FlameGame - with ScrollDetector, KeyboardEvents, HasCollisionDetection, ScaleDetector { - final VoidCallback onEscape; - final ContextMenuController contextMenuController; - late final Sprite selectionSprite, blankSprite; - late final GameHand _hand; - late final BoardGrid grid; - final WorldBloc bloc; - final SettingsCubit settingsCubit; - - bool _isShifting = false; - bool get isShifting => _isShifting; - - BoardGame({ - required this.bloc, - required this.contextMenuController, - required this.onEscape, - required this.settingsCubit, - }); - - @override - FutureOr onLoad() async { - add(ScreenHitbox()); - FlameBlocProvider provider = - FlameBlocProvider.value(value: bloc); - provider = provider; - await add( - FlameBlocProvider.value( - value: settingsCubit, - children: [ - provider, - FlameBlocListener( - listenWhen: (previousState, newState) => - previousState.zoom != newState.zoom, - onNewState: (state) { - camera.viewfinder.zoom = state.zoom.clamp(0.4, 2.0); - }, - ), - ], - ), - ); - provider.addAll([camera, world]); - camera.viewfinder.zoom = settingsCubit.state.zoom; - selectionSprite = await Sprite.load('selection.png'); - blankSprite = await Sprite.load('blank.png'); - _hand = GameHand(); - camera.viewport.add(_hand); - camera.moveTo(camera.viewport.virtualSize * 0.5); - grid = BoardGrid(cellSize: Vector2.all(128)); - world.add(grid); - _updateLocale(); - } - - @override - void onAttach() { - _updateLocale(); - } - - void _updateLocale() { - final context = buildContext; - if (context == null) return; - bloc.state.assetManager.currentLocale = Localizations.localeOf( - context, - ).languageCode; - } - - static const zoomPerScrollUnit = 0.02; - - double _startZoom = 1.0; - Vector2 _startPosition = Vector2.zero(); - bool _scaleStartedOnHand = false; - - @override - void onScaleStart(ScaleStartInfo info) { - _startZoom = camera.viewfinder.zoom; - _startPosition = info.eventPosition.global; - _scaleStartedOnHand = - _hand.isShowing && _hand.containsPoint(info.eventPosition.widget); - } - - @override - void onScaleUpdate(ScaleUpdateInfo info) { - if (_scaleStartedOnHand) { - if (info.pointerCount == 1) { - _hand.dragScroll(info.delta.global.x); - } - return; - } - final zoom = camera.viewfinder.zoom; - final delta = (info.delta.global..negate()) / zoom; - - if (info.scale.global.x == 0 || info.scale.global.x == 1.0) { - camera.moveBy(delta); - return; - } - - final newZoom = (_startZoom * info.scale.global.x).clamp(0.4, 2.0); - final oldZoom = camera.viewfinder.zoom.clamp(0.4, 2.0); - camera.viewfinder.zoom = newZoom; - // Zoom inside towards the focal point - final screenCenter = camera.viewport.size / 2; - final zoomDelta = newZoom - oldZoom; - if (((4.0 - newZoom) < precisionErrorTolerance && - (4.0 - oldZoom) < precisionErrorTolerance) || - ((0.4 - newZoom) < precisionErrorTolerance && - (0.4 - oldZoom) < precisionErrorTolerance)) { - return; - } - final focalPoint = info.eventPosition.global - screenCenter; - final focalDelta = (focalPoint - _startPosition) / newZoom; - camera.moveBy(focalDelta * (zoomDelta / newZoom) + delta); - } - - @override - void onScaleEnd(ScaleEndInfo info) { - _scaleStartedOnHand = false; - settingsCubit.resetZoom(camera.viewfinder.zoom); - } - - @override - void onScroll(PointerScrollInfo info) { - final handled = componentsAtPoint( - info.eventPosition.widget, - ).whereType().any((element) => element.onScroll(info)); - if (handled) return; - camera.viewfinder.zoom += - info.scrollDelta.global.y.sign * zoomPerScrollUnit; - } - - Vector2 _currentCameraVelocity = Vector2.zero(); - - @override - void update(double dt) { - super.update(dt); - - if (!_currentCameraVelocity.isZero()) { - final zoom = camera.viewfinder.zoom; - camera.moveBy(_currentCameraVelocity * dt * 500 / zoom); - } - } - - @override - KeyEventResult onKeyEvent( - KeyEvent event, - Set keysPressed, - ) { - var handled = false; - switch (event.logicalKey) { - case LogicalKeyboardKey.escape: - if (event is KeyDownEvent) { - if (bloc.state.showHand) { - bloc.add(HandChanged(show: false)); - } else { - onEscape(); - } - } - handled = true; - case LogicalKeyboardKey.tab: - if (event is KeyDownEvent) bloc.add(HandChanged.toggle()); - handled = true; - case LogicalKeyboardKey.shiftLeft: - if (event is KeyDownEvent) _isShifting = true; - if (event is KeyUpEvent) _isShifting = false; - handled = true; - case LogicalKeyboardKey.keyW: - case LogicalKeyboardKey.keyS: - case LogicalKeyboardKey.keyA: - case LogicalKeyboardKey.keyD: - handled = true; - case LogicalKeyboardKey.arrowLeft: - if (bloc.state.showHand) { - if (event is KeyDownEvent) _hand.moveLeft(); - handled = true; - } - case LogicalKeyboardKey.arrowRight: - if (bloc.state.showHand) { - if (event is KeyDownEvent) _hand.moveRight(); - handled = true; - } - } - Vector2 nextCameraVelocity = Vector2.zero(); - if (keysPressed.contains(LogicalKeyboardKey.keyW)) { - nextCameraVelocity += Vector2(0, -1); - } - if (keysPressed.contains(LogicalKeyboardKey.keyS)) { - nextCameraVelocity += Vector2(0, 1); - } - if (keysPressed.contains(LogicalKeyboardKey.keyA)) { - nextCameraVelocity += Vector2(-1, 0); - } - if (keysPressed.contains(LogicalKeyboardKey.keyD)) { - nextCameraVelocity += Vector2(1, 0); - } - if (nextCameraVelocity != _currentCameraVelocity) { - _currentCameraVelocity = nextCameraVelocity; - } - return handled ? KeyEventResult.handled : KeyEventResult.ignored; - } - - void showContextMenu({ - required Widget Function(BuildContext, VoidCallback onClose) - contextMenuBuilder, - }) { - final context = buildContext; - if (context == null) return; - contextMenuController.show( - context: context, - contextMenuBuilder: (context) => - contextMenuBuilder(context, contextMenuController.remove), - ); - } - - void teleport(GlobalVectorDefinition position) { - final table = position.table; - if (table != bloc.state.world.tableName) { - bloc.add(TableSwitched(table)); - } - final cellSize = grid.cellSize; - camera.moveTo( - (position.position.toVector()..multiply(cellSize)) + cellSize / 2, - ); - } -} +import 'dart:async'; + +import 'package:flame/components.dart'; +import 'package:flame/events.dart'; +import 'package:flame/game.dart'; +import 'package:flame_bloc/flame_bloc.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:setonix/bloc/settings.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/local.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/board/grid.dart'; +import 'package:setonix/board/hand/view.dart'; +import 'package:setonix/helpers/scroll.dart'; +import 'package:setonix/helpers/vector.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class BoardGame extends FlameGame + with ScrollDetector, KeyboardEvents, HasCollisionDetection, ScaleDetector { + final VoidCallback onEscape; + final ContextMenuController contextMenuController; + late final Sprite selectionSprite, blankSprite; + late final GameHand _hand; + late final BoardGrid grid; + final WorldBloc bloc; + final SettingsCubit settingsCubit; + + bool _isShifting = false; + bool get isShifting => _isShifting; + + BoardGame({ + required this.bloc, + required this.contextMenuController, + required this.onEscape, + required this.settingsCubit, + }); + + @override + FutureOr onLoad() async { + add(ScreenHitbox()); + FlameBlocProvider provider = + FlameBlocProvider.value(value: bloc); + provider = provider; + await add( + FlameBlocProvider.value( + value: settingsCubit, + children: [ + provider, + FlameBlocListener( + listenWhen: (previousState, newState) => + previousState.zoom != newState.zoom, + onNewState: (state) { + camera.viewfinder.zoom = state.zoom.clamp(0.4, 2.0); + }, + ), + ], + ), + ); + provider.addAll([camera, world]); + camera.viewfinder.zoom = settingsCubit.state.zoom; + selectionSprite = await Sprite.load('selection.png'); + blankSprite = await Sprite.load('blank.png'); + _hand = GameHand(); + camera.viewport.add(_hand); + camera.moveTo(camera.viewport.virtualSize * 0.5); + grid = BoardGrid(cellSize: Vector2.all(128)); + world.add(grid); + _updateLocale(); + } + + @override + void onAttach() { + _updateLocale(); + } + + void _updateLocale() { + final context = buildContext; + if (context == null) return; + bloc.state.assetManager.currentLocale = Localizations.localeOf( + context, + ).languageCode; + } + + static const zoomPerScrollUnit = 0.02; + + double _startZoom = 1.0; + Vector2 _startPosition = Vector2.zero(); + bool _scaleStartedOnHand = false; + + @override + void onScaleStart(ScaleStartInfo info) { + _startZoom = camera.viewfinder.zoom; + _startPosition = info.eventPosition.global; + _scaleStartedOnHand = + _hand.isShowing && _hand.containsPoint(info.eventPosition.widget); + } + + @override + void onScaleUpdate(ScaleUpdateInfo info) { + if (_scaleStartedOnHand) { + if (info.pointerCount == 1) { + _hand.dragScroll(info.delta.global.x); + } + return; + } + final zoom = camera.viewfinder.zoom; + final delta = (info.delta.global..negate()) / zoom; + + if (info.scale.global.x == 0 || info.scale.global.x == 1.0) { + camera.moveBy(delta); + return; + } + + final newZoom = (_startZoom * info.scale.global.x).clamp(0.4, 2.0); + final oldZoom = camera.viewfinder.zoom.clamp(0.4, 2.0); + camera.viewfinder.zoom = newZoom; + // Zoom inside towards the focal point + final screenCenter = camera.viewport.size / 2; + final zoomDelta = newZoom - oldZoom; + if (((4.0 - newZoom) < precisionErrorTolerance && + (4.0 - oldZoom) < precisionErrorTolerance) || + ((0.4 - newZoom) < precisionErrorTolerance && + (0.4 - oldZoom) < precisionErrorTolerance)) { + return; + } + final focalPoint = info.eventPosition.global - screenCenter; + final focalDelta = (focalPoint - _startPosition) / newZoom; + camera.moveBy(focalDelta * (zoomDelta / newZoom) + delta); + } + + @override + void onScaleEnd(ScaleEndInfo info) { + _scaleStartedOnHand = false; + settingsCubit.resetZoom(camera.viewfinder.zoom); + } + + @override + void onScroll(PointerScrollInfo info) { + final handled = componentsAtPoint( + info.eventPosition.widget, + ).whereType().any((element) => element.onScroll(info)); + if (handled) return; + camera.viewfinder.zoom += + info.scrollDelta.global.y.sign * zoomPerScrollUnit; + } + + Vector2 _currentCameraVelocity = Vector2.zero(); + + @override + void update(double dt) { + super.update(dt); + + if (!_currentCameraVelocity.isZero()) { + final zoom = camera.viewfinder.zoom; + camera.moveBy(_currentCameraVelocity * dt * 500 / zoom); + } + } + + @override + KeyEventResult onKeyEvent( + KeyEvent event, + Set keysPressed, + ) { + var handled = false; + switch (event.logicalKey) { + case LogicalKeyboardKey.escape: + if (event is KeyDownEvent) { + if (bloc.state.showHand) { + bloc.add(HandChanged(show: false)); + } else { + onEscape(); + } + } + handled = true; + case LogicalKeyboardKey.tab: + if (event is KeyDownEvent) bloc.add(HandChanged.toggle()); + handled = true; + case LogicalKeyboardKey.shiftLeft: + if (event is KeyDownEvent) _isShifting = true; + if (event is KeyUpEvent) _isShifting = false; + handled = true; + case LogicalKeyboardKey.keyW: + case LogicalKeyboardKey.keyS: + case LogicalKeyboardKey.keyA: + case LogicalKeyboardKey.keyD: + handled = true; + case LogicalKeyboardKey.arrowLeft: + if (bloc.state.showHand) { + if (event is KeyDownEvent) _hand.moveLeft(); + handled = true; + } + case LogicalKeyboardKey.arrowRight: + if (bloc.state.showHand) { + if (event is KeyDownEvent) _hand.moveRight(); + handled = true; + } + } + Vector2 nextCameraVelocity = Vector2.zero(); + if (keysPressed.contains(LogicalKeyboardKey.keyW)) { + nextCameraVelocity += Vector2(0, -1); + } + if (keysPressed.contains(LogicalKeyboardKey.keyS)) { + nextCameraVelocity += Vector2(0, 1); + } + if (keysPressed.contains(LogicalKeyboardKey.keyA)) { + nextCameraVelocity += Vector2(-1, 0); + } + if (keysPressed.contains(LogicalKeyboardKey.keyD)) { + nextCameraVelocity += Vector2(1, 0); + } + if (nextCameraVelocity != _currentCameraVelocity) { + _currentCameraVelocity = nextCameraVelocity; + } + return handled ? KeyEventResult.handled : KeyEventResult.ignored; + } + + void showContextMenu({ + required Widget Function(BuildContext, VoidCallback onClose) + contextMenuBuilder, + }) { + final context = buildContext; + if (context == null) return; + contextMenuController.show( + context: context, + contextMenuBuilder: (context) => + contextMenuBuilder(context, contextMenuController.remove), + ); + } + + void teleport(GlobalVectorDefinition position) { + final table = position.table; + if (table != bloc.state.world.tableName) { + bloc.add(TableSwitched(table)); + } + final cellSize = grid.cellSize; + camera.moveTo( + (position.position.toVector()..multiply(cellSize)) + cellSize / 2, + ); + } +} diff --git a/app/lib/board/hand/board.dart b/app/lib/board/hand/board.dart index 64b668b6..5be7b156 100644 --- a/app/lib/board/hand/board.dart +++ b/app/lib/board/hand/board.dart @@ -1,34 +1,34 @@ -import 'package:flame/widgets.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/board/cell.dart'; -import 'package:setonix/board/hand/item.dart'; -import 'package:setonix/helpers/string.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class BoardDefinitionHandItem extends HandItem> { - BoardDefinitionHandItem({required super.item}); - - @override - String getLabel(ClientWorldState state) { - final translation = getAssetManager(state).getTranslations(item.namespace); - return translation.getBoardTranslation(item.id).name; - } - - bool matches(ClientWorldState state, String term) => - item.location.toString().containsIgnoreCase(term) || - getLabel(state).containsIgnoreCase(term); - - @override - Future loadIcon(ClientWorldState state) => - getAssetManager(state).loadBoardSprite(item.location); - @override - void moveItem(HandItemDropZone zone) { - if (zone is! GameCell) return; - bloc.process( - BoardsSpawnRequest.single( - zone.toGlobalDefinition(bloc.state), - item.location, - ), - ); - } -} +import 'package:flame/widgets.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/board/cell.dart'; +import 'package:setonix/board/hand/item.dart'; +import 'package:setonix/helpers/string.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class BoardDefinitionHandItem extends HandItem> { + BoardDefinitionHandItem({required super.item}); + + @override + String getLabel(ClientWorldState state) { + final translation = getAssetManager(state).getTranslations(item.namespace); + return translation.getBoardTranslation(item.id).name; + } + + bool matches(ClientWorldState state, String term) => + item.location.toString().containsIgnoreCase(term) || + getLabel(state).containsIgnoreCase(term); + + @override + Future loadIcon(ClientWorldState state) => + getAssetManager(state).loadBoardSprite(item.location); + @override + void moveItem(HandItemDropZone zone) { + if (zone is! GameCell) return; + bloc.process( + BoardsSpawnRequest.single( + zone.toGlobalDefinition(bloc.state), + item.location, + ), + ); + } +} diff --git a/app/lib/board/hand/deck.dart b/app/lib/board/hand/deck.dart index f63de00e..4f43e6ce 100644 --- a/app/lib/board/hand/deck.dart +++ b/app/lib/board/hand/deck.dart @@ -1,65 +1,65 @@ -import 'package:flame/components.dart'; -import 'package:setonix/bloc/world/local.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/board/cell.dart'; -import 'package:setonix/board/hand/item.dart'; -import 'package:setonix/helpers/string.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class DeckDefinitionHandItem extends HandItem> { - DeckDefinitionHandItem({required super.item}); - - @override - String getLabel(ClientWorldState state) => getAssetManager( - state, - ).getTranslations(item.namespace).getDeckTranslation(item.id).name; - - bool matches(ClientWorldState state, String term) => - item.location.toString().containsIgnoreCase(term) || - getLabel(state).containsIgnoreCase(term); - - @override - void onTapUp(event) { - bloc.process(HandChanged(deck: item.location)); - } - - @override - Future loadIcon(ClientWorldState state) async { - final front = item.item.figures.firstOrNull; - if (front == null) return null; - return getAssetManager(state).loadFigureSprite( - ItemLocation.fromString(front.name, item.namespace), - front.variation, - ); - } - - @override - void moveItem(HandItemDropZone zone) { - if (zone is! GameCell) return; - final global = zone.toGlobalDefinition(bloc.state); - final objects = >{}; - for (final e in item.item.figures) { - final location = global.position + e.position; - objects - .putIfAbsent(location, () => []) - .add( - GameObject( - ItemLocation(item.namespace, e.name), - variation: e.variation, - ), - ); - } - bloc.process(ObjectsSpawned(global.table, objects)); - final boards = >{}; - for (final e in item.item.boards) { - final location = global.position + e.position; - boards - .putIfAbsent(location, () => []) - .add(ItemLocation(item.namespace, e.name)); - } - bloc.process(BoardsSpawnRequest(global.table, boards)); - if (bloc.state.switchCellOnMove) { - bloc.process(CellSwitched(global.position)); - } - } -} +import 'package:flame/components.dart'; +import 'package:setonix/bloc/world/local.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/board/cell.dart'; +import 'package:setonix/board/hand/item.dart'; +import 'package:setonix/helpers/string.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class DeckDefinitionHandItem extends HandItem> { + DeckDefinitionHandItem({required super.item}); + + @override + String getLabel(ClientWorldState state) => getAssetManager( + state, + ).getTranslations(item.namespace).getDeckTranslation(item.id).name; + + bool matches(ClientWorldState state, String term) => + item.location.toString().containsIgnoreCase(term) || + getLabel(state).containsIgnoreCase(term); + + @override + void onTapUp(event) { + bloc.process(HandChanged(deck: item.location)); + } + + @override + Future loadIcon(ClientWorldState state) async { + final front = item.item.figures.firstOrNull; + if (front == null) return null; + return getAssetManager(state).loadFigureSprite( + ItemLocation.fromString(front.name, item.namespace), + front.variation, + ); + } + + @override + void moveItem(HandItemDropZone zone) { + if (zone is! GameCell) return; + final global = zone.toGlobalDefinition(bloc.state); + final objects = >{}; + for (final e in item.item.figures) { + final location = global.position + e.position; + objects + .putIfAbsent(location, () => []) + .add( + GameObject( + ItemLocation(item.namespace, e.name), + variation: e.variation, + ), + ); + } + bloc.process(ObjectsSpawned(global.table, objects)); + final boards = >{}; + for (final e in item.item.boards) { + final location = global.position + e.position; + boards + .putIfAbsent(location, () => []) + .add(ItemLocation(item.namespace, e.name)); + } + bloc.process(BoardsSpawnRequest(global.table, boards)); + if (bloc.state.switchCellOnMove) { + bloc.process(CellSwitched(global.position)); + } + } +} diff --git a/app/lib/board/hand/figure.dart b/app/lib/board/hand/figure.dart index 390c2e69..5dd6790a 100644 --- a/app/lib/board/hand/figure.dart +++ b/app/lib/board/hand/figure.dart @@ -1,49 +1,49 @@ -import 'package:flame/widgets.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/board/cell.dart'; -import 'package:setonix/board/hand/item.dart'; -import 'package:setonix/helpers/string.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class FigureDefinitionHandItem - extends HandItem<(PackItem, String?)> { - FigureDefinitionHandItem({required super.item}); - - @override - String getLabel(ClientWorldState state) { - final translation = getAssetManager( - state, - ).getTranslations(item.$1.namespace); - final variation = item.$2; - if (variation != null) { - return translation - .getFigureVariationTranslation(item.$1.id, variation) - .name; - } - return translation.getFigureTranslation(item.$1.id).name; - } - - bool matches(ClientWorldState state, String term) => - item.$1.location.toString().containsIgnoreCase(term) || - getLabel(state).containsIgnoreCase(term); - - @override - Future loadIcon(ClientWorldState state) => - getAssetManager(state).loadFigureSprite(item.$1.location, item.$2); - @override - void moveItem(HandItemDropZone zone) { - if (zone is! GameCell) return; - final global = zone.toGlobalDefinition(bloc.state); - bloc.process( - ObjectsSpawned.single(global, [ - GameObject( - ItemLocation(item.$1.namespace, item.$1.id), - variation: item.$2, - ), - ]), - ); - if (bloc.state.switchCellOnMove) { - bloc.process(CellSwitched(global.position)); - } - } -} +import 'package:flame/widgets.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/board/cell.dart'; +import 'package:setonix/board/hand/item.dart'; +import 'package:setonix/helpers/string.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class FigureDefinitionHandItem + extends HandItem<(PackItem, String?)> { + FigureDefinitionHandItem({required super.item}); + + @override + String getLabel(ClientWorldState state) { + final translation = getAssetManager( + state, + ).getTranslations(item.$1.namespace); + final variation = item.$2; + if (variation != null) { + return translation + .getFigureVariationTranslation(item.$1.id, variation) + .name; + } + return translation.getFigureTranslation(item.$1.id).name; + } + + bool matches(ClientWorldState state, String term) => + item.$1.location.toString().containsIgnoreCase(term) || + getLabel(state).containsIgnoreCase(term); + + @override + Future loadIcon(ClientWorldState state) => + getAssetManager(state).loadFigureSprite(item.$1.location, item.$2); + @override + void moveItem(HandItemDropZone zone) { + if (zone is! GameCell) return; + final global = zone.toGlobalDefinition(bloc.state); + bloc.process( + ObjectsSpawned.single(global, [ + GameObject( + ItemLocation(item.$1.namespace, item.$1.id), + variation: item.$2, + ), + ]), + ); + if (bloc.state.switchCellOnMove) { + bloc.process(CellSwitched(global.position)); + } + } +} diff --git a/app/lib/board/hand/object.dart b/app/lib/board/hand/object.dart index 003aef47..28dd9b7e 100644 --- a/app/lib/board/hand/object.dart +++ b/app/lib/board/hand/object.dart @@ -1,95 +1,95 @@ -import 'package:flame/components.dart'; -import 'package:flutter/widgets.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/board/cell.dart'; -import 'package:setonix/board/hand/item.dart'; -import 'package:setonix/board/hand/view.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GameObjectHandItem extends HandItem<(VectorDefinition, int, GameObject)> { - GameObjectHandItem({required super.item}); - - GlobalVectorDefinition toGlobalDefinition(ClientWorldState state) => - GlobalVectorDefinition.fromLocal(state.tableName, item.$1); - - @override - String getLabel(ClientWorldState state) { - final object = item.$3; - final translation = getAssetManager( - state, - ).getTranslations(object.asset.namespace); - final variation = object.variation; - if (variation != null && - !item.$3.hidden && - state.isCellVisible(toGlobalDefinition(state))) { - return translation - .getFigureVariationTranslation(object.asset.id, variation) - .name; - } - return translation.getFigureTranslation(object.asset.id).name; - } - - @override - Future loadIcon(ClientWorldState state) => - getAssetManager(state).loadFigureSprite( - item.$3.asset, - item.$3.hidden || !state.isCellVisible(state.toGlobal(item.$1)) - ? null - : item.$3.variation, - ); - - @override - void moveItem(HandItemDropZone zone) { - final current = toGlobalDefinition(bloc.state); - switch (zone) { - case GameCell(): - final global = zone.toDefinition(); - bloc.process( - ObjectsMoved(current.table, [item.$2], current.position, global), - ); - if (bloc.state.switchCellOnMove) { - bloc.process(CellSwitched(global)); - } - case GameObjectHandItem(): - bloc.process(ObjectIndexChanged(current, item.$2, zone.item.$2)); - case GameHand(): - final cell = bloc.state.table.cells[item.$1]; - bloc.process( - ObjectIndexChanged(current, item.$2, (cell?.objects.length ?? 1) - 1), - ); - default: - return; - } - } - - @override - get contextItemsBuilder { - final location = item.$3.asset; - final global = toGlobalDefinition(bloc.state); - return (context, onClose) => [ - ContextMenuButtonItem( - label: AppLocalizations.of(context).toggleHide, - onPressed: () { - bloc.process(CellHideChanged(global, object: item.$2)); - onClose(); - }, - ), - ContextMenuButtonItem( - label: AppLocalizations.of(context).remove, - onPressed: () { - bloc.process(ObjectsRemoved.single(global, object: item.$2)); - onClose(); - }, - ), - if (getAssetManager(bloc.state).getFigure(location)?.rollable ?? true) - ContextMenuButtonItem( - label: AppLocalizations.of(context).roll, - onPressed: () { - bloc.process(CellRollRequest(global, object: item.$2)); - onClose(); - }, - ), - ]; - } -} +import 'package:flame/components.dart'; +import 'package:flutter/widgets.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/board/cell.dart'; +import 'package:setonix/board/hand/item.dart'; +import 'package:setonix/board/hand/view.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GameObjectHandItem extends HandItem<(VectorDefinition, int, GameObject)> { + GameObjectHandItem({required super.item}); + + GlobalVectorDefinition toGlobalDefinition(ClientWorldState state) => + GlobalVectorDefinition.fromLocal(state.tableName, item.$1); + + @override + String getLabel(ClientWorldState state) { + final object = item.$3; + final translation = getAssetManager( + state, + ).getTranslations(object.asset.namespace); + final variation = object.variation; + if (variation != null && + !item.$3.hidden && + state.isCellVisible(toGlobalDefinition(state))) { + return translation + .getFigureVariationTranslation(object.asset.id, variation) + .name; + } + return translation.getFigureTranslation(object.asset.id).name; + } + + @override + Future loadIcon(ClientWorldState state) => + getAssetManager(state).loadFigureSprite( + item.$3.asset, + item.$3.hidden || !state.isCellVisible(state.toGlobal(item.$1)) + ? null + : item.$3.variation, + ); + + @override + void moveItem(HandItemDropZone zone) { + final current = toGlobalDefinition(bloc.state); + switch (zone) { + case GameCell(): + final global = zone.toDefinition(); + bloc.process( + ObjectsMoved(current.table, [item.$2], current.position, global), + ); + if (bloc.state.switchCellOnMove) { + bloc.process(CellSwitched(global)); + } + case GameObjectHandItem(): + bloc.process(ObjectIndexChanged(current, item.$2, zone.item.$2)); + case GameHand(): + final cell = bloc.state.table.cells[item.$1]; + bloc.process( + ObjectIndexChanged(current, item.$2, (cell?.objects.length ?? 1) - 1), + ); + default: + return; + } + } + + @override + get contextItemsBuilder { + final location = item.$3.asset; + final global = toGlobalDefinition(bloc.state); + return (context, onClose) => [ + ContextMenuButtonItem( + label: AppLocalizations.of(context).toggleHide, + onPressed: () { + bloc.process(CellHideChanged(global, object: item.$2)); + onClose(); + }, + ), + ContextMenuButtonItem( + label: AppLocalizations.of(context).remove, + onPressed: () { + bloc.process(ObjectsRemoved.single(global, object: item.$2)); + onClose(); + }, + ), + if (getAssetManager(bloc.state).getFigure(location)?.rollable ?? true) + ContextMenuButtonItem( + label: AppLocalizations.of(context).roll, + onPressed: () { + bloc.process(CellRollRequest(global, object: item.$2)); + onClose(); + }, + ), + ]; + } +} diff --git a/app/lib/board/hand/tile.dart b/app/lib/board/hand/tile.dart index b1900a59..fb35b2e2 100644 --- a/app/lib/board/hand/tile.dart +++ b/app/lib/board/hand/tile.dart @@ -1,50 +1,50 @@ -import 'package:flame/sprite.dart'; -import 'package:flutter/material.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/board/cell.dart'; -import 'package:setonix/board/hand/item.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class BoardTileHandItem extends HandItem<(VectorDefinition, int, BoardTile)> { - BoardTileHandItem({required super.item}); - - @override - String getLabel(ClientWorldState state) { - final object = item.$3; - final translation = getAssetManager( - state, - ).getTranslations(object.asset.namespace); - return translation.getBoardTranslation(object.asset.id).name; - } - - @override - Future loadIcon(ClientWorldState state) { - return getAssetManager(state).loadBoardSprite(item.$3.asset, item.$3.tile); - } - - @override - get contextItemsBuilder { - return (context, onClose) => [ - ContextMenuButtonItem( - label: AppLocalizations.of(context).remove, - onPressed: () { - bloc.process( - BoardRemoveRequest( - GlobalVectorDefinition.fromLocal(bloc.state.tableName, item.$1), - item.$2, - ), - ); - onClose(); - }, - ), - ]; - } - - @override - void moveItem(HandItemDropZone zone) { - if (zone is! GameCell) return; - final to = zone.toDefinition(); - bloc.process(BoardMoveRequest(bloc.state.tableName, item.$1, to, item.$2)); - } -} +import 'package:flame/sprite.dart'; +import 'package:flutter/material.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/board/cell.dart'; +import 'package:setonix/board/hand/item.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class BoardTileHandItem extends HandItem<(VectorDefinition, int, BoardTile)> { + BoardTileHandItem({required super.item}); + + @override + String getLabel(ClientWorldState state) { + final object = item.$3; + final translation = getAssetManager( + state, + ).getTranslations(object.asset.namespace); + return translation.getBoardTranslation(object.asset.id).name; + } + + @override + Future loadIcon(ClientWorldState state) { + return getAssetManager(state).loadBoardSprite(item.$3.asset, item.$3.tile); + } + + @override + get contextItemsBuilder { + return (context, onClose) => [ + ContextMenuButtonItem( + label: AppLocalizations.of(context).remove, + onPressed: () { + bloc.process( + BoardRemoveRequest( + GlobalVectorDefinition.fromLocal(bloc.state.tableName, item.$1), + item.$2, + ), + ); + onClose(); + }, + ), + ]; + } + + @override + void moveItem(HandItemDropZone zone) { + if (zone is! GameCell) return; + final to = zone.toDefinition(); + bloc.process(BoardMoveRequest(bloc.state.tableName, item.$1, to, item.$2)); + } +} diff --git a/app/lib/helpers/asset.dart b/app/lib/helpers/asset.dart index 02b49f73..28d18d84 100644 --- a/app/lib/helpers/asset.dart +++ b/app/lib/helpers/asset.dart @@ -1,141 +1,141 @@ -import 'dart:ui'; - -import 'package:flame/game.dart'; -import 'package:flame/sprite.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; -import 'package:setonix/helpers/vector.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GameAssetManager extends AssetManager { - String currentLocale; - final Map _loadedPacks = {}; - final Map _loadedTranslations = {}; - final Map> _cachedImages = {}; - - final SetonixFileSystem fileSystem; - - GameAssetManager({required this.fileSystem, this.currentLocale = 'en'}); - - @override - Iterable> get packs => _loadedPacks.entries; - - Uint8List? getTexture(String key, String namespace) => - getTextureFromLocation(ItemLocation.fromString(key, namespace)); - - Uint8List? getTextureFromLocation(ItemLocation location) { - final pack = _loadedPacks[location.namespace]; - if (pack == null) return null; - final asset = pack.getTexture(location.id); - if (asset == null) return null; - return asset; - } - - Future loadSprite( - String key, - String namespace, { - Vector2? srcPosition, - Vector2? srcSize, - }) => loadSpriteFromLocation( - ItemLocation.fromString(key, namespace), - srcPosition: srcPosition, - srcSize: srcSize, - ); - - Future loadSpriteFromLocation( - ItemLocation location, { - Vector2? srcPosition, - Vector2? srcSize, - }) { - Future? image = _cachedImages[location]; - if (image == null) { - final texture = getTextureFromLocation(location); - if (texture == null) return Future.value(null); - image = _cachedImages[location] = decodeImageFromList(texture); - } - return image.then( - (e) => Sprite(e, srcPosition: srcPosition, srcSize: srcSize), - ); - } - - Future loadFigureSprite( - ItemLocation location, [ - String? variation, - ]) async { - final figure = getFigure(location); - if (figure == null) return null; - final definition = figure.variations[variation] ?? figure.back; - return loadSprite( - definition.texture, - location.namespace, - srcPosition: definition.offset.toVector(), - srcSize: definition.size?.toVector(), - ); - } - - Future loadBoardSprite( - ItemLocation location, [ - VectorDefinition? tile, - ]) async { - final board = getBoard(location); - if (board == null) return null; - Vector2 offset = board.offset.toVector(); - Vector2? size = board.size?.toVector(); - if (tile != null && size != null) { - size = size.clone()..divide(board.tiles.toVector()); - offset += size.clone()..multiply(tile.toVector()); - } - return loadSprite( - board.texture, - location.namespace, - srcPosition: offset, - srcSize: size, - ); - } - - @override - SetonixData? getPack(String key) => _loadedPacks[key]; - - Future loadPacks() async { - final files = await fileSystem.getPacks(); - final corePack = await fileSystem.fetchCorePack(); - unloadPacks( - _loadedPacks.keys.where((e) => !files.any((f) => f.identifier == e)), - ); - for (final file in [...files, corePack]) { - try { - final pack = file.load(); - _loadedPacks[file.identifier] = pack; - _loadedTranslations[file.identifier] = pack.getTranslationsStore( - getLocale: () => currentLocale, - ); - } catch (_) {} - } - } - - TranslationsStore getTranslations(String key) => - _loadedTranslations[key] ?? - TranslationsStore(getLocale: () => currentLocale); - - void unloadPacks(Iterable keys) { - _loadedTranslations.removeWhere((e, _) => keys.contains(e)); - for (final key in keys) { - if (_loadedPacks.remove(key) != null) clearImagesFromNamespace(key); - } - } - - void clearImagesFromNamespace(String namespace) => - _cachedImages..removeWhere((k, v) { - if (namespace != k?.namespace) return false; - v.then((e) => e.dispose()); - return true; - }); - - void clearImages() => _cachedImages - ..forEach((_, v) => v.then((e) => e.dispose())) - ..clear(); - - @override - bool hasPack(String key) => _loadedPacks.containsKey(key); -} +import 'dart:ui'; + +import 'package:flame/game.dart'; +import 'package:flame/sprite.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; +import 'package:setonix/helpers/vector.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GameAssetManager extends AssetManager { + String currentLocale; + final Map _loadedPacks = {}; + final Map _loadedTranslations = {}; + final Map> _cachedImages = {}; + + final SetonixFileSystem fileSystem; + + GameAssetManager({required this.fileSystem, this.currentLocale = 'en'}); + + @override + Iterable> get packs => _loadedPacks.entries; + + Uint8List? getTexture(String key, String namespace) => + getTextureFromLocation(ItemLocation.fromString(key, namespace)); + + Uint8List? getTextureFromLocation(ItemLocation location) { + final pack = _loadedPacks[location.namespace]; + if (pack == null) return null; + final asset = pack.getTexture(location.id); + if (asset == null) return null; + return asset; + } + + Future loadSprite( + String key, + String namespace, { + Vector2? srcPosition, + Vector2? srcSize, + }) => loadSpriteFromLocation( + ItemLocation.fromString(key, namespace), + srcPosition: srcPosition, + srcSize: srcSize, + ); + + Future loadSpriteFromLocation( + ItemLocation location, { + Vector2? srcPosition, + Vector2? srcSize, + }) { + Future? image = _cachedImages[location]; + if (image == null) { + final texture = getTextureFromLocation(location); + if (texture == null) return Future.value(null); + image = _cachedImages[location] = decodeImageFromList(texture); + } + return image.then( + (e) => Sprite(e, srcPosition: srcPosition, srcSize: srcSize), + ); + } + + Future loadFigureSprite( + ItemLocation location, [ + String? variation, + ]) async { + final figure = getFigure(location); + if (figure == null) return null; + final definition = figure.variations[variation] ?? figure.back; + return loadSprite( + definition.texture, + location.namespace, + srcPosition: definition.offset.toVector(), + srcSize: definition.size?.toVector(), + ); + } + + Future loadBoardSprite( + ItemLocation location, [ + VectorDefinition? tile, + ]) async { + final board = getBoard(location); + if (board == null) return null; + Vector2 offset = board.offset.toVector(); + Vector2? size = board.size?.toVector(); + if (tile != null && size != null) { + size = size.clone()..divide(board.tiles.toVector()); + offset += size.clone()..multiply(tile.toVector()); + } + return loadSprite( + board.texture, + location.namespace, + srcPosition: offset, + srcSize: size, + ); + } + + @override + SetonixData? getPack(String key) => _loadedPacks[key]; + + Future loadPacks() async { + final files = await fileSystem.getPacks(); + final corePack = await fileSystem.fetchCorePack(); + unloadPacks( + _loadedPacks.keys.where((e) => !files.any((f) => f.identifier == e)), + ); + for (final file in [...files, corePack]) { + try { + final pack = file.load(); + _loadedPacks[file.identifier] = pack; + _loadedTranslations[file.identifier] = pack.getTranslationsStore( + getLocale: () => currentLocale, + ); + } catch (_) {} + } + } + + TranslationsStore getTranslations(String key) => + _loadedTranslations[key] ?? + TranslationsStore(getLocale: () => currentLocale); + + void unloadPacks(Iterable keys) { + _loadedTranslations.removeWhere((e, _) => keys.contains(e)); + for (final key in keys) { + if (_loadedPacks.remove(key) != null) clearImagesFromNamespace(key); + } + } + + void clearImagesFromNamespace(String namespace) => + _cachedImages..removeWhere((k, v) { + if (namespace != k?.namespace) return false; + v.then((e) => e.dispose()); + return true; + }); + + void clearImages() => _cachedImages + ..forEach((_, v) => v.then((e) => e.dispose())) + ..clear(); + + @override + bool hasPack(String key) => _loadedPacks.containsKey(key); +} diff --git a/app/lib/helpers/drag.dart b/app/lib/helpers/drag.dart index 3a4be82f..b520e206 100644 --- a/app/lib/helpers/drag.dart +++ b/app/lib/helpers/drag.dart @@ -1,92 +1,92 @@ -import 'dart:ui'; - -import 'package:flame/events.dart'; -import 'package:flutter/foundation.dart'; - -mixin LongDragCallbacks on DragCallbacks, TapCallbacks { - int get longThresholdPixels => 8; - Duration get longThresholdDuration => const Duration(milliseconds: 500); - - DateTime? _start; - double _dragDistance = 0; - bool _isPrecisePointer = false; - bool? _isLongPressing; - - bool? get isLongPressing => _isLongPressing; - bool get isPrecisePointer => _isPrecisePointer; - bool get isLongPressCandidate => - _start != null && !_isPrecisePointer && _isLongPressing != false; - bool? get isMouseOrLongPressing { - if (_isPrecisePointer) return true; - return _isLongPressing; - } - - bool _isPrecisePointerKind(PointerDeviceKind kind) => - kind == PointerDeviceKind.mouse || - kind == PointerDeviceKind.stylus || - kind == PointerDeviceKind.invertedStylus; - - void _startPointer(PointerDeviceKind kind, {bool preserveUnknown = false}) { - if (preserveUnknown && - kind == PointerDeviceKind.unknown && - _start != null) { - _dragDistance = 0; - _isLongPressing = null; - return; - } - _start = DateTime.now(); - _dragDistance = 0; - _isPrecisePointer = kind == PointerDeviceKind.unknown - ? preserveUnknown - : _isPrecisePointerKind(kind); - _isLongPressing = null; - } - - @override - @mustCallSuper - void onTapDown(TapDownEvent event) { - super.onTapDown(event); - _startPointer(event.deviceKind); - } - - @override - @mustCallSuper - void onDragStart(DragStartEvent event) { - super.onDragStart(event); - _startPointer(event.deviceKind, preserveUnknown: _start != null); - } - - @override - @mustCallSuper - void onDragUpdate(DragUpdateEvent event) { - _dragDistance += event.localDelta.length; - final start = _start; - if (start == null) return; - final duration = DateTime.now().difference(start); - if (duration > longThresholdDuration) { - _isLongPressing ??= true; - return; - } - if (_dragDistance > longThresholdPixels) { - _isLongPressing = false; - } - } - - @override - @mustCallSuper - void onDragEnd(DragEndEvent event) { - super.onDragEnd(event); - _start = null; - _dragDistance = 0; - _isLongPressing = null; - } - - @override - @mustCallSuper - void onDragCancel(DragCancelEvent event) { - super.onDragCancel(event); - _start = null; - _dragDistance = 0; - _isLongPressing = null; - } -} +import 'dart:ui'; + +import 'package:flame/events.dart'; +import 'package:flutter/foundation.dart'; + +mixin LongDragCallbacks on DragCallbacks, TapCallbacks { + int get longThresholdPixels => 8; + Duration get longThresholdDuration => const Duration(milliseconds: 500); + + DateTime? _start; + double _dragDistance = 0; + bool _isPrecisePointer = false; + bool? _isLongPressing; + + bool? get isLongPressing => _isLongPressing; + bool get isPrecisePointer => _isPrecisePointer; + bool get isLongPressCandidate => + _start != null && !_isPrecisePointer && _isLongPressing != false; + bool? get isMouseOrLongPressing { + if (_isPrecisePointer) return true; + return _isLongPressing; + } + + bool _isPrecisePointerKind(PointerDeviceKind kind) => + kind == PointerDeviceKind.mouse || + kind == PointerDeviceKind.stylus || + kind == PointerDeviceKind.invertedStylus; + + void _startPointer(PointerDeviceKind kind, {bool preserveUnknown = false}) { + if (preserveUnknown && + kind == PointerDeviceKind.unknown && + _start != null) { + _dragDistance = 0; + _isLongPressing = null; + return; + } + _start = DateTime.now(); + _dragDistance = 0; + _isPrecisePointer = kind == PointerDeviceKind.unknown + ? preserveUnknown + : _isPrecisePointerKind(kind); + _isLongPressing = null; + } + + @override + @mustCallSuper + void onTapDown(TapDownEvent event) { + super.onTapDown(event); + _startPointer(event.deviceKind); + } + + @override + @mustCallSuper + void onDragStart(DragStartEvent event) { + super.onDragStart(event); + _startPointer(event.deviceKind, preserveUnknown: _start != null); + } + + @override + @mustCallSuper + void onDragUpdate(DragUpdateEvent event) { + _dragDistance += event.localDelta.length; + final start = _start; + if (start == null) return; + final duration = DateTime.now().difference(start); + if (duration > longThresholdDuration) { + _isLongPressing ??= true; + return; + } + if (_dragDistance > longThresholdPixels) { + _isLongPressing = false; + } + } + + @override + @mustCallSuper + void onDragEnd(DragEndEvent event) { + super.onDragEnd(event); + _start = null; + _dragDistance = 0; + _isLongPressing = null; + } + + @override + @mustCallSuper + void onDragCancel(DragCancelEvent event) { + super.onDragCancel(event); + _start = null; + _dragDistance = 0; + _isLongPressing = null; + } +} diff --git a/app/lib/helpers/scroll.dart b/app/lib/helpers/scroll.dart index 51b5cc0a..17d5f98f 100644 --- a/app/lib/helpers/scroll.dart +++ b/app/lib/helpers/scroll.dart @@ -1,99 +1,99 @@ -import 'dart:math'; - -import 'package:flame/components.dart'; -import 'package:flame/events.dart'; -import 'package:flutter/widgets.dart'; -import 'package:setonix/board/game.dart'; - -mixin ScrollCallbacks on Component { - bool onScroll(PointerScrollInfo info) => false; -} - -class _ScrollViewport extends PositionComponent { - ScrollViewComponent get scrollParent => parent as ScrollViewComponent; - @override - void onParentResize(Vector2 maxSize) { - super.onParentResize(maxSize); - size = maxSize; - for (final child in children) { - if (child is! PositionComponent) { - continue; - } - if (scrollParent.direction == Axis.horizontal) { - child.height = maxSize.y; - } else { - child.width = maxSize.x; - } - } - } -} - -class ScrollViewComponent extends PositionComponent - with ScrollCallbacks, HasGameReference { - final Axis direction; - final double spacing; - final _ScrollViewport _view = _ScrollViewport(); - double _nextItemPos = 0; - - ScrollViewComponent({ - required this.direction, - super.position, - super.size, - this.spacing = 0, - }); - - @override - void onLoad() { - add(_view); - } - - void addChild(PositionComponent child, {double? size, double? spacing}) { - child.position = direction == Axis.horizontal - ? Vector2(_nextItemPos, 0) - : Vector2(0, _nextItemPos); - size ??= direction == Axis.horizontal ? child.size.x : child.size.y; - child.size = direction == Axis.horizontal - ? Vector2(size, height) - : Vector2(width, size); - _view.add(child); - _nextItemPos += size + (spacing ?? this.spacing); - } - - void clearChildren() { - for (final child in _view.children) { - child.removeFromParent(); - } - _nextItemPos = 0; - _view.position = Vector2.zero(); - } - - void scroll(double delta) { - final current = direction == Axis.horizontal - ? _view.position.x - : _view.position.y; - final double next = (delta + current).clamp( - min(_view.width - _nextItemPos, 0), - 0, - ); - if (direction == Axis.horizontal) { - _view.x = next; - } else { - _view.y = next; - } - } - - @override - bool onScroll(PointerScrollInfo info) { - var delta = direction == Axis.horizontal - ? info.scrollDelta.global.x - : info.scrollDelta.global.y; - if (delta == 0) { - delta = direction == Axis.horizontal - ? info.scrollDelta.global.y - : info.scrollDelta.global.x; - } - final scrollDelta = delta / 4; - scroll(-scrollDelta / game.settingsCubit.state.scrollSensitivity); - return true; - } -} +import 'dart:math'; + +import 'package:flame/components.dart'; +import 'package:flame/events.dart'; +import 'package:flutter/widgets.dart'; +import 'package:setonix/board/game.dart'; + +mixin ScrollCallbacks on Component { + bool onScroll(PointerScrollInfo info) => false; +} + +class _ScrollViewport extends PositionComponent { + ScrollViewComponent get scrollParent => parent as ScrollViewComponent; + @override + void onParentResize(Vector2 maxSize) { + super.onParentResize(maxSize); + size = maxSize; + for (final child in children) { + if (child is! PositionComponent) { + continue; + } + if (scrollParent.direction == Axis.horizontal) { + child.height = maxSize.y; + } else { + child.width = maxSize.x; + } + } + } +} + +class ScrollViewComponent extends PositionComponent + with ScrollCallbacks, HasGameReference { + final Axis direction; + final double spacing; + final _ScrollViewport _view = _ScrollViewport(); + double _nextItemPos = 0; + + ScrollViewComponent({ + required this.direction, + super.position, + super.size, + this.spacing = 0, + }); + + @override + void onLoad() { + add(_view); + } + + void addChild(PositionComponent child, {double? size, double? spacing}) { + child.position = direction == Axis.horizontal + ? Vector2(_nextItemPos, 0) + : Vector2(0, _nextItemPos); + size ??= direction == Axis.horizontal ? child.size.x : child.size.y; + child.size = direction == Axis.horizontal + ? Vector2(size, height) + : Vector2(width, size); + _view.add(child); + _nextItemPos += size + (spacing ?? this.spacing); + } + + void clearChildren() { + for (final child in _view.children) { + child.removeFromParent(); + } + _nextItemPos = 0; + _view.position = Vector2.zero(); + } + + void scroll(double delta) { + final current = direction == Axis.horizontal + ? _view.position.x + : _view.position.y; + final double next = (delta + current).clamp( + min(_view.width - _nextItemPos, 0), + 0, + ); + if (direction == Axis.horizontal) { + _view.x = next; + } else { + _view.y = next; + } + } + + @override + bool onScroll(PointerScrollInfo info) { + var delta = direction == Axis.horizontal + ? info.scrollDelta.global.x + : info.scrollDelta.global.y; + if (delta == 0) { + delta = direction == Axis.horizontal + ? info.scrollDelta.global.y + : info.scrollDelta.global.x; + } + final scrollDelta = delta / 4; + scroll(-scrollDelta / game.settingsCubit.state.scrollSensitivity); + return true; + } +} diff --git a/app/lib/helpers/secondary.dart b/app/lib/helpers/secondary.dart index cc77e0ee..18855638 100644 --- a/app/lib/helpers/secondary.dart +++ b/app/lib/helpers/secondary.dart @@ -1,32 +1,32 @@ -import 'package:flame/events.dart'; -import 'package:flame/game.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/gestures.dart'; - -mixin DetailsTapCallbacks on SecondaryTapCallbacks, DoubleTapCallbacks { - Vector2? _position; - - @override - @mustCallSuper - void onSecondaryTapUp(SecondaryTapUpEvent event) { - onContextMenu(event.devicePosition); - } - - @override - @mustCallSuper - void onDoubleTapDown(DoubleTapDownEvent event) { - _position = event.deviceKind == PointerDeviceKind.touch - ? event.devicePosition - : null; - } - - @override - @mustCallSuper - void onDoubleTapUp(DoubleTapEvent event) { - final position = _position; - if (position == null) return; - onContextMenu(position); - } - - void onContextMenu(Vector2 position); -} +import 'package:flame/events.dart'; +import 'package:flame/game.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; + +mixin DetailsTapCallbacks on SecondaryTapCallbacks, DoubleTapCallbacks { + Vector2? _position; + + @override + @mustCallSuper + void onSecondaryTapUp(SecondaryTapUpEvent event) { + onContextMenu(event.devicePosition); + } + + @override + @mustCallSuper + void onDoubleTapDown(DoubleTapDownEvent event) { + _position = event.deviceKind == PointerDeviceKind.touch + ? event.devicePosition + : null; + } + + @override + @mustCallSuper + void onDoubleTapUp(DoubleTapEvent event) { + final position = _position; + if (position == null) return; + onContextMenu(position); + } + + void onContextMenu(Vector2 position); +} diff --git a/app/lib/helpers/string.dart b/app/lib/helpers/string.dart index 033bbf5d..b8240061 100644 --- a/app/lib/helpers/string.dart +++ b/app/lib/helpers/string.dart @@ -1,6 +1,6 @@ -extension StringHelper on String { - bool equalsIgnoreCase(String other) => toLowerCase() == other.toLowerCase(); - - bool containsIgnoreCase(String other) => - toLowerCase().contains(other.toLowerCase()); -} +extension StringHelper on String { + bool equalsIgnoreCase(String other) => toLowerCase() == other.toLowerCase(); + + bool containsIgnoreCase(String other) => + toLowerCase().contains(other.toLowerCase()); +} diff --git a/app/lib/helpers/vector.dart b/app/lib/helpers/vector.dart index 7488745f..0c8766cc 100644 --- a/app/lib/helpers/vector.dart +++ b/app/lib/helpers/vector.dart @@ -1,17 +1,17 @@ -import 'dart:ui'; - -import 'package:flame/components.dart'; -import 'package:setonix_api/setonix_api.dart'; - -extension VectorToDefinition on Vector2 { - VectorDefinition toDefinition() => VectorDefinition(x.round(), y.round()); -} - -extension OffsetToDefinition on Offset { - VectorDefinition toDefinition() => VectorDefinition(dx.round(), dy.round()); -} - -extension DefinitionToVector on VectorDefinition { - Vector2 toVector() => Vector2(x.toDouble(), y.toDouble()); - Offset toOffset() => Offset(x.toDouble(), y.toDouble()); -} +import 'dart:ui'; + +import 'package:flame/components.dart'; +import 'package:setonix_api/setonix_api.dart'; + +extension VectorToDefinition on Vector2 { + VectorDefinition toDefinition() => VectorDefinition(x.round(), y.round()); +} + +extension OffsetToDefinition on Offset { + VectorDefinition toDefinition() => VectorDefinition(dx.round(), dy.round()); +} + +extension DefinitionToVector on VectorDefinition { + Vector2 toVector() => Vector2(x.toDouble(), y.toDouble()); + Offset toOffset() => Offset(x.toDouble(), y.toDouble()); +} diff --git a/app/lib/helpers/visualizer.dart b/app/lib/helpers/visualizer.dart index a1537ebd..74e4fd2a 100644 --- a/app/lib/helpers/visualizer.dart +++ b/app/lib/helpers/visualizer.dart @@ -1,18 +1,18 @@ -import 'package:flutter/material.dart'; -import 'package:setonix_api/setonix_api.dart'; - -extension TeamColorVisualizer on TeamColor { - Color get color => switch (this) { - TeamColor.red => Colors.red, - TeamColor.blue => Colors.blue, - TeamColor.indigo => Colors.indigo, - TeamColor.green => Colors.green, - TeamColor.yellow => Colors.yellow, - TeamColor.purple => Colors.purple, - TeamColor.orange => Colors.orange, - TeamColor.pink => Colors.pink, - TeamColor.brown => Colors.brown, - TeamColor.white => Colors.white, - TeamColor.black => Colors.black, - }; -} +import 'package:flutter/material.dart'; +import 'package:setonix_api/setonix_api.dart'; + +extension TeamColorVisualizer on TeamColor { + Color get color => switch (this) { + TeamColor.red => Colors.red, + TeamColor.blue => Colors.blue, + TeamColor.indigo => Colors.indigo, + TeamColor.green => Colors.green, + TeamColor.yellow => Colors.yellow, + TeamColor.purple => Colors.purple, + TeamColor.orange => Colors.orange, + TeamColor.pink => Colors.pink, + TeamColor.brown => Colors.brown, + TeamColor.white => Colors.white, + TeamColor.black => Colors.black, + }; +} diff --git a/app/lib/pages/editor/backgrounds.dart b/app/lib/pages/editor/backgrounds.dart index 44ff2b1f..fb09bdce 100644 --- a/app/lib/pages/editor/backgrounds.dart +++ b/app/lib/pages/editor/backgrounds.dart @@ -1,167 +1,167 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/pages/editor/textures.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class BackgroundsEditorPage extends StatelessWidget { - const BackgroundsEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final backgrounds = state.getBackgroundItems(); - if (backgrounds.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: backgrounds.map((background) { - final id = background.id; - return Dismissible( - key: ValueKey(id), - onDismissed: (direction) { - cubit.removeBackground(id); - }, - child: ListTile( - title: Text(id), - onTap: () { - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: BackgroundEditorDialog(name: id), - ), - ); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - cubit.removeBackground(id); - }, - ), - ), - ); - }).toList(), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final name = await showDialog( - context: context, - builder: (context) => NameDialog( - validator: defaultNameValidator( - context, - cubit.state.getBackgrounds().toList(), - ), - ), - ); - if (name == null) return; - cubit.setBackground(name, BackgroundDefinition(texture: '')); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} - -class BackgroundEditorDialog extends StatefulWidget { - final String name; - - const BackgroundEditorDialog({super.key, required this.name}); - - @override - State createState() => _BackgroundEditorDialogState(); -} - -class _BackgroundEditorDialogState extends State { - BackgroundDefinition? _value; - late PackTranslation _translation; - - @override - void initState() { - super.initState(); - final editorState = context.read().state; - _value = editorState.getBackground(widget.name); - _translation = editorState.getTranslationOrDefault(); - } - - @override - Widget build(BuildContext context) { - final value = _value; - if (value == null) { - return const SizedBox(); - } - return ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints( - maxWidth: LeapBreakpoints.compact, - maxHeight: 600, - ), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: const Icon(PhosphorIconsLight.textT), - ), - initialValue: _translation.backgrounds[widget.name]?.name, - onChanged: (value) { - final translation = BackgroundTranslation(name: value); - _translation = _translation.copyWith.backgrounds.put( - widget.name, - translation, - ); - }, - ), - const SizedBox(height: 8), - VisualEditingView( - value: value, - onChanged: (value) { - setState(() { - _value = value; - }); - }, - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - context.read().setBackground(widget.name, value); - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/pages/editor/textures.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class BackgroundsEditorPage extends StatelessWidget { + const BackgroundsEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final backgrounds = state.getBackgroundItems(); + if (backgrounds.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: backgrounds.map((background) { + final id = background.id; + return Dismissible( + key: ValueKey(id), + onDismissed: (direction) { + cubit.removeBackground(id); + }, + child: ListTile( + title: Text(id), + onTap: () { + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: BackgroundEditorDialog(name: id), + ), + ); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + cubit.removeBackground(id); + }, + ), + ), + ); + }).toList(), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final name = await showDialog( + context: context, + builder: (context) => NameDialog( + validator: defaultNameValidator( + context, + cubit.state.getBackgrounds().toList(), + ), + ), + ); + if (name == null) return; + cubit.setBackground(name, BackgroundDefinition(texture: '')); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} + +class BackgroundEditorDialog extends StatefulWidget { + final String name; + + const BackgroundEditorDialog({super.key, required this.name}); + + @override + State createState() => _BackgroundEditorDialogState(); +} + +class _BackgroundEditorDialogState extends State { + BackgroundDefinition? _value; + late PackTranslation _translation; + + @override + void initState() { + super.initState(); + final editorState = context.read().state; + _value = editorState.getBackground(widget.name); + _translation = editorState.getTranslationOrDefault(); + } + + @override + Widget build(BuildContext context) { + final value = _value; + if (value == null) { + return const SizedBox(); + } + return ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints( + maxWidth: LeapBreakpoints.compact, + maxHeight: 600, + ), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const Icon(PhosphorIconsLight.textT), + ), + initialValue: _translation.backgrounds[widget.name]?.name, + onChanged: (value) { + final translation = BackgroundTranslation(name: value); + _translation = _translation.copyWith.backgrounds.put( + widget.name, + translation, + ); + }, + ), + const SizedBox(height: 8), + VisualEditingView( + value: value, + onChanged: (value) { + setState(() { + _value = value; + }); + }, + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + context.read().setBackground(widget.name, value); + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} diff --git a/app/lib/pages/editor/boards.dart b/app/lib/pages/editor/boards.dart index bf599808..726295d8 100644 --- a/app/lib/pages/editor/boards.dart +++ b/app/lib/pages/editor/boards.dart @@ -1,177 +1,177 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/helpers/vector.dart'; -import 'package:setonix/pages/editor/textures.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class BoardsEditorPage extends StatelessWidget { - const BoardsEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final boards = state.getBoardItems(); - if (boards.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: boards.map((board) { - final id = board.id; - return Dismissible( - key: ValueKey(id), - onDismissed: (direction) { - cubit.removeBoard(id); - }, - child: ListTile( - title: Text(id), - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - cubit.removeBoard(id); - }, - ), - onTap: () { - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: BoardEditorDialog(name: id), - ), - ); - }, - ), - ); - }).toList(), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final name = await showDialog( - context: context, - builder: (context) => NameDialog( - validator: defaultNameValidator( - context, - cubit.state.getBoards().toList(), - ), - ), - ); - if (name == null) return; - cubit.setBoard(name, BoardDefinition(texture: '')); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} - -class BoardEditorDialog extends StatefulWidget { - final String name; - - const BoardEditorDialog({super.key, required this.name}); - - @override - State createState() => _BoardEditorDialogState(); -} - -class _BoardEditorDialogState extends State { - BoardDefinition? _value; - late PackTranslation _translation; - - @override - void initState() { - super.initState(); - final editorState = context.read().state; - _value = editorState.getBoard(widget.name); - _translation = editorState.getTranslationOrDefault(); - } - - @override - Widget build(BuildContext context) { - final value = _value; - if (value == null) return const SizedBox(); - return ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: const Icon(PhosphorIconsLight.textT), - ), - initialValue: _translation.boards[widget.name]?.name, - onChanged: (value) { - final translation = BoardTranslation(name: value); - _translation = _translation.copyWith.boards.put( - widget.name, - translation, - ); - }, - ), - const SizedBox(height: 8), - OffsetListTile( - value: value.tiles.toOffset(), - fractionDigits: 0, - onChanged: (value) { - setState(() { - _value = _value?.copyWith(tiles: value.toDefinition()); - }); - }, - title: Text(AppLocalizations.of(context).tiles), - ), - VisualEditingView( - value: value, - onChanged: (value) { - setState(() { - _value = value; - }); - }, - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - context.read().setBoard(widget.name, value); - context.read().setTranslation( - _translation, - widget.name, - ); - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/helpers/vector.dart'; +import 'package:setonix/pages/editor/textures.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class BoardsEditorPage extends StatelessWidget { + const BoardsEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final boards = state.getBoardItems(); + if (boards.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: boards.map((board) { + final id = board.id; + return Dismissible( + key: ValueKey(id), + onDismissed: (direction) { + cubit.removeBoard(id); + }, + child: ListTile( + title: Text(id), + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + cubit.removeBoard(id); + }, + ), + onTap: () { + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: BoardEditorDialog(name: id), + ), + ); + }, + ), + ); + }).toList(), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final name = await showDialog( + context: context, + builder: (context) => NameDialog( + validator: defaultNameValidator( + context, + cubit.state.getBoards().toList(), + ), + ), + ); + if (name == null) return; + cubit.setBoard(name, BoardDefinition(texture: '')); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} + +class BoardEditorDialog extends StatefulWidget { + final String name; + + const BoardEditorDialog({super.key, required this.name}); + + @override + State createState() => _BoardEditorDialogState(); +} + +class _BoardEditorDialogState extends State { + BoardDefinition? _value; + late PackTranslation _translation; + + @override + void initState() { + super.initState(); + final editorState = context.read().state; + _value = editorState.getBoard(widget.name); + _translation = editorState.getTranslationOrDefault(); + } + + @override + Widget build(BuildContext context) { + final value = _value; + if (value == null) return const SizedBox(); + return ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const Icon(PhosphorIconsLight.textT), + ), + initialValue: _translation.boards[widget.name]?.name, + onChanged: (value) { + final translation = BoardTranslation(name: value); + _translation = _translation.copyWith.boards.put( + widget.name, + translation, + ); + }, + ), + const SizedBox(height: 8), + OffsetListTile( + value: value.tiles.toOffset(), + fractionDigits: 0, + onChanged: (value) { + setState(() { + _value = _value?.copyWith(tiles: value.toDefinition()); + }); + }, + title: Text(AppLocalizations.of(context).tiles), + ), + VisualEditingView( + value: value, + onChanged: (value) { + setState(() { + _value = value; + }); + }, + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + context.read().setBoard(widget.name, value); + context.read().setTranslation( + _translation, + widget.name, + ); + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} diff --git a/app/lib/pages/editor/decks.dart b/app/lib/pages/editor/decks.dart index c1c37056..2594f645 100644 --- a/app/lib/pages/editor/decks.dart +++ b/app/lib/pages/editor/decks.dart @@ -1,491 +1,491 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/helpers/vector.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class DecksEditorPage extends StatelessWidget { - const DecksEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final decks = state.getDeckItems(); - if (decks.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: decks.map((deck) { - final id = deck.id; - return Dismissible( - key: ValueKey(id), - onDismissed: (direction) { - cubit.removeDeck(id); - }, - child: ListTile( - title: Text(id), - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - cubit.removeDeck(id); - }, - ), - onTap: () { - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: DeckEditorDialog(name: id), - ), - ); - }, - ), - ); - }).toList(), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final name = await showDialog( - context: context, - builder: (context) => NameDialog( - validator: defaultNameValidator( - context, - cubit.state.getDecks().toList(), - ), - ), - ); - if (name == null) return; - cubit.setDeck(name, DeckDefinition()); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} - -class DeckEditorDialog extends StatefulWidget { - final String name; - - const DeckEditorDialog({super.key, required this.name}); - - @override - State createState() => _DeckEditorDialogState(); -} - -class _DeckEditorDialogState extends State { - DeckDefinition? _value; - late PackTranslation _translation; - - @override - void initState() { - super.initState(); - final editorState = context.read().state; - _value = editorState.getDeck(widget.name); - _translation = editorState.getTranslationOrDefault(); - } - - @override - Widget build(BuildContext context) { - final value = _value; - if (value == null) return const SizedBox(); - return DefaultTabController( - length: 3, - child: ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints( - maxWidth: LeapBreakpoints.compact, - maxHeight: 600, - ), - content: Column( - children: [ - TabBar( - tabs: [ - HorizontalTab( - icon: const Icon(PhosphorIconsLight.textT), - label: Text(AppLocalizations.of(context).general), - ), - HorizontalTab( - icon: const Icon(PhosphorIconsLight.spade), - label: Text(AppLocalizations.of(context).figures), - ), - HorizontalTab( - icon: const Icon(PhosphorIconsLight.stack), - label: Text(AppLocalizations.of(context).boards), - ), - ], - ), - const SizedBox(height: 8), - Expanded( - child: TabBarView( - children: [ - ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: const Icon(PhosphorIconsLight.textT), - ), - initialValue: _translation.figures[widget.name]?.name, - onChanged: (value) { - final translation = FigureTranslation(name: value); - _translation = _translation.copyWith.figures.put( - widget.name, - translation, - ); - }, - ), - ], - ), - Stack( - children: [ - ListView.builder( - itemCount: value.figures.length, - itemBuilder: (context, index) { - final figure = value.figures[index]; - return ListTile( - title: Text(figure.name), - onTap: () async { - final bloc = context.read(); - final result = - await showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: bloc, - child: _DeckFigureEditorDialog( - value: figure, - ), - ), - ); - if (result == null) return; - setState(() { - value.figures[index] = result; - }); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - setState(() { - value.figures.removeAt(index); - }); - }, - ), - ); - }, - ), - Align( - alignment: Alignment.bottomCenter, - child: FloatingActionButton.extended( - onPressed: () async { - final bloc = context.read(); - final result = - await showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: bloc, - child: _DeckFigureEditorDialog(), - ), - ); - if (result == null) return; - setState(() { - value.figures.add(result); - }); - }, - icon: const Icon(PhosphorIconsLight.plus), - label: Text(LeapLocalizations.of(context).create), - ), - ), - ], - ), - Stack( - children: [ - ListView.builder( - itemCount: value.boards.length, - itemBuilder: (context, index) { - final board = value.boards[index]; - return ListTile( - title: Text(board.name), - onTap: () async { - final bloc = context.read(); - final result = - await showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: bloc, - child: _DeckBoardEditorDialog( - value: board, - ), - ), - ); - if (result == null) return; - setState(() { - value.boards[index] = result; - }); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - setState(() { - value.boards.removeAt(index); - }); - }, - ), - ); - }, - ), - Align( - alignment: Alignment.bottomCenter, - child: FloatingActionButton.extended( - onPressed: () async { - final bloc = context.read(); - final result = - await showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: bloc, - child: _DeckBoardEditorDialog(), - ), - ); - if (result == null) return; - setState(() { - value.boards.add(result); - }); - }, - icon: const Icon(PhosphorIconsLight.plus), - label: Text(LeapLocalizations.of(context).create), - ), - ), - ], - ), - ], - ), - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - context.read().setDeck(widget.name, value); - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ), - ); - } -} - -class _DeckFigureEditorDialog extends StatefulWidget { - final FigureDeckDefinition? value; - - const _DeckFigureEditorDialog({this.value}); - - @override - State<_DeckFigureEditorDialog> createState() => - __DeckFigureEditorDialogState(); -} - -class __DeckFigureEditorDialogState extends State<_DeckFigureEditorDialog> { - FigureDeckDefinition? _value; - - @override - void initState() { - super.initState(); - _value = widget.value; - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text(AppLocalizations.of(context).figure), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: BlocBuilder( - builder: (context, state) { - final figure = _value == null ? null : state.getFigure(_value!.name); - return ListView( - shrinkWrap: true, - children: [ - DropdownMenu( - dropdownMenuEntries: state.getFigures().map((e) { - return DropdownMenuEntry(value: e, label: e); - }).toList(), - label: Text(AppLocalizations.of(context).name), - initialSelection: _value?.name, - expandedInsets: EdgeInsets.all(8), - onSelected: (value) { - if (value == null) return; - setState(() { - _value = FigureDeckDefinition(name: value); - }); - }, - ), - if (figure != null) ...[ - const SizedBox(height: 8), - DropdownMenu( - initialSelection: _value?.variation, - label: Text(AppLocalizations.of(context).variation), - expandedInsets: EdgeInsets.all(8), - dropdownMenuEntries: ['', ...figure.variations.keys].map((e) { - return DropdownMenuEntry( - value: e, - label: e.isEmpty - ? AppLocalizations.of(context).notSet - : e, - ); - }).toList(), - onSelected: (value) { - if (value == null) return; - setState(() { - _value = FigureDeckDefinition( - name: _value!.name, - variation: value, - ); - }); - }, - ), - const SizedBox(height: 8), - OffsetListTile( - title: Text(AppLocalizations.of(context).position), - value: _value!.position.toOffset(), - onChanged: (value) { - setState(() { - _value = FigureDeckDefinition( - name: _value!.name, - variation: _value!.variation, - position: value.toDefinition(), - ); - }); - }, - ), - ], - ], - ); - }, - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - Navigator.of(context).pop(_value); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} - -class _DeckBoardEditorDialog extends StatefulWidget { - final BoardDeckDefinition? value; - - const _DeckBoardEditorDialog({this.value}); - - @override - State<_DeckBoardEditorDialog> createState() => __DeckBoardEditorDialogState(); -} - -class __DeckBoardEditorDialogState extends State<_DeckBoardEditorDialog> { - BoardDeckDefinition? _value; - - @override - void initState() { - super.initState(); - _value = widget.value; - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text(AppLocalizations.of(context).board), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: BlocBuilder( - builder: (context, state) { - final board = _value == null ? null : state.getBoard(_value!.name); - return ListView( - shrinkWrap: true, - children: [ - DropdownMenu( - dropdownMenuEntries: state.getBoards().map((e) { - return DropdownMenuEntry(value: e, label: e); - }).toList(), - label: Text(AppLocalizations.of(context).name), - initialSelection: _value?.name, - expandedInsets: EdgeInsets.all(8), - onSelected: (value) { - if (value == null) return; - setState(() { - _value = BoardDeckDefinition(name: value); - }); - }, - ), - if (board != null) ...[ - const SizedBox(height: 8), - OffsetListTile( - title: Text(AppLocalizations.of(context).position), - value: _value!.position.toOffset(), - onChanged: (value) { - setState(() { - _value = BoardDeckDefinition( - name: _value!.name, - position: value.toDefinition(), - ); - }); - }, - ), - ], - ], - ); - }, - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - Navigator.of(context).pop(_value); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/helpers/vector.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class DecksEditorPage extends StatelessWidget { + const DecksEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final decks = state.getDeckItems(); + if (decks.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: decks.map((deck) { + final id = deck.id; + return Dismissible( + key: ValueKey(id), + onDismissed: (direction) { + cubit.removeDeck(id); + }, + child: ListTile( + title: Text(id), + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + cubit.removeDeck(id); + }, + ), + onTap: () { + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: DeckEditorDialog(name: id), + ), + ); + }, + ), + ); + }).toList(), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final name = await showDialog( + context: context, + builder: (context) => NameDialog( + validator: defaultNameValidator( + context, + cubit.state.getDecks().toList(), + ), + ), + ); + if (name == null) return; + cubit.setDeck(name, DeckDefinition()); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} + +class DeckEditorDialog extends StatefulWidget { + final String name; + + const DeckEditorDialog({super.key, required this.name}); + + @override + State createState() => _DeckEditorDialogState(); +} + +class _DeckEditorDialogState extends State { + DeckDefinition? _value; + late PackTranslation _translation; + + @override + void initState() { + super.initState(); + final editorState = context.read().state; + _value = editorState.getDeck(widget.name); + _translation = editorState.getTranslationOrDefault(); + } + + @override + Widget build(BuildContext context) { + final value = _value; + if (value == null) return const SizedBox(); + return DefaultTabController( + length: 3, + child: ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints( + maxWidth: LeapBreakpoints.compact, + maxHeight: 600, + ), + content: Column( + children: [ + TabBar( + tabs: [ + HorizontalTab( + icon: const Icon(PhosphorIconsLight.textT), + label: Text(AppLocalizations.of(context).general), + ), + HorizontalTab( + icon: const Icon(PhosphorIconsLight.spade), + label: Text(AppLocalizations.of(context).figures), + ), + HorizontalTab( + icon: const Icon(PhosphorIconsLight.stack), + label: Text(AppLocalizations.of(context).boards), + ), + ], + ), + const SizedBox(height: 8), + Expanded( + child: TabBarView( + children: [ + ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const Icon(PhosphorIconsLight.textT), + ), + initialValue: _translation.figures[widget.name]?.name, + onChanged: (value) { + final translation = FigureTranslation(name: value); + _translation = _translation.copyWith.figures.put( + widget.name, + translation, + ); + }, + ), + ], + ), + Stack( + children: [ + ListView.builder( + itemCount: value.figures.length, + itemBuilder: (context, index) { + final figure = value.figures[index]; + return ListTile( + title: Text(figure.name), + onTap: () async { + final bloc = context.read(); + final result = + await showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: bloc, + child: _DeckFigureEditorDialog( + value: figure, + ), + ), + ); + if (result == null) return; + setState(() { + value.figures[index] = result; + }); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + setState(() { + value.figures.removeAt(index); + }); + }, + ), + ); + }, + ), + Align( + alignment: Alignment.bottomCenter, + child: FloatingActionButton.extended( + onPressed: () async { + final bloc = context.read(); + final result = + await showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: bloc, + child: _DeckFigureEditorDialog(), + ), + ); + if (result == null) return; + setState(() { + value.figures.add(result); + }); + }, + icon: const Icon(PhosphorIconsLight.plus), + label: Text(LeapLocalizations.of(context).create), + ), + ), + ], + ), + Stack( + children: [ + ListView.builder( + itemCount: value.boards.length, + itemBuilder: (context, index) { + final board = value.boards[index]; + return ListTile( + title: Text(board.name), + onTap: () async { + final bloc = context.read(); + final result = + await showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: bloc, + child: _DeckBoardEditorDialog( + value: board, + ), + ), + ); + if (result == null) return; + setState(() { + value.boards[index] = result; + }); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + setState(() { + value.boards.removeAt(index); + }); + }, + ), + ); + }, + ), + Align( + alignment: Alignment.bottomCenter, + child: FloatingActionButton.extended( + onPressed: () async { + final bloc = context.read(); + final result = + await showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: bloc, + child: _DeckBoardEditorDialog(), + ), + ); + if (result == null) return; + setState(() { + value.boards.add(result); + }); + }, + icon: const Icon(PhosphorIconsLight.plus), + label: Text(LeapLocalizations.of(context).create), + ), + ), + ], + ), + ], + ), + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + context.read().setDeck(widget.name, value); + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ), + ); + } +} + +class _DeckFigureEditorDialog extends StatefulWidget { + final FigureDeckDefinition? value; + + const _DeckFigureEditorDialog({this.value}); + + @override + State<_DeckFigureEditorDialog> createState() => + __DeckFigureEditorDialogState(); +} + +class __DeckFigureEditorDialogState extends State<_DeckFigureEditorDialog> { + FigureDeckDefinition? _value; + + @override + void initState() { + super.initState(); + _value = widget.value; + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text(AppLocalizations.of(context).figure), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: BlocBuilder( + builder: (context, state) { + final figure = _value == null ? null : state.getFigure(_value!.name); + return ListView( + shrinkWrap: true, + children: [ + DropdownMenu( + dropdownMenuEntries: state.getFigures().map((e) { + return DropdownMenuEntry(value: e, label: e); + }).toList(), + label: Text(AppLocalizations.of(context).name), + initialSelection: _value?.name, + expandedInsets: EdgeInsets.all(8), + onSelected: (value) { + if (value == null) return; + setState(() { + _value = FigureDeckDefinition(name: value); + }); + }, + ), + if (figure != null) ...[ + const SizedBox(height: 8), + DropdownMenu( + initialSelection: _value?.variation, + label: Text(AppLocalizations.of(context).variation), + expandedInsets: EdgeInsets.all(8), + dropdownMenuEntries: ['', ...figure.variations.keys].map((e) { + return DropdownMenuEntry( + value: e, + label: e.isEmpty + ? AppLocalizations.of(context).notSet + : e, + ); + }).toList(), + onSelected: (value) { + if (value == null) return; + setState(() { + _value = FigureDeckDefinition( + name: _value!.name, + variation: value, + ); + }); + }, + ), + const SizedBox(height: 8), + OffsetListTile( + title: Text(AppLocalizations.of(context).position), + value: _value!.position.toOffset(), + onChanged: (value) { + setState(() { + _value = FigureDeckDefinition( + name: _value!.name, + variation: _value!.variation, + position: value.toDefinition(), + ); + }); + }, + ), + ], + ], + ); + }, + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(_value); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} + +class _DeckBoardEditorDialog extends StatefulWidget { + final BoardDeckDefinition? value; + + const _DeckBoardEditorDialog({this.value}); + + @override + State<_DeckBoardEditorDialog> createState() => __DeckBoardEditorDialogState(); +} + +class __DeckBoardEditorDialogState extends State<_DeckBoardEditorDialog> { + BoardDeckDefinition? _value; + + @override + void initState() { + super.initState(); + _value = widget.value; + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text(AppLocalizations.of(context).board), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: BlocBuilder( + builder: (context, state) { + final board = _value == null ? null : state.getBoard(_value!.name); + return ListView( + shrinkWrap: true, + children: [ + DropdownMenu( + dropdownMenuEntries: state.getBoards().map((e) { + return DropdownMenuEntry(value: e, label: e); + }).toList(), + label: Text(AppLocalizations.of(context).name), + initialSelection: _value?.name, + expandedInsets: EdgeInsets.all(8), + onSelected: (value) { + if (value == null) return; + setState(() { + _value = BoardDeckDefinition(name: value); + }); + }, + ), + if (board != null) ...[ + const SizedBox(height: 8), + OffsetListTile( + title: Text(AppLocalizations.of(context).position), + value: _value!.position.toOffset(), + onChanged: (value) { + setState(() { + _value = BoardDeckDefinition( + name: _value!.name, + position: value.toDefinition(), + ); + }); + }, + ), + ], + ], + ); + }, + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(_value); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} diff --git a/app/lib/pages/editor/figures.dart b/app/lib/pages/editor/figures.dart index 92c2be90..545e03c1 100644 --- a/app/lib/pages/editor/figures.dart +++ b/app/lib/pages/editor/figures.dart @@ -1,361 +1,361 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/pages/editor/textures.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class FiguresEditorPage extends StatelessWidget { - const FiguresEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final figures = state.getFigureItems(); - if (figures.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: figures.map((figure) { - final id = figure.id; - return Dismissible( - key: ValueKey(id), - onDismissed: (direction) { - cubit.removeFigure(id); - }, - child: ListTile( - title: Text(id), - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - cubit.removeFigure(id); - }, - ), - onTap: () { - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: FigureEditorDialog(name: id), - ), - ); - }, - ), - ); - }).toList(), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final name = await showDialog( - context: context, - builder: (context) => NameDialog( - validator: defaultNameValidator( - context, - cubit.state.getFigures().toList(), - ), - ), - ); - if (name == null) return; - cubit.setFigure( - name, - FigureDefinition(back: FigureBackDefinition(texture: '')), - ); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} - -class FigureEditorDialog extends StatefulWidget { - final String name; - - const FigureEditorDialog({super.key, required this.name}); - - @override - State createState() => _FigureEditorDialogState(); -} - -class _FigureEditorDialogState extends State { - FigureDefinition? _value; - late PackTranslation _translation; - - @override - void initState() { - super.initState(); - final editorState = context.read().state; - _value = editorState.getFigure(widget.name); - _translation = editorState.getTranslationOrDefault(); - } - - @override - Widget build(BuildContext context) { - final value = _value; - if (value == null) return const SizedBox(); - final variations = value.variations.entries.toList(); - return DefaultTabController( - length: 3, - child: ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints( - maxWidth: LeapBreakpoints.compact, - maxHeight: 600, - ), - content: Column( - children: [ - TabBar( - tabs: [ - HorizontalTab( - icon: const Icon(PhosphorIconsLight.textT), - label: Text(AppLocalizations.of(context).general), - ), - HorizontalTab( - icon: const Icon(PhosphorIconsLight.spade), - label: Text(AppLocalizations.of(context).back), - ), - HorizontalTab( - icon: const Icon(PhosphorIconsLight.stack), - label: Text(AppLocalizations.of(context).variations), - ), - ], - ), - const SizedBox(height: 8), - Expanded( - child: TabBarView( - children: [ - ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: const Icon(PhosphorIconsLight.textT), - ), - initialValue: _translation.figures[widget.name]?.name, - onChanged: (value) { - final translation = FigureTranslation(name: value); - _translation = _translation.copyWith.figures.put( - widget.name, - translation, - ); - }, - ), - CheckboxListTile( - value: value.rollable, - title: Text(AppLocalizations.of(context).roll), - onChanged: (bool? value) { - if (value != null) { - setState(() { - _value = _value?.copyWith(rollable: value); - }); - } - }, - ), - ], - ), - SingleChildScrollView( - child: VisualEditingView( - value: value.back, - onChanged: (v) { - setState(() { - _value = value.copyWith(back: v); - }); - }, - ), - ), - Stack( - children: [ - variations.isEmpty - ? Center( - child: Text(AppLocalizations.of(context).noData), - ) - : ListView.builder( - itemCount: variations.length, - itemBuilder: (context, index) { - final variation = variations[index]; - return ListTile( - title: Text(variation.key), - onTap: () async { - final bloc = context.read(); - final result = - await showDialog( - context: context, - builder: (context) => - BlocProvider.value( - value: bloc, - child: - _FigureVariationEditorDialog( - name: variation.key, - value: variation.value, - ), - ), - ); - if (result == null) return; - setState(() { - _value = value.copyWith.variations.put( - variation.key, - result, - ); - }); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - setState(() { - _value = value.copyWith.variations - .remove(variation.key); - }); - }, - ), - ); - }, - ), - Align( - alignment: Alignment.bottomCenter, - child: FloatingActionButton.extended( - onPressed: () async { - final result = await showDialog( - context: context, - builder: (context) => NameDialog( - validator: defaultNameValidator( - context, - value.variations.keys.toList(), - ), - ), - ); - if (result == null) return; - setState(() { - _value = value.copyWith.variations.put( - result, - VariationDefinition(texture: ''), - ); - }); - }, - label: Text(LeapLocalizations.of(context).create), - icon: Icon(PhosphorIconsLight.plus), - ), - ), - ], - ), - ], - ), - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - context.read().setFigure(widget.name, value); - context.read().setTranslation( - _translation, - widget.name, - ); - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ), - ); - } -} - -class _FigureVariationEditorDialog extends StatefulWidget { - final String name; - final VariationDefinition value; - - const _FigureVariationEditorDialog({required this.name, required this.value}); - - @override - State<_FigureVariationEditorDialog> createState() => - __FigureVariationEditorDialogState(); -} - -class __FigureVariationEditorDialogState - extends State<_FigureVariationEditorDialog> { - late VariationDefinition _value; - - @override - void initState() { - super.initState(); - _value = widget.value; - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints( - maxWidth: LeapBreakpoints.compact, - maxHeight: 600, - ), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).category, - filled: true, - icon: const Icon(PhosphorIconsLight.tag), - ), - initialValue: _value.category, - onChanged: (value) { - setState(() { - _value = _value.copyWith(category: value); - }); - }, - ), - const SizedBox(height: 8), - VisualEditingView( - value: _value, - onChanged: (v) => setState(() { - _value = v; - }), - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - Navigator.of(context).pop(_value); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/pages/editor/textures.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class FiguresEditorPage extends StatelessWidget { + const FiguresEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final figures = state.getFigureItems(); + if (figures.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: figures.map((figure) { + final id = figure.id; + return Dismissible( + key: ValueKey(id), + onDismissed: (direction) { + cubit.removeFigure(id); + }, + child: ListTile( + title: Text(id), + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + cubit.removeFigure(id); + }, + ), + onTap: () { + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: FigureEditorDialog(name: id), + ), + ); + }, + ), + ); + }).toList(), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final name = await showDialog( + context: context, + builder: (context) => NameDialog( + validator: defaultNameValidator( + context, + cubit.state.getFigures().toList(), + ), + ), + ); + if (name == null) return; + cubit.setFigure( + name, + FigureDefinition(back: FigureBackDefinition(texture: '')), + ); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} + +class FigureEditorDialog extends StatefulWidget { + final String name; + + const FigureEditorDialog({super.key, required this.name}); + + @override + State createState() => _FigureEditorDialogState(); +} + +class _FigureEditorDialogState extends State { + FigureDefinition? _value; + late PackTranslation _translation; + + @override + void initState() { + super.initState(); + final editorState = context.read().state; + _value = editorState.getFigure(widget.name); + _translation = editorState.getTranslationOrDefault(); + } + + @override + Widget build(BuildContext context) { + final value = _value; + if (value == null) return const SizedBox(); + final variations = value.variations.entries.toList(); + return DefaultTabController( + length: 3, + child: ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints( + maxWidth: LeapBreakpoints.compact, + maxHeight: 600, + ), + content: Column( + children: [ + TabBar( + tabs: [ + HorizontalTab( + icon: const Icon(PhosphorIconsLight.textT), + label: Text(AppLocalizations.of(context).general), + ), + HorizontalTab( + icon: const Icon(PhosphorIconsLight.spade), + label: Text(AppLocalizations.of(context).back), + ), + HorizontalTab( + icon: const Icon(PhosphorIconsLight.stack), + label: Text(AppLocalizations.of(context).variations), + ), + ], + ), + const SizedBox(height: 8), + Expanded( + child: TabBarView( + children: [ + ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const Icon(PhosphorIconsLight.textT), + ), + initialValue: _translation.figures[widget.name]?.name, + onChanged: (value) { + final translation = FigureTranslation(name: value); + _translation = _translation.copyWith.figures.put( + widget.name, + translation, + ); + }, + ), + CheckboxListTile( + value: value.rollable, + title: Text(AppLocalizations.of(context).roll), + onChanged: (bool? value) { + if (value != null) { + setState(() { + _value = _value?.copyWith(rollable: value); + }); + } + }, + ), + ], + ), + SingleChildScrollView( + child: VisualEditingView( + value: value.back, + onChanged: (v) { + setState(() { + _value = value.copyWith(back: v); + }); + }, + ), + ), + Stack( + children: [ + variations.isEmpty + ? Center( + child: Text(AppLocalizations.of(context).noData), + ) + : ListView.builder( + itemCount: variations.length, + itemBuilder: (context, index) { + final variation = variations[index]; + return ListTile( + title: Text(variation.key), + onTap: () async { + final bloc = context.read(); + final result = + await showDialog( + context: context, + builder: (context) => + BlocProvider.value( + value: bloc, + child: + _FigureVariationEditorDialog( + name: variation.key, + value: variation.value, + ), + ), + ); + if (result == null) return; + setState(() { + _value = value.copyWith.variations.put( + variation.key, + result, + ); + }); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + setState(() { + _value = value.copyWith.variations + .remove(variation.key); + }); + }, + ), + ); + }, + ), + Align( + alignment: Alignment.bottomCenter, + child: FloatingActionButton.extended( + onPressed: () async { + final result = await showDialog( + context: context, + builder: (context) => NameDialog( + validator: defaultNameValidator( + context, + value.variations.keys.toList(), + ), + ), + ); + if (result == null) return; + setState(() { + _value = value.copyWith.variations.put( + result, + VariationDefinition(texture: ''), + ); + }); + }, + label: Text(LeapLocalizations.of(context).create), + icon: Icon(PhosphorIconsLight.plus), + ), + ), + ], + ), + ], + ), + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + context.read().setFigure(widget.name, value); + context.read().setTranslation( + _translation, + widget.name, + ); + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ), + ); + } +} + +class _FigureVariationEditorDialog extends StatefulWidget { + final String name; + final VariationDefinition value; + + const _FigureVariationEditorDialog({required this.name, required this.value}); + + @override + State<_FigureVariationEditorDialog> createState() => + __FigureVariationEditorDialogState(); +} + +class __FigureVariationEditorDialogState + extends State<_FigureVariationEditorDialog> { + late VariationDefinition _value; + + @override + void initState() { + super.initState(); + _value = widget.value; + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints( + maxWidth: LeapBreakpoints.compact, + maxHeight: 600, + ), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).category, + filled: true, + icon: const Icon(PhosphorIconsLight.tag), + ), + initialValue: _value.category, + onChanged: (value) { + setState(() { + _value = _value.copyWith(category: value); + }); + }, + ), + const SizedBox(height: 8), + VisualEditingView( + value: _value, + onChanged: (v) => setState(() { + _value = v; + }), + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(_value); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} diff --git a/app/lib/pages/editor/general.dart b/app/lib/pages/editor/general.dart index 7ba07aa5..b88f9fb5 100644 --- a/app/lib/pages/editor/general.dart +++ b/app/lib/pages/editor/general.dart @@ -1,97 +1,97 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GeneralEditorPage extends StatelessWidget { - const GeneralEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - return SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final metadata = state.getMetadataOrDefault(); - var currentName = metadata.name, - currentAuthor = metadata.author, - currentVersion = metadata.version, - currentDescription = metadata.description; - void updateMeta() => context.read().updateMeta( - metadata.copyWith( - name: currentName, - author: currentAuthor, - version: currentVersion, - description: currentDescription, - ), - ); - return Column( - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - icon: const Icon(PhosphorIconsLight.textT), - ), - initialValue: currentName, - onChanged: (value) { - currentName = value; - updateMeta(); - }, - ), - const SizedBox(height: 8), - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).author, - filled: true, - icon: const Icon(PhosphorIconsLight.user), - ), - initialValue: currentAuthor, - onChanged: (value) { - currentAuthor = value; - updateMeta(); - }, - ), - const SizedBox(height: 8), - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).version, - filled: true, - icon: const Icon(PhosphorIconsLight.info), - ), - initialValue: currentVersion, - onChanged: (value) { - currentVersion = value; - updateMeta(); - }, - ), - const SizedBox(height: 8), - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - border: OutlineInputBorder(), - icon: const Icon(PhosphorIconsLight.article), - ), - initialValue: currentDescription, - onChanged: (value) { - currentDescription = value; - updateMeta(); - }, - minLines: 3, - maxLines: 5, - ), - ], - ); - }, - ), - ), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GeneralEditorPage extends StatelessWidget { + const GeneralEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final metadata = state.getMetadataOrDefault(); + var currentName = metadata.name, + currentAuthor = metadata.author, + currentVersion = metadata.version, + currentDescription = metadata.description; + void updateMeta() => context.read().updateMeta( + metadata.copyWith( + name: currentName, + author: currentAuthor, + version: currentVersion, + description: currentDescription, + ), + ); + return Column( + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + icon: const Icon(PhosphorIconsLight.textT), + ), + initialValue: currentName, + onChanged: (value) { + currentName = value; + updateMeta(); + }, + ), + const SizedBox(height: 8), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).author, + filled: true, + icon: const Icon(PhosphorIconsLight.user), + ), + initialValue: currentAuthor, + onChanged: (value) { + currentAuthor = value; + updateMeta(); + }, + ), + const SizedBox(height: 8), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).version, + filled: true, + icon: const Icon(PhosphorIconsLight.info), + ), + initialValue: currentVersion, + onChanged: (value) { + currentVersion = value; + updateMeta(); + }, + ), + const SizedBox(height: 8), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + border: OutlineInputBorder(), + icon: const Icon(PhosphorIconsLight.article), + ), + initialValue: currentDescription, + onChanged: (value) { + currentDescription = value; + updateMeta(); + }, + minLines: 3, + maxLines: 5, + ), + ], + ); + }, + ), + ), + ), + ); + } +} diff --git a/app/lib/pages/editor/mode_dialog.dart b/app/lib/pages/editor/mode_dialog.dart index c76a094d..cedfdbf7 100644 --- a/app/lib/pages/editor/mode_dialog.dart +++ b/app/lib/pages/editor/mode_dialog.dart @@ -1,465 +1,465 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class ModeEditorDialog extends StatefulWidget { - final String name; - - const ModeEditorDialog({super.key, required this.name}); - - @override - State createState() => _ModeEditorDialogState(); -} - -class _ModeEditorDialogState extends State { - GameMode? _value; - - @override - void initState() { - super.initState(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - if (_value == null) { - final editorState = context.read().state; - _value = editorState.getMode(widget.name) ?? GameMode(); - } - } - - @override - Widget build(BuildContext context) { - final value = _value; - if (value == null) return const SizedBox(); - - return DefaultTabController( - length: 3, - child: ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints( - maxWidth: LeapBreakpoints.compact, - maxHeight: 600, - ), - content: Column( - children: [ - TabBar( - tabs: [ - HorizontalTab( - icon: const Icon(PhosphorIconsLight.textT), - label: Text(AppLocalizations.of(context).general), - ), - HorizontalTab( - icon: const Icon(PhosphorIconsLight.users), - label: Text(AppLocalizations.of(context).teams), - ), - HorizontalTab( - icon: const Icon(PhosphorIconsLight.mapTrifold), - label: Text(AppLocalizations.of(context).tables), - ), - ], - ), - const SizedBox(height: 8), - Expanded( - child: TabBarView( - children: [ - // Tab 1: General (Script) - ListView( - shrinkWrap: true, - children: [ - BlocBuilder( - builder: (context, state) { - final scripts = state.getScripts().toList(); - return DropdownButtonFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).scripts, - filled: true, - ), - initialValue: value.script, - items: [ - DropdownMenuItem( - value: null, - child: Text(AppLocalizations.of(context).none), - ), - ...scripts.map( - (script) => DropdownMenuItem( - value: script, - child: Text(script), - ), - ), - ], - onChanged: (newScript) { - setState(() { - _value = value.copyWith(script: newScript); - }); - }, - ); - }, - ), - ], - ), - // Tab 2: Teams - Stack( - children: [ - ListView.builder( - itemCount: value.teams.length, - itemBuilder: (context, index) { - final teamId = value.teams.keys.elementAt(index); - final team = value.teams[teamId]!; - return ListTile( - title: Text(teamId), - subtitle: Text(team.description), - onTap: () async { - final cubit = context.read(); - final result = - await showDialog>( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: _ModeTeamEditorDialog( - initialId: teamId, - initialTeam: team, - ), - ), - ); - if (result == null) return; - setState(() { - final newTeams = Map.from( - value.teams, - ); - if (result.key != teamId) { - newTeams.remove(teamId); - } - newTeams[result.key] = result.value; - _value = value.copyWith(teams: newTeams); - }); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - setState(() { - final newTeams = Map.from( - value.teams, - ); - newTeams.remove(teamId); - _value = value.copyWith(teams: newTeams); - }); - }, - ), - ); - }, - ), - Align( - alignment: Alignment.bottomCenter, - child: FloatingActionButton.extended( - onPressed: () async { - final cubit = context.read(); - final result = - await showDialog>( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: const _ModeTeamEditorDialog(), - ), - ); - if (result == null) return; - setState(() { - final newTeams = Map.from( - value.teams, - ); - newTeams[result.key] = result.value; - _value = value.copyWith(teams: newTeams); - }); - }, - icon: const Icon(PhosphorIconsLight.plus), - label: Text(LeapLocalizations.of(context).create), - ), - ), - ], - ), - // Tab 3: Tables - Stack( - children: [ - ListView.builder( - itemCount: value.tables.length, - itemBuilder: (context, index) { - final tableId = value.tables.keys.elementAt(index); - final table = value.tables[tableId]!; - return ListTile( - title: Text(tableId), - onTap: () async { - final cubit = context.read(); - final result = - await showDialog>( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: _ModeTableEditorDialog( - initialId: tableId, - initialTable: table, - ), - ), - ); - if (result == null) return; - setState(() { - final newTables = Map.from( - value.tables, - ); - if (result.key != tableId) { - newTables.remove(tableId); - } - newTables[result.key] = result.value; - _value = value.copyWith(tables: newTables); - }); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - setState(() { - final newTables = Map.from( - value.tables, - ); - newTables.remove(tableId); - _value = value.copyWith(tables: newTables); - }); - }, - ), - ); - }, - ), - Align( - alignment: Alignment.bottomCenter, - child: FloatingActionButton.extended( - onPressed: () async { - final cubit = context.read(); - final result = - await showDialog>( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: const _ModeTableEditorDialog(), - ), - ); - if (result == null) return; - setState(() { - final newTables = Map.from( - value.tables, - ); - newTables[result.key] = result.value; - _value = value.copyWith(tables: newTables); - }); - }, - icon: const Icon(PhosphorIconsLight.plus), - label: Text(LeapLocalizations.of(context).create), - ), - ), - ], - ), - ], - ), - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - context.read().setMode(widget.name, value); - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ), - ); - } -} - -class _ModeTeamEditorDialog extends StatefulWidget { - final String? initialId; - final GameTeam? initialTeam; - - const _ModeTeamEditorDialog({this.initialId, this.initialTeam}); - - @override - State<_ModeTeamEditorDialog> createState() => _ModeTeamEditorDialogState(); -} - -class _ModeTeamEditorDialogState extends State<_ModeTeamEditorDialog> { - late String _id; - late GameTeam _team; - - @override - void initState() { - super.initState(); - _id = widget.initialId ?? 'team_id'; - _team = widget.initialTeam ?? GameTeam(); - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text( - widget.initialId == null - ? AppLocalizations.of(context).createTeam - : AppLocalizations.of(context).editTeam, - ), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).teamId, - filled: true, - ), - initialValue: _id, - onChanged: (val) => _id = val, - ), - const SizedBox(height: 8), - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - filled: true, - ), - initialValue: _team.description, - onChanged: (val) => - setState(() => _team = _team.copyWith(description: val)), - ), - const SizedBox(height: 8), - DropdownButtonFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).color, - filled: true, - ), - initialValue: _team.color, - items: [ - DropdownMenuItem( - value: null, - child: Text(AppLocalizations.of(context).none), - ), - ...TeamColor.values.map( - (c) => DropdownMenuItem(value: c, child: Text(c.name)), - ), - ], - onChanged: (val) => - setState(() => _team = _team.copyWith(color: val)), - ), - ], - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - if (_id.isEmpty) return; - Navigator.of(context).pop(MapEntry(_id, _team)); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} - -class _ModeTableEditorDialog extends StatefulWidget { - final String? initialId; - final GameTable? initialTable; - - const _ModeTableEditorDialog({this.initialId, this.initialTable}); - - @override - State<_ModeTableEditorDialog> createState() => _ModeTableEditorDialogState(); -} - -class _ModeTableEditorDialogState extends State<_ModeTableEditorDialog> { - late String _id; - late GameTable _table; - - @override - void initState() { - super.initState(); - _id = widget.initialId ?? 'table_id'; - _table = widget.initialTable ?? const GameTable(); - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text( - widget.initialId == null - ? AppLocalizations.of(context).createTable - : AppLocalizations.of(context).editTable, - ), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).tableId, - filled: true, - ), - initialValue: _id, - onChanged: (val) => _id = val, - ), - const SizedBox(height: 8), - BlocBuilder( - builder: (context, state) { - final backgrounds = state.getBackgrounds().toList(); - final currentBg = _table.background?.toString(); - return DropdownButtonFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).backgrounds, - filled: true, - ), - initialValue: backgrounds.contains(currentBg) - ? currentBg - : null, - items: [ - DropdownMenuItem( - value: null, - child: Text(AppLocalizations.of(context).none), - ), - ...backgrounds.map( - (bg) => DropdownMenuItem(value: bg, child: Text(bg)), - ), - ], - onChanged: (val) => setState(() { - _table = _table.copyWith( - background: val == null - ? null - : ItemLocation.fromString(val), - ); - }), - ); - }, - ), - ], - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - if (_id.isEmpty) return; - Navigator.of(context).pop(MapEntry(_id, _table)); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class ModeEditorDialog extends StatefulWidget { + final String name; + + const ModeEditorDialog({super.key, required this.name}); + + @override + State createState() => _ModeEditorDialogState(); +} + +class _ModeEditorDialogState extends State { + GameMode? _value; + + @override + void initState() { + super.initState(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_value == null) { + final editorState = context.read().state; + _value = editorState.getMode(widget.name) ?? GameMode(); + } + } + + @override + Widget build(BuildContext context) { + final value = _value; + if (value == null) return const SizedBox(); + + return DefaultTabController( + length: 3, + child: ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints( + maxWidth: LeapBreakpoints.compact, + maxHeight: 600, + ), + content: Column( + children: [ + TabBar( + tabs: [ + HorizontalTab( + icon: const Icon(PhosphorIconsLight.textT), + label: Text(AppLocalizations.of(context).general), + ), + HorizontalTab( + icon: const Icon(PhosphorIconsLight.users), + label: Text(AppLocalizations.of(context).teams), + ), + HorizontalTab( + icon: const Icon(PhosphorIconsLight.mapTrifold), + label: Text(AppLocalizations.of(context).tables), + ), + ], + ), + const SizedBox(height: 8), + Expanded( + child: TabBarView( + children: [ + // Tab 1: General (Script) + ListView( + shrinkWrap: true, + children: [ + BlocBuilder( + builder: (context, state) { + final scripts = state.getScripts().toList(); + return DropdownButtonFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).scripts, + filled: true, + ), + initialValue: value.script, + items: [ + DropdownMenuItem( + value: null, + child: Text(AppLocalizations.of(context).none), + ), + ...scripts.map( + (script) => DropdownMenuItem( + value: script, + child: Text(script), + ), + ), + ], + onChanged: (newScript) { + setState(() { + _value = value.copyWith(script: newScript); + }); + }, + ); + }, + ), + ], + ), + // Tab 2: Teams + Stack( + children: [ + ListView.builder( + itemCount: value.teams.length, + itemBuilder: (context, index) { + final teamId = value.teams.keys.elementAt(index); + final team = value.teams[teamId]!; + return ListTile( + title: Text(teamId), + subtitle: Text(team.description), + onTap: () async { + final cubit = context.read(); + final result = + await showDialog>( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: _ModeTeamEditorDialog( + initialId: teamId, + initialTeam: team, + ), + ), + ); + if (result == null) return; + setState(() { + final newTeams = Map.from( + value.teams, + ); + if (result.key != teamId) { + newTeams.remove(teamId); + } + newTeams[result.key] = result.value; + _value = value.copyWith(teams: newTeams); + }); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + setState(() { + final newTeams = Map.from( + value.teams, + ); + newTeams.remove(teamId); + _value = value.copyWith(teams: newTeams); + }); + }, + ), + ); + }, + ), + Align( + alignment: Alignment.bottomCenter, + child: FloatingActionButton.extended( + onPressed: () async { + final cubit = context.read(); + final result = + await showDialog>( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: const _ModeTeamEditorDialog(), + ), + ); + if (result == null) return; + setState(() { + final newTeams = Map.from( + value.teams, + ); + newTeams[result.key] = result.value; + _value = value.copyWith(teams: newTeams); + }); + }, + icon: const Icon(PhosphorIconsLight.plus), + label: Text(LeapLocalizations.of(context).create), + ), + ), + ], + ), + // Tab 3: Tables + Stack( + children: [ + ListView.builder( + itemCount: value.tables.length, + itemBuilder: (context, index) { + final tableId = value.tables.keys.elementAt(index); + final table = value.tables[tableId]!; + return ListTile( + title: Text(tableId), + onTap: () async { + final cubit = context.read(); + final result = + await showDialog>( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: _ModeTableEditorDialog( + initialId: tableId, + initialTable: table, + ), + ), + ); + if (result == null) return; + setState(() { + final newTables = Map.from( + value.tables, + ); + if (result.key != tableId) { + newTables.remove(tableId); + } + newTables[result.key] = result.value; + _value = value.copyWith(tables: newTables); + }); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + setState(() { + final newTables = Map.from( + value.tables, + ); + newTables.remove(tableId); + _value = value.copyWith(tables: newTables); + }); + }, + ), + ); + }, + ), + Align( + alignment: Alignment.bottomCenter, + child: FloatingActionButton.extended( + onPressed: () async { + final cubit = context.read(); + final result = + await showDialog>( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: const _ModeTableEditorDialog(), + ), + ); + if (result == null) return; + setState(() { + final newTables = Map.from( + value.tables, + ); + newTables[result.key] = result.value; + _value = value.copyWith(tables: newTables); + }); + }, + icon: const Icon(PhosphorIconsLight.plus), + label: Text(LeapLocalizations.of(context).create), + ), + ), + ], + ), + ], + ), + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + context.read().setMode(widget.name, value); + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ), + ); + } +} + +class _ModeTeamEditorDialog extends StatefulWidget { + final String? initialId; + final GameTeam? initialTeam; + + const _ModeTeamEditorDialog({this.initialId, this.initialTeam}); + + @override + State<_ModeTeamEditorDialog> createState() => _ModeTeamEditorDialogState(); +} + +class _ModeTeamEditorDialogState extends State<_ModeTeamEditorDialog> { + late String _id; + late GameTeam _team; + + @override + void initState() { + super.initState(); + _id = widget.initialId ?? 'team_id'; + _team = widget.initialTeam ?? GameTeam(); + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text( + widget.initialId == null + ? AppLocalizations.of(context).createTeam + : AppLocalizations.of(context).editTeam, + ), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).teamId, + filled: true, + ), + initialValue: _id, + onChanged: (val) => _id = val, + ), + const SizedBox(height: 8), + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + filled: true, + ), + initialValue: _team.description, + onChanged: (val) => + setState(() => _team = _team.copyWith(description: val)), + ), + const SizedBox(height: 8), + DropdownButtonFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).color, + filled: true, + ), + initialValue: _team.color, + items: [ + DropdownMenuItem( + value: null, + child: Text(AppLocalizations.of(context).none), + ), + ...TeamColor.values.map( + (c) => DropdownMenuItem(value: c, child: Text(c.name)), + ), + ], + onChanged: (val) => + setState(() => _team = _team.copyWith(color: val)), + ), + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + if (_id.isEmpty) return; + Navigator.of(context).pop(MapEntry(_id, _team)); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} + +class _ModeTableEditorDialog extends StatefulWidget { + final String? initialId; + final GameTable? initialTable; + + const _ModeTableEditorDialog({this.initialId, this.initialTable}); + + @override + State<_ModeTableEditorDialog> createState() => _ModeTableEditorDialogState(); +} + +class _ModeTableEditorDialogState extends State<_ModeTableEditorDialog> { + late String _id; + late GameTable _table; + + @override + void initState() { + super.initState(); + _id = widget.initialId ?? 'table_id'; + _table = widget.initialTable ?? const GameTable(); + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text( + widget.initialId == null + ? AppLocalizations.of(context).createTable + : AppLocalizations.of(context).editTable, + ), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).tableId, + filled: true, + ), + initialValue: _id, + onChanged: (val) => _id = val, + ), + const SizedBox(height: 8), + BlocBuilder( + builder: (context, state) { + final backgrounds = state.getBackgrounds().toList(); + final currentBg = _table.background?.toString(); + return DropdownButtonFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).backgrounds, + filled: true, + ), + initialValue: backgrounds.contains(currentBg) + ? currentBg + : null, + items: [ + DropdownMenuItem( + value: null, + child: Text(AppLocalizations.of(context).none), + ), + ...backgrounds.map( + (bg) => DropdownMenuItem(value: bg, child: Text(bg)), + ), + ], + onChanged: (val) => setState(() { + _table = _table.copyWith( + background: val == null + ? null + : ItemLocation.fromString(val), + ); + }), + ); + }, + ), + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + if (_id.isEmpty) return; + Navigator.of(context).pop(MapEntry(_id, _table)); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} diff --git a/app/lib/pages/editor/modes.dart b/app/lib/pages/editor/modes.dart index 126c7a5b..51dfabef 100644 --- a/app/lib/pages/editor/modes.dart +++ b/app/lib/pages/editor/modes.dart @@ -1,80 +1,80 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/pages/editor/mode_dialog.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class ModesEditorPage extends StatelessWidget { - const ModesEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final modes = state.getModes().toList(); - if (modes.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: modes.map((id) { - return Dismissible( - key: ValueKey(id), - onDismissed: (direction) { - cubit.removeMode(id); - }, - child: ListTile( - title: Text(id), - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - cubit.removeMode(id); - }, - ), - onTap: () { - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: ModeEditorDialog(name: id), - ), - ); - }, - ), - ); - }).toList(), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final name = await showDialog( - context: context, - builder: (context) => NameDialog(), - ); - if (name == null || name.isEmpty) return; - cubit.setMode(name, GameMode()); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/pages/editor/mode_dialog.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class ModesEditorPage extends StatelessWidget { + const ModesEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final modes = state.getModes().toList(); + if (modes.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: modes.map((id) { + return Dismissible( + key: ValueKey(id), + onDismissed: (direction) { + cubit.removeMode(id); + }, + child: ListTile( + title: Text(id), + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + cubit.removeMode(id); + }, + ), + onTap: () { + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: ModeEditorDialog(name: id), + ), + ); + }, + ), + ); + }).toList(), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final name = await showDialog( + context: context, + builder: (context) => NameDialog(), + ); + if (name == null || name.isEmpty) return; + cubit.setMode(name, GameMode()); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} diff --git a/app/lib/pages/editor/scripts.dart b/app/lib/pages/editor/scripts.dart index 697e5ba7..d5b9b25d 100644 --- a/app/lib/pages/editor/scripts.dart +++ b/app/lib/pages/editor/scripts.dart @@ -1,146 +1,146 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class ScriptsEditorPage extends StatelessWidget { - const ScriptsEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - final scripts = state.getScripts().toList(); - if (scripts.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: scripts.map((id) { - return Dismissible( - key: ValueKey(id), - onDismissed: (direction) { - cubit.removeScript(id); - }, - child: ListTile( - title: Text(id), - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () { - cubit.removeScript(id); - }, - ), - onTap: () { - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: cubit, - child: ScriptEditorDialog(name: id), - ), - ); - }, - ), - ); - }).toList(), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - var name = await showDialog( - context: context, - builder: (context) => - NameDialog(), // We can do better later, just minimal - ); - if (name == null || name.isEmpty) return; - name = '$name.lua'; - cubit.setScript(name, '-- new script\n'); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} - -class ScriptEditorDialog extends StatefulWidget { - final String name; - - const ScriptEditorDialog({super.key, required this.name}); - - @override - State createState() => _ScriptEditorDialogState(); -} - -class _ScriptEditorDialogState extends State { - late final TextEditingController _controller; - - @override - void initState() { - super.initState(); - final editorState = context.read().state; - final value = editorState.getScript(widget.name) ?? ''; - _controller = TextEditingController(text: value); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text(widget.name), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.expanded), - content: TextFormField( - controller: _controller, - decoration: InputDecoration( - labelText: AppLocalizations.of(context).scripts, - filled: true, - alignLabelWithHint: true, - ), - maxLines: null, - expands: true, - keyboardType: TextInputType.multiline, - style: const TextStyle(fontFamily: 'monospace'), - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ElevatedButton( - onPressed: () { - context.read().setScript( - widget.name, - _controller.text, - ); - Navigator.of(context).pop(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class ScriptsEditorPage extends StatelessWidget { + const ScriptsEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + final scripts = state.getScripts().toList(); + if (scripts.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: scripts.map((id) { + return Dismissible( + key: ValueKey(id), + onDismissed: (direction) { + cubit.removeScript(id); + }, + child: ListTile( + title: Text(id), + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () { + cubit.removeScript(id); + }, + ), + onTap: () { + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: cubit, + child: ScriptEditorDialog(name: id), + ), + ); + }, + ), + ); + }).toList(), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + var name = await showDialog( + context: context, + builder: (context) => + NameDialog(), // We can do better later, just minimal + ); + if (name == null || name.isEmpty) return; + name = '$name.lua'; + cubit.setScript(name, '-- new script\n'); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} + +class ScriptEditorDialog extends StatefulWidget { + final String name; + + const ScriptEditorDialog({super.key, required this.name}); + + @override + State createState() => _ScriptEditorDialogState(); +} + +class _ScriptEditorDialogState extends State { + late final TextEditingController _controller; + + @override + void initState() { + super.initState(); + final editorState = context.read().state; + final value = editorState.getScript(widget.name) ?? ''; + _controller = TextEditingController(text: value); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text(widget.name), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.expanded), + content: TextFormField( + controller: _controller, + decoration: InputDecoration( + labelText: AppLocalizations.of(context).scripts, + filled: true, + alignLabelWithHint: true, + ), + maxLines: null, + expands: true, + keyboardType: TextInputType.multiline, + style: const TextStyle(fontFamily: 'monospace'), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ElevatedButton( + onPressed: () { + context.read().setScript( + widget.name, + _controller.text, + ); + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ], + ); + } +} diff --git a/app/lib/pages/editor/shell.dart b/app/lib/pages/editor/shell.dart index 57f3b48b..ccff12c8 100644 --- a/app/lib/pages/editor/shell.dart +++ b/app/lib/pages/editor/shell.dart @@ -1,225 +1,225 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:go_router/go_router.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/bloc/settings.dart'; -import 'package:setonix/pages/editor/backgrounds.dart'; -import 'package:setonix/pages/editor/boards.dart'; -import 'package:setonix/pages/editor/decks.dart'; -import 'package:setonix/pages/editor/figures.dart'; -import 'package:setonix/pages/editor/general.dart'; -import 'package:setonix/pages/editor/textures.dart'; -import 'package:setonix/pages/editor/scripts.dart'; -import 'package:setonix/pages/editor/modes.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:setonix_api/setonix_api.dart'; - -const kEditorPath = '/editor/:name'; - -enum EditorPage { - general(PhosphorIcons.house, ''), - figures(PhosphorIcons.cube, '/figures'), - boards(PhosphorIcons.mapTrifold, '/boards'), - decks(PhosphorIcons.stack, '/decks'), - backgrounds(PhosphorIcons.image, '/backgrounds'), - textures(PhosphorIcons.paintBucket, '/textures'), - scripts(PhosphorIcons.scroll, '/scripts'), - modes(PhosphorIcons.gameController, '/modes'), - translations(PhosphorIcons.translate, null); - - final IconGetter icon; - final String? location; - - const EditorPage(this.icon, this.location); - - String? get fullLocation => location == null ? null : '$kEditorPath$location'; - String? get route => location == null - ? null - : this == EditorPage.general - ? 'editor' - : 'editor-$name'; - - String getLocalizedName(BuildContext context) { - final loc = AppLocalizations.of(context); - return switch (this) { - EditorPage.general => loc.general, - EditorPage.figures => loc.figures, - EditorPage.boards => loc.boards, - EditorPage.decks => loc.decks, - EditorPage.backgrounds => loc.backgrounds, - EditorPage.translations => loc.translations, - EditorPage.textures => loc.textures, - EditorPage.scripts => loc.scripts, - EditorPage.modes => loc.modes, - }; - } - - Widget getPage() { - return switch (this) { - EditorPage.general => const GeneralEditorPage(), - EditorPage.figures => const FiguresEditorPage(), - EditorPage.boards => const BoardsEditorPage(), - EditorPage.decks => const DecksEditorPage(), - EditorPage.backgrounds => const BackgroundsEditorPage(), - EditorPage.translations => const GeneralEditorPage(), - EditorPage.textures => const TexturesEditorPage(), - EditorPage.scripts => const ScriptsEditorPage(), - EditorPage.modes => const ModesEditorPage(), - }; - } -} - -class EditorNavigatorView extends StatelessWidget { - final EditorPage currentPage; - final bool isMobile; - - const EditorNavigatorView({ - super.key, - required this.currentPage, - this.isMobile = false, - }); - - void _navigate(BuildContext context, EditorPage page) { - final cubit = context.read(); - final route = page.route; - if (route == null) { - return; - } - context.goNamed(route, pathParameters: {'name': cubit.path}); - } - - @override - Widget build(BuildContext context) { - return NavigationDrawer( - selectedIndex: isMobile ? currentPage.index + 1 : currentPage.index, - onDestinationSelected: (value) { - if (isMobile) Navigator.of(context).pop(); - if (isMobile && value == 0) { - context.go('/'); - } else { - _navigate(context, EditorPage.values[isMobile ? value - 1 : value]); - } - }, - children: [ - if (isMobile) ...[ - NavigationDrawerDestination( - icon: Icon(PhosphorIconsLight.arrowLeft), - label: Text(AppLocalizations.of(context).back), - ), - const Divider(), - ], - ...EditorPage.values.map( - (e) => NavigationDrawerDestination( - icon: Icon(e.icon(PhosphorIconsStyle.light)), - label: Text(e.getLocalizedName(context)), - selectedIcon: Icon(e.icon(PhosphorIconsStyle.fill)), - enabled: e.location != null, - ), - ), - ], - ); - } -} - -class EditorShell extends StatefulWidget { - final Widget child; - final GoRouterState state; - final String name; - - const EditorShell({ - super.key, - required this.child, - required this.state, - required this.name, - }); - - @override - State createState() => _EditorShellState(); -} - -class _EditorShellState extends State { - Future? _data; - - @override - void initState() { - super.initState(); - - _loadData(); - } - - void _loadData() => _data = context - .read() - .editorSystem - .getFile(widget.name); - - @override - Widget build(BuildContext context) { - return FutureBuilder( - future: _data, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return Scaffold( - appBar: WindowTitleBar( - title: Text(AppLocalizations.of(context).loading), - ), - body: const Center(child: CircularProgressIndicator()), - ); - } - if (snapshot.hasError) { - return Scaffold( - appBar: WindowTitleBar( - title: Text(AppLocalizations.of(context).error), - ), - body: Center(child: Text(snapshot.error.toString())), - ); - } - final data = snapshot.data; - if (data == null) { - return Scaffold( - appBar: WindowTitleBar( - title: Text(AppLocalizations.of(context).error), - ), - body: Center(child: Text(AppLocalizations.of(context).noData)), - ); - } - return _buildContent(context, data); - }, - ); - } - - Widget _buildContent(BuildContext context, SetonixData data) { - final width = MediaQuery.sizeOf(context).width; - final isMobile = width < LeapBreakpoints.medium; - final name = widget.state.fullPath; - final currentPage = EditorPage.values.firstWhere( - (e) => e.fullLocation == name, - orElse: () => EditorPage.general, - ); - return BlocProvider( - create: (context) => - EditorCubit(widget.name, context.read(), data), - child: Scaffold( - appBar: WindowTitleBar( - title: Text( - isMobile ? currentPage.getLocalizedName(context) : widget.name, - ), - ), - drawer: isMobile - ? EditorNavigatorView(currentPage: currentPage, isMobile: true) - : null, - body: Row( - children: [ - if (!isMobile) ...[ - EditorNavigatorView(currentPage: currentPage), - const SizedBox(width: 2), - ], - Expanded(child: widget.child), - ], - ), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:go_router/go_router.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/bloc/settings.dart'; +import 'package:setonix/pages/editor/backgrounds.dart'; +import 'package:setonix/pages/editor/boards.dart'; +import 'package:setonix/pages/editor/decks.dart'; +import 'package:setonix/pages/editor/figures.dart'; +import 'package:setonix/pages/editor/general.dart'; +import 'package:setonix/pages/editor/textures.dart'; +import 'package:setonix/pages/editor/scripts.dart'; +import 'package:setonix/pages/editor/modes.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:setonix_api/setonix_api.dart'; + +const kEditorPath = '/editor/:name'; + +enum EditorPage { + general(PhosphorIcons.house, ''), + figures(PhosphorIcons.cube, '/figures'), + boards(PhosphorIcons.mapTrifold, '/boards'), + decks(PhosphorIcons.stack, '/decks'), + backgrounds(PhosphorIcons.image, '/backgrounds'), + textures(PhosphorIcons.paintBucket, '/textures'), + scripts(PhosphorIcons.scroll, '/scripts'), + modes(PhosphorIcons.gameController, '/modes'), + translations(PhosphorIcons.translate, null); + + final IconGetter icon; + final String? location; + + const EditorPage(this.icon, this.location); + + String? get fullLocation => location == null ? null : '$kEditorPath$location'; + String? get route => location == null + ? null + : this == EditorPage.general + ? 'editor' + : 'editor-$name'; + + String getLocalizedName(BuildContext context) { + final loc = AppLocalizations.of(context); + return switch (this) { + EditorPage.general => loc.general, + EditorPage.figures => loc.figures, + EditorPage.boards => loc.boards, + EditorPage.decks => loc.decks, + EditorPage.backgrounds => loc.backgrounds, + EditorPage.translations => loc.translations, + EditorPage.textures => loc.textures, + EditorPage.scripts => loc.scripts, + EditorPage.modes => loc.modes, + }; + } + + Widget getPage() { + return switch (this) { + EditorPage.general => const GeneralEditorPage(), + EditorPage.figures => const FiguresEditorPage(), + EditorPage.boards => const BoardsEditorPage(), + EditorPage.decks => const DecksEditorPage(), + EditorPage.backgrounds => const BackgroundsEditorPage(), + EditorPage.translations => const GeneralEditorPage(), + EditorPage.textures => const TexturesEditorPage(), + EditorPage.scripts => const ScriptsEditorPage(), + EditorPage.modes => const ModesEditorPage(), + }; + } +} + +class EditorNavigatorView extends StatelessWidget { + final EditorPage currentPage; + final bool isMobile; + + const EditorNavigatorView({ + super.key, + required this.currentPage, + this.isMobile = false, + }); + + void _navigate(BuildContext context, EditorPage page) { + final cubit = context.read(); + final route = page.route; + if (route == null) { + return; + } + context.goNamed(route, pathParameters: {'name': cubit.path}); + } + + @override + Widget build(BuildContext context) { + return NavigationDrawer( + selectedIndex: isMobile ? currentPage.index + 1 : currentPage.index, + onDestinationSelected: (value) { + if (isMobile) Navigator.of(context).pop(); + if (isMobile && value == 0) { + context.go('/'); + } else { + _navigate(context, EditorPage.values[isMobile ? value - 1 : value]); + } + }, + children: [ + if (isMobile) ...[ + NavigationDrawerDestination( + icon: Icon(PhosphorIconsLight.arrowLeft), + label: Text(AppLocalizations.of(context).back), + ), + const Divider(), + ], + ...EditorPage.values.map( + (e) => NavigationDrawerDestination( + icon: Icon(e.icon(PhosphorIconsStyle.light)), + label: Text(e.getLocalizedName(context)), + selectedIcon: Icon(e.icon(PhosphorIconsStyle.fill)), + enabled: e.location != null, + ), + ), + ], + ); + } +} + +class EditorShell extends StatefulWidget { + final Widget child; + final GoRouterState state; + final String name; + + const EditorShell({ + super.key, + required this.child, + required this.state, + required this.name, + }); + + @override + State createState() => _EditorShellState(); +} + +class _EditorShellState extends State { + Future? _data; + + @override + void initState() { + super.initState(); + + _loadData(); + } + + void _loadData() => _data = context + .read() + .editorSystem + .getFile(widget.name); + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _data, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return Scaffold( + appBar: WindowTitleBar( + title: Text(AppLocalizations.of(context).loading), + ), + body: const Center(child: CircularProgressIndicator()), + ); + } + if (snapshot.hasError) { + return Scaffold( + appBar: WindowTitleBar( + title: Text(AppLocalizations.of(context).error), + ), + body: Center(child: Text(snapshot.error.toString())), + ); + } + final data = snapshot.data; + if (data == null) { + return Scaffold( + appBar: WindowTitleBar( + title: Text(AppLocalizations.of(context).error), + ), + body: Center(child: Text(AppLocalizations.of(context).noData)), + ); + } + return _buildContent(context, data); + }, + ); + } + + Widget _buildContent(BuildContext context, SetonixData data) { + final width = MediaQuery.sizeOf(context).width; + final isMobile = width < LeapBreakpoints.medium; + final name = widget.state.fullPath; + final currentPage = EditorPage.values.firstWhere( + (e) => e.fullLocation == name, + orElse: () => EditorPage.general, + ); + return BlocProvider( + create: (context) => + EditorCubit(widget.name, context.read(), data), + child: Scaffold( + appBar: WindowTitleBar( + title: Text( + isMobile ? currentPage.getLocalizedName(context) : widget.name, + ), + ), + drawer: isMobile + ? EditorNavigatorView(currentPage: currentPage, isMobile: true) + : null, + body: Row( + children: [ + if (!isMobile) ...[ + EditorNavigatorView(currentPage: currentPage), + const SizedBox(width: 2), + ], + Expanded(child: widget.child), + ], + ), + ), + ); + } +} diff --git a/app/lib/pages/editor/textures.dart b/app/lib/pages/editor/textures.dart index 7736202a..ba9fd57f 100644 --- a/app/lib/pages/editor/textures.dart +++ b/app/lib/pages/editor/textures.dart @@ -1,238 +1,238 @@ -import 'dart:typed_data'; - -import 'package:file_picker/file_picker.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/editor.dart'; -import 'package:setonix/helpers/vector.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class TexturesEditorPage extends StatelessWidget { - const TexturesEditorPage({super.key}); - - @override - Widget build(BuildContext context) { - final cubit = context.read(); - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), - padding: const EdgeInsets.all(4), - child: BlocBuilder( - builder: (context, state) { - return _TexturesColumn( - textures: state.getTexturesData(), - onRemove: (texture) => cubit.removeTexture(texture), - ); - }, - ), - ), - ), - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final data = await FilePicker.pickFiles( - type: FileType.image, - ).then((result) => result?.files.firstOrNull); - if (data == null) return; - final bytes = await data.readAsBytes(); - if (!context.mounted) return; - final name = await showDialog( - context: context, - builder: (context) => NameDialog( - value: data.name, - validator: defaultNameValidator( - context, - cubit.state.getTextures().toList(), - ), - ), - ); - if (name == null) return; - cubit.setTexture(name, bytes); - }, - label: Text(LeapLocalizations.of(context).create), - icon: const Icon(PhosphorIconsLight.plus), - ), - ); - } -} - -class EditorTextureListTile extends StatelessWidget { - final String? label; - final String value; - final ValueChanged onChanged; - final VoidCallback? onRemove; - - const EditorTextureListTile({ - super.key, - this.label, - required this.value, - required this.onChanged, - this.onRemove, - }); - - @override - Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - final data = state.getTexture(value); - return ListTile( - title: Text(label ?? AppLocalizations.of(context).texture), - subtitle: Text( - value.isEmpty ? AppLocalizations.of(context).notSet : '', - ), - leading: data == null - ? null - : Image.memory(data, width: 48, height: 48), - onTap: () => - showDialog( - context: context, - builder: (context) => - TextureDialog(textures: state.getTexturesData()), - ).then((texture) { - if (texture == null) return; - onChanged(texture); - }), - trailing: onRemove == null - ? null - : IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: onRemove, - ), - ); - }, - ); - } -} - -class TextureDialog extends StatelessWidget { - final Map textures; - - const TextureDialog({super.key, required this.textures}); - - @override - Widget build(BuildContext context) { - return AlertDialog( - title: Text(AppLocalizations.of(context).textures), - scrollable: true, - content: _TexturesColumn( - textures: textures, - onClick: (texture) => Navigator.of(context).pop(texture), - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: Text(AppLocalizations.of(context).cancel), - ), - ], - ); - } -} - -class _TexturesColumn extends StatelessWidget { - final Map textures; - final void Function(String)? onClick; - final void Function(String)? onRemove; - - const _TexturesColumn({required this.textures, this.onClick, this.onRemove}); - - @override - Widget build(BuildContext context) { - if (textures.isEmpty) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(AppLocalizations.of(context).noData), - ), - ); - } - return Column( - children: textures.entries.map((entry) { - final texture = entry.key; - final data = entry.value; - final tile = ListTile( - title: Text(texture), - leading: data == null - ? null - : Image.memory(data, width: 48, height: 48), - trailing: onRemove == null - ? null - : IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () => onRemove!(texture), - ), - onTap: onClick == null ? null : () => onClick!(texture), - ); - if (onRemove == null) return tile; - return Dismissible( - key: ValueKey(texture), - onDismissed: (direction) => onRemove!(texture), - child: tile, - ); - }).toList(), - ); - } -} - -class VisualEditingView extends StatelessWidget { - final T value; - final ValueChanged onChanged; - - const VisualEditingView({ - super.key, - required this.value, - required this.onChanged, - }); - - @override - Widget build(BuildContext context) { - final size = value.size; - return Column( - children: [ - EditorTextureListTile( - value: value.texture, - onChanged: (texture) => - onChanged(value.copyWith(texture: texture) as T), - onRemove: value.texture.isEmpty - ? null - : () => onChanged(value.copyWith(texture: '') as T), - ), - const SizedBox(height: 4), - OffsetListTile( - value: value.offset.toOffset(), - title: Text(AppLocalizations.of(context).offset), - fractionDigits: 0, - onChanged: (offset) => - onChanged(value.copyWith(offset: offset.toDefinition()) as T), - ), - const SizedBox(height: 4), - size == null - ? ListTile( - title: Text(AppLocalizations.of(context).size), - subtitle: Text( - AppLocalizations.of(context).wholeSizeClickCustomize, - ), - onTap: () => - onChanged(value.copyWith(size: VectorDefinition.one) as T), - ) - : OffsetListTile( - value: size.toOffset(), - title: Text(AppLocalizations.of(context).size), - fractionDigits: 0, - onChanged: (offset) => onChanged( - value.copyWith(offset: offset.toDefinition()) as T, - ), - trailing: IconButton( - tooltip: AppLocalizations.of(context).clear, - icon: const Icon(PhosphorIconsLight.x), - onPressed: () => onChanged(value.copyWith(size: null) as T), - ), - ), - ], - ); - } -} +import 'dart:typed_data'; + +import 'package:file_picker/file_picker.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/editor.dart'; +import 'package:setonix/helpers/vector.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class TexturesEditorPage extends StatelessWidget { + const TexturesEditorPage({super.key}); + + @override + Widget build(BuildContext context) { + final cubit = context.read(); + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.expanded), + padding: const EdgeInsets.all(4), + child: BlocBuilder( + builder: (context, state) { + return _TexturesColumn( + textures: state.getTexturesData(), + onRemove: (texture) => cubit.removeTexture(texture), + ); + }, + ), + ), + ), + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final data = await FilePicker.pickFiles( + type: FileType.image, + ).then((result) => result?.files.firstOrNull); + if (data == null) return; + final bytes = await data.readAsBytes(); + if (!context.mounted) return; + final name = await showDialog( + context: context, + builder: (context) => NameDialog( + value: data.name, + validator: defaultNameValidator( + context, + cubit.state.getTextures().toList(), + ), + ), + ); + if (name == null) return; + cubit.setTexture(name, bytes); + }, + label: Text(LeapLocalizations.of(context).create), + icon: const Icon(PhosphorIconsLight.plus), + ), + ); + } +} + +class EditorTextureListTile extends StatelessWidget { + final String? label; + final String value; + final ValueChanged onChanged; + final VoidCallback? onRemove; + + const EditorTextureListTile({ + super.key, + this.label, + required this.value, + required this.onChanged, + this.onRemove, + }); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + final data = state.getTexture(value); + return ListTile( + title: Text(label ?? AppLocalizations.of(context).texture), + subtitle: Text( + value.isEmpty ? AppLocalizations.of(context).notSet : '', + ), + leading: data == null + ? null + : Image.memory(data, width: 48, height: 48), + onTap: () => + showDialog( + context: context, + builder: (context) => + TextureDialog(textures: state.getTexturesData()), + ).then((texture) { + if (texture == null) return; + onChanged(texture); + }), + trailing: onRemove == null + ? null + : IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: onRemove, + ), + ); + }, + ); + } +} + +class TextureDialog extends StatelessWidget { + final Map textures; + + const TextureDialog({super.key, required this.textures}); + + @override + Widget build(BuildContext context) { + return AlertDialog( + title: Text(AppLocalizations.of(context).textures), + scrollable: true, + content: _TexturesColumn( + textures: textures, + onClick: (texture) => Navigator.of(context).pop(texture), + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(AppLocalizations.of(context).cancel), + ), + ], + ); + } +} + +class _TexturesColumn extends StatelessWidget { + final Map textures; + final void Function(String)? onClick; + final void Function(String)? onRemove; + + const _TexturesColumn({required this.textures, this.onClick, this.onRemove}); + + @override + Widget build(BuildContext context) { + if (textures.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(AppLocalizations.of(context).noData), + ), + ); + } + return Column( + children: textures.entries.map((entry) { + final texture = entry.key; + final data = entry.value; + final tile = ListTile( + title: Text(texture), + leading: data == null + ? null + : Image.memory(data, width: 48, height: 48), + trailing: onRemove == null + ? null + : IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () => onRemove!(texture), + ), + onTap: onClick == null ? null : () => onClick!(texture), + ); + if (onRemove == null) return tile; + return Dismissible( + key: ValueKey(texture), + onDismissed: (direction) => onRemove!(texture), + child: tile, + ); + }).toList(), + ); + } +} + +class VisualEditingView extends StatelessWidget { + final T value; + final ValueChanged onChanged; + + const VisualEditingView({ + super.key, + required this.value, + required this.onChanged, + }); + + @override + Widget build(BuildContext context) { + final size = value.size; + return Column( + children: [ + EditorTextureListTile( + value: value.texture, + onChanged: (texture) => + onChanged(value.copyWith(texture: texture) as T), + onRemove: value.texture.isEmpty + ? null + : () => onChanged(value.copyWith(texture: '') as T), + ), + const SizedBox(height: 4), + OffsetListTile( + value: value.offset.toOffset(), + title: Text(AppLocalizations.of(context).offset), + fractionDigits: 0, + onChanged: (offset) => + onChanged(value.copyWith(offset: offset.toDefinition()) as T), + ), + const SizedBox(height: 4), + size == null + ? ListTile( + title: Text(AppLocalizations.of(context).size), + subtitle: Text( + AppLocalizations.of(context).wholeSizeClickCustomize, + ), + onTap: () => + onChanged(value.copyWith(size: VectorDefinition.one) as T), + ) + : OffsetListTile( + value: size.toOffset(), + title: Text(AppLocalizations.of(context).size), + fractionDigits: 0, + onChanged: (offset) => onChanged( + value.copyWith(offset: offset.toDefinition()) as T, + ), + trailing: IconButton( + tooltip: AppLocalizations.of(context).clear, + icon: const Icon(PhosphorIconsLight.x), + onPressed: () => onChanged(value.copyWith(size: null) as T), + ), + ), + ], + ); + } +} diff --git a/app/lib/pages/game/auth.dart b/app/lib/pages/game/auth.dart index ca02c6b5..cb7dabc6 100644 --- a/app/lib/pages/game/auth.dart +++ b/app/lib/pages/game/auth.dart @@ -1,168 +1,168 @@ -import 'dart:ui'; - -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/pages/home/accounts.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class AuthGameView extends StatefulWidget { - const AuthGameView({super.key}); - - @override - State createState() => _AuthGameViewState(); -} - -class _AuthGameViewState extends State { - late final SetonixFileSystem _fileSystem; - Future>? _keysFuture; - bool _isLoading = false; - - @override - void initState() { - super.initState(); - _fileSystem = context.read(); - _buildKeysFuture(); - } - - void _buildKeysFuture() { - _keysFuture = _fileSystem.getAccounts(); - } - - @override - Widget build(BuildContext context) { - return BlocConsumer( - buildWhen: (previous, current) => - previous.world.authRequest != current.world.authRequest, - listenWhen: (previous, current) => - previous.world.authRequest != current.world.authRequest, - listener: (context, state) { - setState(() { - _isLoading = false; - }); - }, - builder: (context, state) { - final authRequest = state.world.authRequest; - if (authRequest == null) { - return const SizedBox.shrink(); - } - return Stack( - alignment: Alignment.center, - children: [ - BackdropFilter( - filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), - child: Container(color: Colors.black.withValues(alpha: 0.5)), - ), - ResponsiveAlertDialog( - title: Text(AppLocalizations.of(context).authenticate), - constraints: BoxConstraints(maxWidth: LeapBreakpoints.compact), - headerActions: [ - IconButton( - icon: const Icon(PhosphorIconsLight.gear), - onPressed: () async { - await showDialog( - context: context, - builder: (context) => AccountsDialog(), - ); - setState(() { - _buildKeysFuture(); - }); - }, - ), - ], - content: _isLoading - ? Column( - mainAxisSize: MainAxisSize.min, - children: [ - CircularProgressIndicator(), - const SizedBox(height: 16.0), - Text(AppLocalizations.of(context).authenticateLoading), - ], - ) - : Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - AppLocalizations.of(context).authenticateDescription, - ), - if (authRequest.isRequired) - Text( - AppLocalizations.of(context).authenticateRequired, - style: Theme.of( - context, - ).textTheme.bodyMedium?.copyWith(color: Colors.red), - ), - const SizedBox(height: 16.0), - Flexible( - child: FutureBuilder>( - future: _keysFuture, - builder: (context, snapshot) { - if (snapshot.connectionState == - ConnectionState.waiting) { - return const Padding( - padding: EdgeInsets.all(16.0), - child: CircularProgressIndicator(), - ); - } else if (snapshot.hasError) { - return Padding( - padding: const EdgeInsets.all(16.0), - child: Text( - AppLocalizations.of(context).error, - ), - ); - } else if (!snapshot.hasData || - snapshot.data!.isEmpty) { - return Padding( - padding: const EdgeInsets.all(16.0), - child: Text( - AppLocalizations.of(context).noAccount, - ), - ); - } else { - final accounts = snapshot.data!; - return ListView.builder( - shrinkWrap: true, - itemCount: accounts.length, - itemBuilder: (context, index) { - final account = accounts[index]; - return ListTile( - title: Text(account.name.substring(1)), - subtitle: Text( - account.getFingerprint( - pretty: true, - short: true, - ), - ), - onTap: () async { - final bloc = context.read(); - final event = - await AuthenticateRequest.build( - authRequest, - account, - ); - bloc.process(event); - setState(() { - _isLoading = true; - }); - }, - ); - }, - ); - } - }, - ), - ), - ], - ), - ), - ], - ); - }, - ); - } -} +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/pages/home/accounts.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class AuthGameView extends StatefulWidget { + const AuthGameView({super.key}); + + @override + State createState() => _AuthGameViewState(); +} + +class _AuthGameViewState extends State { + late final SetonixFileSystem _fileSystem; + Future>? _keysFuture; + bool _isLoading = false; + + @override + void initState() { + super.initState(); + _fileSystem = context.read(); + _buildKeysFuture(); + } + + void _buildKeysFuture() { + _keysFuture = _fileSystem.getAccounts(); + } + + @override + Widget build(BuildContext context) { + return BlocConsumer( + buildWhen: (previous, current) => + previous.world.authRequest != current.world.authRequest, + listenWhen: (previous, current) => + previous.world.authRequest != current.world.authRequest, + listener: (context, state) { + setState(() { + _isLoading = false; + }); + }, + builder: (context, state) { + final authRequest = state.world.authRequest; + if (authRequest == null) { + return const SizedBox.shrink(); + } + return Stack( + alignment: Alignment.center, + children: [ + BackdropFilter( + filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), + child: Container(color: Colors.black.withValues(alpha: 0.5)), + ), + ResponsiveAlertDialog( + title: Text(AppLocalizations.of(context).authenticate), + constraints: BoxConstraints(maxWidth: LeapBreakpoints.compact), + headerActions: [ + IconButton( + icon: const Icon(PhosphorIconsLight.gear), + onPressed: () async { + await showDialog( + context: context, + builder: (context) => AccountsDialog(), + ); + setState(() { + _buildKeysFuture(); + }); + }, + ), + ], + content: _isLoading + ? Column( + mainAxisSize: MainAxisSize.min, + children: [ + CircularProgressIndicator(), + const SizedBox(height: 16.0), + Text(AppLocalizations.of(context).authenticateLoading), + ], + ) + : Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + AppLocalizations.of(context).authenticateDescription, + ), + if (authRequest.isRequired) + Text( + AppLocalizations.of(context).authenticateRequired, + style: Theme.of( + context, + ).textTheme.bodyMedium?.copyWith(color: Colors.red), + ), + const SizedBox(height: 16.0), + Flexible( + child: FutureBuilder>( + future: _keysFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return const Padding( + padding: EdgeInsets.all(16.0), + child: CircularProgressIndicator(), + ); + } else if (snapshot.hasError) { + return Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + AppLocalizations.of(context).error, + ), + ); + } else if (!snapshot.hasData || + snapshot.data!.isEmpty) { + return Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + AppLocalizations.of(context).noAccount, + ), + ); + } else { + final accounts = snapshot.data!; + return ListView.builder( + shrinkWrap: true, + itemCount: accounts.length, + itemBuilder: (context, index) { + final account = accounts[index]; + return ListTile( + title: Text(account.name.substring(1)), + subtitle: Text( + account.getFingerprint( + pretty: true, + short: true, + ), + ), + onTap: () async { + final bloc = context.read(); + final event = + await AuthenticateRequest.build( + authRequest, + account, + ); + bloc.process(event); + setState(() { + _isLoading = true; + }); + }, + ); + }, + ); + } + }, + ), + ), + ], + ), + ), + ], + ); + }, + ); + } +} diff --git a/app/lib/pages/game/chat.dart b/app/lib/pages/game/chat.dart index 0e050928..9f44bc9a 100644 --- a/app/lib/pages/game/chat.dart +++ b/app/lib/pages/game/chat.dart @@ -1,151 +1,151 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:intl/intl.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GameChatDrawer extends StatefulWidget { - const GameChatDrawer({super.key}); - - @override - State createState() => _GameChatDrawerState(); -} - -class _GameChatDrawerState extends State { - final ScrollController _scrollController = ScrollController(); - final TextEditingController _messageController = TextEditingController(); - final FocusNode _messageFocus = FocusNode(); - - @override - void initState() { - super.initState(); - _scheduleScroll(); - } - - void _scheduleScroll() { - WidgetsBinding.instance.addPostFrameCallback((_) { - _scrollController.jumpTo(_scrollController.position.maxScrollExtent); - }); - } - - @override - void dispose() { - super.dispose(); - _scrollController.dispose(); - _messageController.dispose(); - _messageFocus.dispose(); - } - - @override - Widget build(BuildContext context) { - return Drawer( - child: Column( - children: [ - Header( - leading: IconButton.outlined( - icon: const Icon(PhosphorIconsLight.x), - onPressed: () => Navigator.of(context).pop(), - ), - title: Text(AppLocalizations.of(context).chat), - ), - Flexible( - child: BlocConsumer( - listenWhen: (previous, current) => - previous.messages.length != current.messages.length, - listener: (context, state) { - _scheduleScroll(); - }, - builder: (context, state) { - final messages = state.messages; - return ListView.builder( - itemCount: messages.length, - controller: _scrollController, - itemBuilder: (context, index) { - final message = messages[index]; - return Card.filled( - color: message.author == state.id - ? Theme.of(context).colorScheme.primaryContainer - : null, - child: Padding( - padding: const EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - AppLocalizations.of( - context, - ).defaultPlayerName(message.author), - style: Theme.of(context).textTheme.bodyMedium, - ), - Text( - DateFormat.Hms( - Localizations.localeOf( - context, - ).languageCode, - ).format(message.timestamp), - style: Theme.of(context).textTheme.bodySmall, - ), - ], - ), - Text(message.content), - ], - ), - ), - ); - }, - ); - }, - ), - ), - const SizedBox(height: 8), - Row( - children: [ - Flexible( - child: TextField( - controller: _messageController, - textAlignVertical: TextAlignVertical.center, - decoration: InputDecoration( - hintText: AppLocalizations.of(context).message, - filled: true, - suffixIcon: ListenableBuilder( - listenable: _messageController, - builder: (context, _) { - return IconButton( - icon: const Icon(PhosphorIconsLight.paperPlaneRight), - onPressed: _messageController.text.isEmpty - ? null - : _onSubmit, - ); - }, - ), - ), - focusNode: _messageFocus, - autofocus: true, - onSubmitted: (_) { - _onSubmit(); - _messageFocus.requestFocus(); - }, - ), - ), - ], - ), - ], - ), - ); - } - - void _onSubmit() { - final message = _messageController.text; - if (message.isNotEmpty) { - context.read().process(MessageRequest(message)); - _messageController.clear(); - } - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:intl/intl.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GameChatDrawer extends StatefulWidget { + const GameChatDrawer({super.key}); + + @override + State createState() => _GameChatDrawerState(); +} + +class _GameChatDrawerState extends State { + final ScrollController _scrollController = ScrollController(); + final TextEditingController _messageController = TextEditingController(); + final FocusNode _messageFocus = FocusNode(); + + @override + void initState() { + super.initState(); + _scheduleScroll(); + } + + void _scheduleScroll() { + WidgetsBinding.instance.addPostFrameCallback((_) { + _scrollController.jumpTo(_scrollController.position.maxScrollExtent); + }); + } + + @override + void dispose() { + super.dispose(); + _scrollController.dispose(); + _messageController.dispose(); + _messageFocus.dispose(); + } + + @override + Widget build(BuildContext context) { + return Drawer( + child: Column( + children: [ + Header( + leading: IconButton.outlined( + icon: const Icon(PhosphorIconsLight.x), + onPressed: () => Navigator.of(context).pop(), + ), + title: Text(AppLocalizations.of(context).chat), + ), + Flexible( + child: BlocConsumer( + listenWhen: (previous, current) => + previous.messages.length != current.messages.length, + listener: (context, state) { + _scheduleScroll(); + }, + builder: (context, state) { + final messages = state.messages; + return ListView.builder( + itemCount: messages.length, + controller: _scrollController, + itemBuilder: (context, index) { + final message = messages[index]; + return Card.filled( + color: message.author == state.id + ? Theme.of(context).colorScheme.primaryContainer + : null, + child: Padding( + padding: const EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + AppLocalizations.of( + context, + ).defaultPlayerName(message.author), + style: Theme.of(context).textTheme.bodyMedium, + ), + Text( + DateFormat.Hms( + Localizations.localeOf( + context, + ).languageCode, + ).format(message.timestamp), + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ), + Text(message.content), + ], + ), + ), + ); + }, + ); + }, + ), + ), + const SizedBox(height: 8), + Row( + children: [ + Flexible( + child: TextField( + controller: _messageController, + textAlignVertical: TextAlignVertical.center, + decoration: InputDecoration( + hintText: AppLocalizations.of(context).message, + filled: true, + suffixIcon: ListenableBuilder( + listenable: _messageController, + builder: (context, _) { + return IconButton( + icon: const Icon(PhosphorIconsLight.paperPlaneRight), + onPressed: _messageController.text.isEmpty + ? null + : _onSubmit, + ); + }, + ), + ), + focusNode: _messageFocus, + autofocus: true, + onSubmitted: (_) { + _onSubmit(); + _messageFocus.requestFocus(); + }, + ), + ), + ], + ), + ], + ), + ); + } + + void _onSubmit() { + final message = _messageController.text; + if (message.isNotEmpty) { + context.read().process(MessageRequest(message)); + _messageController.clear(); + } + } +} diff --git a/app/lib/pages/game/dialog.dart b/app/lib/pages/game/dialog.dart index 40182122..277c359f 100644 --- a/app/lib/pages/game/dialog.dart +++ b/app/lib/pages/game/dialog.dart @@ -1,307 +1,307 @@ -import 'dart:ui'; -import 'dart:typed_data'; - -import 'package:collection/collection.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:markdown_widget/markdown_widget.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:markdown/markdown.dart' as md; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GameDialogOverlay extends StatelessWidget { - const GameDialogOverlay({super.key}); - - @override - Widget build(BuildContext context) { - return BlocBuilder( - buildWhen: (previous, current) => - previous.world.dialogs.firstOrNull != - current.world.dialogs.firstOrNull || - previous.world.images != current.world.images, - builder: (context, state) { - final dialog = state.world.dialogs.firstOrNull; - if (dialog == null) { - return const SizedBox(); - } - final image = state.world.images[dialog.image]; - return _GameDialogContent(dialog: dialog, image: image); - }, - ); - } -} - -class _GameDialogContent extends StatefulWidget { - final GameDialog dialog; - final Uint8List? image; - - const _GameDialogContent({required this.dialog, this.image}); - - @override - State<_GameDialogContent> createState() => _GameDialogContentState(); -} - -class _GameDialogContentState extends State<_GameDialogContent> { - late GameDialogValue value; - - @override - void initState() { - super.initState(); - _initValue(); - } - - @override - void didUpdateWidget(covariant _GameDialogContent oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.dialog.id != widget.dialog.id) { - _initValue(); - } - } - - void _initValue() { - var newValue = GameDialogValue(); - for (var i = 0; i < widget.dialog.components.length; i++) { - final component = widget.dialog.components[i]; - if (component is GameDialogTextFieldComponent) { - newValue = newValue.copyWith.values.put( - component.idOrLabel, - GameDialogTextFieldValue(value: '', component: i), - ); - } else if (component is GameDialogCheckboxComponent) { - newValue = newValue.copyWith.values.put( - component.idOrLabel, - GameDialogCheckboxValue(value: component.initialValue, component: i), - ); - } else if (component is GameDialogDropdownComponent) { - newValue = newValue.copyWith.values.put( - component.idOrLabel, - GameDialogDropdownValue( - value: - component.initialValue ?? - component.options.firstOrNull?.value ?? - '', - component: i, - ), - ); - } - } - value = newValue; - } - - void updateValue(GameDialogValue newValue) { - setState(() { - value = newValue; - }); - } - - void submitValue([GameDialogValue? newValue]) { - context.read().process( - DialogCloseRequest(widget.dialog.id, newValue ?? value), - ); - } - - @override - Widget build(BuildContext context) { - final header = widget.image == null - ? null - : Image.memory(widget.image!, height: 200); - - final isMobile = MediaQuery.of(context).size.width < LeapBreakpoints.medium; - - return Stack( - children: [ - GestureDetector( - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), - child: Container(color: Colors.black.withValues(alpha: 0.5)), - ), - onTap: () { - submitValue(); - }, - ), - ResponsiveAlertDialog( - title: Text(widget.dialog.title), - leading: IconButton.outlined( - icon: const Icon(PhosphorIconsLight.x), - onPressed: () => submitValue(), - ), - constraints: BoxConstraints( - maxWidth: header == null - ? LeapBreakpoints.medium - : LeapBreakpoints.expanded, - ), - content: Row( - children: [ - if (!isMobile && header != null) Expanded(child: header), - Expanded( - child: ListView.separated( - shrinkWrap: true, - itemCount: widget.dialog.components.length + 1, - separatorBuilder: (context, index) => - const SizedBox(height: 12), - itemBuilder: (context, cIndex) { - if (cIndex == 0) { - return Column( - children: [ - if (isMobile && header != null) header, - Card.filled( - child: Padding( - padding: const EdgeInsets.all(12), - child: Row( - children: [ - Icon(PhosphorIconsLight.warning), - const SizedBox(width: 12), - Expanded( - child: Text( - AppLocalizations.of( - context, - ).thirdPartyContent, - style: Theme.of( - context, - ).textTheme.bodyMedium, - ), - ), - ], - ), - ), - ), - ], - ); - } - cIndex--; - final component = widget.dialog.components[cIndex]; - switch (component) { - case GameDialogMarkdownComponent(): - return MarkdownWidget( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - markdownGenerator: MarkdownGenerator( - extensionSet: md.ExtensionSet( - md.ExtensionSet.gitHubWeb.blockSyntaxes, - [ - md.EmojiSyntax(), - ...md.ExtensionSet.gitHubWeb.inlineSyntaxes, - ], - ), - ), - data: component.content, - ); - case GameDialogTextFieldComponent(): - final multiline = - component.multiline && !component.password; - final initialValue = value - .getValue(component.idOrLabel) - .getAsString(); - void updateComponent(String text) => updateValue( - value.copyWith.values.put( - component.idOrLabel, - GameDialogTextFieldValue( - value: text, - component: cIndex, - ), - ), - ); - return TextFormField( - decoration: InputDecoration( - labelText: component.label, - hintText: component.placeholder, - filled: !multiline, - border: multiline - ? const OutlineInputBorder() - : null, - ), - maxLines: multiline ? null : 1, - obscureText: component.password, - initialValue: initialValue, - onChanged: updateComponent, - ); - case GameDialogCheckboxComponent(): - final initialValue = value.hasValue(component.idOrLabel) - ? value.getValue(component.idOrLabel).getAsBool() - : component.initialValue; - void updateComponent(bool? val) => updateValue( - value.copyWith.values.put( - component.idOrLabel, - GameDialogCheckboxValue( - value: val ?? false, - component: cIndex, - ), - ), - ); - return CheckboxListTile( - title: Text(component.label), - value: initialValue, - onChanged: updateComponent, - ); - case GameDialogDropdownComponent(): - final initialValue = value.hasValue(component.idOrLabel) - ? value.getValue(component.idOrLabel).getAsString() - : component.initialValue ?? - component.options.firstOrNull?.value ?? - ''; - void updateComponent(String? val) => updateValue( - value.copyWith.values.put( - component.idOrLabel, - GameDialogDropdownValue( - value: val ?? '', - component: cIndex, - ), - ), - ); - return DropdownMenu( - label: Text(component.label), - expandedInsets: EdgeInsets.symmetric(vertical: 4), - initialSelection: initialValue.isEmpty - ? null - : initialValue, - dropdownMenuEntries: component.options - .map( - (e) => DropdownMenuEntry( - value: e.value, - label: e.idOrLabel, - ), - ) - .toList(), - onSelected: updateComponent, - ); - } - }, - ), - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - submitValue(); - }, - child: Text(AppLocalizations.of(context).cancel), - ), - ...(widget.dialog.actions?.mapIndexed((index, action) { - return ElevatedButton( - onPressed: () { - submitValue( - value.copyWith(buttonPressed: action.idOrLabel), - ); - }, - child: Text(action.label), - ); - }) ?? - [ - ElevatedButton( - onPressed: () { - submitValue(); - }, - child: Text(AppLocalizations.of(context).save), - ), - ]), - ], - ), - ], - ); - } -} +import 'dart:ui'; +import 'dart:typed_data'; + +import 'package:collection/collection.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:markdown_widget/markdown_widget.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:markdown/markdown.dart' as md; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GameDialogOverlay extends StatelessWidget { + const GameDialogOverlay({super.key}); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + buildWhen: (previous, current) => + previous.world.dialogs.firstOrNull != + current.world.dialogs.firstOrNull || + previous.world.images != current.world.images, + builder: (context, state) { + final dialog = state.world.dialogs.firstOrNull; + if (dialog == null) { + return const SizedBox(); + } + final image = state.world.images[dialog.image]; + return _GameDialogContent(dialog: dialog, image: image); + }, + ); + } +} + +class _GameDialogContent extends StatefulWidget { + final GameDialog dialog; + final Uint8List? image; + + const _GameDialogContent({required this.dialog, this.image}); + + @override + State<_GameDialogContent> createState() => _GameDialogContentState(); +} + +class _GameDialogContentState extends State<_GameDialogContent> { + late GameDialogValue value; + + @override + void initState() { + super.initState(); + _initValue(); + } + + @override + void didUpdateWidget(covariant _GameDialogContent oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.dialog.id != widget.dialog.id) { + _initValue(); + } + } + + void _initValue() { + var newValue = GameDialogValue(); + for (var i = 0; i < widget.dialog.components.length; i++) { + final component = widget.dialog.components[i]; + if (component is GameDialogTextFieldComponent) { + newValue = newValue.copyWith.values.put( + component.idOrLabel, + GameDialogTextFieldValue(value: '', component: i), + ); + } else if (component is GameDialogCheckboxComponent) { + newValue = newValue.copyWith.values.put( + component.idOrLabel, + GameDialogCheckboxValue(value: component.initialValue, component: i), + ); + } else if (component is GameDialogDropdownComponent) { + newValue = newValue.copyWith.values.put( + component.idOrLabel, + GameDialogDropdownValue( + value: + component.initialValue ?? + component.options.firstOrNull?.value ?? + '', + component: i, + ), + ); + } + } + value = newValue; + } + + void updateValue(GameDialogValue newValue) { + setState(() { + value = newValue; + }); + } + + void submitValue([GameDialogValue? newValue]) { + context.read().process( + DialogCloseRequest(widget.dialog.id, newValue ?? value), + ); + } + + @override + Widget build(BuildContext context) { + final header = widget.image == null + ? null + : Image.memory(widget.image!, height: 200); + + final isMobile = MediaQuery.of(context).size.width < LeapBreakpoints.medium; + + return Stack( + children: [ + GestureDetector( + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), + child: Container(color: Colors.black.withValues(alpha: 0.5)), + ), + onTap: () { + submitValue(); + }, + ), + ResponsiveAlertDialog( + title: Text(widget.dialog.title), + leading: IconButton.outlined( + icon: const Icon(PhosphorIconsLight.x), + onPressed: () => submitValue(), + ), + constraints: BoxConstraints( + maxWidth: header == null + ? LeapBreakpoints.medium + : LeapBreakpoints.expanded, + ), + content: Row( + children: [ + if (!isMobile && header != null) Expanded(child: header), + Expanded( + child: ListView.separated( + shrinkWrap: true, + itemCount: widget.dialog.components.length + 1, + separatorBuilder: (context, index) => + const SizedBox(height: 12), + itemBuilder: (context, cIndex) { + if (cIndex == 0) { + return Column( + children: [ + if (isMobile && header != null) header, + Card.filled( + child: Padding( + padding: const EdgeInsets.all(12), + child: Row( + children: [ + Icon(PhosphorIconsLight.warning), + const SizedBox(width: 12), + Expanded( + child: Text( + AppLocalizations.of( + context, + ).thirdPartyContent, + style: Theme.of( + context, + ).textTheme.bodyMedium, + ), + ), + ], + ), + ), + ), + ], + ); + } + cIndex--; + final component = widget.dialog.components[cIndex]; + switch (component) { + case GameDialogMarkdownComponent(): + return MarkdownWidget( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + markdownGenerator: MarkdownGenerator( + extensionSet: md.ExtensionSet( + md.ExtensionSet.gitHubWeb.blockSyntaxes, + [ + md.EmojiSyntax(), + ...md.ExtensionSet.gitHubWeb.inlineSyntaxes, + ], + ), + ), + data: component.content, + ); + case GameDialogTextFieldComponent(): + final multiline = + component.multiline && !component.password; + final initialValue = value + .getValue(component.idOrLabel) + .getAsString(); + void updateComponent(String text) => updateValue( + value.copyWith.values.put( + component.idOrLabel, + GameDialogTextFieldValue( + value: text, + component: cIndex, + ), + ), + ); + return TextFormField( + decoration: InputDecoration( + labelText: component.label, + hintText: component.placeholder, + filled: !multiline, + border: multiline + ? const OutlineInputBorder() + : null, + ), + maxLines: multiline ? null : 1, + obscureText: component.password, + initialValue: initialValue, + onChanged: updateComponent, + ); + case GameDialogCheckboxComponent(): + final initialValue = value.hasValue(component.idOrLabel) + ? value.getValue(component.idOrLabel).getAsBool() + : component.initialValue; + void updateComponent(bool? val) => updateValue( + value.copyWith.values.put( + component.idOrLabel, + GameDialogCheckboxValue( + value: val ?? false, + component: cIndex, + ), + ), + ); + return CheckboxListTile( + title: Text(component.label), + value: initialValue, + onChanged: updateComponent, + ); + case GameDialogDropdownComponent(): + final initialValue = value.hasValue(component.idOrLabel) + ? value.getValue(component.idOrLabel).getAsString() + : component.initialValue ?? + component.options.firstOrNull?.value ?? + ''; + void updateComponent(String? val) => updateValue( + value.copyWith.values.put( + component.idOrLabel, + GameDialogDropdownValue( + value: val ?? '', + component: cIndex, + ), + ), + ); + return DropdownMenu( + label: Text(component.label), + expandedInsets: EdgeInsets.symmetric(vertical: 4), + initialSelection: initialValue.isEmpty + ? null + : initialValue, + dropdownMenuEntries: component.options + .map( + (e) => DropdownMenuEntry( + value: e.value, + label: e.idOrLabel, + ), + ) + .toList(), + onSelected: updateComponent, + ); + } + }, + ), + ), + ], + ), + actions: [ + TextButton( + onPressed: () { + submitValue(); + }, + child: Text(AppLocalizations.of(context).cancel), + ), + ...(widget.dialog.actions?.mapIndexed((index, action) { + return ElevatedButton( + onPressed: () { + submitValue( + value.copyWith(buttonPressed: action.idOrLabel), + ); + }, + child: Text(action.label), + ); + }) ?? + [ + ElevatedButton( + onPressed: () { + submitValue(); + }, + child: Text(AppLocalizations.of(context).save), + ), + ]), + ], + ), + ], + ); + } +} diff --git a/app/lib/pages/game/filter.dart b/app/lib/pages/game/filter.dart index 2a030bd2..a3bbcdcb 100644 --- a/app/lib/pages/game/filter.dart +++ b/app/lib/pages/game/filter.dart @@ -1,73 +1,73 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/local.dart'; -import 'package:setonix/bloc/world/state.dart'; - -class GameFilterView extends StatefulWidget { - const GameFilterView({super.key}); - - @override - State createState() => _GameFilterViewState(); -} - -class _GameFilterViewState extends State { - final TextEditingController _searchController = TextEditingController(); - - @override - void initState() { - super.initState(); - _searchController.text = context.read().state.searchTerm; - } - - @override - Widget build(BuildContext context) { - return BlocBuilder( - buildWhen: (previous, current) => - previous.showHand != current.showHand || - previous.selectedCell != current.selectedCell || - previous.showDuplicates != current.showDuplicates, - builder: (context, state) { - if (!state.showHand || state.selectedCell != null) return SizedBox(); - return Align( - alignment: Alignment.topCenter, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: LeapBreakpoints.compact), - child: Card( - child: Padding( - padding: EdgeInsets.all(4), - child: Row( - children: [ - Expanded( - child: SearchBar( - leading: const Icon(PhosphorIconsLight.magnifyingGlass), - hintText: AppLocalizations.of(context).search, - autoFocus: true, - onChanged: (value) => context.read().add( - SearchTermChanged(value), - ), - ), - ), - const SizedBox(height: 8), - IconButton( - icon: const Icon(PhosphorIconsLight.stack), - selectedIcon: const Icon(PhosphorIconsFill.stack), - tooltip: AppLocalizations.of(context).showDuplicates, - isSelected: state.showDuplicates, - onPressed: () => context.read().add( - ShowDuplicatesChanged.toggle(), - ), - ), - ], - ), - ), - ), - ), - ); - }, - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/local.dart'; +import 'package:setonix/bloc/world/state.dart'; + +class GameFilterView extends StatefulWidget { + const GameFilterView({super.key}); + + @override + State createState() => _GameFilterViewState(); +} + +class _GameFilterViewState extends State { + final TextEditingController _searchController = TextEditingController(); + + @override + void initState() { + super.initState(); + _searchController.text = context.read().state.searchTerm; + } + + @override + Widget build(BuildContext context) { + return BlocBuilder( + buildWhen: (previous, current) => + previous.showHand != current.showHand || + previous.selectedCell != current.selectedCell || + previous.showDuplicates != current.showDuplicates, + builder: (context, state) { + if (!state.showHand || state.selectedCell != null) return SizedBox(); + return Align( + alignment: Alignment.topCenter, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: LeapBreakpoints.compact), + child: Card( + child: Padding( + padding: EdgeInsets.all(4), + child: Row( + children: [ + Expanded( + child: SearchBar( + leading: const Icon(PhosphorIconsLight.magnifyingGlass), + hintText: AppLocalizations.of(context).search, + autoFocus: true, + onChanged: (value) => context.read().add( + SearchTermChanged(value), + ), + ), + ), + const SizedBox(height: 8), + IconButton( + icon: const Icon(PhosphorIconsLight.stack), + selectedIcon: const Icon(PhosphorIconsFill.stack), + tooltip: AppLocalizations.of(context).showDuplicates, + isSelected: state.showDuplicates, + onPressed: () => context.read().add( + ShowDuplicatesChanged.toggle(), + ), + ), + ], + ), + ), + ), + ), + ); + }, + ); + } +} diff --git a/app/lib/pages/game/info.dart b/app/lib/pages/game/info.dart index 3a0aed82..be785a58 100644 --- a/app/lib/pages/game/info.dart +++ b/app/lib/pages/game/info.dart @@ -1,54 +1,54 @@ -import 'package:flutter/material.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class EditInfoDialog extends StatelessWidget { - final FileMetadata value; - const EditInfoDialog({super.key, required this.value}); - - @override - Widget build(BuildContext context) { - var info = value; - return ResponsiveAlertDialog( - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration( - filled: true, - labelText: AppLocalizations.of(context).name, - ), - onChanged: (value) => info = info.copyWith(name: value), - initialValue: info.name, - ), - const SizedBox(height: 8), - TextFormField( - decoration: InputDecoration( - border: const OutlineInputBorder(), - labelText: AppLocalizations.of(context).description, - ), - maxLines: 3, - onChanged: (value) => info = info.copyWith(description: value), - initialValue: info.description, - ), - ], - ), - title: Text(AppLocalizations.of(context).editInfo), - actions: [ - TextButton.icon( - label: Text(AppLocalizations.of(context).cancel), - icon: const Icon(PhosphorIconsLight.prohibit), - onPressed: () => Navigator.of(context).pop(), - ), - ElevatedButton.icon( - label: Text(AppLocalizations.of(context).edit), - icon: const Icon(PhosphorIconsLight.pencil), - onPressed: () => Navigator.of(context).pop(info), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class EditInfoDialog extends StatelessWidget { + final FileMetadata value; + const EditInfoDialog({super.key, required this.value}); + + @override + Widget build(BuildContext context) { + var info = value; + return ResponsiveAlertDialog( + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration( + filled: true, + labelText: AppLocalizations.of(context).name, + ), + onChanged: (value) => info = info.copyWith(name: value), + initialValue: info.name, + ), + const SizedBox(height: 8), + TextFormField( + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: AppLocalizations.of(context).description, + ), + maxLines: 3, + onChanged: (value) => info = info.copyWith(description: value), + initialValue: info.description, + ), + ], + ), + title: Text(AppLocalizations.of(context).editInfo), + actions: [ + TextButton.icon( + label: Text(AppLocalizations.of(context).cancel), + icon: const Icon(PhosphorIconsLight.prohibit), + onPressed: () => Navigator.of(context).pop(), + ), + ElevatedButton.icon( + label: Text(AppLocalizations.of(context).edit), + icon: const Icon(PhosphorIconsLight.pencil), + onPressed: () => Navigator.of(context).pop(info), + ), + ], + ); + } +} diff --git a/app/lib/pages/game/multiplayer/dialog.dart b/app/lib/pages/game/multiplayer/dialog.dart index bdbba428..40c44bab 100644 --- a/app/lib/pages/game/multiplayer/dialog.dart +++ b/app/lib/pages/game/multiplayer/dialog.dart @@ -1,34 +1,34 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lw_sysapi/lw_sysapi.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:networker/networker.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:barcode/barcode.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:setonix/api/open.dart'; -import 'package:setonix/bloc/multiplayer.dart'; -import 'package:setonix/bloc/settings.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:setonix_api/setonix_api.dart'; - -part 'start.dart'; -part 'view.dart'; - -class MultiplayerDialog extends StatelessWidget { - const MultiplayerDialog({super.key}); - - @override - Widget build(BuildContext context) { - return BlocBuilder( - builder: (context, state) { - if (state is MultiplayerConnectedState) { - return ViewMultiplayerDialog(state: state); - } else { - return StartMultiplayerDialog(); - } - }, - ); - } -} +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:lw_sysapi/lw_sysapi.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:networker/networker.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:barcode/barcode.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:setonix/api/open.dart'; +import 'package:setonix/bloc/multiplayer.dart'; +import 'package:setonix/bloc/settings.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:setonix_api/setonix_api.dart'; + +part 'start.dart'; +part 'view.dart'; + +class MultiplayerDialog extends StatelessWidget { + const MultiplayerDialog({super.key}); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + if (state is MultiplayerConnectedState) { + return ViewMultiplayerDialog(state: state); + } else { + return StartMultiplayerDialog(); + } + }, + ); + } +} diff --git a/app/lib/pages/game/multiplayer/start.dart b/app/lib/pages/game/multiplayer/start.dart index 9d2fb34e..0ec63564 100644 --- a/app/lib/pages/game/multiplayer/start.dart +++ b/app/lib/pages/game/multiplayer/start.dart @@ -1,149 +1,149 @@ -part of 'dialog.dart'; - -class StartMultiplayerDialog extends StatefulWidget { - const StartMultiplayerDialog({super.key}); - - @override - State createState() => _StartMultiplayerDialogState(); -} - -class _StartMultiplayerDialogState extends State - with TickerProviderStateMixin { - final GlobalKey _formKey = GlobalKey(); - late final SettingsCubit _settingsCubit; - late String _defaultSwamp; - late final TabController _tabController; - final TextEditingController _webSocketPortController = TextEditingController( - text: kDefaultPort.toString(), - ); - late final TextEditingController _swampAddressController; - - @override - void initState() { - super.initState(); - _tabController = TabController(length: 2, vsync: this); - _settingsCubit = context.read(); - _defaultSwamp = _settingsCubit.state.swamps.firstOrNull ?? ''; - _swampAddressController = TextEditingController(text: _defaultSwamp); - } - - void _start() { - if (kIsWeb) return; - final multiplayer = context.read(); - if (_tabController.index == 0) { - final swamp = _swampAddressController.text; - multiplayer.createSwamp(Uri.parse(swamp)); - if (swamp != _defaultSwamp) { - _settingsCubit.changeSwamp(swamp); - } - return; - } - multiplayer.createSocket(port: int.tryParse(_webSocketPortController.text)); - } - - @override - void dispose() { - super.dispose(); - _webSocketPortController.dispose(); - _swampAddressController.dispose(); - _tabController.dispose(); - } - - @override - Widget build(BuildContext context) { - return Form( - key: _formKey, - child: DefaultTabController( - length: 2, - child: ResponsiveAlertDialog( - title: Text(AppLocalizations.of(context).multiplayer), - leading: IconButton.outlined( - onPressed: () => Navigator.pop(context), - icon: Icon(PhosphorIconsLight.x), - tooltip: MaterialLocalizations.of(context).closeButtonTooltip, - ), - constraints: BoxConstraints(maxWidth: 400, maxHeight: 400), - content: Column( - children: [ - TabBar( - controller: _tabController, - tabs: [ - HorizontalTab( - label: const Text('Swamp'), - icon: Icon(PhosphorIconsLight.globe), - ), - HorizontalTab( - label: Text(AppLocalizations.of(context).webSocket), - icon: Icon(PhosphorIconsLight.wifiHigh), - ), - ], - ), - const SizedBox(height: 8), - Expanded( - child: TabBarView( - controller: _tabController, - children: [ - Column( - mainAxisSize: MainAxisSize.min, - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).address, - hintText: 'example.com', - filled: true, - ), - controller: _swampAddressController, - ), - ], - ), - kIsWeb - ? Text(AppLocalizations.of(context).webNotSupported) - : Column( - children: [ - TextFormField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).port, - hintText: kDefaultPort.toString(), - filled: true, - ), - controller: _webSocketPortController, - keyboardType: TextInputType.number, - validator: (value) { - if (value?.isEmpty ?? true) { - return LeapLocalizations.of( - context, - ).shouldNotEmpty; - } - final number = int.tryParse(value!); - if (number == null) { - return AppLocalizations.of( - context, - ).shouldANumber; - } - return null; - }, - ), - ], - ), - ], - ), - ), - ], - ), - actions: [ - ElevatedButton.icon( - onPressed: kIsWeb - ? null - : () { - if (!(_formKey.currentState?.validate() ?? false)) return; - _start(); - }, - icon: Icon(PhosphorIconsLight.play), - label: Text(AppLocalizations.of(context).start), - ), - ], - ), - ), - ); - } -} +part of 'dialog.dart'; + +class StartMultiplayerDialog extends StatefulWidget { + const StartMultiplayerDialog({super.key}); + + @override + State createState() => _StartMultiplayerDialogState(); +} + +class _StartMultiplayerDialogState extends State + with TickerProviderStateMixin { + final GlobalKey _formKey = GlobalKey(); + late final SettingsCubit _settingsCubit; + late String _defaultSwamp; + late final TabController _tabController; + final TextEditingController _webSocketPortController = TextEditingController( + text: kDefaultPort.toString(), + ); + late final TextEditingController _swampAddressController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + _settingsCubit = context.read(); + _defaultSwamp = _settingsCubit.state.swamps.firstOrNull ?? ''; + _swampAddressController = TextEditingController(text: _defaultSwamp); + } + + void _start() { + if (kIsWeb) return; + final multiplayer = context.read(); + if (_tabController.index == 0) { + final swamp = _swampAddressController.text; + multiplayer.createSwamp(Uri.parse(swamp)); + if (swamp != _defaultSwamp) { + _settingsCubit.changeSwamp(swamp); + } + return; + } + multiplayer.createSocket(port: int.tryParse(_webSocketPortController.text)); + } + + @override + void dispose() { + super.dispose(); + _webSocketPortController.dispose(); + _swampAddressController.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return Form( + key: _formKey, + child: DefaultTabController( + length: 2, + child: ResponsiveAlertDialog( + title: Text(AppLocalizations.of(context).multiplayer), + leading: IconButton.outlined( + onPressed: () => Navigator.pop(context), + icon: Icon(PhosphorIconsLight.x), + tooltip: MaterialLocalizations.of(context).closeButtonTooltip, + ), + constraints: BoxConstraints(maxWidth: 400, maxHeight: 400), + content: Column( + children: [ + TabBar( + controller: _tabController, + tabs: [ + HorizontalTab( + label: const Text('Swamp'), + icon: Icon(PhosphorIconsLight.globe), + ), + HorizontalTab( + label: Text(AppLocalizations.of(context).webSocket), + icon: Icon(PhosphorIconsLight.wifiHigh), + ), + ], + ), + const SizedBox(height: 8), + Expanded( + child: TabBarView( + controller: _tabController, + children: [ + Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).address, + hintText: 'example.com', + filled: true, + ), + controller: _swampAddressController, + ), + ], + ), + kIsWeb + ? Text(AppLocalizations.of(context).webNotSupported) + : Column( + children: [ + TextFormField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).port, + hintText: kDefaultPort.toString(), + filled: true, + ), + controller: _webSocketPortController, + keyboardType: TextInputType.number, + validator: (value) { + if (value?.isEmpty ?? true) { + return LeapLocalizations.of( + context, + ).shouldNotEmpty; + } + final number = int.tryParse(value!); + if (number == null) { + return AppLocalizations.of( + context, + ).shouldANumber; + } + return null; + }, + ), + ], + ), + ], + ), + ), + ], + ), + actions: [ + ElevatedButton.icon( + onPressed: kIsWeb + ? null + : () { + if (!(_formKey.currentState?.validate() ?? false)) return; + _start(); + }, + icon: Icon(PhosphorIconsLight.play), + label: Text(AppLocalizations.of(context).start), + ), + ], + ), + ), + ); + } +} diff --git a/app/lib/pages/game/multiplayer/view.dart b/app/lib/pages/game/multiplayer/view.dart index 3dcbef78..9f570062 100644 --- a/app/lib/pages/game/multiplayer/view.dart +++ b/app/lib/pages/game/multiplayer/view.dart @@ -1,141 +1,141 @@ -part of 'dialog.dart'; - -class ViewMultiplayerDialog extends StatelessWidget { - final MultiplayerConnectedState state; - - const ViewMultiplayerDialog({super.key, required this.state}); - - @override - Widget build(BuildContext context) { - final info = FutureBuilder( - future: Future.value(state.getShareAddress()), - builder: (context, snapshot) { - final address = snapshot.data?.toString() ?? '?'; - final connect = getConnectUri(address).toString(); - final qr = Barcode.qrCode(); - final svg = qr.toSvg(connect, width: 256, height: 256); - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - height: 208, - width: 208, - child: InkWell( - borderRadius: BorderRadius.circular(8), - radius: 12, - onTap: () { - exportFile( - context: context, - bytes: Uint8List.fromList(svg.codeUnits), - fileExtension: 'svg', - mimeType: 'image/svg', - uniformTypeIdentifier: 'public.svg-image', - share: true, - fileName: 'output', - label: AppLocalizations.of(context).export, - ); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(12), - child: Stack( - alignment: Alignment.center, - fit: StackFit.expand, - children: [ - ColoredBox(color: Colors.white), - Padding( - padding: const EdgeInsets.all(8), - child: SvgPicture.string(svg), - ), - ], - ), - ), - ), - ), - const SizedBox(height: 8), - ListTile( - title: Text(AppLocalizations.of(context).url), - subtitle: Text(address), - onTap: () => saveToClipboard(context, connect), - ), - ], - ); - }, - ); - final userList = StreamBuilder>( - stream: state.clientChange, - builder: (context, snapshot) { - final connections = snapshot.data ?? {}; - if (connections.isEmpty) { - return Text( - AppLocalizations.of(context).noConnections, - textAlign: TextAlign.center, - ); - } - return ListView.builder( - itemCount: connections.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, index) { - final channel = connections.elementAt(index); - final defaultName = AppLocalizations.of( - context, - ).defaultUserName(channel); - - return ListTile(title: Text(defaultName)); - }, - ); - }, - ); - final size = MediaQuery.sizeOf(context); - final isMobile = size.width < LeapBreakpoints.medium; - return ResponsiveAlertDialog( - title: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Text(AppLocalizations.of(context).multiplayer), - Text( - state.isServer - ? AppLocalizations.of(context).server - : AppLocalizations.of(context).client, - style: TextTheme.of(context).labelLarge, - ), - ], - ), - leading: IconButton.outlined( - icon: const Icon(PhosphorIconsLight.x), - onPressed: () => Navigator.of(context).pop(), - tooltip: MaterialLocalizations.of(context).closeButtonTooltip, - ), - constraints: BoxConstraints( - maxWidth: LeapBreakpoints.medium, - maxHeight: 500, - ), - content: isMobile - ? ListView(children: [info, const Divider(), userList]) - : Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - child: Center(child: SingleChildScrollView(child: info)), - ), - const VerticalDivider(), - Expanded(child: SingleChildScrollView(child: userList)), - ], - ), - actions: [ - OutlinedButton( - child: Text(AppLocalizations.of(context).stop), - onPressed: () { - context.read().disconnect(); - }, - ), - TextButton( - child: Text(MaterialLocalizations.of(context).closeButtonLabel), - onPressed: () => Navigator.of(context).pop(), - ), - ], - ); - } -} +part of 'dialog.dart'; + +class ViewMultiplayerDialog extends StatelessWidget { + final MultiplayerConnectedState state; + + const ViewMultiplayerDialog({super.key, required this.state}); + + @override + Widget build(BuildContext context) { + final info = FutureBuilder( + future: Future.value(state.getShareAddress()), + builder: (context, snapshot) { + final address = snapshot.data?.toString() ?? '?'; + final connect = getConnectUri(address).toString(); + final qr = Barcode.qrCode(); + final svg = qr.toSvg(connect, width: 256, height: 256); + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + height: 208, + width: 208, + child: InkWell( + borderRadius: BorderRadius.circular(8), + radius: 12, + onTap: () { + exportFile( + context: context, + bytes: Uint8List.fromList(svg.codeUnits), + fileExtension: 'svg', + mimeType: 'image/svg', + uniformTypeIdentifier: 'public.svg-image', + share: true, + fileName: 'output', + label: AppLocalizations.of(context).export, + ); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(12), + child: Stack( + alignment: Alignment.center, + fit: StackFit.expand, + children: [ + ColoredBox(color: Colors.white), + Padding( + padding: const EdgeInsets.all(8), + child: SvgPicture.string(svg), + ), + ], + ), + ), + ), + ), + const SizedBox(height: 8), + ListTile( + title: Text(AppLocalizations.of(context).url), + subtitle: Text(address), + onTap: () => saveToClipboard(context, connect), + ), + ], + ); + }, + ); + final userList = StreamBuilder>( + stream: state.clientChange, + builder: (context, snapshot) { + final connections = snapshot.data ?? {}; + if (connections.isEmpty) { + return Text( + AppLocalizations.of(context).noConnections, + textAlign: TextAlign.center, + ); + } + return ListView.builder( + itemCount: connections.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + final channel = connections.elementAt(index); + final defaultName = AppLocalizations.of( + context, + ).defaultUserName(channel); + + return ListTile(title: Text(defaultName)); + }, + ); + }, + ); + final size = MediaQuery.sizeOf(context); + final isMobile = size.width < LeapBreakpoints.medium; + return ResponsiveAlertDialog( + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text(AppLocalizations.of(context).multiplayer), + Text( + state.isServer + ? AppLocalizations.of(context).server + : AppLocalizations.of(context).client, + style: TextTheme.of(context).labelLarge, + ), + ], + ), + leading: IconButton.outlined( + icon: const Icon(PhosphorIconsLight.x), + onPressed: () => Navigator.of(context).pop(), + tooltip: MaterialLocalizations.of(context).closeButtonTooltip, + ), + constraints: BoxConstraints( + maxWidth: LeapBreakpoints.medium, + maxHeight: 500, + ), + content: isMobile + ? ListView(children: [info, const Divider(), userList]) + : Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + child: Center(child: SingleChildScrollView(child: info)), + ), + const VerticalDivider(), + Expanded(child: SingleChildScrollView(child: userList)), + ], + ), + actions: [ + OutlinedButton( + child: Text(AppLocalizations.of(context).stop), + onPressed: () { + context.read().disconnect(); + }, + ), + TextButton( + child: Text(MaterialLocalizations.of(context).closeButtonLabel), + onPressed: () => Navigator.of(context).pop(), + ), + ], + ); + } +} diff --git a/app/lib/pages/game/note.dart b/app/lib/pages/game/note.dart index 7227df3a..21d092ea 100644 --- a/app/lib/pages/game/note.dart +++ b/app/lib/pages/game/note.dart @@ -1,138 +1,138 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:markdown_widget/markdown_widget.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:markdown/markdown.dart' as md; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GameNoteDialog extends StatefulWidget { - final String? note; - - const GameNoteDialog({super.key, this.note}); - - @override - State createState() => _GameNoteDialogState(); -} - -class _GameNoteDialogState extends State { - late final WorldBloc _bloc; - bool _editing = true, _expanded = false; - final TextEditingController _nameController = TextEditingController(), - _contentController = TextEditingController(); - - @override - void initState() { - super.initState(); - _bloc = context.read(); - final note = widget.note; - if (note != null) { - _editing = false; - _nameController.text = note; - _contentController.text = _bloc.state.data.getNote(note) ?? ''; - } - } - - @override - void dispose() { - super.dispose(); - _nameController.dispose(); - _contentController.dispose(); - } - - @override - Widget build(BuildContext context) { - final size = MediaQuery.sizeOf(context); - return ResponsiveAlertDialog( - title: widget.note == null - ? TextFormField( - controller: _nameController, - autofocus: true, - style: Theme.of(context).textTheme.headlineSmall, - decoration: InputDecoration( - hintText: AppLocalizations.of(context).name, - filled: true, - ), - ) - : Text(widget.note!), - headerActions: [ - IconButton( - icon: const Icon(PhosphorIconsLight.pencil), - tooltip: _editing - ? AppLocalizations.of(context).enterEditMode - : AppLocalizations.of(context).exitEditMode, - isSelected: _editing, - selectedIcon: const Icon(PhosphorIconsLight.monitor), - onPressed: () { - setState(() { - _editing = !_editing; - }); - }, - ), - if (size.width > LeapBreakpoints.expanded) - IconButton( - icon: _expanded - ? const Icon(PhosphorIconsLight.arrowsInSimple) - : const Icon(PhosphorIconsLight.arrowsOutSimple), - tooltip: _expanded - ? AppLocalizations.of(context).collapse - : AppLocalizations.of(context).expand, - onPressed: () => setState(() => _expanded = !_expanded), - ), - ], - actions: [ - TextButton.icon( - icon: const Icon(PhosphorIconsLight.prohibit), - label: Text(AppLocalizations.of(context).cancel), - onPressed: () => Navigator.of(context).pop(), - ), - ElevatedButton.icon( - icon: const Icon(PhosphorIconsLight.floppyDisk), - label: Text(AppLocalizations.of(context).save), - onPressed: () { - _bloc.process( - NoteChanged(_nameController.text, _contentController.text), - ); - Navigator.of(context).pop(); - }, - ), - ], - constraints: BoxConstraints( - maxWidth: _expanded ? LeapBreakpoints.large : LeapBreakpoints.medium, - maxHeight: 1000, - ), - content: _editing - ? TextFormField( - minLines: _expanded ? 15 : 6, - maxLines: 50, - autofocus: widget.note != null, - controller: _contentController, - decoration: InputDecoration( - hintText: AppLocalizations.of(context).content, - border: const OutlineInputBorder(), - ), - ) - : ListenableBuilder( - listenable: _contentController, - builder: (context, _) => ConstrainedBox( - constraints: BoxConstraints(minHeight: _expanded ? 400 : 200), - child: MarkdownWidget( - markdownGenerator: MarkdownGenerator( - extensionSet: md.ExtensionSet( - md.ExtensionSet.gitHubWeb.blockSyntaxes, - [ - md.EmojiSyntax(), - ...md.ExtensionSet.gitHubWeb.inlineSyntaxes, - ], - ), - ), - shrinkWrap: true, - data: _contentController.text, - ), - ), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:markdown_widget/markdown_widget.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:markdown/markdown.dart' as md; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GameNoteDialog extends StatefulWidget { + final String? note; + + const GameNoteDialog({super.key, this.note}); + + @override + State createState() => _GameNoteDialogState(); +} + +class _GameNoteDialogState extends State { + late final WorldBloc _bloc; + bool _editing = true, _expanded = false; + final TextEditingController _nameController = TextEditingController(), + _contentController = TextEditingController(); + + @override + void initState() { + super.initState(); + _bloc = context.read(); + final note = widget.note; + if (note != null) { + _editing = false; + _nameController.text = note; + _contentController.text = _bloc.state.data.getNote(note) ?? ''; + } + } + + @override + void dispose() { + super.dispose(); + _nameController.dispose(); + _contentController.dispose(); + } + + @override + Widget build(BuildContext context) { + final size = MediaQuery.sizeOf(context); + return ResponsiveAlertDialog( + title: widget.note == null + ? TextFormField( + controller: _nameController, + autofocus: true, + style: Theme.of(context).textTheme.headlineSmall, + decoration: InputDecoration( + hintText: AppLocalizations.of(context).name, + filled: true, + ), + ) + : Text(widget.note!), + headerActions: [ + IconButton( + icon: const Icon(PhosphorIconsLight.pencil), + tooltip: _editing + ? AppLocalizations.of(context).enterEditMode + : AppLocalizations.of(context).exitEditMode, + isSelected: _editing, + selectedIcon: const Icon(PhosphorIconsLight.monitor), + onPressed: () { + setState(() { + _editing = !_editing; + }); + }, + ), + if (size.width > LeapBreakpoints.expanded) + IconButton( + icon: _expanded + ? const Icon(PhosphorIconsLight.arrowsInSimple) + : const Icon(PhosphorIconsLight.arrowsOutSimple), + tooltip: _expanded + ? AppLocalizations.of(context).collapse + : AppLocalizations.of(context).expand, + onPressed: () => setState(() => _expanded = !_expanded), + ), + ], + actions: [ + TextButton.icon( + icon: const Icon(PhosphorIconsLight.prohibit), + label: Text(AppLocalizations.of(context).cancel), + onPressed: () => Navigator.of(context).pop(), + ), + ElevatedButton.icon( + icon: const Icon(PhosphorIconsLight.floppyDisk), + label: Text(AppLocalizations.of(context).save), + onPressed: () { + _bloc.process( + NoteChanged(_nameController.text, _contentController.text), + ); + Navigator.of(context).pop(); + }, + ), + ], + constraints: BoxConstraints( + maxWidth: _expanded ? LeapBreakpoints.large : LeapBreakpoints.medium, + maxHeight: 1000, + ), + content: _editing + ? TextFormField( + minLines: _expanded ? 15 : 6, + maxLines: 50, + autofocus: widget.note != null, + controller: _contentController, + decoration: InputDecoration( + hintText: AppLocalizations.of(context).content, + border: const OutlineInputBorder(), + ), + ) + : ListenableBuilder( + listenable: _contentController, + builder: (context, _) => ConstrainedBox( + constraints: BoxConstraints(minHeight: _expanded ? 400 : 200), + child: MarkdownWidget( + markdownGenerator: MarkdownGenerator( + extensionSet: md.ExtensionSet( + md.ExtensionSet.gitHubWeb.blockSyntaxes, + [ + md.EmojiSyntax(), + ...md.ExtensionSet.gitHubWeb.inlineSyntaxes, + ], + ), + ), + shrinkWrap: true, + data: _contentController.text, + ), + ), + ), + ); + } +} diff --git a/app/lib/pages/game/notes.dart b/app/lib/pages/game/notes.dart index 5fc857a6..980addee 100644 --- a/app/lib/pages/game/notes.dart +++ b/app/lib/pages/game/notes.dart @@ -1,128 +1,128 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/pages/game/note.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class GameNotesDrawer extends StatefulWidget { - const GameNotesDrawer({super.key}); - - @override - State createState() => _GameNotesDrawerState(); -} - -class _GameNotesDrawerState extends State { - @override - void initState() { - super.initState(); - } - - @override - void dispose() { - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Drawer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Header( - leading: IconButton.outlined( - icon: const Icon(PhosphorIconsLight.x), - onPressed: () => Navigator.of(context).pop(), - ), - title: Text(AppLocalizations.of(context).notes), - ), - Flexible( - child: BlocBuilder( - buildWhen: (previous, current) => previous.data != current.data, - builder: (context, state) { - final notes = state.data.getNotes().toList(); - return ListView.builder( - itemCount: notes.length, - itemBuilder: (context, index) { - final note = notes[index]; - return ListTile( - title: Text(note), - onTap: () { - final bloc = context.read(); - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: bloc, - child: GameNoteDialog(note: note), - ), - ); - }, - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.trash), - onPressed: () async { - final bloc = context.read(); - final result = await showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text( - AppLocalizations.of(context).deleteNote, - ), - content: Text( - AppLocalizations.of( - context, - ).deleteNoteMessage(note), - ), - actions: [ - TextButton( - onPressed: () => - Navigator.of(context).pop(false), - child: Text( - AppLocalizations.of(context).cancel, - ), - ), - TextButton( - onPressed: () => - Navigator.of(context).pop(true), - child: Text( - AppLocalizations.of(context).delete, - ), - ), - ], - ), - ); - if (!(result ?? false)) return; - bloc.process(NoteRemoved(note)); - }, - ), - ); - }, - ); - }, - ), - ), - const SizedBox(height: 8), - SizedBox( - height: 48, - child: ElevatedButton.icon( - icon: const Icon(PhosphorIconsLight.plus), - label: Text(LeapLocalizations.of(context).create), - onPressed: () { - final bloc = context.read(); - showDialog( - context: context, - builder: (context) => BlocProvider.value( - value: bloc, - child: const GameNoteDialog(), - ), - ); - }, - ), - ), - ], - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/pages/game/note.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class GameNotesDrawer extends StatefulWidget { + const GameNotesDrawer({super.key}); + + @override + State createState() => _GameNotesDrawerState(); +} + +class _GameNotesDrawerState extends State { + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Drawer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Header( + leading: IconButton.outlined( + icon: const Icon(PhosphorIconsLight.x), + onPressed: () => Navigator.of(context).pop(), + ), + title: Text(AppLocalizations.of(context).notes), + ), + Flexible( + child: BlocBuilder( + buildWhen: (previous, current) => previous.data != current.data, + builder: (context, state) { + final notes = state.data.getNotes().toList(); + return ListView.builder( + itemCount: notes.length, + itemBuilder: (context, index) { + final note = notes[index]; + return ListTile( + title: Text(note), + onTap: () { + final bloc = context.read(); + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: bloc, + child: GameNoteDialog(note: note), + ), + ); + }, + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.trash), + onPressed: () async { + final bloc = context.read(); + final result = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + AppLocalizations.of(context).deleteNote, + ), + content: Text( + AppLocalizations.of( + context, + ).deleteNoteMessage(note), + ), + actions: [ + TextButton( + onPressed: () => + Navigator.of(context).pop(false), + child: Text( + AppLocalizations.of(context).cancel, + ), + ), + TextButton( + onPressed: () => + Navigator.of(context).pop(true), + child: Text( + AppLocalizations.of(context).delete, + ), + ), + ], + ), + ); + if (!(result ?? false)) return; + bloc.process(NoteRemoved(note)); + }, + ), + ); + }, + ); + }, + ), + ), + const SizedBox(height: 8), + SizedBox( + height: 48, + child: ElevatedButton.icon( + icon: const Icon(PhosphorIconsLight.plus), + label: Text(LeapLocalizations.of(context).create), + onPressed: () { + final bloc = context.read(); + showDialog( + context: context, + builder: (context) => BlocProvider.value( + value: bloc, + child: const GameNoteDialog(), + ), + ); + }, + ), + ), + ], + ), + ); + } +} diff --git a/app/lib/pages/game/team.dart b/app/lib/pages/game/team.dart index eec07264..7b1fc9f6 100644 --- a/app/lib/pages/game/team.dart +++ b/app/lib/pages/game/team.dart @@ -1,140 +1,140 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/bloc/world/state.dart'; -import 'package:setonix/helpers/visualizer.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class TeamDialog extends StatefulWidget { - final String? team; - final GameTeam? data; - - const TeamDialog({super.key, this.team, this.data}); - - @override - State createState() => _TeamDialogState(); -} - -class _TeamDialogState extends State { - late final WorldBloc _bloc = context.read(); - final TextEditingController _nameController = TextEditingController(), - _descriptionController = TextEditingController(); - TeamColor? _color; - - @override - void initState() { - super.initState(); - _nameController.text = widget.team ?? ''; - final data = widget.data; - if (data != null) { - _descriptionController.text = data.description; - _color = data.color; - } - } - - @override - void dispose() { - _nameController.dispose(); - _descriptionController.dispose(); - super.dispose(); - } - - bool _isCreate() => widget.team == null; - - @override - Widget build(BuildContext context) { - return AlertDialog( - title: Text(AppLocalizations.of(context).addTeam), - scrollable: true, - content: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - TextField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).name, - filled: true, - ), - controller: _nameController, - ), - const SizedBox(height: 16), - TextField( - decoration: InputDecoration( - labelText: AppLocalizations.of(context).description, - border: const OutlineInputBorder(), - ), - controller: _descriptionController, - minLines: 3, - maxLines: 5, - ), - const SizedBox(height: 16), - Wrap( - children: TeamColor.values - .map( - (e) => ColorButton( - color: e.color, - size: 32, - selected: _color == e, - onTap: () => - setState(() => _color = _color == e ? null : e), - ), - ) - .toList(), - ), - ], - ), - ), - actions: [ - TextButton.icon( - onPressed: () => Navigator.of(context).pop(), - icon: const Icon(PhosphorIconsLight.prohibit), - label: Text(AppLocalizations.of(context).cancel), - ), - BlocBuilder( - bloc: _bloc, - buildWhen: (previous, current) => - previous.info.teams != current.info.teams, - builder: (context, state) => ListenableBuilder( - listenable: _nameController, - builder: (context, child) { - final text = _nameController.text; - return ElevatedButton.icon( - onPressed: - text.isEmpty || - (state.info.teams.containsKey(text) && - text != widget.team) - ? null - : () { - final team = GameTeam( - description: _descriptionController.text, - color: _color, - ); - _bloc.process( - _isCreate() - ? TeamChanged(_nameController.text, team) - : TeamChanged.rename( - widget.team ?? _nameController.text, - _nameController.text, - team, - ), - ); - Navigator.of(context).pop(); - }, - icon: const Icon(PhosphorIconsLight.check), - label: Text( - _isCreate() - ? LeapLocalizations.of(context).create - : AppLocalizations.of(context).edit, - ), - ); - }, - ), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/bloc/world/state.dart'; +import 'package:setonix/helpers/visualizer.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class TeamDialog extends StatefulWidget { + final String? team; + final GameTeam? data; + + const TeamDialog({super.key, this.team, this.data}); + + @override + State createState() => _TeamDialogState(); +} + +class _TeamDialogState extends State { + late final WorldBloc _bloc = context.read(); + final TextEditingController _nameController = TextEditingController(), + _descriptionController = TextEditingController(); + TeamColor? _color; + + @override + void initState() { + super.initState(); + _nameController.text = widget.team ?? ''; + final data = widget.data; + if (data != null) { + _descriptionController.text = data.description; + _color = data.color; + } + } + + @override + void dispose() { + _nameController.dispose(); + _descriptionController.dispose(); + super.dispose(); + } + + bool _isCreate() => widget.team == null; + + @override + Widget build(BuildContext context) { + return AlertDialog( + title: Text(AppLocalizations.of(context).addTeam), + scrollable: true, + content: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).name, + filled: true, + ), + controller: _nameController, + ), + const SizedBox(height: 16), + TextField( + decoration: InputDecoration( + labelText: AppLocalizations.of(context).description, + border: const OutlineInputBorder(), + ), + controller: _descriptionController, + minLines: 3, + maxLines: 5, + ), + const SizedBox(height: 16), + Wrap( + children: TeamColor.values + .map( + (e) => ColorButton( + color: e.color, + size: 32, + selected: _color == e, + onTap: () => + setState(() => _color = _color == e ? null : e), + ), + ) + .toList(), + ), + ], + ), + ), + actions: [ + TextButton.icon( + onPressed: () => Navigator.of(context).pop(), + icon: const Icon(PhosphorIconsLight.prohibit), + label: Text(AppLocalizations.of(context).cancel), + ), + BlocBuilder( + bloc: _bloc, + buildWhen: (previous, current) => + previous.info.teams != current.info.teams, + builder: (context, state) => ListenableBuilder( + listenable: _nameController, + builder: (context, child) { + final text = _nameController.text; + return ElevatedButton.icon( + onPressed: + text.isEmpty || + (state.info.teams.containsKey(text) && + text != widget.team) + ? null + : () { + final team = GameTeam( + description: _descriptionController.text, + color: _color, + ); + _bloc.process( + _isCreate() + ? TeamChanged(_nameController.text, team) + : TeamChanged.rename( + widget.team ?? _nameController.text, + _nameController.text, + team, + ), + ); + Navigator.of(context).pop(); + }, + icon: const Icon(PhosphorIconsLight.check), + label: Text( + _isCreate() + ? LeapLocalizations.of(context).create + : AppLocalizations.of(context).edit, + ), + ); + }, + ), + ), + ], + ); + } +} diff --git a/app/lib/pages/game/waypoint.dart b/app/lib/pages/game/waypoint.dart index 6599d71d..9f05e477 100644 --- a/app/lib/pages/game/waypoint.dart +++ b/app/lib/pages/game/waypoint.dart @@ -1,78 +1,78 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:setonix/bloc/world/bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class WaypointDialog extends StatelessWidget { - final String? team; - final Waypoint? waypoint; - final GlobalVectorDefinition? position; - - const WaypointDialog({super.key, this.team, this.waypoint, this.position}); - - @override - Widget build(BuildContext context) { - final isCreated = position != null; - final loc = AppLocalizations.of(context); - var waypoint = - this.waypoint ?? - Waypoint( - name: '', - position: position ?? GlobalVectorDefinition('', 0, 0), - ); - var team = this.team; - final bloc = context.read(); - return ResponsiveAlertDialog( - title: Text(isCreated ? loc.addWaypoint : loc.editWaypoint), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: ListView( - shrinkWrap: true, - children: [ - TextFormField( - decoration: InputDecoration(labelText: loc.name, filled: true), - initialValue: waypoint.name, - onChanged: (value) { - waypoint = waypoint.copyWith(name: value); - }, - ), - const SizedBox(height: 8), - DropdownMenu( - expandedInsets: EdgeInsets.symmetric(horizontal: 0, vertical: 12), - dropdownMenuEntries: [ - DropdownMenuEntry(value: null, label: loc.public), - ...bloc.state.world.getTeams().map( - (e) => DropdownMenuEntry(value: e, label: e), - ), - ], - label: Text(loc.team), - initialSelection: team, - onSelected: (value) { - team = value; - }, - ), - ], - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: Text(loc.cancel), - ), - ElevatedButton( - onPressed: () { - bloc.add( - WaypointChanged( - waypoint: waypoint, - team: team, - name: this.waypoint?.name, - ), - ); - Navigator.of(context).pop(); - }, - child: Text(isCreated ? loc.add : loc.save), - ), - ], - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:setonix/bloc/world/bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class WaypointDialog extends StatelessWidget { + final String? team; + final Waypoint? waypoint; + final GlobalVectorDefinition? position; + + const WaypointDialog({super.key, this.team, this.waypoint, this.position}); + + @override + Widget build(BuildContext context) { + final isCreated = position != null; + final loc = AppLocalizations.of(context); + var waypoint = + this.waypoint ?? + Waypoint( + name: '', + position: position ?? GlobalVectorDefinition('', 0, 0), + ); + var team = this.team; + final bloc = context.read(); + return ResponsiveAlertDialog( + title: Text(isCreated ? loc.addWaypoint : loc.editWaypoint), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: ListView( + shrinkWrap: true, + children: [ + TextFormField( + decoration: InputDecoration(labelText: loc.name, filled: true), + initialValue: waypoint.name, + onChanged: (value) { + waypoint = waypoint.copyWith(name: value); + }, + ), + const SizedBox(height: 8), + DropdownMenu( + expandedInsets: EdgeInsets.symmetric(horizontal: 0, vertical: 12), + dropdownMenuEntries: [ + DropdownMenuEntry(value: null, label: loc.public), + ...bloc.state.world.getTeams().map( + (e) => DropdownMenuEntry(value: e, label: e), + ), + ], + label: Text(loc.team), + initialSelection: team, + onSelected: (value) { + team = value; + }, + ), + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(loc.cancel), + ), + ElevatedButton( + onPressed: () { + bloc.add( + WaypointChanged( + waypoint: waypoint, + team: team, + name: this.waypoint?.name, + ), + ); + Navigator.of(context).pop(); + }, + child: Text(isCreated ? loc.add : loc.save), + ), + ], + ); + } +} diff --git a/app/lib/pages/home/accounts.dart b/app/lib/pages/home/accounts.dart index fc5c7df3..09982fd2 100644 --- a/app/lib/pages/home/accounts.dart +++ b/app/lib/pages/home/accounts.dart @@ -1,175 +1,175 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lw_file_system/lw_file_system.dart'; -import 'package:setonix/api/open.dart'; -import 'package:setonix/api/save.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:setonix_api/setonix_api.dart'; - -class AccountsDialog extends StatefulWidget { - final bool inView; - const AccountsDialog({super.key, this.inView = false}); - - @override - State createState() => _AccountsDialogState(); -} - -class _AccountsDialogState extends State { - late final KeyFileSystem _privateKeyFileSystem, _publicKeyFileSystem; - Future>? _keysFuture; - late final SetonixFileSystem _fileSystem; - - @override - void initState() { - super.initState(); - _fileSystem = context.read(); - _privateKeyFileSystem = _fileSystem.privateKeySystem; - _publicKeyFileSystem = _fileSystem.publicKeySystem; - _buildKeysFuture(); - } - - void _buildKeysFuture() { - _keysFuture = _fileSystem.getAccounts(); - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text(AppLocalizations.of(context).accounts), - constraints: const BoxConstraints( - maxWidth: LeapBreakpoints.medium, - maxHeight: 500, - ), - leading: IconButton.outlined( - onPressed: () => Navigator.of(context).pop(), - icon: const PhosphorIcon(PhosphorIconsLight.x), - ), - headerActions: [ - IconButton( - icon: const PhosphorIcon(PhosphorIconsLight.arrowSquareIn), - tooltip: AppLocalizations.of(context).import, - onPressed: () async { - await importFile(context, _fileSystem); - setState(() { - _buildKeysFuture(); - }); - }, - ), - IconButton( - icon: const PhosphorIcon(PhosphorIconsLight.export), - tooltip: AppLocalizations.of(context).backupAllKeys, - onPressed: () async { - final data = await _fileSystem.exportAccounts(); - if (!context.mounted) return; - exportData(context, data, 'accounts'); - }, - ), - ], - content: Stack( - children: [ - FutureBuilder>( - future: _keysFuture, - builder: (context, state) { - if (state.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } - if (state.hasError) { - return Center( - child: Text( - AppLocalizations.of(context).error, - style: Theme.of(context).textTheme.bodyLarge, - ), - ); - } - final accounts = state.data ?? []; - if (accounts.isEmpty) { - return Center( - child: Text( - AppLocalizations.of(context).noAccount, - style: Theme.of(context).textTheme.bodyLarge, - ), - ); - } - return ListView.builder( - itemCount: accounts.length, - shrinkWrap: true, - itemBuilder: (context, index) { - final account = accounts[index]; - final key = account.name; - final fingerprint = account.getFingerprint( - pretty: true, - short: true, - ); - void deleteKey() { - _privateKeyFileSystem.deleteFile(key); - _publicKeyFileSystem.deleteFile(key); - setState(() { - accounts.removeAt(index); - }); - } - - return Dismissible( - key: Key(key), - child: ContextRegion( - builder: (context, button, controller) => ListTile( - title: Text(key.substring(1)), - subtitle: Text(fingerprint), - trailing: button, - onTap: () => - saveToClipboard(context, account.getFingerprint()), - ), - menuChildren: [ - MenuItemButton( - leadingIcon: const PhosphorIcon( - PhosphorIconsLight.export, - ), - onPressed: () async { - final data = await _fileSystem.exportAccounts([ - key, - ]); - if (!context.mounted) return; - exportData(context, data, key); - }, - child: Text(AppLocalizations.of(context).backupKey), - ), - MenuItemButton( - leadingIcon: const PhosphorIcon( - PhosphorIconsLight.trash, - ), - onPressed: deleteKey, - child: Text(AppLocalizations.of(context).delete), - ), - ], - ), - onDismissed: (direction) => deleteKey(), - ); - }, - ); - }, - ), - Align( - alignment: Alignment.bottomRight, - child: FloatingActionButton.extended( - onPressed: () async { - final name = await showDialog( - context: context, - builder: (context) => NameDialog(), - ); - if (name == null) return; - await _fileSystem.generateKey(name); - setState(() { - _buildKeysFuture(); - }); - }, - label: Text(AppLocalizations.of(context).add), - icon: const PhosphorIcon(PhosphorIconsLight.plus), - ), - ), - ], - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:lw_file_system/lw_file_system.dart'; +import 'package:setonix/api/open.dart'; +import 'package:setonix/api/save.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:setonix_api/setonix_api.dart'; + +class AccountsDialog extends StatefulWidget { + final bool inView; + const AccountsDialog({super.key, this.inView = false}); + + @override + State createState() => _AccountsDialogState(); +} + +class _AccountsDialogState extends State { + late final KeyFileSystem _privateKeyFileSystem, _publicKeyFileSystem; + Future>? _keysFuture; + late final SetonixFileSystem _fileSystem; + + @override + void initState() { + super.initState(); + _fileSystem = context.read(); + _privateKeyFileSystem = _fileSystem.privateKeySystem; + _publicKeyFileSystem = _fileSystem.publicKeySystem; + _buildKeysFuture(); + } + + void _buildKeysFuture() { + _keysFuture = _fileSystem.getAccounts(); + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text(AppLocalizations.of(context).accounts), + constraints: const BoxConstraints( + maxWidth: LeapBreakpoints.medium, + maxHeight: 500, + ), + leading: IconButton.outlined( + onPressed: () => Navigator.of(context).pop(), + icon: const PhosphorIcon(PhosphorIconsLight.x), + ), + headerActions: [ + IconButton( + icon: const PhosphorIcon(PhosphorIconsLight.arrowSquareIn), + tooltip: AppLocalizations.of(context).import, + onPressed: () async { + await importFile(context, _fileSystem); + setState(() { + _buildKeysFuture(); + }); + }, + ), + IconButton( + icon: const PhosphorIcon(PhosphorIconsLight.export), + tooltip: AppLocalizations.of(context).backupAllKeys, + onPressed: () async { + final data = await _fileSystem.exportAccounts(); + if (!context.mounted) return; + exportData(context, data, 'accounts'); + }, + ), + ], + content: Stack( + children: [ + FutureBuilder>( + future: _keysFuture, + builder: (context, state) { + if (state.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + if (state.hasError) { + return Center( + child: Text( + AppLocalizations.of(context).error, + style: Theme.of(context).textTheme.bodyLarge, + ), + ); + } + final accounts = state.data ?? []; + if (accounts.isEmpty) { + return Center( + child: Text( + AppLocalizations.of(context).noAccount, + style: Theme.of(context).textTheme.bodyLarge, + ), + ); + } + return ListView.builder( + itemCount: accounts.length, + shrinkWrap: true, + itemBuilder: (context, index) { + final account = accounts[index]; + final key = account.name; + final fingerprint = account.getFingerprint( + pretty: true, + short: true, + ); + void deleteKey() { + _privateKeyFileSystem.deleteFile(key); + _publicKeyFileSystem.deleteFile(key); + setState(() { + accounts.removeAt(index); + }); + } + + return Dismissible( + key: Key(key), + child: ContextRegion( + builder: (context, button, controller) => ListTile( + title: Text(key.substring(1)), + subtitle: Text(fingerprint), + trailing: button, + onTap: () => + saveToClipboard(context, account.getFingerprint()), + ), + menuChildren: [ + MenuItemButton( + leadingIcon: const PhosphorIcon( + PhosphorIconsLight.export, + ), + onPressed: () async { + final data = await _fileSystem.exportAccounts([ + key, + ]); + if (!context.mounted) return; + exportData(context, data, key); + }, + child: Text(AppLocalizations.of(context).backupKey), + ), + MenuItemButton( + leadingIcon: const PhosphorIcon( + PhosphorIconsLight.trash, + ), + onPressed: deleteKey, + child: Text(AppLocalizations.of(context).delete), + ), + ], + ), + onDismissed: (direction) => deleteKey(), + ); + }, + ); + }, + ), + Align( + alignment: Alignment.bottomRight, + child: FloatingActionButton.extended( + onPressed: () async { + final name = await showDialog( + context: context, + builder: (context) => NameDialog(), + ); + if (name == null) return; + await _fileSystem.generateKey(name); + setState(() { + _buildKeysFuture(); + }); + }, + label: Text(AppLocalizations.of(context).add), + icon: const PhosphorIcon(PhosphorIconsLight.plus), + ), + ), + ], + ), + ); + } +} diff --git a/app/lib/pages/home/background.dart b/app/lib/pages/home/background.dart index c37b2218..69c46719 100644 --- a/app/lib/pages/home/background.dart +++ b/app/lib/pages/home/background.dart @@ -1,120 +1,120 @@ -import 'package:flutter/material.dart'; - -class DotsBackground extends StatefulWidget { - final double spacing, size, offset; - const DotsBackground({ - super.key, - this.spacing = 48.0, - this.size = 2, - this.offset = 0, - }); - - @override - State createState() => _DotsBackgroundState(); -} - -class _DotsBackgroundState extends State - with TickerProviderStateMixin { - late final AnimationController _controller = AnimationController( - duration: const Duration(seconds: 7), - vsync: this, - )..repeat(reverse: true); - late final Tween _valueTween = Tween(begin: 0.05, end: 0.18); - @override - void didUpdateWidget(covariant DotsBackground oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.spacing != widget.spacing || - oldWidget.size != widget.size || - oldWidget.offset != widget.offset) { - setState(() {}); - } - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - return AnimatedBuilder( - animation: _controller, - builder: (context, child) => DecoratedBox( - decoration: BoxDecoration( - gradient: RadialGradient( - center: const Alignment(-0.85, -0.9), - radius: 1.2, - colors: [ - colorScheme.primaryContainer.withValues(alpha: 0.55), - colorScheme.surface.withValues(alpha: 0), - ], - ), - ), - child: DecoratedBox( - decoration: BoxDecoration( - gradient: RadialGradient( - center: const Alignment(1, 0.85), - radius: 1, - colors: [ - colorScheme.secondaryContainer.withValues(alpha: 0.48), - colorScheme.surface.withValues(alpha: 0), - ], - ), - ), - child: CustomPaint( - painter: DotsPainter( - spacing: widget.spacing, - size: widget.size, - color: colorScheme.onSurface, - offset: widget.offset, - value: _valueTween.evaluate(_controller), - ), - child: const SizedBox.expand(), - ), - ), - ), - ); - } -} - -class DotsPainter extends CustomPainter { - final Color color; - final double spacing, size, offset, value; - - const DotsPainter({ - this.spacing = 64.0, - this.size = 8, - this.offset = 0, - this.value = 0, - this.color = Colors.white, - }); - - @override - void paint(Canvas canvas, Size size) { - final paint = Paint() - ..color = color.withValues(alpha: value) - ..strokeWidth = 2 - ..style = PaintingStyle.fill; - - final realOffset = offset % spacing; - - for (var x = (size.width % spacing) / 2; x < size.width; x += spacing) { - for ( - var y = (size.height % spacing) / 2; - y < (size.height + realOffset); - y += spacing - ) { - canvas.drawCircle(Offset(x, y - realOffset), this.size, paint); - } - } - } - - @override - bool shouldRepaint(DotsPainter oldDelegate) => - spacing != oldDelegate.spacing || - size != oldDelegate.size || - offset != oldDelegate.offset || - value != oldDelegate.value; -} +import 'package:flutter/material.dart'; + +class DotsBackground extends StatefulWidget { + final double spacing, size, offset; + const DotsBackground({ + super.key, + this.spacing = 48.0, + this.size = 2, + this.offset = 0, + }); + + @override + State createState() => _DotsBackgroundState(); +} + +class _DotsBackgroundState extends State + with TickerProviderStateMixin { + late final AnimationController _controller = AnimationController( + duration: const Duration(seconds: 7), + vsync: this, + )..repeat(reverse: true); + late final Tween _valueTween = Tween(begin: 0.05, end: 0.18); + @override + void didUpdateWidget(covariant DotsBackground oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.spacing != widget.spacing || + oldWidget.size != widget.size || + oldWidget.offset != widget.offset) { + setState(() {}); + } + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final colorScheme = Theme.of(context).colorScheme; + return AnimatedBuilder( + animation: _controller, + builder: (context, child) => DecoratedBox( + decoration: BoxDecoration( + gradient: RadialGradient( + center: const Alignment(-0.85, -0.9), + radius: 1.2, + colors: [ + colorScheme.primaryContainer.withValues(alpha: 0.55), + colorScheme.surface.withValues(alpha: 0), + ], + ), + ), + child: DecoratedBox( + decoration: BoxDecoration( + gradient: RadialGradient( + center: const Alignment(1, 0.85), + radius: 1, + colors: [ + colorScheme.secondaryContainer.withValues(alpha: 0.48), + colorScheme.surface.withValues(alpha: 0), + ], + ), + ), + child: CustomPaint( + painter: DotsPainter( + spacing: widget.spacing, + size: widget.size, + color: colorScheme.onSurface, + offset: widget.offset, + value: _valueTween.evaluate(_controller), + ), + child: const SizedBox.expand(), + ), + ), + ), + ); + } +} + +class DotsPainter extends CustomPainter { + final Color color; + final double spacing, size, offset, value; + + const DotsPainter({ + this.spacing = 64.0, + this.size = 8, + this.offset = 0, + this.value = 0, + this.color = Colors.white, + }); + + @override + void paint(Canvas canvas, Size size) { + final paint = Paint() + ..color = color.withValues(alpha: value) + ..strokeWidth = 2 + ..style = PaintingStyle.fill; + + final realOffset = offset % spacing; + + for (var x = (size.width % spacing) / 2; x < size.width; x += spacing) { + for ( + var y = (size.height % spacing) / 2; + y < (size.height + realOffset); + y += spacing + ) { + canvas.drawCircle(Offset(x, y - realOffset), this.size, paint); + } + } + } + + @override + bool shouldRepaint(DotsPainter oldDelegate) => + spacing != oldDelegate.spacing || + size != oldDelegate.size || + offset != oldDelegate.offset || + value != oldDelegate.value; +} diff --git a/app/lib/pages/packs/editor.dart b/app/lib/pages/packs/editor.dart index af6591a2..ddedef45 100644 --- a/app/lib/pages/packs/editor.dart +++ b/app/lib/pages/packs/editor.dart @@ -1,227 +1,227 @@ -part of 'dialog.dart'; - -class _EditorPacksView extends StatefulWidget { - final VoidCallback onReload; - - const _EditorPacksView({required this.onReload}); - - @override - State<_EditorPacksView> createState() => _EditorPacksViewState(); -} - -class _EditorPacksViewState extends State<_EditorPacksView> { - late final SetonixFileSystem _fileSystem = context.read(); - Future>>? _packs; - - @override - void initState() { - super.initState(); - _packs = _fileSystem.editorSystem.getFiles(); - } - - void _reloadPacks() { - setState(() { - _packs = _fileSystem.editorSystem.getFiles(); - }); - } - - @override - Widget build(BuildContext context) { - return Stack( - children: [ - FutureBuilder>>( - future: _packs, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } - if (snapshot.hasError) { - return Center(child: Text(snapshot.error.toString())); - } - final files = snapshot.data ?? []; - if (files.isEmpty) { - return Center(child: Text(AppLocalizations.of(context).noData)); - } - return ListView.builder( - itemCount: files.length, - itemBuilder: (context, index) { - final file = files[index]; - final data = file.data!; - final metadata = data.getMetadataOrDefault(); - return ContextRegion( - builder: (context, widget, controller) { - return ListTile( - title: Text(metadata.name), - subtitle: Text(file.identifier), - onTap: () => GoRouter.of(context).goNamed( - 'editor', - pathParameters: {'name': file.pathWithoutLeadingSlash}, - ), - trailing: widget, - ); - }, - menuChildren: [ - MenuItemButton( - leadingIcon: const Icon(PhosphorIconsLight.download), - child: Text(AppLocalizations.of(context).install), - onPressed: () async { - await importFileData( - context, - _fileSystem, - SetonixFile(data.exportAsBytes()), - ); - widget.onReload(); - }, - ), - MenuItemButton( - leadingIcon: const Icon(PhosphorIconsLight.export), - child: Text(AppLocalizations.of(context).export), - onPressed: () async { - exportData(context, data, metadata.name); - }, - ), - MenuItemButton( - leadingIcon: const Icon(PhosphorIconsLight.trash), - child: Text(AppLocalizations.of(context).delete), - onPressed: () async { - final result = await showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text( - AppLocalizations.of(context).removePack, - ), - content: Text( - AppLocalizations.of( - context, - ).removePackMessage(file.identifier), - ), - actions: [ - TextButton( - onPressed: () => - Navigator.of(context).pop(false), - child: Text( - AppLocalizations.of(context).cancel, - ), - ), - TextButton( - onPressed: () => - Navigator.of(context).pop(true), - child: Text( - AppLocalizations.of(context).remove, - ), - ), - ], - ), - ); - if (!(result ?? false)) return; - await _fileSystem.editorSystem.deleteFile( - file.identifier, - ); - _reloadPacks(); - }, - ), - ], - ); - }, - ); - }, - ), - Align( - alignment: Alignment.bottomRight, - child: FloatingActionButton.extended( - onPressed: () => showLeapBottomSheet( - context: context, - titleBuilder: (context) => Text(AppLocalizations.of(context).add), - childrenBuilder: (ctx) => [ - ListTile( - title: Text(LeapLocalizations.of(ctx).create), - leading: const Icon(PhosphorIconsLight.plusCircle), - onTap: () async { - Navigator.of(ctx).pop(); - final name = await showDialog( - context: context, - builder: (context) => NameDialog(), - ); - if (name == null) return; - await _fileSystem.editorSystem.createFile( - name, - SetonixData.empty().setMetadata( - FileMetadata(name: name, type: SetonixFileType.pack), - ), - ); - _reloadPacks(); - }, - ), - ListTile( - title: Text(AppLocalizations.of(context).installed), - leading: const Icon(PhosphorIconsLight.download), - onTap: () async { - final packs = await _fileSystem.packSystem.getFiles(); - if (packs.isEmpty || !context.mounted) { - return; - } - Navigator.of(ctx).pop(); - showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text(AppLocalizations.of(context).import), - scrollable: true, - content: Column( - mainAxisSize: MainAxisSize.min, - children: packs.map((pack) { - final file = pack.data!; - final data = file.load(); - final metadata = data.getMetadataOrDefault(); - return ListTile( - title: Text(metadata.name), - subtitle: Text(pack.identifier), - onTap: () async { - Navigator.of(context).pop(); - await _fileSystem.editorSystem.createFile( - metadata.name, - data, - ); - _reloadPacks(); - }, - ); - }).toList(), - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(false), - child: Text(AppLocalizations.of(context).cancel), - ), - ], - ), - ); - }, - ), - ListTile( - title: Text(AppLocalizations.of(context).import), - leading: const Icon(PhosphorIconsLight.arrowSquareIn), - onTap: () async { - Navigator.of(ctx).pop(); - final result = await openFile(); - if (result == null) return; - final data = result.load(); - final metadata = data.getMetadataOrDefault(); - if (metadata.type != SetonixFileType.pack) { - return; - } - await _fileSystem.editorSystem.createFile( - metadata.name, - data, - ); - _reloadPacks(); - }, - ), - ], - ), - label: Text(AppLocalizations.of(context).add), - icon: const Icon(PhosphorIconsLight.plus), - ), - ), - ], - ); - } -} +part of 'dialog.dart'; + +class _EditorPacksView extends StatefulWidget { + final VoidCallback onReload; + + const _EditorPacksView({required this.onReload}); + + @override + State<_EditorPacksView> createState() => _EditorPacksViewState(); +} + +class _EditorPacksViewState extends State<_EditorPacksView> { + late final SetonixFileSystem _fileSystem = context.read(); + Future>>? _packs; + + @override + void initState() { + super.initState(); + _packs = _fileSystem.editorSystem.getFiles(); + } + + void _reloadPacks() { + setState(() { + _packs = _fileSystem.editorSystem.getFiles(); + }); + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + FutureBuilder>>( + future: _packs, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + if (snapshot.hasError) { + return Center(child: Text(snapshot.error.toString())); + } + final files = snapshot.data ?? []; + if (files.isEmpty) { + return Center(child: Text(AppLocalizations.of(context).noData)); + } + return ListView.builder( + itemCount: files.length, + itemBuilder: (context, index) { + final file = files[index]; + final data = file.data!; + final metadata = data.getMetadataOrDefault(); + return ContextRegion( + builder: (context, widget, controller) { + return ListTile( + title: Text(metadata.name), + subtitle: Text(file.identifier), + onTap: () => GoRouter.of(context).goNamed( + 'editor', + pathParameters: {'name': file.pathWithoutLeadingSlash}, + ), + trailing: widget, + ); + }, + menuChildren: [ + MenuItemButton( + leadingIcon: const Icon(PhosphorIconsLight.download), + child: Text(AppLocalizations.of(context).install), + onPressed: () async { + await importFileData( + context, + _fileSystem, + SetonixFile(data.exportAsBytes()), + ); + widget.onReload(); + }, + ), + MenuItemButton( + leadingIcon: const Icon(PhosphorIconsLight.export), + child: Text(AppLocalizations.of(context).export), + onPressed: () async { + exportData(context, data, metadata.name); + }, + ), + MenuItemButton( + leadingIcon: const Icon(PhosphorIconsLight.trash), + child: Text(AppLocalizations.of(context).delete), + onPressed: () async { + final result = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + AppLocalizations.of(context).removePack, + ), + content: Text( + AppLocalizations.of( + context, + ).removePackMessage(file.identifier), + ), + actions: [ + TextButton( + onPressed: () => + Navigator.of(context).pop(false), + child: Text( + AppLocalizations.of(context).cancel, + ), + ), + TextButton( + onPressed: () => + Navigator.of(context).pop(true), + child: Text( + AppLocalizations.of(context).remove, + ), + ), + ], + ), + ); + if (!(result ?? false)) return; + await _fileSystem.editorSystem.deleteFile( + file.identifier, + ); + _reloadPacks(); + }, + ), + ], + ); + }, + ); + }, + ), + Align( + alignment: Alignment.bottomRight, + child: FloatingActionButton.extended( + onPressed: () => showLeapBottomSheet( + context: context, + titleBuilder: (context) => Text(AppLocalizations.of(context).add), + childrenBuilder: (ctx) => [ + ListTile( + title: Text(LeapLocalizations.of(ctx).create), + leading: const Icon(PhosphorIconsLight.plusCircle), + onTap: () async { + Navigator.of(ctx).pop(); + final name = await showDialog( + context: context, + builder: (context) => NameDialog(), + ); + if (name == null) return; + await _fileSystem.editorSystem.createFile( + name, + SetonixData.empty().setMetadata( + FileMetadata(name: name, type: SetonixFileType.pack), + ), + ); + _reloadPacks(); + }, + ), + ListTile( + title: Text(AppLocalizations.of(context).installed), + leading: const Icon(PhosphorIconsLight.download), + onTap: () async { + final packs = await _fileSystem.packSystem.getFiles(); + if (packs.isEmpty || !context.mounted) { + return; + } + Navigator.of(ctx).pop(); + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text(AppLocalizations.of(context).import), + scrollable: true, + content: Column( + mainAxisSize: MainAxisSize.min, + children: packs.map((pack) { + final file = pack.data!; + final data = file.load(); + final metadata = data.getMetadataOrDefault(); + return ListTile( + title: Text(metadata.name), + subtitle: Text(pack.identifier), + onTap: () async { + Navigator.of(context).pop(); + await _fileSystem.editorSystem.createFile( + metadata.name, + data, + ); + _reloadPacks(); + }, + ); + }).toList(), + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(false), + child: Text(AppLocalizations.of(context).cancel), + ), + ], + ), + ); + }, + ), + ListTile( + title: Text(AppLocalizations.of(context).import), + leading: const Icon(PhosphorIconsLight.arrowSquareIn), + onTap: () async { + Navigator.of(ctx).pop(); + final result = await openFile(); + if (result == null) return; + final data = result.load(); + final metadata = data.getMetadataOrDefault(); + if (metadata.type != SetonixFileType.pack) { + return; + } + await _fileSystem.editorSystem.createFile( + metadata.name, + data, + ); + _reloadPacks(); + }, + ), + ], + ), + label: Text(AppLocalizations.of(context).add), + icon: const Icon(PhosphorIconsLight.plus), + ), + ), + ], + ); + } +} diff --git a/app/lib/pages/packs/installed.dart b/app/lib/pages/packs/installed.dart index 0e215ad5..44346eb2 100644 --- a/app/lib/pages/packs/installed.dart +++ b/app/lib/pages/packs/installed.dart @@ -1,199 +1,199 @@ -part of 'dialog.dart'; - -class _InstalledPacksView extends StatefulWidget { - final List<(SetonixFile, SetonixData, DataMetadata)> filtered; - final String? selected; - final SelectFunction onSelected; - final VoidCallback onReload, onUnselect; - final WorldBloc? bloc; - - const _InstalledPacksView({ - required this.filtered, - required this.onSelected, - required this.bloc, - this.selected, - required this.onReload, - required this.onUnselect, - }); - - @override - State<_InstalledPacksView> createState() => _InstalledPacksViewState(); -} - -class _InstalledPacksViewState extends State<_InstalledPacksView> { - late final SetonixFileSystem _fileSystem = context.read(); - - List _buildDetailsChildren( - String key, - SetonixFile pack, - FileMetadata metadata, - DataMetadata data, - ) { - final locale = Localizations.localeOf(context).languageCode; - final lastUsed = data.lastUsed(); - return [ - ListTile( - title: Text(key), - trailing: IconButton( - icon: const Icon(PhosphorIconsLight.copy), - tooltip: AppLocalizations.of(context).copy, - onPressed: () => saveToClipboard(context, key), - ), - ), - SizedBox( - height: 50, - child: Row( - children: [ - const SizedBox(width: 8), - Icon( - data.manuallyAdded - ? PhosphorIconsLight.plusSquare - : PhosphorIconsLight.robot, - ), - const SizedBox(width: 8), - Expanded( - child: Text( - data.manuallyAdded - ? AppLocalizations.of(context).manuallyAdded - : AppLocalizations.of(context).autoAdded, - ), - ), - if (!data.manuallyAdded) ...[ - const SizedBox(width: 8), - IconButton( - icon: const Icon(PhosphorIconsLight.plusSquare), - tooltip: AppLocalizations.of(context).addManually, - onPressed: () { - final newData = data.copyWith(manuallyAdded: true); - _fileSystem.dataInfoSystem.updateFile( - pack.identifier, - newData, - ); - widget.onUnselect(); - widget.onReload(); - }, - ), - ], - const SizedBox(width: 8), - ], - ), - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text(metadata.description), - ), - ListTile( - title: Text(AppLocalizations.of(context).size), - subtitle: Text(pack.data.lengthInBytes.toString()), - ), - const SizedBox(height: 8), - ListTile( - title: Text(AppLocalizations.of(context).author), - subtitle: Text(metadata.author), - ), - ListTile( - title: Text(AppLocalizations.of(context).version), - subtitle: Text(metadata.version), - ), - const Divider(), - ListTile( - title: Text(AppLocalizations.of(context).installed), - subtitle: Text( - '${DateFormat.yMd(locale).format(data.addedAt)} ${DateFormat.Hm(locale).format(data.addedAt)}', - ), - ), - if (!data.manuallyAdded) - ListTile( - title: Text(AppLocalizations.of(context).lastUsed), - subtitle: Text( - '${DateFormat.yMd(locale).format(lastUsed)} ${DateFormat.Hm(locale).format(lastUsed)}', - ), - ), - ]; - } - - List _buildActionsChildren( - SetonixData pack, { - VoidCallback? onRemove, - }) => [ - if (onRemove != null) ...[ - SizedBox( - height: 42, - child: FilledButton.tonalIcon( - onPressed: onRemove, - label: Text(AppLocalizations.of(context).remove), - icon: const Icon(PhosphorIconsLight.trash), - ), - ), - ], - ]; - - Future _removePack() async { - widget.onUnselect(); - final selected = widget.selected; - if (selected == null) return; - await _fileSystem.packSystem.deleteFile(selected); - widget.onReload(); - } - - bool _allowRemoving(String? id, bool? installed) => - id != kCorePackId && (installed ?? false); - - void _select( - String key, - SetonixFile file, - FileMetadata metadata, - DataMetadata data, - ) { - widget.onSelected( - Text(metadata.name), - _buildDetailsChildren(key, file, metadata, data), - _buildActionsChildren( - file.load(), - onRemove: _allowRemoving(key, true) ? _removePack : null, - ), - key, - ); - } - - @override - Widget build(BuildContext context) { - return ListView.builder( - itemCount: widget.filtered.length, - itemBuilder: (context, index) { - final pack = widget.filtered[index]; - final file = pack.$1; - final key = file.identifier; - final metadata = file.load().getMetadataOrDefault(); - return ListTile( - title: Text(metadata.name), - subtitle: Text(key), - selected: widget.selected == key, - onTap: () => _select(key, file, metadata, pack.$3), - leading: widget.bloc != null - ? BlocBuilder( - bloc: widget.bloc, - buildWhen: (previous, current) => - previous.info.packs != current.info.packs, - builder: (context, state) { - return IconButton.outlined( - icon: const Icon(PhosphorIconsLight.plus), - tooltip: AppLocalizations.of(context).addPack, - onPressed: state.info.packs.contains(key) - ? null - : () { - final packs = [ - ...widget.bloc!.state.info.packs, - key, - ]; - widget.bloc!.process(PacksChangeRequest(packs)); - }, - ); - }, - ) - : null, - ); - }, - ); - } -} +part of 'dialog.dart'; + +class _InstalledPacksView extends StatefulWidget { + final List<(SetonixFile, SetonixData, DataMetadata)> filtered; + final String? selected; + final SelectFunction onSelected; + final VoidCallback onReload, onUnselect; + final WorldBloc? bloc; + + const _InstalledPacksView({ + required this.filtered, + required this.onSelected, + required this.bloc, + this.selected, + required this.onReload, + required this.onUnselect, + }); + + @override + State<_InstalledPacksView> createState() => _InstalledPacksViewState(); +} + +class _InstalledPacksViewState extends State<_InstalledPacksView> { + late final SetonixFileSystem _fileSystem = context.read(); + + List _buildDetailsChildren( + String key, + SetonixFile pack, + FileMetadata metadata, + DataMetadata data, + ) { + final locale = Localizations.localeOf(context).languageCode; + final lastUsed = data.lastUsed(); + return [ + ListTile( + title: Text(key), + trailing: IconButton( + icon: const Icon(PhosphorIconsLight.copy), + tooltip: AppLocalizations.of(context).copy, + onPressed: () => saveToClipboard(context, key), + ), + ), + SizedBox( + height: 50, + child: Row( + children: [ + const SizedBox(width: 8), + Icon( + data.manuallyAdded + ? PhosphorIconsLight.plusSquare + : PhosphorIconsLight.robot, + ), + const SizedBox(width: 8), + Expanded( + child: Text( + data.manuallyAdded + ? AppLocalizations.of(context).manuallyAdded + : AppLocalizations.of(context).autoAdded, + ), + ), + if (!data.manuallyAdded) ...[ + const SizedBox(width: 8), + IconButton( + icon: const Icon(PhosphorIconsLight.plusSquare), + tooltip: AppLocalizations.of(context).addManually, + onPressed: () { + final newData = data.copyWith(manuallyAdded: true); + _fileSystem.dataInfoSystem.updateFile( + pack.identifier, + newData, + ); + widget.onUnselect(); + widget.onReload(); + }, + ), + ], + const SizedBox(width: 8), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text(metadata.description), + ), + ListTile( + title: Text(AppLocalizations.of(context).size), + subtitle: Text(pack.data.lengthInBytes.toString()), + ), + const SizedBox(height: 8), + ListTile( + title: Text(AppLocalizations.of(context).author), + subtitle: Text(metadata.author), + ), + ListTile( + title: Text(AppLocalizations.of(context).version), + subtitle: Text(metadata.version), + ), + const Divider(), + ListTile( + title: Text(AppLocalizations.of(context).installed), + subtitle: Text( + '${DateFormat.yMd(locale).format(data.addedAt)} ${DateFormat.Hm(locale).format(data.addedAt)}', + ), + ), + if (!data.manuallyAdded) + ListTile( + title: Text(AppLocalizations.of(context).lastUsed), + subtitle: Text( + '${DateFormat.yMd(locale).format(lastUsed)} ${DateFormat.Hm(locale).format(lastUsed)}', + ), + ), + ]; + } + + List _buildActionsChildren( + SetonixData pack, { + VoidCallback? onRemove, + }) => [ + if (onRemove != null) ...[ + SizedBox( + height: 42, + child: FilledButton.tonalIcon( + onPressed: onRemove, + label: Text(AppLocalizations.of(context).remove), + icon: const Icon(PhosphorIconsLight.trash), + ), + ), + ], + ]; + + Future _removePack() async { + widget.onUnselect(); + final selected = widget.selected; + if (selected == null) return; + await _fileSystem.packSystem.deleteFile(selected); + widget.onReload(); + } + + bool _allowRemoving(String? id, bool? installed) => + id != kCorePackId && (installed ?? false); + + void _select( + String key, + SetonixFile file, + FileMetadata metadata, + DataMetadata data, + ) { + widget.onSelected( + Text(metadata.name), + _buildDetailsChildren(key, file, metadata, data), + _buildActionsChildren( + file.load(), + onRemove: _allowRemoving(key, true) ? _removePack : null, + ), + key, + ); + } + + @override + Widget build(BuildContext context) { + return ListView.builder( + itemCount: widget.filtered.length, + itemBuilder: (context, index) { + final pack = widget.filtered[index]; + final file = pack.$1; + final key = file.identifier; + final metadata = file.load().getMetadataOrDefault(); + return ListTile( + title: Text(metadata.name), + subtitle: Text(key), + selected: widget.selected == key, + onTap: () => _select(key, file, metadata, pack.$3), + leading: widget.bloc != null + ? BlocBuilder( + bloc: widget.bloc, + buildWhen: (previous, current) => + previous.info.packs != current.info.packs, + builder: (context, state) { + return IconButton.outlined( + icon: const Icon(PhosphorIconsLight.plus), + tooltip: AppLocalizations.of(context).addPack, + onPressed: state.info.packs.contains(key) + ? null + : () { + final packs = [ + ...widget.bloc!.state.info.packs, + key, + ]; + widget.bloc!.process(PacksChangeRequest(packs)); + }, + ); + }, + ) + : null, + ); + }, + ); + } +} diff --git a/app/lib/pages/packs/world.dart b/app/lib/pages/packs/world.dart index 7318a708..394318ef 100644 --- a/app/lib/pages/packs/world.dart +++ b/app/lib/pages/packs/world.dart @@ -1,57 +1,57 @@ -part of 'dialog.dart'; - -class _WorldPacksView extends StatelessWidget { - final WorldBloc bloc; - final String query; - - const _WorldPacksView({required this.bloc, required this.query}); - - @override - Widget build(BuildContext context) { - return BlocBuilder( - bloc: bloc, - buildWhen: (previous, current) => - previous.info.packs != current.info.packs, - builder: (context, state) { - final loadedPacks = state.assetManager.packs.toList(); - final worldPacks = loadedPacks - .where((entry) => state.info.packs.contains(entry.key)) - .where( - (entry) => - entry.value.getMetadataOrDefault().name.contains(query), - ) - .toList(); - return ReorderableListView.builder( - itemCount: worldPacks.length, - itemBuilder: (context, index) { - final entry = worldPacks[index]; - final id = entry.key; - final data = entry.value; - final metadata = data.getMetadata(); - return ListTile( - key: ValueKey(id), - title: Text( - metadata?.name ?? AppLocalizations.of(context).unnamed, - ), - subtitle: Text(id), - leading: IconButton.outlined( - icon: const Icon(PhosphorIconsLight.minus), - tooltip: AppLocalizations.of(context).removePack, - onPressed: () { - final packs = List.from(state.info.packs)..remove(id); - bloc.process(PacksChangeRequest(packs)); - }, - ), - ); - }, - onReorderItem: (int oldIndex, int newIndex) { - final packs = List.from(state.info.packs); - final pack = packs.removeAt(oldIndex); - packs.insert(newIndex, pack); - bloc.process(PacksChangeRequest(packs)); - }, - ); - }, - ); - } -} +part of 'dialog.dart'; + +class _WorldPacksView extends StatelessWidget { + final WorldBloc bloc; + final String query; + + const _WorldPacksView({required this.bloc, required this.query}); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + bloc: bloc, + buildWhen: (previous, current) => + previous.info.packs != current.info.packs, + builder: (context, state) { + final loadedPacks = state.assetManager.packs.toList(); + final worldPacks = loadedPacks + .where((entry) => state.info.packs.contains(entry.key)) + .where( + (entry) => + entry.value.getMetadataOrDefault().name.contains(query), + ) + .toList(); + return ReorderableListView.builder( + itemCount: worldPacks.length, + itemBuilder: (context, index) { + final entry = worldPacks[index]; + final id = entry.key; + final data = entry.value; + final metadata = data.getMetadata(); + return ListTile( + key: ValueKey(id), + title: Text( + metadata?.name ?? AppLocalizations.of(context).unnamed, + ), + subtitle: Text(id), + leading: IconButton.outlined( + icon: const Icon(PhosphorIconsLight.minus), + tooltip: AppLocalizations.of(context).removePack, + onPressed: () { + final packs = List.from(state.info.packs)..remove(id); + bloc.process(PacksChangeRequest(packs)); + }, + ), + ); + }, + onReorderItem: (int oldIndex, int newIndex) { + final packs = List.from(state.info.packs); + final pack = packs.removeAt(oldIndex); + packs.insert(newIndex, pack); + bloc.process(PacksChangeRequest(packs)); + }, + ); + }, + ); + } +} diff --git a/app/lib/pages/settings/data.dart b/app/lib/pages/settings/data.dart index 53e194b0..bac0c226 100644 --- a/app/lib/pages/settings/data.dart +++ b/app/lib/pages/settings/data.dart @@ -1,136 +1,136 @@ -import 'package:archive/archive.dart'; -import 'package:file_picker/file_picker.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:lw_sysapi/lw_sysapi.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/services/file_system.dart'; -import 'package:setonix/theme.dart'; - -import '../../bloc/settings.dart'; - -class DataSettingsPage extends StatelessWidget { - final bool inView; - const DataSettingsPage({super.key, this.inView = false}); - - @override - Widget build(BuildContext context) { - final settingsCubit = context.read(); - Future changePath(String newPath) async { - final oldPath = settingsCubit.state.dataDirectory; - final worldSystem = context.read().worldSystem; - if (!(await worldSystem.moveAbsolute(oldPath, newPath))) { - return; - } - settingsCubit.changeDataDirectory(newPath); - } - - return Scaffold( - backgroundColor: inView ? Colors.transparent : null, - appBar: WindowTitleBar( - inView: inView, - backgroundColor: inView ? Colors.transparent : null, - title: Text(AppLocalizations.of(context).data), - ), - body: BlocBuilder( - builder: (context, state) { - return ListView( - children: [ - if (!kIsWeb) - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ListTile( - leading: const PhosphorIcon( - PhosphorIconsLight.folder, - ), - title: Text( - AppLocalizations.of(context).dataDirectory, - ), - subtitle: state.dataDirectory.isNotEmpty - ? Text(state.dataDirectory) - : Text(AppLocalizations.of(context).defaultPath), - trailing: state.dataDirectory.isNotEmpty - ? IconButton( - icon: const PhosphorIcon( - PhosphorIconsLight.clockClockwise, - ), - tooltip: AppLocalizations.of( - context, - ).defaultPath, - onPressed: () => changePath(''), - ) - : null, - onTap: () async { - try { - final selectedDir = - await FilePicker.getDirectoryPath(); - if (selectedDir != null) { - changePath(selectedDir); - } - } catch (e) { - if (context.mounted) { - showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text( - AppLocalizations.of(context).error, - ), - content: Text(e.toString()), - ), - ); - } - } - }, - ), - ListTile( - title: Text(AppLocalizations.of(context).export), - leading: const PhosphorIcon( - PhosphorIconsLight.export, - ), - onTap: () async { - final worldSystem = context - .read() - .worldSystem; - final archive = Archive(); - final keys = await worldSystem.getKeys(); - for (final key in keys) { - final entity = await worldSystem.fileSystem - .getFile(key); - if (entity == null) continue; - archive.addFile( - ArchiveFile('$key.stnx', entity.length, entity), - ); - } - final bytes = ZipEncoder().encodeBytes(archive); - if (context.mounted) { - exportFile( - context: context, - bytes: bytes, - fileExtension: 'zip', - mimeType: 'application/zip', - uniformTypeIdentifier: 'public.zip-archive', - fileName: 'output', - label: AppLocalizations.of(context).export, - ); - } - }, - ), - ], - ), - ), - ), - ], - ); - }, - ), - ); - } -} +import 'package:archive/archive.dart'; +import 'package:file_picker/file_picker.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:lw_sysapi/lw_sysapi.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/services/file_system.dart'; +import 'package:setonix/theme.dart'; + +import '../../bloc/settings.dart'; + +class DataSettingsPage extends StatelessWidget { + final bool inView; + const DataSettingsPage({super.key, this.inView = false}); + + @override + Widget build(BuildContext context) { + final settingsCubit = context.read(); + Future changePath(String newPath) async { + final oldPath = settingsCubit.state.dataDirectory; + final worldSystem = context.read().worldSystem; + if (!(await worldSystem.moveAbsolute(oldPath, newPath))) { + return; + } + settingsCubit.changeDataDirectory(newPath); + } + + return Scaffold( + backgroundColor: inView ? Colors.transparent : null, + appBar: WindowTitleBar( + inView: inView, + backgroundColor: inView ? Colors.transparent : null, + title: Text(AppLocalizations.of(context).data), + ), + body: BlocBuilder( + builder: (context, state) { + return ListView( + children: [ + if (!kIsWeb) + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ListTile( + leading: const PhosphorIcon( + PhosphorIconsLight.folder, + ), + title: Text( + AppLocalizations.of(context).dataDirectory, + ), + subtitle: state.dataDirectory.isNotEmpty + ? Text(state.dataDirectory) + : Text(AppLocalizations.of(context).defaultPath), + trailing: state.dataDirectory.isNotEmpty + ? IconButton( + icon: const PhosphorIcon( + PhosphorIconsLight.clockClockwise, + ), + tooltip: AppLocalizations.of( + context, + ).defaultPath, + onPressed: () => changePath(''), + ) + : null, + onTap: () async { + try { + final selectedDir = + await FilePicker.getDirectoryPath(); + if (selectedDir != null) { + changePath(selectedDir); + } + } catch (e) { + if (context.mounted) { + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + AppLocalizations.of(context).error, + ), + content: Text(e.toString()), + ), + ); + } + } + }, + ), + ListTile( + title: Text(AppLocalizations.of(context).export), + leading: const PhosphorIcon( + PhosphorIconsLight.export, + ), + onTap: () async { + final worldSystem = context + .read() + .worldSystem; + final archive = Archive(); + final keys = await worldSystem.getKeys(); + for (final key in keys) { + final entity = await worldSystem.fileSystem + .getFile(key); + if (entity == null) continue; + archive.addFile( + ArchiveFile('$key.stnx', entity.length, entity), + ); + } + final bytes = ZipEncoder().encodeBytes(archive); + if (context.mounted) { + exportFile( + context: context, + bytes: bytes, + fileExtension: 'zip', + mimeType: 'application/zip', + uniformTypeIdentifier: 'public.zip-archive', + fileName: 'output', + label: AppLocalizations.of(context).export, + ); + } + }, + ), + ], + ), + ), + ), + ], + ); + }, + ), + ); + } +} diff --git a/app/lib/pages/settings/general.dart b/app/lib/pages/settings/general.dart index d4bd82b1..5b8e0b9f 100644 --- a/app/lib/pages/settings/general.dart +++ b/app/lib/pages/settings/general.dart @@ -1,335 +1,335 @@ -import 'dart:convert'; - -import 'package:setonix/api/open.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/pages/settings/intro.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:setonix/bloc/settings.dart'; -import 'package:setonix/theme.dart'; -import 'package:url_launcher/url_launcher.dart'; -import 'package:http/http.dart' as http; - -@immutable -class Meta { - final String stableVersion, nightlyVersion, developVersion, mainVersion; - - const Meta({ - required this.stableVersion, - required this.nightlyVersion, - required this.developVersion, - required this.mainVersion, - }); - Meta.fromJson(Map json) - : stableVersion = json['version']?['stable'] ?? '?', - nightlyVersion = json['version']?['nightly'] ?? '?', - developVersion = json['version']?['develop'] ?? '?', - mainVersion = json['version']?['main'] ?? '?'; -} - -class GeneralSettingsPage extends StatefulWidget { - final bool inView; - const GeneralSettingsPage({super.key, this.inView = false}); - - @override - State createState() => _GeneralSettingsPageState(); -} - -class _GeneralSettingsPageState extends State { - Future? _metaFuture; - - void loadMeta() => setState(() { - _metaFuture = _fetchMeta(); - }); - - Future _fetchMeta() async { - final response = await http.get( - Uri.parse('https://setonix.linwood.dev/meta.json'), - ); - return Meta.fromJson({...json.decode(response.body)}); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: widget.inView ? Colors.transparent : null, - appBar: WindowTitleBar( - title: Text(AppLocalizations.of(context).general), - backgroundColor: widget.inView ? Colors.transparent : null, - inView: widget.inView, - ), - body: FutureBuilder( - future: PackageInfo.fromPlatform(), - builder: (context, snapshot) { - final currentVersion = snapshot.data?.version ?? '?'; - return ListView( - children: [ - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Padding( - padding: settingsCardTitlePadding, - child: Text( - AppLocalizations.of(context).update, - style: Theme.of(context).textTheme.headlineSmall, - ), - ), - const SizedBox(height: 16), - ListTile( - title: Text( - AppLocalizations.of(context).currentVersion, - ), - subtitle: Text(currentVersion), - onTap: () => saveToClipboard(context, currentVersion), - ), - if (!kIsWeb) - FutureBuilder( - future: _metaFuture, - builder: (context, snapshot) { - if (snapshot.hasError) { - return Text('Error: ${snapshot.error}'); - } - if (snapshot.connectionState == - ConnectionState.waiting) { - return const Center( - child: CircularProgressIndicator(), - ); - } - if (!snapshot.hasData) { - return ListTile( - title: Text( - AppLocalizations.of(context).checkForUpdates, - ), - subtitle: Text( - AppLocalizations.of( - context, - ).checkForUpdatesWarning, - ), - onTap: loadMeta, - ); - } - final meta = snapshot.data!; - final stableVersion = meta.stableVersion; - final nightlyVersion = meta.nightlyVersion; - final developVersion = meta.developVersion; - final mainVersion = meta.mainVersion; - final isStable = currentVersion == stableVersion; - final isNightly = currentVersion == nightlyVersion; - final isDevelop = currentVersion == developVersion; - final isMain = currentVersion == mainVersion; - final isError = - meta.nightlyVersion == '?' || - meta.stableVersion == '?'; - final isUpdateAvailable = - !isError && - !isStable && - !isNightly && - !isDevelop && - !isMain; - return Column( - children: [ - ListTile( - title: Text( - AppLocalizations.of(context).stable, - ), - subtitle: Text(stableVersion), - onTap: () => - saveToClipboard(context, stableVersion), - ), - ListTile( - title: Text( - AppLocalizations.of(context).nightly, - ), - subtitle: Text(nightlyVersion), - onTap: () => - saveToClipboard(context, nightlyVersion), - ), - const Divider(), - if (isStable) ...[ - ListTile( - title: Text( - AppLocalizations.of( - context, - ).usingLatestStable, - ), - ), - ] else if (isNightly || - isDevelop || - isMain) ...[ - ListTile( - title: Text( - AppLocalizations.of( - context, - ).usingLatestNightly, - ), - ), - ] else if (isError) ...[ - ListTile( - title: Text( - AppLocalizations.of(context).error, - ), - ), - ] else if (isUpdateAvailable) - ListTile( - title: Text( - AppLocalizations.of( - context, - ).updateAvailable, - ), - subtitle: Text( - AppLocalizations.of(context).updateNow, - ), - leading: const PhosphorIcon( - PhosphorIconsLight.arrowRight, - ), - onTap: () async { - await launchUrl( - Uri.parse( - 'https://setonix.linwood.dev/downloads', - ), - mode: LaunchMode.externalApplication, - ); - }, - ), - ], - ); - }, - ), - ], - ), - ), - ), - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.info), - title: Text(AppLocalizations.of(context).showIntro), - onTap: () => showDialog( - context: context, - builder: (context) => IntroDialog(), - ), - ), - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.article), - title: Text(AppLocalizations.of(context).documentation), - onTap: () => launchUrl( - Uri.https('setonix.linwood.dev', ''), - mode: LaunchMode.externalApplication, - ), - ), - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.flag), - title: Text(AppLocalizations.of(context).releaseNotes), - onTap: () => openReleaseNotes(), - ), - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.users), - title: const Text('Matrix'), - onTap: () => launchUrl( - Uri.https('go.linwood.dev', 'matrix'), - mode: LaunchMode.externalApplication, - ), - ), - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.users), - title: const Text('Discord'), - onTap: () => launchUrl( - Uri.https('go.linwood.dev', 'discord'), - mode: LaunchMode.externalApplication, - ), - ), - /*ListTile( - leading: const PhosphorIcon( - PhosphorIconsLight.translate, - ), - title: const Text('Translate'), - onTap: () => launchUrl( - Uri.https('go.linwood.dev', 'setonix/translate'), - mode: LaunchMode.externalApplication, - ), - ),*/ - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.code), - title: Text(AppLocalizations.of(context).source), - onTap: () => launchUrl( - Uri.https('go.linwood.dev', 'setonix/source'), - mode: LaunchMode.externalApplication, - ), - ), - ListTile( - leading: const PhosphorIcon( - PhosphorIconsLight.arrowCounterClockwise, - ), - title: Text(AppLocalizations.of(context).changelog), - onTap: () => launchUrl( - Uri.https('setonix.linwood.dev', 'changelog'), - mode: LaunchMode.externalApplication, - ), - ), - ], - ), - ), - ), - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.stack), - title: Text(AppLocalizations.of(context).license), - onTap: () => launchUrl( - Uri.https('go.linwood.dev', 'setonix/license'), - mode: LaunchMode.externalApplication, - ), - ), - ListTile( - leading: const PhosphorIcon( - PhosphorIconsLight.identificationCard, - ), - title: Text(AppLocalizations.of(context).imprint), - onTap: () => launchUrl( - Uri.https('go.linwood.dev', 'imprint'), - mode: LaunchMode.externalApplication, - ), - ), - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.shield), - title: Text(AppLocalizations.of(context).privacypolicy), - onTap: () => launchUrl( - Uri.https('setonix.linwood.dev', 'privacypolicy'), - mode: LaunchMode.externalApplication, - ), - ), - ListTile( - title: Text( - AppLocalizations.of(context).thirdPartyLicenses, - ), - leading: const PhosphorIcon(PhosphorIconsLight.file), - onTap: () => showLicensePage(context: context), - ), - ], - ), - ), - ), - ], - ); - }, - ), - ); - } -} +import 'dart:convert'; + +import 'package:setonix/api/open.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/pages/settings/intro.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:setonix/bloc/settings.dart'; +import 'package:setonix/theme.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:http/http.dart' as http; + +@immutable +class Meta { + final String stableVersion, nightlyVersion, developVersion, mainVersion; + + const Meta({ + required this.stableVersion, + required this.nightlyVersion, + required this.developVersion, + required this.mainVersion, + }); + Meta.fromJson(Map json) + : stableVersion = json['version']?['stable'] ?? '?', + nightlyVersion = json['version']?['nightly'] ?? '?', + developVersion = json['version']?['develop'] ?? '?', + mainVersion = json['version']?['main'] ?? '?'; +} + +class GeneralSettingsPage extends StatefulWidget { + final bool inView; + const GeneralSettingsPage({super.key, this.inView = false}); + + @override + State createState() => _GeneralSettingsPageState(); +} + +class _GeneralSettingsPageState extends State { + Future? _metaFuture; + + void loadMeta() => setState(() { + _metaFuture = _fetchMeta(); + }); + + Future _fetchMeta() async { + final response = await http.get( + Uri.parse('https://setonix.linwood.dev/meta.json'), + ); + return Meta.fromJson({...json.decode(response.body)}); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: widget.inView ? Colors.transparent : null, + appBar: WindowTitleBar( + title: Text(AppLocalizations.of(context).general), + backgroundColor: widget.inView ? Colors.transparent : null, + inView: widget.inView, + ), + body: FutureBuilder( + future: PackageInfo.fromPlatform(), + builder: (context, snapshot) { + final currentVersion = snapshot.data?.version ?? '?'; + return ListView( + children: [ + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: settingsCardTitlePadding, + child: Text( + AppLocalizations.of(context).update, + style: Theme.of(context).textTheme.headlineSmall, + ), + ), + const SizedBox(height: 16), + ListTile( + title: Text( + AppLocalizations.of(context).currentVersion, + ), + subtitle: Text(currentVersion), + onTap: () => saveToClipboard(context, currentVersion), + ), + if (!kIsWeb) + FutureBuilder( + future: _metaFuture, + builder: (context, snapshot) { + if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } + if (snapshot.connectionState == + ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator(), + ); + } + if (!snapshot.hasData) { + return ListTile( + title: Text( + AppLocalizations.of(context).checkForUpdates, + ), + subtitle: Text( + AppLocalizations.of( + context, + ).checkForUpdatesWarning, + ), + onTap: loadMeta, + ); + } + final meta = snapshot.data!; + final stableVersion = meta.stableVersion; + final nightlyVersion = meta.nightlyVersion; + final developVersion = meta.developVersion; + final mainVersion = meta.mainVersion; + final isStable = currentVersion == stableVersion; + final isNightly = currentVersion == nightlyVersion; + final isDevelop = currentVersion == developVersion; + final isMain = currentVersion == mainVersion; + final isError = + meta.nightlyVersion == '?' || + meta.stableVersion == '?'; + final isUpdateAvailable = + !isError && + !isStable && + !isNightly && + !isDevelop && + !isMain; + return Column( + children: [ + ListTile( + title: Text( + AppLocalizations.of(context).stable, + ), + subtitle: Text(stableVersion), + onTap: () => + saveToClipboard(context, stableVersion), + ), + ListTile( + title: Text( + AppLocalizations.of(context).nightly, + ), + subtitle: Text(nightlyVersion), + onTap: () => + saveToClipboard(context, nightlyVersion), + ), + const Divider(), + if (isStable) ...[ + ListTile( + title: Text( + AppLocalizations.of( + context, + ).usingLatestStable, + ), + ), + ] else if (isNightly || + isDevelop || + isMain) ...[ + ListTile( + title: Text( + AppLocalizations.of( + context, + ).usingLatestNightly, + ), + ), + ] else if (isError) ...[ + ListTile( + title: Text( + AppLocalizations.of(context).error, + ), + ), + ] else if (isUpdateAvailable) + ListTile( + title: Text( + AppLocalizations.of( + context, + ).updateAvailable, + ), + subtitle: Text( + AppLocalizations.of(context).updateNow, + ), + leading: const PhosphorIcon( + PhosphorIconsLight.arrowRight, + ), + onTap: () async { + await launchUrl( + Uri.parse( + 'https://setonix.linwood.dev/downloads', + ), + mode: LaunchMode.externalApplication, + ); + }, + ), + ], + ); + }, + ), + ], + ), + ), + ), + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.info), + title: Text(AppLocalizations.of(context).showIntro), + onTap: () => showDialog( + context: context, + builder: (context) => IntroDialog(), + ), + ), + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.article), + title: Text(AppLocalizations.of(context).documentation), + onTap: () => launchUrl( + Uri.https('setonix.linwood.dev', ''), + mode: LaunchMode.externalApplication, + ), + ), + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.flag), + title: Text(AppLocalizations.of(context).releaseNotes), + onTap: () => openReleaseNotes(), + ), + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.users), + title: const Text('Matrix'), + onTap: () => launchUrl( + Uri.https('go.linwood.dev', 'matrix'), + mode: LaunchMode.externalApplication, + ), + ), + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.users), + title: const Text('Discord'), + onTap: () => launchUrl( + Uri.https('go.linwood.dev', 'discord'), + mode: LaunchMode.externalApplication, + ), + ), + /*ListTile( + leading: const PhosphorIcon( + PhosphorIconsLight.translate, + ), + title: const Text('Translate'), + onTap: () => launchUrl( + Uri.https('go.linwood.dev', 'setonix/translate'), + mode: LaunchMode.externalApplication, + ), + ),*/ + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.code), + title: Text(AppLocalizations.of(context).source), + onTap: () => launchUrl( + Uri.https('go.linwood.dev', 'setonix/source'), + mode: LaunchMode.externalApplication, + ), + ), + ListTile( + leading: const PhosphorIcon( + PhosphorIconsLight.arrowCounterClockwise, + ), + title: Text(AppLocalizations.of(context).changelog), + onTap: () => launchUrl( + Uri.https('setonix.linwood.dev', 'changelog'), + mode: LaunchMode.externalApplication, + ), + ), + ], + ), + ), + ), + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.stack), + title: Text(AppLocalizations.of(context).license), + onTap: () => launchUrl( + Uri.https('go.linwood.dev', 'setonix/license'), + mode: LaunchMode.externalApplication, + ), + ), + ListTile( + leading: const PhosphorIcon( + PhosphorIconsLight.identificationCard, + ), + title: Text(AppLocalizations.of(context).imprint), + onTap: () => launchUrl( + Uri.https('go.linwood.dev', 'imprint'), + mode: LaunchMode.externalApplication, + ), + ), + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.shield), + title: Text(AppLocalizations.of(context).privacypolicy), + onTap: () => launchUrl( + Uri.https('setonix.linwood.dev', 'privacypolicy'), + mode: LaunchMode.externalApplication, + ), + ), + ListTile( + title: Text( + AppLocalizations.of(context).thirdPartyLicenses, + ), + leading: const PhosphorIcon(PhosphorIconsLight.file), + onTap: () => showLicensePage(context: context), + ), + ], + ), + ), + ), + ], + ); + }, + ), + ); + } +} diff --git a/app/lib/pages/settings/home.dart b/app/lib/pages/settings/home.dart index e983889f..f3c3565c 100644 --- a/app/lib/pages/settings/home.dart +++ b/app/lib/pages/settings/home.dart @@ -1,156 +1,156 @@ -import 'package:flutter/material.dart'; -import 'package:setonix/pages/settings/input.dart'; -import 'package:setonix/pages/settings/servers.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:go_router/go_router.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/pages/settings/data.dart'; - -import 'general.dart'; -import 'personalization.dart'; - -enum SettingsView { - general, - data, - personalization, - inputs, - servers; - - bool get isEnabled => true; - - String getLocalizedName(BuildContext context) => switch (this) { - SettingsView.general => AppLocalizations.of(context).general, - SettingsView.data => AppLocalizations.of(context).data, - SettingsView.personalization => AppLocalizations.of( - context, - ).personalization, - SettingsView.inputs => AppLocalizations.of(context).inputs, - SettingsView.servers => AppLocalizations.of(context).serverLists, - }; - - IconGetter get icon => switch (this) { - SettingsView.general => PhosphorIcons.gear, - SettingsView.data => PhosphorIcons.database, - SettingsView.personalization => PhosphorIcons.monitor, - SettingsView.inputs => PhosphorIcons.keyboard, - SettingsView.servers => PhosphorIcons.list, - }; - String get path => '/settings/$name'; - - Widget buildContent({bool inView = false}) => switch (this) { - SettingsView.general => GeneralSettingsPage(inView: inView), - SettingsView.data => DataSettingsPage(inView: inView), - SettingsView.personalization => PersonalizationSettingsPage(inView: inView), - SettingsView.inputs => InputsSettingsPage(inView: inView), - SettingsView.servers => ServersSettingsPage(inView: inView), - }; -} - -class SettingsPage extends StatefulWidget { - final bool isDialog; - final SettingsView view; - - const SettingsPage({ - super.key, - this.isDialog = false, - this.view = SettingsView.general, - }); - - @override - State createState() => _SettingsPageState(); -} - -class _SettingsPageState extends State { - SettingsView _view = SettingsView.general; - final ScrollController _scrollController = ScrollController(); - - @override - void initState() { - super.initState(); - - _view = widget.view; - } - - @override - void dispose() { - super.dispose(); - - _scrollController.dispose(); - } - - @override - Widget build(BuildContext context) { - return SafeArea( - child: Material( - color: widget.isDialog ? Colors.transparent : null, - child: LayoutBuilder( - builder: (context, constraints) { - final isMobile = constraints.maxWidth < 600; - var navigation = Column( - mainAxisSize: MainAxisSize.min, - children: [ - Header( - title: Text(AppLocalizations.of(context).settings), - leading: IconButton.outlined( - icon: const PhosphorIcon(PhosphorIconsLight.x), - onPressed: () => Navigator.of(context).pop(), - ), - ), - Flexible( - child: Material( - color: widget.isDialog ? Colors.transparent : null, - child: ListView( - controller: _scrollController, - shrinkWrap: true, - children: [ - ...SettingsView.values.where((e) => e.isEnabled).map(( - view, - ) { - final selected = _view == view && !isMobile; - void navigateTo() { - if (isMobile) { - context.push(view.path); - } else { - setState(() { - _view = view; - }); - } - } - - return ListTile( - leading: PhosphorIcon( - view.icon( - selected - ? PhosphorIconsStyle.fill - : PhosphorIconsStyle.light, - ), - ), - title: Text(view.getLocalizedName(context)), - onTap: navigateTo, - selected: selected, - ); - }), - ], - ), - ), - ), - ], - ); - if (isMobile) { - return navigation; - } - final content = _view.buildContent(inView: true); - return Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - SizedBox(width: 300, child: navigation), - Expanded(child: content), - ], - ); - }, - ), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:setonix/pages/settings/input.dart'; +import 'package:setonix/pages/settings/servers.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:go_router/go_router.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/pages/settings/data.dart'; + +import 'general.dart'; +import 'personalization.dart'; + +enum SettingsView { + general, + data, + personalization, + inputs, + servers; + + bool get isEnabled => true; + + String getLocalizedName(BuildContext context) => switch (this) { + SettingsView.general => AppLocalizations.of(context).general, + SettingsView.data => AppLocalizations.of(context).data, + SettingsView.personalization => AppLocalizations.of( + context, + ).personalization, + SettingsView.inputs => AppLocalizations.of(context).inputs, + SettingsView.servers => AppLocalizations.of(context).serverLists, + }; + + IconGetter get icon => switch (this) { + SettingsView.general => PhosphorIcons.gear, + SettingsView.data => PhosphorIcons.database, + SettingsView.personalization => PhosphorIcons.monitor, + SettingsView.inputs => PhosphorIcons.keyboard, + SettingsView.servers => PhosphorIcons.list, + }; + String get path => '/settings/$name'; + + Widget buildContent({bool inView = false}) => switch (this) { + SettingsView.general => GeneralSettingsPage(inView: inView), + SettingsView.data => DataSettingsPage(inView: inView), + SettingsView.personalization => PersonalizationSettingsPage(inView: inView), + SettingsView.inputs => InputsSettingsPage(inView: inView), + SettingsView.servers => ServersSettingsPage(inView: inView), + }; +} + +class SettingsPage extends StatefulWidget { + final bool isDialog; + final SettingsView view; + + const SettingsPage({ + super.key, + this.isDialog = false, + this.view = SettingsView.general, + }); + + @override + State createState() => _SettingsPageState(); +} + +class _SettingsPageState extends State { + SettingsView _view = SettingsView.general; + final ScrollController _scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + + _view = widget.view; + } + + @override + void dispose() { + super.dispose(); + + _scrollController.dispose(); + } + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Material( + color: widget.isDialog ? Colors.transparent : null, + child: LayoutBuilder( + builder: (context, constraints) { + final isMobile = constraints.maxWidth < 600; + var navigation = Column( + mainAxisSize: MainAxisSize.min, + children: [ + Header( + title: Text(AppLocalizations.of(context).settings), + leading: IconButton.outlined( + icon: const PhosphorIcon(PhosphorIconsLight.x), + onPressed: () => Navigator.of(context).pop(), + ), + ), + Flexible( + child: Material( + color: widget.isDialog ? Colors.transparent : null, + child: ListView( + controller: _scrollController, + shrinkWrap: true, + children: [ + ...SettingsView.values.where((e) => e.isEnabled).map(( + view, + ) { + final selected = _view == view && !isMobile; + void navigateTo() { + if (isMobile) { + context.push(view.path); + } else { + setState(() { + _view = view; + }); + } + } + + return ListTile( + leading: PhosphorIcon( + view.icon( + selected + ? PhosphorIconsStyle.fill + : PhosphorIconsStyle.light, + ), + ), + title: Text(view.getLocalizedName(context)), + onTap: navigateTo, + selected: selected, + ); + }), + ], + ), + ), + ), + ], + ); + if (isMobile) { + return navigation; + } + final content = _view.buildContent(inView: true); + return Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SizedBox(width: 300, child: navigation), + Expanded(child: content), + ], + ); + }, + ), + ), + ); + } +} diff --git a/app/lib/pages/settings/input.dart b/app/lib/pages/settings/input.dart index 287e9344..df25dfc3 100644 --- a/app/lib/pages/settings/input.dart +++ b/app/lib/pages/settings/input.dart @@ -1,69 +1,69 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:setonix/theme.dart'; - -import '../../bloc/settings.dart'; - -class InputsSettingsPage extends StatelessWidget { - final bool inView; - const InputsSettingsPage({super.key, this.inView = false}); - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: inView ? Colors.transparent : null, - appBar: WindowTitleBar( - inView: inView, - backgroundColor: inView ? Colors.transparent : null, - title: Text(AppLocalizations.of(context).inputs), - ), - body: BlocBuilder( - builder: (context, state) { - return ListView( - children: [ - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Padding( - padding: settingsCardTitlePadding, - child: Column( - spacing: 8, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - AppLocalizations.of(context).sensitivity, - style: TextTheme.of(context).headlineSmall, - ), - Text(AppLocalizations.of(context).sensitivityHint), - ], - ), - ), - ExactSlider( - min: 10, - max: 1000, - defaultValue: 100, - value: state.scrollSensitivity * 100, - header: Text(AppLocalizations.of(context).scroll), - fractionDigits: 0, - onChangeEnd: (value) { - final cubit = context.read(); - cubit.changeScrollSensitivity(value / 100); - }, - ), - ], - ), - ), - ), - ], - ); - }, - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:setonix/theme.dart'; + +import '../../bloc/settings.dart'; + +class InputsSettingsPage extends StatelessWidget { + final bool inView; + const InputsSettingsPage({super.key, this.inView = false}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: inView ? Colors.transparent : null, + appBar: WindowTitleBar( + inView: inView, + backgroundColor: inView ? Colors.transparent : null, + title: Text(AppLocalizations.of(context).inputs), + ), + body: BlocBuilder( + builder: (context, state) { + return ListView( + children: [ + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: settingsCardTitlePadding, + child: Column( + spacing: 8, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context).sensitivity, + style: TextTheme.of(context).headlineSmall, + ), + Text(AppLocalizations.of(context).sensitivityHint), + ], + ), + ), + ExactSlider( + min: 10, + max: 1000, + defaultValue: 100, + value: state.scrollSensitivity * 100, + header: Text(AppLocalizations.of(context).scroll), + fractionDigits: 0, + onChangeEnd: (value) { + final cubit = context.read(); + cubit.changeScrollSensitivity(value / 100); + }, + ), + ], + ), + ), + ), + ], + ); + }, + ), + ); + } +} diff --git a/app/lib/pages/settings/intro.dart b/app/lib/pages/settings/intro.dart index 4adc2187..ac7233ad 100644 --- a/app/lib/pages/settings/intro.dart +++ b/app/lib/pages/settings/intro.dart @@ -1,70 +1,70 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/bloc/settings.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; - -class IntroDialog extends StatefulWidget { - const IntroDialog({super.key}); - - @override - State createState() => _IntroDialogState(); -} - -class _IntroDialogState extends State { - bool _loadDefaultServers = true; - late final SettingsCubit _settingsCubit; - - @override - void initState() { - super.initState(); - _settingsCubit = context.read(); - } - - @override - void dispose() async { - super.dispose(); - await _settingsCubit.changeShowIntro(false); - if (_loadDefaultServers) { - await _settingsCubit.addServersToList(getDefaultServerList(), true); - } - } - - @override - Widget build(BuildContext context) { - return ResponsiveAlertDialog( - title: Text(AppLocalizations.of(context).welcome), - constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), - content: ListView( - shrinkWrap: true, - children: [ - Image.asset('images/logo.png', width: 100, height: 100), - Text( - AppLocalizations.of(context).welcomeContent, - style: Theme.of(context).textTheme.bodyLarge, - textAlign: TextAlign.center, - ), - const SizedBox(height: 16), - const Divider(), - SwitchListTile( - value: _loadDefaultServers, - onChanged: (e) => setState(() => _loadDefaultServers = e), - title: Text(AppLocalizations.of(context).loadDefaultServerList), - subtitle: Text( - AppLocalizations.of(context).loadDefaultServerListDescription, - ), - ), - const SizedBox(height: 16), - FilledButton.icon( - onPressed: () { - Navigator.of(context).pop(); - }, - icon: const PhosphorIcon(PhosphorIconsLight.check), - label: Text(AppLocalizations.of(context).confirm), - ), - ], - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/bloc/settings.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; + +class IntroDialog extends StatefulWidget { + const IntroDialog({super.key}); + + @override + State createState() => _IntroDialogState(); +} + +class _IntroDialogState extends State { + bool _loadDefaultServers = true; + late final SettingsCubit _settingsCubit; + + @override + void initState() { + super.initState(); + _settingsCubit = context.read(); + } + + @override + void dispose() async { + super.dispose(); + await _settingsCubit.changeShowIntro(false); + if (_loadDefaultServers) { + await _settingsCubit.addServersToList(getDefaultServerList(), true); + } + } + + @override + Widget build(BuildContext context) { + return ResponsiveAlertDialog( + title: Text(AppLocalizations.of(context).welcome), + constraints: const BoxConstraints(maxWidth: LeapBreakpoints.compact), + content: ListView( + shrinkWrap: true, + children: [ + Image.asset('images/logo.png', width: 100, height: 100), + Text( + AppLocalizations.of(context).welcomeContent, + style: Theme.of(context).textTheme.bodyLarge, + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + const Divider(), + SwitchListTile( + value: _loadDefaultServers, + onChanged: (e) => setState(() => _loadDefaultServers = e), + title: Text(AppLocalizations.of(context).loadDefaultServerList), + subtitle: Text( + AppLocalizations.of(context).loadDefaultServerListDescription, + ), + ), + const SizedBox(height: 16), + FilledButton.icon( + onPressed: () { + Navigator.of(context).pop(); + }, + icon: const PhosphorIcon(PhosphorIconsLight.check), + label: Text(AppLocalizations.of(context).confirm), + ), + ], + ), + ); + } +} diff --git a/app/lib/pages/settings/personalization.dart b/app/lib/pages/settings/personalization.dart index 722198f5..73a318b6 100644 --- a/app/lib/pages/settings/personalization.dart +++ b/app/lib/pages/settings/personalization.dart @@ -1,273 +1,273 @@ -import 'dart:io'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:flutter_localized_locales/flutter_localized_locales.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; - -import '../../bloc/settings.dart'; -import '../../main.dart'; -import '../../theme.dart'; - -class PersonalizationSettingsPage extends StatelessWidget { - final bool inView; - const PersonalizationSettingsPage({super.key, this.inView = false}); - - String _getThemeName(BuildContext context, ThemeMode mode) => switch (mode) { - ThemeMode.system => AppLocalizations.of(context).systemTheme, - ThemeMode.light => AppLocalizations.of(context).lightTheme, - ThemeMode.dark => AppLocalizations.of(context).darkTheme, - }; - - String _getLocaleName(BuildContext context, String locale) => - locale.isNotEmpty - ? LocaleNames.of(context)?.nameOf(locale.replaceAll('-', '_')) ?? locale - : AppLocalizations.of(context).systemLocale; - - String _getDensityName(BuildContext context, ThemeDensity density) => - switch (density) { - ThemeDensity.system => AppLocalizations.of(context).systemTheme, - ThemeDensity.maximize => LeapLocalizations.of(context).maximize, - ThemeDensity.desktop => AppLocalizations.of(context).desktop, - ThemeDensity.compact => AppLocalizations.of(context).compact, - ThemeDensity.standard => AppLocalizations.of(context).standard, - ThemeDensity.comfortable => AppLocalizations.of(context).comfortable, - }; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: inView ? Colors.transparent : null, - appBar: WindowTitleBar( - inView: inView, - backgroundColor: inView ? Colors.transparent : null, - title: Text(AppLocalizations.of(context).personalization), - ), - body: BlocBuilder( - builder: (context, state) { - final design = state.design; - return ListView( - children: [ - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.eye), - title: Text(AppLocalizations.of(context).theme), - subtitle: Text(_getThemeName(context, state.theme)), - onTap: () => _openThemeModal(context), - ), - ListTile( - leading: const PhosphorIcon(PhosphorIconsLight.palette), - title: Text(AppLocalizations.of(context).design), - subtitle: Text( - design.isEmpty - ? AppLocalizations.of(context).systemTheme - : design, - ), - trailing: ThemeBox( - theme: getThemeData(state.design, false), - ), - onTap: () => _openDesignModal(context), - ), - ListTile( - leading: const PhosphorIcon( - PhosphorIconsLight.translate, - ), - title: Text(AppLocalizations.of(context).locale), - subtitle: Text( - AppLocalizations.of( - context, - ).comingSoon /*_getLocaleName(context, state.localeTag)*/, - ), - onTap: null /*() => _openLocaleModal(context)*/, - ), - ListTile( - leading: const PhosphorIcon( - PhosphorIconsLight.gridNine, - ), - title: Text(AppLocalizations.of(context).density), - subtitle: Text(_getDensityName(context, state.density)), - onTap: () => _openDensityModal(context), - ), - SwitchListTile( - title: Text(AppLocalizations.of(context).highContrast), - secondary: const PhosphorIcon( - PhosphorIconsLight.circleHalf, - ), - value: state.highContrast, - onChanged: (value) => context - .read() - .changeHighContrast(value), - ), - if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) - SwitchListTile( - value: state.nativeTitleBar, - title: Text( - AppLocalizations.of(context).nativeTitleBar, - ), - secondary: const PhosphorIcon( - PhosphorIconsLight.appWindow, - ), - onChanged: (value) => context - .read() - .changeNativeTitleBar(value), - ), - ], - ), - ), - ), - Card( - margin: settingsCardMargin, - child: Padding( - padding: settingsCardPadding, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - SwitchListTile( - title: Text(AppLocalizations.of(context).stackedCards), - secondary: const PhosphorIcon(PhosphorIconsLight.stack), - value: state.stackedCards, - onChanged: (value) => context - .read() - .changeStackedCards(value), - ), - ], - ), - ), - ), - ], - ); - }, - ), - ); - } - - void _openDensityModal(BuildContext context) { - final cubit = context.read(); - final density = cubit.state.density; - - showLeapBottomSheet( - context: context, - titleBuilder: (ctx) => Text(AppLocalizations.of(context).density), - childrenBuilder: (context) { - void changeDensity(ThemeDensity density) { - cubit.changeDensity(density); - Navigator.of(context).pop(); - } - - return ThemeDensity.values - .map( - (e) => ListTile( - title: Text(_getDensityName(context, e)), - selected: e == density, - onTap: () => changeDensity(e), - ), - ) - .toList(); - }, - ); - } - - void _openDesignModal(BuildContext context) { - final cubit = context.read(); - final design = cubit.state.design; - - void changeDesign(String design) { - cubit.changeDesign(design); - Navigator.of(context).pop(); - } - - showLeapBottomSheet( - context: context, - titleBuilder: (context) => Text(AppLocalizations.of(context).theme), - childrenBuilder: (context) => [ - ListTile( - title: Text(AppLocalizations.of(context).systemTheme), - selected: design.isEmpty, - onTap: () => changeDesign(''), - leading: ThemeBox(theme: getThemeData('', false)), - ), - ...getThemes().map((e) { - final theme = getThemeData(e, false); - return ListTile( - title: Text(e), - selected: e == design, - onTap: () => changeDesign(e), - leading: ThemeBox(theme: theme), - ); - }), - ], - ); - } - - void _openThemeModal(BuildContext context) { - final cubit = context.read(); - final currentTheme = cubit.state.theme; - void changeTheme(ThemeMode themeMode) { - cubit.changeTheme(themeMode); - Navigator.of(context).pop(); - } - - showLeapBottomSheet( - context: context, - titleBuilder: (context) => Text(AppLocalizations.of(context).theme), - childrenBuilder: (context) => [ - ListTile( - title: Text(AppLocalizations.of(context).systemTheme), - selected: currentTheme == ThemeMode.system, - leading: const PhosphorIcon(PhosphorIconsLight.power), - onTap: () => changeTheme(ThemeMode.system), - ), - ListTile( - title: Text(AppLocalizations.of(context).lightTheme), - selected: currentTheme == ThemeMode.light, - leading: const PhosphorIcon(PhosphorIconsLight.sun), - onTap: () => changeTheme(ThemeMode.light), - ), - ListTile( - title: Text(AppLocalizations.of(context).darkTheme), - selected: currentTheme == ThemeMode.dark, - leading: const PhosphorIcon(PhosphorIconsLight.moon), - onTap: () => changeTheme(ThemeMode.dark), - ), - ], - ); - } - - // ignore: unused_element - void _openLocaleModal(BuildContext context) { - final cubit = context.read(); - var currentLocale = cubit.state.localeTag; - var locales = getLocales(); - void changeLocale(Locale? locale) { - cubit.changeLocale(locale); - Navigator.of(context).pop(); - } - - showLeapBottomSheet( - context: context, - childrenBuilder: (context) => [ - ListTile( - title: Text(AppLocalizations.of(context).defaultLocale), - selected: currentLocale.isEmpty, - onTap: () => changeLocale(null), - ), - ...locales.map( - (e) => ListTile( - title: Text(_getLocaleName(context, e.toLanguageTag())), - selected: currentLocale == e.toLanguageTag(), - onTap: () => changeLocale(e), - ), - ), - ], - ); - } -} +import 'dart:io'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:flutter_localized_locales/flutter_localized_locales.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; + +import '../../bloc/settings.dart'; +import '../../main.dart'; +import '../../theme.dart'; + +class PersonalizationSettingsPage extends StatelessWidget { + final bool inView; + const PersonalizationSettingsPage({super.key, this.inView = false}); + + String _getThemeName(BuildContext context, ThemeMode mode) => switch (mode) { + ThemeMode.system => AppLocalizations.of(context).systemTheme, + ThemeMode.light => AppLocalizations.of(context).lightTheme, + ThemeMode.dark => AppLocalizations.of(context).darkTheme, + }; + + String _getLocaleName(BuildContext context, String locale) => + locale.isNotEmpty + ? LocaleNames.of(context)?.nameOf(locale.replaceAll('-', '_')) ?? locale + : AppLocalizations.of(context).systemLocale; + + String _getDensityName(BuildContext context, ThemeDensity density) => + switch (density) { + ThemeDensity.system => AppLocalizations.of(context).systemTheme, + ThemeDensity.maximize => LeapLocalizations.of(context).maximize, + ThemeDensity.desktop => AppLocalizations.of(context).desktop, + ThemeDensity.compact => AppLocalizations.of(context).compact, + ThemeDensity.standard => AppLocalizations.of(context).standard, + ThemeDensity.comfortable => AppLocalizations.of(context).comfortable, + }; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: inView ? Colors.transparent : null, + appBar: WindowTitleBar( + inView: inView, + backgroundColor: inView ? Colors.transparent : null, + title: Text(AppLocalizations.of(context).personalization), + ), + body: BlocBuilder( + builder: (context, state) { + final design = state.design; + return ListView( + children: [ + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.eye), + title: Text(AppLocalizations.of(context).theme), + subtitle: Text(_getThemeName(context, state.theme)), + onTap: () => _openThemeModal(context), + ), + ListTile( + leading: const PhosphorIcon(PhosphorIconsLight.palette), + title: Text(AppLocalizations.of(context).design), + subtitle: Text( + design.isEmpty + ? AppLocalizations.of(context).systemTheme + : design, + ), + trailing: ThemeBox( + theme: getThemeData(state.design, false), + ), + onTap: () => _openDesignModal(context), + ), + ListTile( + leading: const PhosphorIcon( + PhosphorIconsLight.translate, + ), + title: Text(AppLocalizations.of(context).locale), + subtitle: Text( + AppLocalizations.of( + context, + ).comingSoon /*_getLocaleName(context, state.localeTag)*/, + ), + onTap: null /*() => _openLocaleModal(context)*/, + ), + ListTile( + leading: const PhosphorIcon( + PhosphorIconsLight.gridNine, + ), + title: Text(AppLocalizations.of(context).density), + subtitle: Text(_getDensityName(context, state.density)), + onTap: () => _openDensityModal(context), + ), + SwitchListTile( + title: Text(AppLocalizations.of(context).highContrast), + secondary: const PhosphorIcon( + PhosphorIconsLight.circleHalf, + ), + value: state.highContrast, + onChanged: (value) => context + .read() + .changeHighContrast(value), + ), + if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) + SwitchListTile( + value: state.nativeTitleBar, + title: Text( + AppLocalizations.of(context).nativeTitleBar, + ), + secondary: const PhosphorIcon( + PhosphorIconsLight.appWindow, + ), + onChanged: (value) => context + .read() + .changeNativeTitleBar(value), + ), + ], + ), + ), + ), + Card( + margin: settingsCardMargin, + child: Padding( + padding: settingsCardPadding, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SwitchListTile( + title: Text(AppLocalizations.of(context).stackedCards), + secondary: const PhosphorIcon(PhosphorIconsLight.stack), + value: state.stackedCards, + onChanged: (value) => context + .read() + .changeStackedCards(value), + ), + ], + ), + ), + ), + ], + ); + }, + ), + ); + } + + void _openDensityModal(BuildContext context) { + final cubit = context.read(); + final density = cubit.state.density; + + showLeapBottomSheet( + context: context, + titleBuilder: (ctx) => Text(AppLocalizations.of(context).density), + childrenBuilder: (context) { + void changeDensity(ThemeDensity density) { + cubit.changeDensity(density); + Navigator.of(context).pop(); + } + + return ThemeDensity.values + .map( + (e) => ListTile( + title: Text(_getDensityName(context, e)), + selected: e == density, + onTap: () => changeDensity(e), + ), + ) + .toList(); + }, + ); + } + + void _openDesignModal(BuildContext context) { + final cubit = context.read(); + final design = cubit.state.design; + + void changeDesign(String design) { + cubit.changeDesign(design); + Navigator.of(context).pop(); + } + + showLeapBottomSheet( + context: context, + titleBuilder: (context) => Text(AppLocalizations.of(context).theme), + childrenBuilder: (context) => [ + ListTile( + title: Text(AppLocalizations.of(context).systemTheme), + selected: design.isEmpty, + onTap: () => changeDesign(''), + leading: ThemeBox(theme: getThemeData('', false)), + ), + ...getThemes().map((e) { + final theme = getThemeData(e, false); + return ListTile( + title: Text(e), + selected: e == design, + onTap: () => changeDesign(e), + leading: ThemeBox(theme: theme), + ); + }), + ], + ); + } + + void _openThemeModal(BuildContext context) { + final cubit = context.read(); + final currentTheme = cubit.state.theme; + void changeTheme(ThemeMode themeMode) { + cubit.changeTheme(themeMode); + Navigator.of(context).pop(); + } + + showLeapBottomSheet( + context: context, + titleBuilder: (context) => Text(AppLocalizations.of(context).theme), + childrenBuilder: (context) => [ + ListTile( + title: Text(AppLocalizations.of(context).systemTheme), + selected: currentTheme == ThemeMode.system, + leading: const PhosphorIcon(PhosphorIconsLight.power), + onTap: () => changeTheme(ThemeMode.system), + ), + ListTile( + title: Text(AppLocalizations.of(context).lightTheme), + selected: currentTheme == ThemeMode.light, + leading: const PhosphorIcon(PhosphorIconsLight.sun), + onTap: () => changeTheme(ThemeMode.light), + ), + ListTile( + title: Text(AppLocalizations.of(context).darkTheme), + selected: currentTheme == ThemeMode.dark, + leading: const PhosphorIcon(PhosphorIconsLight.moon), + onTap: () => changeTheme(ThemeMode.dark), + ), + ], + ); + } + + // ignore: unused_element + void _openLocaleModal(BuildContext context) { + final cubit = context.read(); + var currentLocale = cubit.state.localeTag; + var locales = getLocales(); + void changeLocale(Locale? locale) { + cubit.changeLocale(locale); + Navigator.of(context).pop(); + } + + showLeapBottomSheet( + context: context, + childrenBuilder: (context) => [ + ListTile( + title: Text(AppLocalizations.of(context).defaultLocale), + selected: currentLocale.isEmpty, + onTap: () => changeLocale(null), + ), + ...locales.map( + (e) => ListTile( + title: Text(_getLocaleName(context, e.toLanguageTag())), + selected: currentLocale == e.toLanguageTag(), + onTap: () => changeLocale(e), + ), + ), + ], + ); + } +} diff --git a/app/lib/pages/settings/servers.dart b/app/lib/pages/settings/servers.dart index db9c2874..aa34a0a0 100644 --- a/app/lib/pages/settings/servers.dart +++ b/app/lib/pages/settings/servers.dart @@ -1,127 +1,127 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; - -import '../../bloc/settings.dart'; - -class ServersSettingsPage extends StatelessWidget { - final bool inView; - const ServersSettingsPage({super.key, this.inView = false}); - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: inView ? Colors.transparent : null, - appBar: WindowTitleBar( - inView: inView, - backgroundColor: inView ? Colors.transparent : null, - title: Text(AppLocalizations.of(context).servers), - actions: [ - IconButton( - icon: const PhosphorIcon(PhosphorIconsLight.clockCounterClockwise), - tooltip: AppLocalizations.of(context).loadDefaultServerList, - onPressed: () async { - final settingsCubit = context.read(); - showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text( - AppLocalizations.of(context).loadDefaultServerList, - ), - content: Text( - AppLocalizations.of( - context, - ).loadDefaultServerListDescription, - ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(false), - child: Text(AppLocalizations.of(context).cancel), - ), - OutlinedButton( - onPressed: () { - settingsCubit.addServersToList( - getDefaultServerList(), - true, - ); - Navigator.of(context).pop(true); - }, - child: Text(AppLocalizations.of(context).reset), - ), - ElevatedButton( - onPressed: () { - settingsCubit.addServersToList(getDefaultServerList()); - Navigator.of(context).pop(true); - }, - child: Text(AppLocalizations.of(context).confirm), - ), - ], - ), - ); - }, - ), - ], - ), - body: BlocBuilder( - buildWhen: (previous, current) => - previous.serverList != current.serverList, - builder: (context, state) { - final servers = state.serverList; - if (servers.isEmpty) { - return Center( - child: Text( - AppLocalizations.of(context).noServers, - style: Theme.of(context).textTheme.bodyLarge, - ), - ); - } - return ListView.builder( - itemCount: servers.length, - itemBuilder: (context, index) { - final server = servers[index]; - - void deleteServer() => - context.read().removeServerFromList(server); - - return Dismissible( - key: Key(server), - child: ContextRegion( - builder: (context, button, controller) => - ListTile(title: Text(server), trailing: button), - menuChildren: [ - MenuItemButton( - leadingIcon: const PhosphorIcon(PhosphorIconsLight.trash), - onPressed: deleteServer, - child: Text(AppLocalizations.of(context).delete), - ), - ], - ), - onDismissed: (direction) => deleteServer(), - ); - }, - ); - }, - ), - floatingActionButton: FloatingActionButton.extended( - onPressed: () async { - final settingsCubit = context.read(); - final name = await showDialog( - context: context, - builder: (context) => NameDialog(), - ); - if (name == null) return; - var uri = Uri.tryParse(name); - if (uri == null) return; - if (!uri.hasScheme) { - uri = uri.replace(scheme: 'https'); - } - settingsCubit.addServerToList(name); - }, - label: Text(AppLocalizations.of(context).add), - icon: const PhosphorIcon(PhosphorIconsLight.plus), - ), - ); - } -} +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; + +import '../../bloc/settings.dart'; + +class ServersSettingsPage extends StatelessWidget { + final bool inView; + const ServersSettingsPage({super.key, this.inView = false}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: inView ? Colors.transparent : null, + appBar: WindowTitleBar( + inView: inView, + backgroundColor: inView ? Colors.transparent : null, + title: Text(AppLocalizations.of(context).servers), + actions: [ + IconButton( + icon: const PhosphorIcon(PhosphorIconsLight.clockCounterClockwise), + tooltip: AppLocalizations.of(context).loadDefaultServerList, + onPressed: () async { + final settingsCubit = context.read(); + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + AppLocalizations.of(context).loadDefaultServerList, + ), + content: Text( + AppLocalizations.of( + context, + ).loadDefaultServerListDescription, + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(false), + child: Text(AppLocalizations.of(context).cancel), + ), + OutlinedButton( + onPressed: () { + settingsCubit.addServersToList( + getDefaultServerList(), + true, + ); + Navigator.of(context).pop(true); + }, + child: Text(AppLocalizations.of(context).reset), + ), + ElevatedButton( + onPressed: () { + settingsCubit.addServersToList(getDefaultServerList()); + Navigator.of(context).pop(true); + }, + child: Text(AppLocalizations.of(context).confirm), + ), + ], + ), + ); + }, + ), + ], + ), + body: BlocBuilder( + buildWhen: (previous, current) => + previous.serverList != current.serverList, + builder: (context, state) { + final servers = state.serverList; + if (servers.isEmpty) { + return Center( + child: Text( + AppLocalizations.of(context).noServers, + style: Theme.of(context).textTheme.bodyLarge, + ), + ); + } + return ListView.builder( + itemCount: servers.length, + itemBuilder: (context, index) { + final server = servers[index]; + + void deleteServer() => + context.read().removeServerFromList(server); + + return Dismissible( + key: Key(server), + child: ContextRegion( + builder: (context, button, controller) => + ListTile(title: Text(server), trailing: button), + menuChildren: [ + MenuItemButton( + leadingIcon: const PhosphorIcon(PhosphorIconsLight.trash), + onPressed: deleteServer, + child: Text(AppLocalizations.of(context).delete), + ), + ], + ), + onDismissed: (direction) => deleteServer(), + ); + }, + ); + }, + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () async { + final settingsCubit = context.read(); + final name = await showDialog( + context: context, + builder: (context) => NameDialog(), + ); + if (name == null) return; + var uri = Uri.tryParse(name); + if (uri == null) return; + if (!uri.hasScheme) { + uri = uri.replace(scheme: 'https'); + } + settingsCubit.addServerToList(name); + }, + label: Text(AppLocalizations.of(context).add), + icon: const PhosphorIcon(PhosphorIconsLight.plus), + ), + ); + } +} diff --git a/app/lib/services/file_system.dart b/app/lib/services/file_system.dart index d06804b6..f4499add 100644 --- a/app/lib/services/file_system.dart +++ b/app/lib/services/file_system.dart @@ -1,319 +1,319 @@ -import 'dart:collection'; -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:cryptography_plus/cryptography_plus.dart'; -import 'package:http/http.dart' as http; -import 'package:idb_shim/idb.dart'; -import 'package:lw_file_system/lw_file_system.dart'; -import 'package:setonix/api/open.dart'; -import 'package:setonix/api/storage.dart'; -import 'package:setonix_api/setonix_api.dart'; - -enum PackDownloadResult { - success, - alreadyExists, - downloadFailed, - invalidIdentifier, - invalidUri; - - bool get isSuccess => this == success || this == alreadyExists; -} - -bool _isSafeDownloadUri(Uri uri) { - if (uri.isScheme('https')) return true; - if (!uri.isScheme('http')) return false; - return uri.host == 'localhost' || - uri.host == '127.0.0.1' || - uri.host == '::1'; -} - -class SetonixFileSystem { - SetonixFile? _corePack; - final TypedKeyFileSystem packSystem; - final TypedKeyFileSystem templateSystem, - worldSystem, - editorSystem; - final TypedKeyFileSystem dataInfoSystem; - final KeyFileSystem privateKeySystem, publicKeySystem; - - static Future _onDatabaseUpgrade(VersionChangeEvent event) async { - await initStores(event, ['packs', 'templates', 'worlds']); - if (event.oldVersion < 2) { - event.database.createObjectStore('packs-data'); - } - if (event.oldVersion < 3) { - event.database.createObjectStore('editor'); - event.database.createObjectStore('accounts'); - } - } - - static const kDatabaseVersion = 3; - - SetonixFileSystem({SetonixFile? corePack}) - : _corePack = corePack, - packSystem = TypedKeyFileSystem.build( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'packs', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Packs', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.stnx', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - onDecode: SetonixFile.new, - onEncode: (data) => data.data, - ), - dataInfoSystem = TypedKeyFileSystem.build( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'packs', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Packs', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.json', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - onEncode: (data) => utf8.encode(data.toJson()), - onDecode: (data) => DataMetadataMapper.fromJson(utf8.decode(data)), - ), - templateSystem = TypedKeyFileSystem.build( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'templates', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Templates', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.stnx', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - onDecode: SetonixData.fromData, - onEncode: (data) => data.exportAsBytes(), - ), - worldSystem = TypedKeyFileSystem.build( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'worlds', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Worlds', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.stnx', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - onDecode: SetonixData.fromData, - onEncode: (data) => data.exportAsBytes(), - ), - editorSystem = TypedKeyFileSystem.build( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'editor', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Editor', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.stnx', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - onDecode: SetonixData.fromData, - onEncode: (data) => data.exportAsBytes(), - ), - privateKeySystem = KeyFileSystem.fromPlatform( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'accounts', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Accounts', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.key', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - ), - publicKeySystem = KeyFileSystem.fromPlatform( - FileSystemConfig( - passwordStorage: SecureStoragePasswordStorage(), - storeName: 'accounts', - getDirectory: (storage) async => - '${await getSetonixDirectory()}/Accounts', - database: 'setonix.db', - databaseVersion: kDatabaseVersion, - keySuffix: '.pub', - onDatabaseUpgrade: _onDatabaseUpgrade, - ), - ); - - Future fetchCorePack() async => - _corePack ?? (_corePack = await getCorePack()); - - Future> getPacks({ - bool fetchCore = true, - bool force = false, - }) async { - final corePack = fetchCore ? await fetchCorePack() : null; - await packSystem.initialize(); - return HashSet( - equals: (a, b) => a.identifier == b.identifier, - hashCode: (a) => a.identifier.hashCode, - )..addAll([ - ...(await packSystem.getFiles()).map((e) => e.data!), - ?corePack, - ]); - } - - Future getPack(String packId) => - packId == kCorePackId ? fetchCorePack() : packSystem.getFile(packId); - - Future addPack(Uint8List data, {bool force = false}) async { - final pack = SetonixFile(data); - final identifier = pack.identifier; - if (!force && await packSystem.hasKey(identifier)) return false; - await packSystem.updateFile(identifier, pack); - await dataInfoSystem.updateFile( - identifier, - DataMetadata(addedAt: DateTime.now(), manuallyAdded: true), - ); - return true; - } - - Future downloadPack( - String url, - String expectedIdentifier, { - bool force = false, - }) async { - try { - final uri = Uri.tryParse(url); - if (uri == null) return PackDownloadResult.invalidUri; - if (!_isSafeDownloadUri(uri)) return PackDownloadResult.invalidUri; - if (!force && await packSystem.hasKey(expectedIdentifier)) { - return PackDownloadResult.alreadyExists; - } - final response = await http.get(uri); - if (response.statusCode != 200) return PackDownloadResult.downloadFailed; - final identifier = createPackIdentifier(response.bodyBytes); - if (identifier != expectedIdentifier) { - return PackDownloadResult.invalidIdentifier; - } - await packSystem.updateFile( - expectedIdentifier, - SetonixFile(response.bodyBytes), - ); - await dataInfoSystem.updateFile( - expectedIdentifier, - DataMetadata(addedAt: DateTime.now(), manuallyAdded: false), - ); - return PackDownloadResult.success; - } catch (e) { - return PackDownloadResult.downloadFailed; - } - } - - Future updateServerLastUsed(String packId, String serverAddress) async { - final data = - await dataInfoSystem.getFile(packId) ?? - DataMetadata(addedAt: DateTime(0)); - data.serversLastUsed[serverAddress] = DateTime.now(); - await dataInfoSystem.updateFile(packId, data); - } - - Future updateMultipleServerLastUsed( - Iterable packIds, - String serverAddress, - ) async { - for (final pack in packIds) { - await updateServerLastUsed(pack, serverAddress); - } - } - - Future generateKey(String name) async { - final generator = Ed25519(); - final keyPair = await generator.newKeyPair(); - final privateKey = await keyPair.extractPrivateKeyBytes(); - final publicKey = await keyPair.extractPublicKey(); - await privateKeySystem.createFileWithName( - Uint8List.fromList(privateKey), - name: name, - ); - await publicKeySystem.createFileWithName( - Uint8List.fromList(publicKey.bytes), - name: name, - ); - } - - Future getAccount(String name) async { - final privateKey = await privateKeySystem.getFile(name); - if (privateKey == null) return null; - final publicKey = await publicKeySystem.getFile(name); - if (publicKey == null) return null; - return SetonixAccount( - privateKey: privateKey, - publicKey: publicKey, - name: name, - ); - } - - Future deleteAccount(String name) async { - await privateKeySystem.deleteFile(name); - await publicKeySystem.deleteFile(name); - } - - Future importAccountsFromData(SetonixData data) => - importAccounts(data.getAccounts().toList()); - - Future importAccounts(List accounts) async { - for (final account in accounts) { - final name = await privateKeySystem.createFileWithName( - account.privateKey, - name: account.name, - ); - await publicKeySystem.updateFile(name, account.publicKey); - } - } - - Future> getAccounts([List? names]) async { - await privateKeySystem.initialize(); - names ??= await privateKeySystem.getKeys(); - return Future.wait( - names.map((name) => getAccount(name)), - ).then((accounts) => accounts.nonNulls.toList()); - } - - Future exportAccounts([ - List? names, - List? accounts, - ]) async { - var data = SetonixData.empty().setMetadata( - FileMetadata(type: SetonixFileType.accounts), - ); - final allAccounts = accounts ?? await getAccounts(names); - for (final account in allAccounts) { - final privateKey = account.privateKey; - final publicKey = account.publicKey; - if (privateKey.isEmpty || publicKey.isEmpty) continue; - data = data.addAccount( - SetonixAccount( - privateKey: privateKey, - publicKey: publicKey, - name: account.name, - ), - ); - } - return data; - } - - Future getFingerprint( - String key, { - bool short = false, - bool pretty = false, - }) async { - final publicKey = await publicKeySystem.getFile(key); - if (publicKey == null) { - return ''; - } - return generateFingerprint(publicKey, short: short, pretty: pretty); - } -} +import 'dart:collection'; +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:cryptography_plus/cryptography_plus.dart'; +import 'package:http/http.dart' as http; +import 'package:idb_shim/idb.dart'; +import 'package:lw_file_system/lw_file_system.dart'; +import 'package:setonix/api/open.dart'; +import 'package:setonix/api/storage.dart'; +import 'package:setonix_api/setonix_api.dart'; + +enum PackDownloadResult { + success, + alreadyExists, + downloadFailed, + invalidIdentifier, + invalidUri; + + bool get isSuccess => this == success || this == alreadyExists; +} + +bool _isSafeDownloadUri(Uri uri) { + if (uri.isScheme('https')) return true; + if (!uri.isScheme('http')) return false; + return uri.host == 'localhost' || + uri.host == '127.0.0.1' || + uri.host == '::1'; +} + +class SetonixFileSystem { + SetonixFile? _corePack; + final TypedKeyFileSystem packSystem; + final TypedKeyFileSystem templateSystem, + worldSystem, + editorSystem; + final TypedKeyFileSystem dataInfoSystem; + final KeyFileSystem privateKeySystem, publicKeySystem; + + static Future _onDatabaseUpgrade(VersionChangeEvent event) async { + await initStores(event, ['packs', 'templates', 'worlds']); + if (event.oldVersion < 2) { + event.database.createObjectStore('packs-data'); + } + if (event.oldVersion < 3) { + event.database.createObjectStore('editor'); + event.database.createObjectStore('accounts'); + } + } + + static const kDatabaseVersion = 3; + + SetonixFileSystem({SetonixFile? corePack}) + : _corePack = corePack, + packSystem = TypedKeyFileSystem.build( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'packs', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Packs', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.stnx', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + onDecode: SetonixFile.new, + onEncode: (data) => data.data, + ), + dataInfoSystem = TypedKeyFileSystem.build( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'packs', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Packs', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.json', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + onEncode: (data) => utf8.encode(data.toJson()), + onDecode: (data) => DataMetadataMapper.fromJson(utf8.decode(data)), + ), + templateSystem = TypedKeyFileSystem.build( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'templates', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Templates', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.stnx', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + onDecode: SetonixData.fromData, + onEncode: (data) => data.exportAsBytes(), + ), + worldSystem = TypedKeyFileSystem.build( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'worlds', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Worlds', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.stnx', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + onDecode: SetonixData.fromData, + onEncode: (data) => data.exportAsBytes(), + ), + editorSystem = TypedKeyFileSystem.build( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'editor', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Editor', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.stnx', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + onDecode: SetonixData.fromData, + onEncode: (data) => data.exportAsBytes(), + ), + privateKeySystem = KeyFileSystem.fromPlatform( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'accounts', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Accounts', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.key', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + ), + publicKeySystem = KeyFileSystem.fromPlatform( + FileSystemConfig( + passwordStorage: SecureStoragePasswordStorage(), + storeName: 'accounts', + getDirectory: (storage) async => + '${await getSetonixDirectory()}/Accounts', + database: 'setonix.db', + databaseVersion: kDatabaseVersion, + keySuffix: '.pub', + onDatabaseUpgrade: _onDatabaseUpgrade, + ), + ); + + Future fetchCorePack() async => + _corePack ?? (_corePack = await getCorePack()); + + Future> getPacks({ + bool fetchCore = true, + bool force = false, + }) async { + final corePack = fetchCore ? await fetchCorePack() : null; + await packSystem.initialize(); + return HashSet( + equals: (a, b) => a.identifier == b.identifier, + hashCode: (a) => a.identifier.hashCode, + )..addAll([ + ...(await packSystem.getFiles()).map((e) => e.data!), + ?corePack, + ]); + } + + Future getPack(String packId) => + packId == kCorePackId ? fetchCorePack() : packSystem.getFile(packId); + + Future addPack(Uint8List data, {bool force = false}) async { + final pack = SetonixFile(data); + final identifier = pack.identifier; + if (!force && await packSystem.hasKey(identifier)) return false; + await packSystem.updateFile(identifier, pack); + await dataInfoSystem.updateFile( + identifier, + DataMetadata(addedAt: DateTime.now(), manuallyAdded: true), + ); + return true; + } + + Future downloadPack( + String url, + String expectedIdentifier, { + bool force = false, + }) async { + try { + final uri = Uri.tryParse(url); + if (uri == null) return PackDownloadResult.invalidUri; + if (!_isSafeDownloadUri(uri)) return PackDownloadResult.invalidUri; + if (!force && await packSystem.hasKey(expectedIdentifier)) { + return PackDownloadResult.alreadyExists; + } + final response = await http.get(uri); + if (response.statusCode != 200) return PackDownloadResult.downloadFailed; + final identifier = createPackIdentifier(response.bodyBytes); + if (identifier != expectedIdentifier) { + return PackDownloadResult.invalidIdentifier; + } + await packSystem.updateFile( + expectedIdentifier, + SetonixFile(response.bodyBytes), + ); + await dataInfoSystem.updateFile( + expectedIdentifier, + DataMetadata(addedAt: DateTime.now(), manuallyAdded: false), + ); + return PackDownloadResult.success; + } catch (e) { + return PackDownloadResult.downloadFailed; + } + } + + Future updateServerLastUsed(String packId, String serverAddress) async { + final data = + await dataInfoSystem.getFile(packId) ?? + DataMetadata(addedAt: DateTime(0)); + data.serversLastUsed[serverAddress] = DateTime.now(); + await dataInfoSystem.updateFile(packId, data); + } + + Future updateMultipleServerLastUsed( + Iterable packIds, + String serverAddress, + ) async { + for (final pack in packIds) { + await updateServerLastUsed(pack, serverAddress); + } + } + + Future generateKey(String name) async { + final generator = Ed25519(); + final keyPair = await generator.newKeyPair(); + final privateKey = await keyPair.extractPrivateKeyBytes(); + final publicKey = await keyPair.extractPublicKey(); + await privateKeySystem.createFileWithName( + Uint8List.fromList(privateKey), + name: name, + ); + await publicKeySystem.createFileWithName( + Uint8List.fromList(publicKey.bytes), + name: name, + ); + } + + Future getAccount(String name) async { + final privateKey = await privateKeySystem.getFile(name); + if (privateKey == null) return null; + final publicKey = await publicKeySystem.getFile(name); + if (publicKey == null) return null; + return SetonixAccount( + privateKey: privateKey, + publicKey: publicKey, + name: name, + ); + } + + Future deleteAccount(String name) async { + await privateKeySystem.deleteFile(name); + await publicKeySystem.deleteFile(name); + } + + Future importAccountsFromData(SetonixData data) => + importAccounts(data.getAccounts().toList()); + + Future importAccounts(List accounts) async { + for (final account in accounts) { + final name = await privateKeySystem.createFileWithName( + account.privateKey, + name: account.name, + ); + await publicKeySystem.updateFile(name, account.publicKey); + } + } + + Future> getAccounts([List? names]) async { + await privateKeySystem.initialize(); + names ??= await privateKeySystem.getKeys(); + return Future.wait( + names.map((name) => getAccount(name)), + ).then((accounts) => accounts.nonNulls.toList()); + } + + Future exportAccounts([ + List? names, + List? accounts, + ]) async { + var data = SetonixData.empty().setMetadata( + FileMetadata(type: SetonixFileType.accounts), + ); + final allAccounts = accounts ?? await getAccounts(names); + for (final account in allAccounts) { + final privateKey = account.privateKey; + final publicKey = account.publicKey; + if (privateKey.isEmpty || publicKey.isEmpty) continue; + data = data.addAccount( + SetonixAccount( + privateKey: privateKey, + publicKey: publicKey, + name: account.name, + ), + ); + } + return data; + } + + Future getFingerprint( + String key, { + bool short = false, + bool pretty = false, + }) async { + final publicKey = await publicKeySystem.getFile(key); + if (publicKey == null) { + return ''; + } + return generateFingerprint(publicKey, short: short, pretty: pretty); + } +} diff --git a/app/lib/setup.dart b/app/lib/setup.dart index e9fb47a5..ff5930ab 100644 --- a/app/lib/setup.dart +++ b/app/lib/setup.dart @@ -1,3 +1,3 @@ -import 'bloc/settings.dart'; - -Future setup(SettingsCubit settingsCubit) async {} +import 'bloc/settings.dart'; + +Future setup(SettingsCubit settingsCubit) async {} diff --git a/app/lib/setup_io.dart b/app/lib/setup_io.dart index ed405958..d1e8eadf 100644 --- a/app/lib/setup_io.dart +++ b/app/lib/setup_io.dart @@ -1,29 +1,29 @@ -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:setonix/main.dart'; -import 'package:window_manager/window_manager.dart'; - -import 'bloc/settings.dart'; -import 'setup.dart' as general_setup; - -Future setup(SettingsCubit settingsCubit) async { - setupFullScreen(); - if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { - await windowManager.ensureInitialized(); - - final windowOptions = WindowOptions( - minimumSize: const Size(420, 300), - titleBarStyle: settingsCubit.state.nativeTitleBar - ? TitleBarStyle.normal - : TitleBarStyle.hidden, - title: applicationName, - ); - windowManager.waitUntilReadyToShow(windowOptions, () async { - await windowManager.show(); - await windowManager.focus(); - }); - await general_setup.setup(settingsCubit); - } -} +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:setonix/main.dart'; +import 'package:window_manager/window_manager.dart'; + +import 'bloc/settings.dart'; +import 'setup.dart' as general_setup; + +Future setup(SettingsCubit settingsCubit) async { + setupFullScreen(); + if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { + await windowManager.ensureInitialized(); + + final windowOptions = WindowOptions( + minimumSize: const Size(420, 300), + titleBarStyle: settingsCubit.state.nativeTitleBar + ? TitleBarStyle.normal + : TitleBarStyle.hidden, + title: applicationName, + ); + windowManager.waitUntilReadyToShow(windowOptions, () async { + await windowManager.show(); + await windowManager.focus(); + }); + await general_setup.setup(settingsCubit); + } +} diff --git a/app/lib/setup_web.dart b/app/lib/setup_web.dart index 323345e7..322bfb20 100644 --- a/app/lib/setup_web.dart +++ b/app/lib/setup_web.dart @@ -1,9 +1,9 @@ -import 'package:flutter/services.dart'; - -import 'bloc/settings.dart'; -import 'setup.dart' as general_setup; - -Future setup(SettingsCubit settingsCubit) async { - await BrowserContextMenu.disableContextMenu(); - await general_setup.setup(settingsCubit); -} +import 'package:flutter/services.dart'; + +import 'bloc/settings.dart'; +import 'setup.dart' as general_setup; + +Future setup(SettingsCubit settingsCubit) async { + await BrowserContextMenu.disableContextMenu(); + await general_setup.setup(settingsCubit); +} diff --git a/app/lib/theme.dart b/app/lib/theme.dart index 4c793cd0..da304ed7 100644 --- a/app/lib/theme.dart +++ b/app/lib/theme.dart @@ -1,64 +1,64 @@ -import 'package:flex_color_scheme/flex_color_scheme.dart'; -import 'package:flutter/material.dart'; - -const kClassicThemePrimary = Color(0xFFFBAC11); -const kClassicThemeSecondary = Color(0xFF35EF53); -const kClassicTheme = FlexSchemeColor( - primary: kClassicThemePrimary, - secondary: kClassicThemeSecondary, -); -const kClassicThemeData = FlexSchemeData( - name: '', - description: '', - light: kClassicTheme, - dark: kClassicTheme, -); - -const settingsCardMargin = EdgeInsets.all(8); -const settingsCardPadding = EdgeInsets.all(16); -const settingsCardTitlePadding = EdgeInsets.only(left: 12, top: 8, right: 12); - -ThemeData getThemeData( - String name, - bool dark, [ - ColorScheme? overridden, - bool highContrast = false, -]) { - final color = getFlexThemeColor(name, dark); - final override = overridden != null && name.isEmpty; - if (dark) { - return FlexThemeData.dark( - colors: override ? null : color, - colorScheme: override ? overridden : null, - useMaterial3: true, - appBarElevation: 2, - fontFamily: 'Comfortaa', - swapLegacyOnMaterial3: true, - fontFamilyFallback: ['Roboto'], - darkIsTrueBlack: highContrast, - ); - } - return FlexThemeData.light( - colors: override ? null : color, - colorScheme: override ? overridden : null, - useMaterial3: true, - appBarElevation: 0.5, - fontFamily: 'Comfortaa', - swapLegacyOnMaterial3: true, - fontFamilyFallback: ['Roboto'], - lightIsWhite: highContrast, - ); -} - -FlexSchemeColor getFlexThemeColor(String name, bool dark) { - final color = FlexColor.schemesList.firstWhere( - (scheme) => scheme.name == name, - orElse: () => kClassicThemeData, - ); - if (dark) return color.dark; - return color.light; -} - -List getThemes() { - return ['Classic', ...FlexColor.schemesList.map((e) => e.name)]; -} +import 'package:flex_color_scheme/flex_color_scheme.dart'; +import 'package:flutter/material.dart'; + +const kClassicThemePrimary = Color(0xFFFBAC11); +const kClassicThemeSecondary = Color(0xFF35EF53); +const kClassicTheme = FlexSchemeColor( + primary: kClassicThemePrimary, + secondary: kClassicThemeSecondary, +); +const kClassicThemeData = FlexSchemeData( + name: '', + description: '', + light: kClassicTheme, + dark: kClassicTheme, +); + +const settingsCardMargin = EdgeInsets.all(8); +const settingsCardPadding = EdgeInsets.all(16); +const settingsCardTitlePadding = EdgeInsets.only(left: 12, top: 8, right: 12); + +ThemeData getThemeData( + String name, + bool dark, [ + ColorScheme? overridden, + bool highContrast = false, +]) { + final color = getFlexThemeColor(name, dark); + final override = overridden != null && name.isEmpty; + if (dark) { + return FlexThemeData.dark( + colors: override ? null : color, + colorScheme: override ? overridden : null, + useMaterial3: true, + appBarElevation: 2, + fontFamily: 'Comfortaa', + swapLegacyOnMaterial3: true, + fontFamilyFallback: ['Roboto'], + darkIsTrueBlack: highContrast, + ); + } + return FlexThemeData.light( + colors: override ? null : color, + colorScheme: override ? overridden : null, + useMaterial3: true, + appBarElevation: 0.5, + fontFamily: 'Comfortaa', + swapLegacyOnMaterial3: true, + fontFamilyFallback: ['Roboto'], + lightIsWhite: highContrast, + ); +} + +FlexSchemeColor getFlexThemeColor(String name, bool dark) { + final color = FlexColor.schemesList.firstWhere( + (scheme) => scheme.name == name, + orElse: () => kClassicThemeData, + ); + if (dark) return color.dark; + return color.light; +} + +List getThemes() { + return ['Classic', ...FlexColor.schemesList.map((e) => e.name)]; +} diff --git a/app/lib/widgets/search.dart b/app/lib/widgets/search.dart index e7f90d6e..0beee986 100644 --- a/app/lib/widgets/search.dart +++ b/app/lib/widgets/search.dart @@ -1,118 +1,118 @@ -import 'package:flutter/material.dart'; -import 'package:setonix/src/generated/i18n/app_localizations.dart'; -import 'package:material_leap/material_leap.dart'; -import 'package:phosphor_flutter/phosphor_flutter.dart'; -import 'package:setonix/widgets/two_child_row_layout.dart'; - -const searchConstraints = BoxConstraints( - minWidth: 200.0, - maxWidth: 260.0, - minHeight: 56.0, -); - -class TabSearchView extends StatelessWidget { - final TabController? tabController; - final TextEditingController? searchController; - final List tabs; - final ValueChanged? onSearchChanged; - final ValueChanged? onSearchSubmitted; - final ValueChanged? onTabTap; - - const TabSearchView({ - super.key, - this.tabController, - this.searchController, - required this.tabs, - this.onSearchChanged, - this.onSearchSubmitted, - this.onTabTap, - }); - - @override - Widget build(BuildContext context) { - final tabBar = TabBar( - controller: tabController, - isScrollable: true, - tabAlignment: TabAlignment.start, - indicatorSize: TabBarIndicatorSize.label, - onTap: onTabTap, - tabs: tabs, - ); - final searchBar = SearchBar( - constraints: const BoxConstraints( - minWidth: 200.0, - maxWidth: 260.0, - minHeight: 56.0, - ), - leading: const PhosphorIcon(PhosphorIconsLight.magnifyingGlass), - hintText: AppLocalizations.of(context).search, - onChanged: onSearchChanged, - onSubmitted: onSearchSubmitted, - controller: searchController, - ); - return TwoChildRowLayout( - primary: tabBar, - second: searchBar, - breakpoint: LeapBreakpoints.medium, - ); - } -} - -class RowSearchView extends StatefulWidget { - final List children; - final ValueChanged? onSearchChanged; - final ValueChanged? onSearchSubmitted; - final ValueChanged? onTabTap; - - const RowSearchView({ - super.key, - this.children = const [], - this.onSearchChanged, - this.onSearchSubmitted, - this.onTabTap, - }); - - @override - State createState() => _RowSearchViewState(); -} - -class _RowSearchViewState extends State { - final ScrollController _scrollController = ScrollController(); - - @override - void dispose() { - _scrollController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - final tabBar = widget.children.isEmpty - ? const SizedBox() - : SizedBox( - height: 56, - child: Scrollbar( - controller: _scrollController, - child: ListView.separated( - controller: _scrollController, - scrollDirection: Axis.horizontal, - itemCount: widget.children.length, - itemBuilder: (context, index) => widget.children[index], - separatorBuilder: (context, index) => const SizedBox(width: 8), - ), - ), - ); - final searchBar = SearchBar( - constraints: const BoxConstraints( - minWidth: 200.0, - maxWidth: 260.0, - minHeight: 56.0, - ), - leading: const PhosphorIcon(PhosphorIconsLight.magnifyingGlass), - hintText: AppLocalizations.of(context).search, - onChanged: widget.onSearchChanged, - onSubmitted: widget.onSearchSubmitted, - ); - return TwoChildRowLayout(primary: tabBar, second: searchBar); - } -} +import 'package:flutter/material.dart'; +import 'package:setonix/src/generated/i18n/app_localizations.dart'; +import 'package:material_leap/material_leap.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:setonix/widgets/two_child_row_layout.dart'; + +const searchConstraints = BoxConstraints( + minWidth: 200.0, + maxWidth: 260.0, + minHeight: 56.0, +); + +class TabSearchView extends StatelessWidget { + final TabController? tabController; + final TextEditingController? searchController; + final List tabs; + final ValueChanged? onSearchChanged; + final ValueChanged? onSearchSubmitted; + final ValueChanged? onTabTap; + + const TabSearchView({ + super.key, + this.tabController, + this.searchController, + required this.tabs, + this.onSearchChanged, + this.onSearchSubmitted, + this.onTabTap, + }); + + @override + Widget build(BuildContext context) { + final tabBar = TabBar( + controller: tabController, + isScrollable: true, + tabAlignment: TabAlignment.start, + indicatorSize: TabBarIndicatorSize.label, + onTap: onTabTap, + tabs: tabs, + ); + final searchBar = SearchBar( + constraints: const BoxConstraints( + minWidth: 200.0, + maxWidth: 260.0, + minHeight: 56.0, + ), + leading: const PhosphorIcon(PhosphorIconsLight.magnifyingGlass), + hintText: AppLocalizations.of(context).search, + onChanged: onSearchChanged, + onSubmitted: onSearchSubmitted, + controller: searchController, + ); + return TwoChildRowLayout( + primary: tabBar, + second: searchBar, + breakpoint: LeapBreakpoints.medium, + ); + } +} + +class RowSearchView extends StatefulWidget { + final List children; + final ValueChanged? onSearchChanged; + final ValueChanged? onSearchSubmitted; + final ValueChanged? onTabTap; + + const RowSearchView({ + super.key, + this.children = const [], + this.onSearchChanged, + this.onSearchSubmitted, + this.onTabTap, + }); + + @override + State createState() => _RowSearchViewState(); +} + +class _RowSearchViewState extends State { + final ScrollController _scrollController = ScrollController(); + + @override + void dispose() { + _scrollController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final tabBar = widget.children.isEmpty + ? const SizedBox() + : SizedBox( + height: 56, + child: Scrollbar( + controller: _scrollController, + child: ListView.separated( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: widget.children.length, + itemBuilder: (context, index) => widget.children[index], + separatorBuilder: (context, index) => const SizedBox(width: 8), + ), + ), + ); + final searchBar = SearchBar( + constraints: const BoxConstraints( + minWidth: 200.0, + maxWidth: 260.0, + minHeight: 56.0, + ), + leading: const PhosphorIcon(PhosphorIconsLight.magnifyingGlass), + hintText: AppLocalizations.of(context).search, + onChanged: widget.onSearchChanged, + onSubmitted: widget.onSearchSubmitted, + ); + return TwoChildRowLayout(primary: tabBar, second: searchBar); + } +} diff --git a/app/lib/widgets/two_child_row_layout.dart b/app/lib/widgets/two_child_row_layout.dart index 41ab44dc..aa996ce4 100644 --- a/app/lib/widgets/two_child_row_layout.dart +++ b/app/lib/widgets/two_child_row_layout.dart @@ -1,33 +1,33 @@ -import 'package:flutter/material.dart'; -import 'package:material_leap/helpers.dart'; - -class TwoChildRowLayout extends StatelessWidget { - final Widget primary, second; - final double breakpoint; - const TwoChildRowLayout({ - super.key, - required this.primary, - required this.second, - this.breakpoint = LeapBreakpoints.compact, - }); - - @override - Widget build(BuildContext context) { - return LayoutBuilder( - builder: (context, constraints) { - if (constraints.maxWidth < breakpoint) { - return Column( - children: [second, const SizedBox(height: 12), primary], - ); - } - return Row( - children: [ - Expanded(child: primary), - const SizedBox(width: 64), - second, - ], - ); - }, - ); - } -} +import 'package:flutter/material.dart'; +import 'package:material_leap/helpers.dart'; + +class TwoChildRowLayout extends StatelessWidget { + final Widget primary, second; + final double breakpoint; + const TwoChildRowLayout({ + super.key, + required this.primary, + required this.second, + this.breakpoint = LeapBreakpoints.compact, + }); + + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (context, constraints) { + if (constraints.maxWidth < breakpoint) { + return Column( + children: [second, const SizedBox(height: 12), primary], + ); + } + return Row( + children: [ + Expanded(child: primary), + const SizedBox(width: 64), + second, + ], + ); + }, + ); + } +} diff --git a/app/linux/.gitignore b/app/linux/.gitignore index d3896c98..c7ea17fc 100644 --- a/app/linux/.gitignore +++ b/app/linux/.gitignore @@ -1 +1 @@ -flutter/ephemeral +flutter/ephemeral diff --git a/app/linux/CMakeLists.txt b/app/linux/CMakeLists.txt index cce060e0..ed512e8f 100644 --- a/app/linux/CMakeLists.txt +++ b/app/linux/CMakeLists.txt @@ -1,153 +1,153 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.10) -project(runner LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "setonix") -# The unique GTK application identifier for this application. See: -# https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "dev.linwood.setonix") - -# Fix flutter_secure_storage_linux build error on newer versions of CMake. -include(CheckCXXCompilerFlag) -check_cxx_compiler_flag("-Wno-error=deprecated-literal-operator" COMPILER_SUPPORTS_NO_ERROR_DEPRECATED_LITERAL_OPERATOR) -if(COMPILER_SUPPORTS_NO_ERROR_DEPRECATED_LITERAL_OPERATOR) - message(STATUS "Disabling error for deprecated literal operator") - add_definitions(-Wno-error=deprecated-literal-operator) -endif() - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(SET CMP0063 NEW) - -# Load bundled libraries from the lib/ directory relative to the binary. -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Root filesystem for cross-building. -if(FLUTTER_TARGET_PLATFORM_SYSROOT) - set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -# Define build configuration options. -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") -endif() - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_14) - target_compile_options(${TARGET} PRIVATE -Wall -Werror) - target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") - target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) - -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) - -# Only the install-generated bundle's copy of the executable will launch -# correctly, since the resources must in the right relative locations. To avoid -# people trying to run the unbundled copy, put it in a subdirectory instead of -# the default top-level location. -set_target_properties(${BINARY_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" -) - - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# By default, "installing" just makes a relocatable bundle in the build -# directory. -set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -# Start with a clean build bundle directory every time. -install(CODE " - file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") - " COMPONENT Runtime) - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) - install(FILES "${bundled_library}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endforeach(bundled_library) - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "setonix") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "dev.linwood.setonix") + +# Fix flutter_secure_storage_linux build error on newer versions of CMake. +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag("-Wno-error=deprecated-literal-operator" COMPILER_SUPPORTS_NO_ERROR_DEPRECATED_LITERAL_OPERATOR) +if(COMPILER_SUPPORTS_NO_ERROR_DEPRECATED_LITERAL_OPERATOR) + message(STATUS "Disabling error for deprecated literal operator") + add_definitions(-Wno-error=deprecated-literal-operator) +endif() + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/app/linux/debian/usr/share/applications/dev.linwood.setonix.desktop b/app/linux/debian/usr/share/applications/dev.linwood.setonix.desktop index 5e6dbf30..6712e20b 100644 --- a/app/linux/debian/usr/share/applications/dev.linwood.setonix.desktop +++ b/app/linux/debian/usr/share/applications/dev.linwood.setonix.desktop @@ -1,8 +1,8 @@ -[Desktop Entry] -Name=Linwood Setonix -Comment=Play games everywhere you like -Exec=setonix %f -Icon=dev.linwood.setonix -Terminal=false -Type=Application -Categories=Game; +[Desktop Entry] +Name=Linwood Setonix +Comment=Play games everywhere you like +Exec=setonix %f +Icon=dev.linwood.setonix +Terminal=false +Type=Application +Categories=Game; diff --git a/app/linux/flutter/CMakeLists.txt b/app/linux/flutter/CMakeLists.txt index d5bd0164..27860e80 100644 --- a/app/linux/flutter/CMakeLists.txt +++ b/app/linux/flutter/CMakeLists.txt @@ -1,88 +1,88 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.10) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. - -# Serves the same purpose as list(TRANSFORM ... PREPEND ...), -# which isn't available in 3.10. -function(list_prepend LIST_NAME PREFIX) - set(NEW_LIST "") - foreach(element ${${LIST_NAME}}) - list(APPEND NEW_LIST "${PREFIX}${element}") - endforeach(element) - set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) -endfunction() - -# === Flutter Library === -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) - -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "fl_basic_message_channel.h" - "fl_binary_codec.h" - "fl_binary_messenger.h" - "fl_dart_project.h" - "fl_engine.h" - "fl_json_message_codec.h" - "fl_json_method_codec.h" - "fl_message_codec.h" - "fl_method_call.h" - "fl_method_channel.h" - "fl_method_codec.h" - "fl_method_response.h" - "fl_plugin_registrar.h" - "fl_plugin_registry.h" - "fl_standard_message_codec.h" - "fl_standard_method_codec.h" - "fl_string_codec.h" - "fl_value.h" - "fl_view.h" - "flutter_linux.h" -) -list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") -target_link_libraries(flutter INTERFACE - PkgConfig::GTK - PkgConfig::GLIB - PkgConfig::GIO -) -add_dependencies(flutter flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/_phony_ - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} -) +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/app/linux/main.cc b/app/linux/main.cc index e7c5c543..4340ffc1 100644 --- a/app/linux/main.cc +++ b/app/linux/main.cc @@ -1,6 +1,6 @@ -#include "my_application.h" - -int main(int argc, char** argv) { - g_autoptr(MyApplication) app = my_application_new(); - return g_application_run(G_APPLICATION(app), argc, argv); -} +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/app/linux/my_application.cc b/app/linux/my_application.cc index 8b8adea9..165e58f5 100644 --- a/app/linux/my_application.cc +++ b/app/linux/my_application.cc @@ -1,124 +1,124 @@ -#include "my_application.h" - -#include -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#include "flutter/generated_plugin_registrant.h" - -struct _MyApplication { - GtkApplication parent_instance; - char** dart_entrypoint_arguments; -}; - -G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) - -// Implements GApplication::activate. -static void my_application_activate(GApplication* application) { - MyApplication* self = MY_APPLICATION(application); - GtkWindow* window = - GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - - // Use a header bar when running in GNOME as this is the common style used - // by applications and is the setup most users will be using (e.g. Ubuntu - // desktop). - // If running on X and not using GNOME then just use a traditional title bar - // in case the window manager does more exotic layout, e.g. tiling. - // If running on Wayland assume the header bar will work (may need changing - // if future cases occur). - gboolean use_header_bar = TRUE; -#ifdef GDK_WINDOWING_X11 - GdkScreen* screen = gtk_window_get_screen(window); - if (GDK_IS_X11_SCREEN(screen)) { - const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { - use_header_bar = FALSE; - } - } -#endif - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "Setonix"); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, "Setonix"); - } - - gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); - - g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); - - FlView* view = fl_view_new(project); - gtk_widget_show(GTK_WIDGET(view)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); - - fl_register_plugins(FL_PLUGIN_REGISTRY(view)); - - gtk_widget_grab_focus(GTK_WIDGET(view)); -} - -// Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { - MyApplication* self = MY_APPLICATION(application); - // Strip out the first argument as it is the binary name. - self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); - - g_autoptr(GError) error = nullptr; - if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; - } - - g_application_activate(application); - *exit_status = 0; - - return TRUE; -} - -// Implements GApplication::startup. -static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application startup. - - G_APPLICATION_CLASS(my_application_parent_class)->startup(application); -} - -// Implements GApplication::shutdown. -static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); - - // Perform any actions required at application shutdown. - - G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); -} - -// Implements GObject::dispose. -static void my_application_dispose(GObject* object) { - MyApplication* self = MY_APPLICATION(object); - g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); - G_OBJECT_CLASS(my_application_parent_class)->dispose(object); -} - -static void my_application_class_init(MyApplicationClass* klass) { - G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; - G_APPLICATION_CLASS(klass)->startup = my_application_startup; - G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; - G_OBJECT_CLASS(klass)->dispose = my_application_dispose; -} - -static void my_application_init(MyApplication* self) {} - -MyApplication* my_application_new() { - return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); -} +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "Setonix"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "Setonix"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + //MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/app/linux/my_application.h b/app/linux/my_application.h index 72271d5e..8f20fb55 100644 --- a/app/linux/my_application.h +++ b/app/linux/my_application.h @@ -1,18 +1,18 @@ -#ifndef FLUTTER_MY_APPLICATION_H_ -#define FLUTTER_MY_APPLICATION_H_ - -#include - -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, - GtkApplication) - -/** - * my_application_new: - * - * Creates a new Flutter-based application. - * - * Returns: a new #MyApplication. - */ -MyApplication* my_application_new(); - -#endif // FLUTTER_MY_APPLICATION_H_ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/app/linux/rpm/linwood-setonix.desktop b/app/linux/rpm/linwood-setonix.desktop index 9e55e33c..d0c43dec 100644 --- a/app/linux/rpm/linwood-setonix.desktop +++ b/app/linux/rpm/linwood-setonix.desktop @@ -1,8 +1,8 @@ -[Desktop Entry] -Name=Linwood Setonix -Comment=Play games everywhere you like -Exec=/usr/bin/linwood-setonix %f -Icon=/usr/share/linwood-setonix/data/flutter_assets/images/logo.svg -Terminal=false -Type=Application -Categories=Game; +[Desktop Entry] +Name=Linwood Setonix +Comment=Play games everywhere you like +Exec=/usr/bin/linwood-setonix %f +Icon=/usr/share/linwood-setonix/data/flutter_assets/images/logo.svg +Terminal=false +Type=Application +Categories=Game; diff --git a/app/linux/rpm/linwood-setonix.spec b/app/linux/rpm/linwood-setonix.spec index 531d79e9..3a07ece8 100644 --- a/app/linux/rpm/linwood-setonix.spec +++ b/app/linux/rpm/linwood-setonix.spec @@ -1,43 +1,43 @@ -Name: linwood-setonix -Version: 1.0.0 -Release: 1%{?dist} -Summary: Play games everywhere you like -BuildArch: %{_target_cpu} -URL: https://github.com/LinwoodDev/Setonix -License: AGPLv3 -Source0: %{name}-%{version}.tar.gz - -Requires: bash - -%description -Coming soon... - -%prep -%setup -q - -%install -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT/%{_bindir} -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name} -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps - -# Copy binaries and architecture-specific files -cp %{name} $RPM_BUILD_ROOT/%{_datadir}/%{name} -cp -R lib $RPM_BUILD_ROOT/%{_datadir}/%{name} -cp -R data $RPM_BUILD_ROOT/%{_datadir}/%{name} - -# Create symlink for the binary -ln -s %{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT/%{_bindir}/%{name} - -# Install the desktop file -desktop-file-install --dir=$RPM_BUILD_ROOT/usr/share/applications %{name}.desktop - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%{_bindir}/%{name} -%{_datadir}/%{name} -/usr/share/applications/ - -%changelog +Name: linwood-setonix +Version: 1.0.0 +Release: 1%{?dist} +Summary: Play games everywhere you like +BuildArch: %{_target_cpu} +URL: https://github.com/LinwoodDev/Setonix +License: AGPLv3 +Source0: %{name}-%{version}.tar.gz + +Requires: bash + +%description +Coming soon... + +%prep +%setup -q + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/%{_bindir} +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name} +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps + +# Copy binaries and architecture-specific files +cp %{name} $RPM_BUILD_ROOT/%{_datadir}/%{name} +cp -R lib $RPM_BUILD_ROOT/%{_datadir}/%{name} +cp -R data $RPM_BUILD_ROOT/%{_datadir}/%{name} + +# Create symlink for the binary +ln -s %{_datadir}/%{name}/%{name} $RPM_BUILD_ROOT/%{_bindir}/%{name} + +# Install the desktop file +desktop-file-install --dir=$RPM_BUILD_ROOT/usr/share/applications %{name}.desktop + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{_bindir}/%{name} +%{_datadir}/%{name} +/usr/share/applications/ + +%changelog diff --git a/app/macos/.gitignore b/app/macos/.gitignore index 746adbb6..d4e05695 100644 --- a/app/macos/.gitignore +++ b/app/macos/.gitignore @@ -1,7 +1,7 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/app/macos/Flutter/Flutter-Debug.xcconfig b/app/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b6..f022c34e 100644 --- a/app/macos/Flutter/Flutter-Debug.xcconfig +++ b/app/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1 @@ -#include "ephemeral/Flutter-Generated.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/app/macos/Flutter/Flutter-Release.xcconfig b/app/macos/Flutter/Flutter-Release.xcconfig index c2efd0b6..f022c34e 100644 --- a/app/macos/Flutter/Flutter-Release.xcconfig +++ b/app/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1 @@ -#include "ephemeral/Flutter-Generated.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/app/macos/Runner.xcodeproj/project.pbxproj b/app/macos/Runner.xcodeproj/project.pbxproj index 278a3774..c77f5f22 100644 --- a/app/macos/Runner.xcodeproj/project.pbxproj +++ b/app/macos/Runner.xcodeproj/project.pbxproj @@ -1,705 +1,705 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC10EC2044A3C60003C045; - remoteInfo = Runner; - }; - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* setonix.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "setonix.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 331C80D2294CF70F00263BE5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C80D6294CF71000263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C80D7294CF71000263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 331C80D6294CF71000263BE5 /* RunnerTests */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* setonix.app */, - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C80D4294CF70F00263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 331C80D1294CF70F00263BE5 /* Sources */, - 331C80D2294CF70F00263BE5 /* Frameworks */, - 331C80D3294CF70F00263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C80DA294CF71000263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* setonix.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1510; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C80D4294CF70F00263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 33CC10EC2044A3C60003C045; - }; - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 331C80D4294CF70F00263BE5 /* RunnerTests */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C80D3294CF70F00263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C80D1294CF70F00263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC10EC2044A3C60003C045 /* Runner */; - targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; - }; - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 331C80DB294CF71000263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/setonix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/setonix"; - }; - name = Debug; - }; - 331C80DC294CF71000263BE5 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/setonix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/setonix"; - }; - name = Release; - }; - 331C80DD294CF71000263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/setonix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/setonix"; - }; - name = Profile; - }; - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C80DB294CF71000263BE5 /* Debug */, - 331C80DC294CF71000263BE5 /* Release */, - 331C80DD294CF71000263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* setonix.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "setonix.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* setonix.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* setonix.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/setonix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/setonix"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/setonix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/setonix"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/setonix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/setonix"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index 18d98100..fc6bf807 100644 --- a/app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -1,8 +1,8 @@ - - - - - IDEDidComputeMac32BitWarning - - - + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 26b8edc2..6e4e7f93 100644 --- a/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,98 +1,98 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/macos/Runner.xcworkspace/contents.xcworkspacedata b/app/macos/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16..59c6d394 100644 --- a/app/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/app/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index 18d98100..fc6bf807 100644 --- a/app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -1,8 +1,8 @@ - - - - - IDEDidComputeMac32BitWarning - - - + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app/macos/Runner/AppDelegate.swift b/app/macos/Runner/AppDelegate.swift index d53ef643..553a135b 100644 --- a/app/macos/Runner/AppDelegate.swift +++ b/app/macos/Runner/AppDelegate.swift @@ -1,9 +1,9 @@ -import Cocoa -import FlutterMacOS - -@NSApplicationMain -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } -} +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index a2ec33f1..8d4e7cb8 100644 --- a/app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,68 +1,68 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app/macos/Runner/Base.lproj/MainMenu.xib b/app/macos/Runner/Base.lproj/MainMenu.xib index 80e867a4..4632c696 100644 --- a/app/macos/Runner/Base.lproj/MainMenu.xib +++ b/app/macos/Runner/Base.lproj/MainMenu.xib @@ -1,343 +1,343 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/macos/Runner/Configs/AppInfo.xcconfig b/app/macos/Runner/Configs/AppInfo.xcconfig index 2f49b346..edd15f1e 100644 --- a/app/macos/Runner/Configs/AppInfo.xcconfig +++ b/app/macos/Runner/Configs/AppInfo.xcconfig @@ -1,14 +1,14 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = setonix - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 dev.linwood. All rights reserved. +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = setonix + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = dev.linwood.setonix + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2024 dev.linwood. All rights reserved. diff --git a/app/macos/Runner/Configs/Debug.xcconfig b/app/macos/Runner/Configs/Debug.xcconfig index 36b0fd94..b3988237 100644 --- a/app/macos/Runner/Configs/Debug.xcconfig +++ b/app/macos/Runner/Configs/Debug.xcconfig @@ -1,2 +1,2 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/app/macos/Runner/Configs/Release.xcconfig b/app/macos/Runner/Configs/Release.xcconfig index dff4f495..d93e5dc4 100644 --- a/app/macos/Runner/Configs/Release.xcconfig +++ b/app/macos/Runner/Configs/Release.xcconfig @@ -1,2 +1,2 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/app/macos/Runner/Configs/Warnings.xcconfig b/app/macos/Runner/Configs/Warnings.xcconfig index 42bcbf47..fb4d7d3f 100644 --- a/app/macos/Runner/Configs/Warnings.xcconfig +++ b/app/macos/Runner/Configs/Warnings.xcconfig @@ -1,13 +1,13 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/app/macos/Runner/DebugProfile.entitlements b/app/macos/Runner/DebugProfile.entitlements index dddb8a30..51d09670 100644 --- a/app/macos/Runner/DebugProfile.entitlements +++ b/app/macos/Runner/DebugProfile.entitlements @@ -1,12 +1,12 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/app/macos/Runner/Info.plist b/app/macos/Runner/Info.plist index 4789daa6..3733c1a8 100644 --- a/app/macos/Runner/Info.plist +++ b/app/macos/Runner/Info.plist @@ -1,32 +1,32 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/app/macos/Runner/MainFlutterWindow.swift b/app/macos/Runner/MainFlutterWindow.swift index 3cc05eb2..ab30cba8 100644 --- a/app/macos/Runner/MainFlutterWindow.swift +++ b/app/macos/Runner/MainFlutterWindow.swift @@ -1,15 +1,15 @@ -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/app/macos/Runner/Release.entitlements b/app/macos/Runner/Release.entitlements index 852fa1a4..04336df3 100644 --- a/app/macos/Runner/Release.entitlements +++ b/app/macos/Runner/Release.entitlements @@ -1,8 +1,8 @@ - - - - - com.apple.security.app-sandbox - - - + + + + + com.apple.security.app-sandbox + + + diff --git a/app/macos/RunnerTests/RunnerTests.swift b/app/macos/RunnerTests/RunnerTests.swift index 61f3bd1f..21fe1ab9 100644 --- a/app/macos/RunnerTests/RunnerTests.swift +++ b/app/macos/RunnerTests/RunnerTests.swift @@ -1,12 +1,12 @@ -import Cocoa -import FlutterMacOS -import XCTest - -class RunnerTests: XCTestCase { - - func testExample() { - // If you add code to the Runner application, consider adding tests here. - // See https://developer.apple.com/documentation/xctest for more information about using XCTest. - } - -} +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/app/pack/backgrounds/cards.json b/app/pack/backgrounds/cards.json index 2c14f0e6..1360d86f 100644 --- a/app/pack/backgrounds/cards.json +++ b/app/pack/backgrounds/cards.json @@ -1,3 +1,3 @@ -{ - "texture": "backgrounds/cards.png" -} +{ + "texture": "backgrounds/cards.png" +} diff --git a/app/pack/backgrounds/grid.json b/app/pack/backgrounds/grid.json index 0dc0f702..27de6e48 100644 --- a/app/pack/backgrounds/grid.json +++ b/app/pack/backgrounds/grid.json @@ -1,4 +1,4 @@ -{ - "texture": "backgrounds/grid.png", - "priority": 1 -} +{ + "texture": "backgrounds/grid.png", + "priority": 1 +} diff --git a/app/pack/boards/chess.json b/app/pack/boards/chess.json index bef2e396..d1f6018a 100644 --- a/app/pack/boards/chess.json +++ b/app/pack/boards/chess.json @@ -1,6 +1,6 @@ -{ - "offset": [0, 0], - "size": [160, 160], - "texture": "boards/chess.png", - "tiles": [10, 10] -} +{ + "offset": [0, 0], + "size": [160, 160], + "texture": "boards/chess.png", + "tiles": [10, 10] +} diff --git a/app/pack/decks/chess.json b/app/pack/decks/chess.json index 2adb97df..6f5ea6c8 100644 --- a/app/pack/decks/chess.json +++ b/app/pack/decks/chess.json @@ -1,170 +1,170 @@ -{ - "boards": [ - { - "position": [0, 0], - "name": "chess" - } - ], - "figures": [ - { - "position": [1, 1], - "name": "chess_black", - "variation": "rook" - }, - { - "position": [2, 1], - "name": "chess_black", - "variation": "knight" - }, - { - "position": [3, 1], - "name": "chess_black", - "variation": "bishop" - }, - { - "position": [4, 1], - "name": "chess_black", - "variation": "queen" - }, - { - "position": [5, 1], - "name": "chess_black", - "variation": "king" - }, - { - "position": [6, 1], - "name": "chess_black", - "variation": "bishop" - }, - { - "position": [7, 1], - "name": "chess_black", - "variation": "knight" - }, - { - "position": [8, 1], - "name": "chess_black", - "variation": "rook" - }, - { - "position": [1, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [2, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [3, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [4, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [5, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [6, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [7, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [8, 2], - "name": "chess_black", - "variation": "pawn" - }, - { - "position": [1, 8], - "name": "chess_white", - "variation": "rook" - }, - { - "position": [2, 8], - "name": "chess_white", - "variation": "knight" - }, - { - "position": [3, 8], - "name": "chess_white", - "variation": "bishop" - }, - { - "position": [4, 8], - "name": "chess_white", - "variation": "queen" - }, - { - "position": [5, 8], - "name": "chess_white", - "variation": "king" - }, - { - "position": [6, 8], - "name": "chess_white", - "variation": "bishop" - }, - { - "position": [7, 8], - "name": "chess_white", - "variation": "knight" - }, - { - "position": [8, 8], - "name": "chess_white", - "variation": "rook" - }, - { - "position": [1, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [2, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [3, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [4, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [5, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [6, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [7, 7], - "name": "chess_white", - "variation": "pawn" - }, - { - "position": [8, 7], - "name": "chess_white", - "variation": "pawn" - } - ] -} +{ + "boards": [ + { + "position": [0, 0], + "name": "chess" + } + ], + "figures": [ + { + "position": [1, 1], + "name": "chess_black", + "variation": "rook" + }, + { + "position": [2, 1], + "name": "chess_black", + "variation": "knight" + }, + { + "position": [3, 1], + "name": "chess_black", + "variation": "bishop" + }, + { + "position": [4, 1], + "name": "chess_black", + "variation": "queen" + }, + { + "position": [5, 1], + "name": "chess_black", + "variation": "king" + }, + { + "position": [6, 1], + "name": "chess_black", + "variation": "bishop" + }, + { + "position": [7, 1], + "name": "chess_black", + "variation": "knight" + }, + { + "position": [8, 1], + "name": "chess_black", + "variation": "rook" + }, + { + "position": [1, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [2, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [3, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [4, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [5, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [6, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [7, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [8, 2], + "name": "chess_black", + "variation": "pawn" + }, + { + "position": [1, 8], + "name": "chess_white", + "variation": "rook" + }, + { + "position": [2, 8], + "name": "chess_white", + "variation": "knight" + }, + { + "position": [3, 8], + "name": "chess_white", + "variation": "bishop" + }, + { + "position": [4, 8], + "name": "chess_white", + "variation": "queen" + }, + { + "position": [5, 8], + "name": "chess_white", + "variation": "king" + }, + { + "position": [6, 8], + "name": "chess_white", + "variation": "bishop" + }, + { + "position": [7, 8], + "name": "chess_white", + "variation": "knight" + }, + { + "position": [8, 8], + "name": "chess_white", + "variation": "rook" + }, + { + "position": [1, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [2, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [3, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [4, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [5, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [6, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [7, 7], + "name": "chess_white", + "variation": "pawn" + }, + { + "position": [8, 7], + "name": "chess_white", + "variation": "pawn" + } + ] +} diff --git a/app/pack/decks/chips.json b/app/pack/decks/chips.json index 2896ac01..550c867b 100644 --- a/app/pack/decks/chips.json +++ b/app/pack/decks/chips.json @@ -1,39 +1,39 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "chips", - "variation": "white" - }, - { - "position": [0, 0], - "name": "chips", - "variation": "black" - }, - { - "position": [0, 0], - "name": "chips", - "variation": "red" - }, - { - "position": [0, 0], - "name": "chips", - "variation": "yellow" - }, - { - "position": [0, 0], - "name": "chips", - "variation": "green" - }, - { - "position": [0, 0], - "name": "chips", - "variation": "blue" - }, - { - "position": [0, 0], - "name": "chips", - "variation": "indigo" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "chips", + "variation": "white" + }, + { + "position": [0, 0], + "name": "chips", + "variation": "black" + }, + { + "position": [0, 0], + "name": "chips", + "variation": "red" + }, + { + "position": [0, 0], + "name": "chips", + "variation": "yellow" + }, + { + "position": [0, 0], + "name": "chips", + "variation": "green" + }, + { + "position": [0, 0], + "name": "chips", + "variation": "blue" + }, + { + "position": [0, 0], + "name": "chips", + "variation": "indigo" + } + ] +} diff --git a/app/pack/decks/dices.json b/app/pack/decks/dices.json index f1f4de02..7092fd22 100644 --- a/app/pack/decks/dices.json +++ b/app/pack/decks/dices.json @@ -1,9 +1,9 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "d6", - "variation": "6" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "d6", + "variation": "6" + } + ] +} diff --git a/app/pack/decks/doko.json b/app/pack/decks/doko.json index ca76a498..1ba0aa94 100644 --- a/app/pack/decks/doko.json +++ b/app/pack/decks/doko.json @@ -1,204 +1,204 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + } + ] +} diff --git a/app/pack/decks/doko9.json b/app/pack/decks/doko9.json index a7e8c7f3..cfad0264 100644 --- a/app/pack/decks/doko9.json +++ b/app/pack/decks/doko9.json @@ -1,244 +1,244 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "cards", - "variation": "heart-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "cards", + "variation": "heart-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + } + ] +} diff --git a/app/pack/decks/full.json b/app/pack/decks/full.json index 269672f1..e5f3630e 100644 --- a/app/pack/decks/full.json +++ b/app/pack/decks/full.json @@ -1,279 +1,279 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "joker-red" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "joker-black" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "joker-mixed" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "joker-red" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "joker-black" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "joker-mixed" + } + ] +} diff --git a/app/pack/decks/poker.json b/app/pack/decks/poker.json index 161aeb7f..14402ae8 100644 --- a/app/pack/decks/poker.json +++ b/app/pack/decks/poker.json @@ -1,264 +1,264 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-2" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-3" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-4" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-5" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-6" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-2" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-3" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-4" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-5" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-6" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + } + ] +} diff --git a/app/pack/decks/skat.json b/app/pack/decks/skat.json index b1a68502..c90d30bf 100644 --- a/app/pack/decks/skat.json +++ b/app/pack/decks/skat.json @@ -1,164 +1,164 @@ -{ - "figures": [ - { - "position": [0, 0], - "name": "cards", - "variation": "heart-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "heart-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "diamond-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "spade-ace" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-7" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-8" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-9" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-10" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-jack" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-queen" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-king" - }, - { - "position": [0, 0], - "name": "cards", - "variation": "club-ace" - } - ] -} +{ + "figures": [ + { + "position": [0, 0], + "name": "cards", + "variation": "heart-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "heart-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "diamond-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "spade-ace" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-7" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-8" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-9" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-10" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-jack" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-queen" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-king" + }, + { + "position": [0, 0], + "name": "cards", + "variation": "club-ace" + } + ] +} diff --git a/app/pack/figures/cards.json b/app/pack/figures/cards.json index 0eefe007..92eeb858 100644 --- a/app/pack/figures/cards.json +++ b/app/pack/figures/cards.json @@ -1,363 +1,363 @@ -{ - "back": { - "texture": "figures/cards.png", - "offset": [448, 96], - "size": [32, 32] - }, - "variations": { - "heart": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [0, 0], - "size": [32, 32] - }, - "heart-ace": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [32, 0], - "size": [32, 32] - }, - "heart-2": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [64, 0], - "size": [32, 32] - }, - "heart-3": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [96, 0], - "size": [32, 32] - }, - "heart-4": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [128, 0], - "size": [32, 32] - }, - "heart-5": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [160, 0], - "size": [32, 32] - }, - "heart-6": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [192, 0], - "size": [32, 32] - }, - "heart-7": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [224, 0], - "size": [32, 32] - }, - "heart-8": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [256, 0], - "size": [32, 32] - }, - "heart-9": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [288, 0], - "size": [32, 32] - }, - "heart-10": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [320, 0], - "size": [32, 32] - }, - "heart-jack": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [352, 0], - "size": [32, 32] - }, - "heart-queen": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [384, 0], - "size": [32, 32] - }, - "heart-king": { - "category": "heart", - "texture": "figures/cards.png", - "offset": [416, 0], - "size": [32, 32] - }, - "diamond": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [0, 32], - "size": [32, 32] - }, - "diamond-ace": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [32, 32], - "size": [32, 32] - }, - "diamond-2": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [64, 32], - "size": [32, 32] - }, - "diamond-3": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [96, 32], - "size": [32, 32] - }, - "diamond-4": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [128, 32], - "size": [32, 32] - }, - "diamond-5": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [160, 32], - "size": [32, 32] - }, - "diamond-6": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [192, 32], - "size": [32, 32] - }, - "diamond-7": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [224, 32], - "size": [32, 32] - }, - "diamond-8": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [256, 32], - "size": [32, 32] - }, - "diamond-9": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [288, 32], - "size": [32, 32] - }, - "diamond-10": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [320, 32], - "size": [32, 32] - }, - "diamond-jack": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [352, 32], - "size": [32, 32] - }, - "diamond-queen": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [384, 32], - "size": [32, 32] - }, - "diamond-king": { - "category": "diamond", - "texture": "figures/cards.png", - "offset": [416, 32], - "size": [32, 32] - }, - "spade": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [0, 64], - "size": [32, 32] - }, - "spade-ace": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [32, 64], - "size": [32, 32] - }, - "spade-2": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [64, 64], - "size": [32, 32] - }, - "spade-3": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [96, 64], - "size": [32, 32] - }, - "spade-4": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [128, 64], - "size": [32, 32] - }, - "spade-5": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [160, 64], - "size": [32, 32] - }, - "spade-6": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [192, 64], - "size": [32, 32] - }, - "spade-7": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [224, 64], - "size": [32, 32] - }, - "spade-8": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [256, 64], - "size": [32, 32] - }, - "spade-9": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [288, 64], - "size": [32, 32] - }, - "spade-10": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [320, 64], - "size": [32, 32] - }, - "spade-jack": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [352, 64], - "size": [32, 32] - }, - "spade-queen": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [384, 64], - "size": [32, 32] - }, - "spade-king": { - "category": "spade", - "texture": "figures/cards.png", - "offset": [416, 64], - "size": [32, 32] - }, - "club": { - "category": "club", - "texture": "figures/cards.png", - "offset": [0, 96], - "size": [32, 32] - }, - "club-ace": { - "category": "club", - "texture": "figures/cards.png", - "offset": [32, 96], - "size": [32, 32] - }, - "club-2": { - "category": "club", - "texture": "figures/cards.png", - "offset": [64, 96], - "size": [32, 32] - }, - "club-3": { - "category": "club", - "texture": "figures/cards.png", - "offset": [96, 96], - "size": [32, 32] - }, - "club-4": { - "category": "club", - "texture": "figures/cards.png", - "offset": [128, 96], - "size": [32, 32] - }, - "club-5": { - "category": "club", - "texture": "figures/cards.png", - "offset": [160, 96], - "size": [32, 32] - }, - "club-6": { - "category": "club", - "texture": "figures/cards.png", - "offset": [192, 96], - "size": [32, 32] - }, - "club-7": { - "category": "club", - "texture": "figures/cards.png", - "offset": [224, 96], - "size": [32, 32] - }, - "club-8": { - "category": "club", - "texture": "figures/cards.png", - "offset": [256, 96], - "size": [32, 32] - }, - "club-9": { - "category": "club", - "texture": "figures/cards.png", - "offset": [288, 96], - "size": [32, 32] - }, - "club-10": { - "category": "club", - "texture": "figures/cards.png", - "offset": [320, 96], - "size": [32, 32] - }, - "club-jack": { - "category": "club", - "texture": "figures/cards.png", - "offset": [352, 96], - "size": [32, 32] - }, - "club-queen": { - "category": "club", - "texture": "figures/cards.png", - "offset": [384, 96], - "size": [32, 32] - }, - "club-king": { - "category": "club", - "texture": "figures/cards.png", - "offset": [416, 96], - "size": [32, 32] - }, - "joker-red": { - "category": "joker", - "texture": "figures/cards.png", - "offset": [448, 0], - "size": [32, 32] - }, - "joker-black": { - "category": "joker", - "texture": "figures/cards.png", - "offset": [448, 32], - "size": [32, 32] - }, - "joker-mixed": { - "category": "joker", - "texture": "figures/cards.png", - "offset": [448, 64], - "size": [32, 32] - } - } -} +{ + "back": { + "texture": "figures/cards.png", + "offset": [448, 96], + "size": [32, 32] + }, + "variations": { + "heart": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [0, 0], + "size": [32, 32] + }, + "heart-ace": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [32, 0], + "size": [32, 32] + }, + "heart-2": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [64, 0], + "size": [32, 32] + }, + "heart-3": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [96, 0], + "size": [32, 32] + }, + "heart-4": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [128, 0], + "size": [32, 32] + }, + "heart-5": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [160, 0], + "size": [32, 32] + }, + "heart-6": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [192, 0], + "size": [32, 32] + }, + "heart-7": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [224, 0], + "size": [32, 32] + }, + "heart-8": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [256, 0], + "size": [32, 32] + }, + "heart-9": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [288, 0], + "size": [32, 32] + }, + "heart-10": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [320, 0], + "size": [32, 32] + }, + "heart-jack": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [352, 0], + "size": [32, 32] + }, + "heart-queen": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [384, 0], + "size": [32, 32] + }, + "heart-king": { + "category": "heart", + "texture": "figures/cards.png", + "offset": [416, 0], + "size": [32, 32] + }, + "diamond": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [0, 32], + "size": [32, 32] + }, + "diamond-ace": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [32, 32], + "size": [32, 32] + }, + "diamond-2": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [64, 32], + "size": [32, 32] + }, + "diamond-3": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [96, 32], + "size": [32, 32] + }, + "diamond-4": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [128, 32], + "size": [32, 32] + }, + "diamond-5": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [160, 32], + "size": [32, 32] + }, + "diamond-6": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [192, 32], + "size": [32, 32] + }, + "diamond-7": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [224, 32], + "size": [32, 32] + }, + "diamond-8": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [256, 32], + "size": [32, 32] + }, + "diamond-9": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [288, 32], + "size": [32, 32] + }, + "diamond-10": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [320, 32], + "size": [32, 32] + }, + "diamond-jack": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [352, 32], + "size": [32, 32] + }, + "diamond-queen": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [384, 32], + "size": [32, 32] + }, + "diamond-king": { + "category": "diamond", + "texture": "figures/cards.png", + "offset": [416, 32], + "size": [32, 32] + }, + "spade": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [0, 64], + "size": [32, 32] + }, + "spade-ace": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [32, 64], + "size": [32, 32] + }, + "spade-2": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [64, 64], + "size": [32, 32] + }, + "spade-3": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [96, 64], + "size": [32, 32] + }, + "spade-4": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [128, 64], + "size": [32, 32] + }, + "spade-5": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [160, 64], + "size": [32, 32] + }, + "spade-6": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [192, 64], + "size": [32, 32] + }, + "spade-7": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [224, 64], + "size": [32, 32] + }, + "spade-8": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [256, 64], + "size": [32, 32] + }, + "spade-9": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [288, 64], + "size": [32, 32] + }, + "spade-10": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [320, 64], + "size": [32, 32] + }, + "spade-jack": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [352, 64], + "size": [32, 32] + }, + "spade-queen": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [384, 64], + "size": [32, 32] + }, + "spade-king": { + "category": "spade", + "texture": "figures/cards.png", + "offset": [416, 64], + "size": [32, 32] + }, + "club": { + "category": "club", + "texture": "figures/cards.png", + "offset": [0, 96], + "size": [32, 32] + }, + "club-ace": { + "category": "club", + "texture": "figures/cards.png", + "offset": [32, 96], + "size": [32, 32] + }, + "club-2": { + "category": "club", + "texture": "figures/cards.png", + "offset": [64, 96], + "size": [32, 32] + }, + "club-3": { + "category": "club", + "texture": "figures/cards.png", + "offset": [96, 96], + "size": [32, 32] + }, + "club-4": { + "category": "club", + "texture": "figures/cards.png", + "offset": [128, 96], + "size": [32, 32] + }, + "club-5": { + "category": "club", + "texture": "figures/cards.png", + "offset": [160, 96], + "size": [32, 32] + }, + "club-6": { + "category": "club", + "texture": "figures/cards.png", + "offset": [192, 96], + "size": [32, 32] + }, + "club-7": { + "category": "club", + "texture": "figures/cards.png", + "offset": [224, 96], + "size": [32, 32] + }, + "club-8": { + "category": "club", + "texture": "figures/cards.png", + "offset": [256, 96], + "size": [32, 32] + }, + "club-9": { + "category": "club", + "texture": "figures/cards.png", + "offset": [288, 96], + "size": [32, 32] + }, + "club-10": { + "category": "club", + "texture": "figures/cards.png", + "offset": [320, 96], + "size": [32, 32] + }, + "club-jack": { + "category": "club", + "texture": "figures/cards.png", + "offset": [352, 96], + "size": [32, 32] + }, + "club-queen": { + "category": "club", + "texture": "figures/cards.png", + "offset": [384, 96], + "size": [32, 32] + }, + "club-king": { + "category": "club", + "texture": "figures/cards.png", + "offset": [416, 96], + "size": [32, 32] + }, + "joker-red": { + "category": "joker", + "texture": "figures/cards.png", + "offset": [448, 0], + "size": [32, 32] + }, + "joker-black": { + "category": "joker", + "texture": "figures/cards.png", + "offset": [448, 32], + "size": [32, 32] + }, + "joker-mixed": { + "category": "joker", + "texture": "figures/cards.png", + "offset": [448, 64], + "size": [32, 32] + } + } +} diff --git a/app/pack/figures/chess_black.json b/app/pack/figures/chess_black.json index 1e2b570f..881f7239 100644 --- a/app/pack/figures/chess_black.json +++ b/app/pack/figures/chess_black.json @@ -1,39 +1,39 @@ -{ - "back": { - "texture": "figures/chess.png", - "offset": [0, 0], - "size": [32, 32] - }, - "variations": { - "king": { - "texture": "figures/chess.png", - "offset": [32, 0], - "size": [32, 32] - }, - "queen": { - "texture": "figures/chess.png", - "offset": [64, 0], - "size": [32, 32] - }, - "bishop": { - "texture": "figures/chess.png", - "offset": [96, 0], - "size": [32, 32] - }, - "knight": { - "texture": "figures/chess.png", - "offset": [128, 0], - "size": [32, 32] - }, - "rook": { - "texture": "figures/chess.png", - "offset": [160, 0], - "size": [32, 32] - }, - "pawn": { - "texture": "figures/chess.png", - "offset": [192, 0], - "size": [32, 32] - } - } -} +{ + "back": { + "texture": "figures/chess.png", + "offset": [0, 0], + "size": [32, 32] + }, + "variations": { + "king": { + "texture": "figures/chess.png", + "offset": [32, 0], + "size": [32, 32] + }, + "queen": { + "texture": "figures/chess.png", + "offset": [64, 0], + "size": [32, 32] + }, + "bishop": { + "texture": "figures/chess.png", + "offset": [96, 0], + "size": [32, 32] + }, + "knight": { + "texture": "figures/chess.png", + "offset": [128, 0], + "size": [32, 32] + }, + "rook": { + "texture": "figures/chess.png", + "offset": [160, 0], + "size": [32, 32] + }, + "pawn": { + "texture": "figures/chess.png", + "offset": [192, 0], + "size": [32, 32] + } + } +} diff --git a/app/pack/figures/chess_white.json b/app/pack/figures/chess_white.json index d87aad77..09aec84b 100644 --- a/app/pack/figures/chess_white.json +++ b/app/pack/figures/chess_white.json @@ -1,39 +1,39 @@ -{ - "back": { - "texture": "figures/chess.png", - "offset": [0, 32], - "size": [32, 32] - }, - "variations": { - "king": { - "texture": "figures/chess.png", - "offset": [32, 32], - "size": [32, 32] - }, - "queen": { - "texture": "figures/chess.png", - "offset": [64, 32], - "size": [32, 32] - }, - "bishop": { - "texture": "figures/chess.png", - "offset": [96, 32], - "size": [32, 32] - }, - "knight": { - "texture": "figures/chess.png", - "offset": [128, 32], - "size": [32, 32] - }, - "rook": { - "texture": "figures/chess.png", - "offset": [160, 32], - "size": [32, 32] - }, - "pawn": { - "texture": "figures/chess.png", - "offset": [192, 32], - "size": [32, 32] - } - } -} +{ + "back": { + "texture": "figures/chess.png", + "offset": [0, 32], + "size": [32, 32] + }, + "variations": { + "king": { + "texture": "figures/chess.png", + "offset": [32, 32], + "size": [32, 32] + }, + "queen": { + "texture": "figures/chess.png", + "offset": [64, 32], + "size": [32, 32] + }, + "bishop": { + "texture": "figures/chess.png", + "offset": [96, 32], + "size": [32, 32] + }, + "knight": { + "texture": "figures/chess.png", + "offset": [128, 32], + "size": [32, 32] + }, + "rook": { + "texture": "figures/chess.png", + "offset": [160, 32], + "size": [32, 32] + }, + "pawn": { + "texture": "figures/chess.png", + "offset": [192, 32], + "size": [32, 32] + } + } +} diff --git a/app/pack/figures/chips.json b/app/pack/figures/chips.json index b1260685..067782e8 100644 --- a/app/pack/figures/chips.json +++ b/app/pack/figures/chips.json @@ -1,44 +1,44 @@ -{ - "back": { - "texture": "figures/chips.png", - "offset": [0, 0], - "size": [32, 32] - }, - "variations": { - "white": { - "texture": "figures/chips.png", - "offset": [32, 0], - "size": [32, 32] - }, - "black": { - "texture": "figures/chips.png", - "offset": [64, 0], - "size": [32, 32] - }, - "red": { - "texture": "figures/chips.png", - "offset": [96, 0], - "size": [32, 32] - }, - "yellow": { - "texture": "figures/chips.png", - "offset": [0, 32], - "size": [32, 32] - }, - "green": { - "texture": "figures/chips.png", - "offset": [32, 32], - "size": [32, 32] - }, - "blue": { - "texture": "figures/chips.png", - "offset": [64, 32], - "size": [32, 32] - }, - "indigo": { - "texture": "figures/chips.png", - "offset": [96, 32], - "size": [32, 32] - } - } -} +{ + "back": { + "texture": "figures/chips.png", + "offset": [0, 0], + "size": [32, 32] + }, + "variations": { + "white": { + "texture": "figures/chips.png", + "offset": [32, 0], + "size": [32, 32] + }, + "black": { + "texture": "figures/chips.png", + "offset": [64, 0], + "size": [32, 32] + }, + "red": { + "texture": "figures/chips.png", + "offset": [96, 0], + "size": [32, 32] + }, + "yellow": { + "texture": "figures/chips.png", + "offset": [0, 32], + "size": [32, 32] + }, + "green": { + "texture": "figures/chips.png", + "offset": [32, 32], + "size": [32, 32] + }, + "blue": { + "texture": "figures/chips.png", + "offset": [64, 32], + "size": [32, 32] + }, + "indigo": { + "texture": "figures/chips.png", + "offset": [96, 32], + "size": [32, 32] + } + } +} diff --git a/app/pack/figures/d6.json b/app/pack/figures/d6.json index fa18a693..0db0f75b 100644 --- a/app/pack/figures/d6.json +++ b/app/pack/figures/d6.json @@ -1,40 +1,40 @@ -{ - "back": { - "texture": "figures/d6.png", - "offset": [0, 0], - "size": [32, 32] - }, - "rollable": true, - "variations": { - "1": { - "texture": "figures/d6.png", - "offset": [32, 0], - "size": [32, 32] - }, - "2": { - "texture": "figures/d6.png", - "offset": [64, 0], - "size": [32, 32] - }, - "3": { - "texture": "figures/d6.png", - "offset": [96, 0], - "size": [32, 32] - }, - "4": { - "texture": "figures/d6.png", - "offset": [128, 0], - "size": [32, 32] - }, - "5": { - "texture": "figures/d6.png", - "offset": [160, 0], - "size": [32, 32] - }, - "6": { - "texture": "figures/d6.png", - "offset": [192, 0], - "size": [32, 32] - } - } -} +{ + "back": { + "texture": "figures/d6.png", + "offset": [0, 0], + "size": [32, 32] + }, + "rollable": true, + "variations": { + "1": { + "texture": "figures/d6.png", + "offset": [32, 0], + "size": [32, 32] + }, + "2": { + "texture": "figures/d6.png", + "offset": [64, 0], + "size": [32, 32] + }, + "3": { + "texture": "figures/d6.png", + "offset": [96, 0], + "size": [32, 32] + }, + "4": { + "texture": "figures/d6.png", + "offset": [128, 0], + "size": [32, 32] + }, + "5": { + "texture": "figures/d6.png", + "offset": [160, 0], + "size": [32, 32] + }, + "6": { + "texture": "figures/d6.png", + "offset": [192, 0], + "size": [32, 32] + } + } +} diff --git a/app/pack/pack.json b/app/pack/pack.json index fc10ba86..4db11b34 100644 --- a/app/pack/pack.json +++ b/app/pack/pack.json @@ -1,6 +1,6 @@ -{ - "name": "Core pack", - "description": "Official general pack", - "author": "Linwood", - "version": "1.0.0" -} +{ + "name": "Core pack", + "description": "Official general pack", + "author": "Linwood", + "version": "1.0.0" +} diff --git a/app/pubspec.lock b/app/pubspec.lock index fdf5b03b..ecee4ccf 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -173,10 +173,10 @@ packages: dependency: transitive description: name: code_assets - sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.1" collection: dependency: "direct main" description: @@ -554,10 +554,10 @@ packages: dependency: "direct main" description: name: hooks - sha256: "025f060e86d2d4c3c47b56e33caf7f93bf9283340f26d23424ebcfccf34f621e" + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.2" http: dependency: "direct main" description: @@ -682,8 +682,8 @@ packages: dependency: "direct main" description: path: "packages/lw_file_system" - ref: "4e752615dd91f264cca97bf6a5e95447d2bb3764" - resolved-ref: "4e752615dd91f264cca97bf6a5e95447d2bb3764" + ref: "064aed61c361194bf0eb3cb599e62bdd3c111d7c" + resolved-ref: "064aed61c361194bf0eb3cb599e62bdd3c111d7c" url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "1.0.0" @@ -691,8 +691,8 @@ packages: dependency: transitive description: path: "packages/lw_file_system_api" - ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" - resolved-ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" + ref: "37594211585889e35e65dad382d4fdcf29ac69a0" + resolved-ref: "37594211585889e35e65dad382d4fdcf29ac69a0" url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "1.0.0" @@ -700,8 +700,8 @@ packages: dependency: "direct main" description: path: "packages/lw_sysapi" - ref: "6d43be062401fafdd956448c59dea8c1df69198b" - resolved-ref: "6d43be062401fafdd956448c59dea8c1df69198b" + ref: f245398f838660b34737d229be94ff35918d5b4f + resolved-ref: f245398f838660b34737d229be94ff35918d5b4f url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "0.0.1" @@ -741,8 +741,8 @@ packages: dependency: "direct main" description: path: "packages/material_leap" - ref: fa022bf7691aee963486058a13c7027f301cc630 - resolved-ref: fa022bf7691aee963486058a13c7027f301cc630 + ref: "064aed61c361194bf0eb3cb599e62bdd3c111d7c" + resolved-ref: "064aed61c361194bf0eb3cb599e62bdd3c111d7c" url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "0.0.1" @@ -770,22 +770,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.17.0" - native_toolchain_c: - dependency: transitive - description: - name: native_toolchain_c - sha256: "6ba77bb18063eebe9de401f5e6437e95e1438af0a87a3a39084fbd37c90df572" - url: "https://pub.dev" - source: hosted - version: "0.17.6" native_toolchain_rust: dependency: transitive description: name: native_toolchain_rust - sha256: "26d4dcae954328af4ebfa8fc56cca0bf74b9ae8b4a6132de5da2071ac3d237b3" + sha256: faa57d2258a3b0fd2a634054f54e4496c9fcbd971977e7d2b7e6916d56892857 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.4+0" nested: dependency: transitive description: @@ -849,10 +841,10 @@ packages: dependency: transitive description: name: objective_c - sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52" + sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" url: "https://pub.dev" source: hosted - version: "9.3.0" + version: "9.4.1" ordered_set: dependency: transitive description: @@ -1414,10 +1406,10 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: "7ee12e6dffe0fc8e755179d6d91b3b34f5924223fc104d85572ef9180d73d172" + sha256: "142a9146f447d15b10bdc00e21d5f4d83e5b32bb5f8f8f5a04c75311344923a3" url: "https://pub.dev" source: hosted - version: "1.2.5" + version: "1.2.6" vector_math: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 82c7ff55..b602e23b 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: material_leap: git: url: https://github.com/LinwoodDev/dart_pkgs.git - ref: fa022bf7691aee963486058a13c7027f301cc630 + ref: 064aed61c361194bf0eb3cb599e62bdd3c111d7c path: packages/material_leap flex_color_scheme: ^8.1.0 flutter_svg: ^2.2.0 @@ -78,12 +78,12 @@ dependencies: lw_file_system: git: url: https://github.com/LinwoodDev/dart_pkgs.git - ref: 4e752615dd91f264cca97bf6a5e95447d2bb3764 + ref: 064aed61c361194bf0eb3cb599e62bdd3c111d7c path: packages/lw_file_system lw_sysapi: git: url: https://github.com/LinwoodDev/dart_pkgs.git - ref: 6d43be062401fafdd956448c59dea8c1df69198b + ref: f245398f838660b34737d229be94ff35918d5b4f path: packages/lw_sysapi setonix_api: path: ../api @@ -93,7 +93,7 @@ dependencies: markdown_widget: ^2.3.2+8 markdown: ^7.2.2 bloc_concurrency: ^0.3.0 - hooks: ^1.0.3 + hooks: ^2.0.2 idb_shim: ^2.6.1+7 setonix_plugin: path: ../plugin diff --git a/app/scripts/build-rpm.sh b/app/scripts/build-rpm.sh index 4ceaa0b6..a16bf62d 100644 --- a/app/scripts/build-rpm.sh +++ b/app/scripts/build-rpm.sh @@ -1,74 +1,74 @@ -#!/bin/bash - -# Default values for architecture -DIRECTORY_ARCH="x64" # Default directory name -BINARY_ARCH="x86_64" # Default binary name -RPM_ARCH="x86_64" # Default RPM architecture - -# Parse command-line arguments -while getopts "d:b:" opt; do - case $opt in - d) DIRECTORY_ARCH="$OPTARG" ;; # Set the directory architecture - b) BINARY_ARCH="$OPTARG" ;; # Set the binary architecture - *) - echo "Usage: $0 [-d directory_arch] [-b binary_arch]" - exit 1 - ;; - esac -done - -RPM_ARCH="$DIRECTORY_ARCH" # Set RPM architecture based on directory architecture -if [ "$RPM_ARCH" = "x64" ]; then - RPM_ARCH="x86_64" -elif [ "$RPM_ARCH" = "arm64" ]; then - RPM_ARCH="aarch64" -fi - -# Read version from pubspec -SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" -[[ $(grep -E "${SETONIX_VERSION_REGEX}" pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] -SETONIX_VERSION="${BASH_REMATCH[1]}" - -# Replace - with ~ to match RPM versioning -RPM_VERSION=$(echo $SETONIX_VERSION | sed 's/-/~/g') -CURRENT_DIR=$(pwd) -echo "Building Setonix $RPM_VERSION for $DIRECTORY_ARCH/$BINARY_ARCH ($RPM_ARCH)" - -# Clean and set up build directories -rm -rf build/{BUILD,RPMS,SOURCES,SPECS,SRPMS} -mkdir -p build/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - -# Copy files -cp linux/rpm/linwood-setonix.spec build/SPECS/linwood-setonix.spec -cp -r build/linux/${DIRECTORY_ARCH}/release/bundle build/SOURCES/linwood-setonix-$RPM_VERSION -chmod 755 build/SOURCES/linwood-setonix-$RPM_VERSION/setonix -mv build/SOURCES/linwood-setonix-$RPM_VERSION/setonix build/SOURCES/linwood-setonix-$RPM_VERSION/linwood-setonix -cp linux/rpm/linwood-setonix.desktop build/SOURCES/linwood-setonix-$RPM_VERSION/linwood-setonix.desktop - -# Update .spec file with the correct version -sed -i "2s/.*/Version: $RPM_VERSION/" build/SPECS/linwood-setonix.spec - -# Create tarball -cd build/SOURCES/ -# Fix .so files using patchelf -cd linwood-setonix-$RPM_VERSION/lib -for file in *.so; do - PATCHELF_OUTPUT=$(patchelf --print-rpath "$file") - echo "Checking $file: $PATCHELF_OUTPUT" - # Skip file if PATCHELF_OUTPUT does not contain CURRENT_DIR - if [[ ! $PATCHELF_OUTPUT =~ $CURRENT_DIR ]]; then - echo "Skipping $file" - continue - fi - echo "Fixing $file" - patchelf --set-rpath '$ORIGIN' "$file" -done -cd ../../ -tar --create --file linwood-setonix-$RPM_VERSION.tar.gz linwood-setonix-$RPM_VERSION -cd ../../ - -# Build RPM -QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -bb build/SPECS/linwood-setonix.spec --define "_topdir $(pwd)/build" - -# Copy the RPM to the build folder -cp build/RPMS/${RPM_ARCH}/linwood-setonix-*.rpm build/linwood-setonix-linux-${BINARY_ARCH}.rpm +#!/bin/bash + +# Default values for architecture +DIRECTORY_ARCH="x64" # Default directory name +BINARY_ARCH="x86_64" # Default binary name +RPM_ARCH="x86_64" # Default RPM architecture + +# Parse command-line arguments +while getopts "d:b:" opt; do + case $opt in + d) DIRECTORY_ARCH="$OPTARG" ;; # Set the directory architecture + b) BINARY_ARCH="$OPTARG" ;; # Set the binary architecture + *) + echo "Usage: $0 [-d directory_arch] [-b binary_arch]" + exit 1 + ;; + esac +done + +RPM_ARCH="$DIRECTORY_ARCH" # Set RPM architecture based on directory architecture +if [ "$RPM_ARCH" = "x64" ]; then + RPM_ARCH="x86_64" +elif [ "$RPM_ARCH" = "arm64" ]; then + RPM_ARCH="aarch64" +fi + +# Read version from pubspec +SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)" +[[ $(grep -E "${SETONIX_VERSION_REGEX}" pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]] +SETONIX_VERSION="${BASH_REMATCH[1]}" + +# Replace - with ~ to match RPM versioning +RPM_VERSION=$(echo $SETONIX_VERSION | sed 's/-/~/g') +CURRENT_DIR=$(pwd) +echo "Building Setonix $RPM_VERSION for $DIRECTORY_ARCH/$BINARY_ARCH ($RPM_ARCH)" + +# Clean and set up build directories +rm -rf build/{BUILD,RPMS,SOURCES,SPECS,SRPMS} +mkdir -p build/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + +# Copy files +cp linux/rpm/linwood-setonix.spec build/SPECS/linwood-setonix.spec +cp -r build/linux/${DIRECTORY_ARCH}/release/bundle build/SOURCES/linwood-setonix-$RPM_VERSION +chmod 755 build/SOURCES/linwood-setonix-$RPM_VERSION/setonix +mv build/SOURCES/linwood-setonix-$RPM_VERSION/setonix build/SOURCES/linwood-setonix-$RPM_VERSION/linwood-setonix +cp linux/rpm/linwood-setonix.desktop build/SOURCES/linwood-setonix-$RPM_VERSION/linwood-setonix.desktop + +# Update .spec file with the correct version +sed -i "2s/.*/Version: $RPM_VERSION/" build/SPECS/linwood-setonix.spec + +# Create tarball +cd build/SOURCES/ +# Fix .so files using patchelf +cd linwood-setonix-$RPM_VERSION/lib +for file in *.so; do + PATCHELF_OUTPUT=$(patchelf --print-rpath "$file") + echo "Checking $file: $PATCHELF_OUTPUT" + # Skip file if PATCHELF_OUTPUT does not contain CURRENT_DIR + if [[ ! $PATCHELF_OUTPUT =~ $CURRENT_DIR ]]; then + echo "Skipping $file" + continue + fi + echo "Fixing $file" + patchelf --set-rpath '$ORIGIN' "$file" +done +cd ../../ +tar --create --file linwood-setonix-$RPM_VERSION.tar.gz linwood-setonix-$RPM_VERSION +cd ../../ + +# Build RPM +QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -bb build/SPECS/linwood-setonix.spec --define "_topdir $(pwd)/build" + +# Copy the RPM to the build folder +cp build/RPMS/${RPM_ARCH}/linwood-setonix-*.rpm build/linwood-setonix-linux-${BINARY_ARCH}.rpm diff --git a/app/scripts/start.bat b/app/scripts/start.bat index 1dcdf24e..d87ed42a 100644 --- a/app/scripts/start.bat +++ b/app/scripts/start.bat @@ -1,2 +1,2 @@ -@ECHO OFF -START "" "%~dp0setonix.exe" --path "%~dp0UserData" +@ECHO OFF +START "" "%~dp0setonix.exe" --path "%~dp0UserData" diff --git a/app/scripts/start.sh b/app/scripts/start.sh index 7def7ed0..0657f687 100644 --- a/app/scripts/start.sh +++ b/app/scripts/start.sh @@ -1,2 +1,2 @@ -#!/bin/sh -./setonix --path ./UserData +#!/bin/sh +./setonix --path ./UserData diff --git a/app/snapcraft.yaml b/app/snapcraft.yaml index f6e7039a..4c500773 100644 --- a/app/snapcraft.yaml +++ b/app/snapcraft.yaml @@ -1,91 +1,91 @@ -name: setonix -grade: stable -adopt-info: setonix -icon: linux/debian/usr/share/icons/hicolor/256x256/apps/dev.linwood.setonix.png -base: core24 -confinement: strict -compression: lzo -title: 'Linwood Setonix' #For future, if changes needed, it can be easily done from here -issues: https://github.com/LinwoodDev/Setonix/issues #for metadata -website: https://github.com/LinwoodDev/Setonix #for metadata in gnome-software, kde-discover -license: AGPL-3.0 #for metadata -platforms: - amd64: - arm64: -apps: - setonix: - command: setonix - extensions: [gnome] - plugs: - - home - - network - - optical-drive - - removable-media - common-id: dev.linwood.setonix - desktop: meta/gui/setonix.desktop - -parts: - flutter-git: - source: https://github.com/flutter/flutter.git - plugin: nil - override-pull: | - set -eux - # Extract the Flutter version from pubspec.yaml - FLUTTER_VERSION=$(grep -E '^ flutter:' "$CRAFT_PROJECT_DIR/app/pubspec.yaml" | awk '{print $2}') - echo "Using Flutter version: $FLUTTER_VERSION" - git clone --recursive --branch "$FLUTTER_VERSION" https://github.com/flutter/flutter.git "$CRAFT_PART_SRC" - override-build: | - set -eux - mkdir -p $CRAFT_PART_INSTALL/usr/bin - mkdir -p $CRAFT_PART_INSTALL/usr/libexec - cp -r $CRAFT_PART_SRC $CRAFT_PART_INSTALL/usr/libexec/flutter - ln -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter - ln -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/dart $CRAFT_PART_INSTALL/usr/bin/dart - export PATH="$CRAFT_PART_INSTALL/usr/bin:$PATH" - flutter doctor - build-packages: - - clang - - cmake - - curl - - ninja-build - - unzip - override-prime: '' - setonix: - after: [ flutter-git ] - plugin: nil - #plugin: flutter - source: . - build-snaps: - - cmake - build-packages: - - curl - - libsecret-1-dev - - libjsoncpp-dev - - clang - - ninja-build - - pkg-config - - rustup - - lld - - llvm - override-build: | - craftctl default - set -eux - cd $CRAFT_PART_SRC_WORK - cd tools - dart pub get - cd .. - dart run tools/generate.dart - cd app - flutter pub get || true - flutter build linux --release --verbose --target lib/main.dart - cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/ - mkdir -p $CRAFT_PART_INSTALL/metainfo - cp -r linux/debian/usr/share/metainfo/dev.linwood.setonix.appdata.xml $CRAFT_PART_INSTALL/metainfo/ - mkdir -p $CRAFT_PART_INSTALL/meta/gui - mv linux/debian/usr/share/applications/dev.linwood.setonix.desktop $CRAFT_PART_INSTALL/meta/gui/setonix.desktop - mkdir -p $CRAFT_PART_INSTALL/usr/share/icons/hicolor - cp linux/debian/usr/share/icons/hicolor $CRAFT_PART_INSTALL/usr/share/icons/ -r - stage-packages: - - libsecret-1-0 - - libjsoncpp25 - parse-info: [ metainfo/dev.linwood.setonix.appdata.xml ] +name: setonix +grade: stable +adopt-info: setonix +icon: linux/debian/usr/share/icons/hicolor/256x256/apps/dev.linwood.setonix.png +base: core24 +confinement: strict +compression: lzo +title: 'Linwood Setonix' #For future, if changes needed, it can be easily done from here +issues: https://github.com/LinwoodDev/Setonix/issues #for metadata +website: https://github.com/LinwoodDev/Setonix #for metadata in gnome-software, kde-discover +license: AGPL-3.0 #for metadata +platforms: + amd64: + arm64: +apps: + setonix: + command: setonix + extensions: [gnome] + plugs: + - home + - network + - optical-drive + - removable-media + common-id: dev.linwood.setonix + desktop: meta/gui/setonix.desktop + +parts: + flutter-git: + source: https://github.com/flutter/flutter.git + plugin: nil + override-pull: | + set -eux + # Extract the Flutter version from pubspec.yaml + FLUTTER_VERSION=$(grep -E '^ flutter:' "$CRAFT_PROJECT_DIR/app/pubspec.yaml" | awk '{print $2}') + echo "Using Flutter version: $FLUTTER_VERSION" + git clone --recursive --branch "$FLUTTER_VERSION" https://github.com/flutter/flutter.git "$CRAFT_PART_SRC" + override-build: | + set -eux + mkdir -p $CRAFT_PART_INSTALL/usr/bin + mkdir -p $CRAFT_PART_INSTALL/usr/libexec + cp -r $CRAFT_PART_SRC $CRAFT_PART_INSTALL/usr/libexec/flutter + ln -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter + ln -sf $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/dart $CRAFT_PART_INSTALL/usr/bin/dart + export PATH="$CRAFT_PART_INSTALL/usr/bin:$PATH" + flutter doctor + build-packages: + - clang + - cmake + - curl + - ninja-build + - unzip + override-prime: '' + setonix: + after: [ flutter-git ] + plugin: nil + #plugin: flutter + source: . + build-snaps: + - cmake + build-packages: + - curl + - libsecret-1-dev + - libjsoncpp-dev + - clang + - ninja-build + - pkg-config + - rustup + - lld + - llvm + override-build: | + craftctl default + set -eux + cd $CRAFT_PART_SRC_WORK + cd tools + dart pub get + cd .. + dart run tools/generate.dart + cd app + flutter pub get || true + flutter build linux --release --verbose --target lib/main.dart + cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/ + mkdir -p $CRAFT_PART_INSTALL/metainfo + cp -r linux/debian/usr/share/metainfo/dev.linwood.setonix.appdata.xml $CRAFT_PART_INSTALL/metainfo/ + mkdir -p $CRAFT_PART_INSTALL/meta/gui + mv linux/debian/usr/share/applications/dev.linwood.setonix.desktop $CRAFT_PART_INSTALL/meta/gui/setonix.desktop + mkdir -p $CRAFT_PART_INSTALL/usr/share/icons/hicolor + cp linux/debian/usr/share/icons/hicolor $CRAFT_PART_INSTALL/usr/share/icons/ -r + stage-packages: + - libsecret-1-0 + - libjsoncpp25 + parse-info: [ metainfo/dev.linwood.setonix.appdata.xml ] diff --git a/app/test/widget_test.dart b/app/test/widget_test.dart index 42c21b8f..22c608c7 100644 --- a/app/test/widget_test.dart +++ b/app/test/widget_test.dart @@ -1,16 +1,16 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:setonix/helpers/string.dart'; - -void main() { - group('StringHelper', () { - test('equalsIgnoreCase only matches complete strings', () { - expect('Setonix'.equalsIgnoreCase('setonix'), isTrue); - expect('Setonix'.equalsIgnoreCase('set'), isFalse); - }); - - test('containsIgnoreCase matches substrings', () { - expect('Linwood Setonix'.containsIgnoreCase('SETONIX'), isTrue); - expect('Linwood Setonix'.containsIgnoreCase('swamp'), isFalse); - }); - }); -} +import 'package:flutter_test/flutter_test.dart'; +import 'package:setonix/helpers/string.dart'; + +void main() { + group('StringHelper', () { + test('equalsIgnoreCase only matches complete strings', () { + expect('Setonix'.equalsIgnoreCase('setonix'), isTrue); + expect('Setonix'.equalsIgnoreCase('set'), isFalse); + }); + + test('containsIgnoreCase matches substrings', () { + expect('Linwood Setonix'.containsIgnoreCase('SETONIX'), isTrue); + expect('Linwood Setonix'.containsIgnoreCase('swamp'), isFalse); + }); + }); +} diff --git a/app/web/index.html b/app/web/index.html index 2bd5abb1..95ab6471 100644 --- a/app/web/index.html +++ b/app/web/index.html @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - Linwood Setonix - - - - - - + + + + + + + + + + + + + + + + + + + + Linwood Setonix + + + + + + diff --git a/app/web/manifest.json b/app/web/manifest.json index a7e5a00e..c4949dca 100644 --- a/app/web/manifest.json +++ b/app/web/manifest.json @@ -1,461 +1,461 @@ -{ - "name": "Linwood Setonix", - "short_name": "Setonix", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "Play games everywhere you like", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "windows11/SmallTile.scale-100.png", - "sizes": "71x71" - }, - { - "src": "windows11/SmallTile.scale-125.png", - "sizes": "89x89" - }, - { - "src": "windows11/SmallTile.scale-150.png", - "sizes": "107x107" - }, - { - "src": "windows11/SmallTile.scale-200.png", - "sizes": "142x142" - }, - { - "src": "windows11/SmallTile.scale-400.png", - "sizes": "284x284" - }, - { - "src": "windows11/Square150x150Logo.scale-100.png", - "sizes": "150x150" - }, - { - "src": "windows11/Square150x150Logo.scale-125.png", - "sizes": "188x188" - }, - { - "src": "windows11/Square150x150Logo.scale-150.png", - "sizes": "225x225" - }, - { - "src": "windows11/Square150x150Logo.scale-200.png", - "sizes": "300x300" - }, - { - "src": "windows11/Square150x150Logo.scale-400.png", - "sizes": "600x600" - }, - { - "src": "windows11/Wide310x150Logo.scale-100.png", - "sizes": "310x150" - }, - { - "src": "windows11/Wide310x150Logo.scale-125.png", - "sizes": "388x188" - }, - { - "src": "windows11/Wide310x150Logo.scale-150.png", - "sizes": "465x225" - }, - { - "src": "windows11/Wide310x150Logo.scale-200.png", - "sizes": "620x300" - }, - { - "src": "windows11/Wide310x150Logo.scale-400.png", - "sizes": "1240x600" - }, - { - "src": "windows11/LargeTile.scale-100.png", - "sizes": "310x310" - }, - { - "src": "windows11/LargeTile.scale-125.png", - "sizes": "388x388" - }, - { - "src": "windows11/LargeTile.scale-150.png", - "sizes": "465x465" - }, - { - "src": "windows11/LargeTile.scale-200.png", - "sizes": "620x620" - }, - { - "src": "windows11/LargeTile.scale-400.png", - "sizes": "1240x1240" - }, - { - "src": "windows11/Square44x44Logo.scale-100.png", - "sizes": "44x44" - }, - { - "src": "windows11/Square44x44Logo.scale-125.png", - "sizes": "55x55" - }, - { - "src": "windows11/Square44x44Logo.scale-150.png", - "sizes": "66x66" - }, - { - "src": "windows11/Square44x44Logo.scale-200.png", - "sizes": "88x88" - }, - { - "src": "windows11/Square44x44Logo.scale-400.png", - "sizes": "176x176" - }, - { - "src": "windows11/StoreLogo.scale-100.png", - "sizes": "50x50" - }, - { - "src": "windows11/StoreLogo.scale-125.png", - "sizes": "63x63" - }, - { - "src": "windows11/StoreLogo.scale-150.png", - "sizes": "75x75" - }, - { - "src": "windows11/StoreLogo.scale-200.png", - "sizes": "100x100" - }, - { - "src": "windows11/StoreLogo.scale-400.png", - "sizes": "200x200" - }, - { - "src": "windows11/SplashScreen.scale-100.png", - "sizes": "620x300" - }, - { - "src": "windows11/SplashScreen.scale-125.png", - "sizes": "775x375" - }, - { - "src": "windows11/SplashScreen.scale-150.png", - "sizes": "930x450" - }, - { - "src": "windows11/SplashScreen.scale-200.png", - "sizes": "1240x600" - }, - { - "src": "windows11/SplashScreen.scale-400.png", - "sizes": "2480x1200" - }, - { - "src": "windows11/Square44x44Logo.targetsize-16.png", - "sizes": "16x16" - }, - { - "src": "windows11/Square44x44Logo.targetsize-20.png", - "sizes": "20x20" - }, - { - "src": "windows11/Square44x44Logo.targetsize-24.png", - "sizes": "24x24" - }, - { - "src": "windows11/Square44x44Logo.targetsize-30.png", - "sizes": "30x30" - }, - { - "src": "windows11/Square44x44Logo.targetsize-32.png", - "sizes": "32x32" - }, - { - "src": "windows11/Square44x44Logo.targetsize-36.png", - "sizes": "36x36" - }, - { - "src": "windows11/Square44x44Logo.targetsize-40.png", - "sizes": "40x40" - }, - { - "src": "windows11/Square44x44Logo.targetsize-44.png", - "sizes": "44x44" - }, - { - "src": "windows11/Square44x44Logo.targetsize-48.png", - "sizes": "48x48" - }, - { - "src": "windows11/Square44x44Logo.targetsize-60.png", - "sizes": "60x60" - }, - { - "src": "windows11/Square44x44Logo.targetsize-64.png", - "sizes": "64x64" - }, - { - "src": "windows11/Square44x44Logo.targetsize-72.png", - "sizes": "72x72" - }, - { - "src": "windows11/Square44x44Logo.targetsize-80.png", - "sizes": "80x80" - }, - { - "src": "windows11/Square44x44Logo.targetsize-96.png", - "sizes": "96x96" - }, - { - "src": "windows11/Square44x44Logo.targetsize-256.png", - "sizes": "256x256" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-16.png", - "sizes": "16x16" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-20.png", - "sizes": "20x20" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-24.png", - "sizes": "24x24" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-30.png", - "sizes": "30x30" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-32.png", - "sizes": "32x32" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-36.png", - "sizes": "36x36" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-40.png", - "sizes": "40x40" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-44.png", - "sizes": "44x44" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-48.png", - "sizes": "48x48" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-60.png", - "sizes": "60x60" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-64.png", - "sizes": "64x64" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-72.png", - "sizes": "72x72" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-80.png", - "sizes": "80x80" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-96.png", - "sizes": "96x96" - }, - { - "src": "windows11/Square44x44Logo.altform-unplated_targetsize-256.png", - "sizes": "256x256" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-16.png", - "sizes": "16x16" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-20.png", - "sizes": "20x20" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-24.png", - "sizes": "24x24" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-30.png", - "sizes": "30x30" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-32.png", - "sizes": "32x32" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-36.png", - "sizes": "36x36" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-40.png", - "sizes": "40x40" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-44.png", - "sizes": "44x44" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-48.png", - "sizes": "48x48" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-60.png", - "sizes": "60x60" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png", - "sizes": "64x64" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-72.png", - "sizes": "72x72" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-80.png", - "sizes": "80x80" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-96.png", - "sizes": "96x96" - }, - { - "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-256.png", - "sizes": "256x256" - }, - { - "src": "android/android-launchericon-512-512.png", - "sizes": "512x512" - }, - { - "src": "android/android-launchericon-192-192.png", - "sizes": "192x192" - }, - { - "src": "android/android-launchericon-144-144.png", - "sizes": "144x144" - }, - { - "src": "android/android-launchericon-96-96.png", - "sizes": "96x96" - }, - { - "src": "android/android-launchericon-72-72.png", - "sizes": "72x72" - }, - { - "src": "android/android-launchericon-48-48.png", - "sizes": "48x48" - }, - { - "src": "ios/16.png", - "sizes": "16x16" - }, - { - "src": "ios/20.png", - "sizes": "20x20" - }, - { - "src": "ios/29.png", - "sizes": "29x29" - }, - { - "src": "ios/32.png", - "sizes": "32x32" - }, - { - "src": "ios/40.png", - "sizes": "40x40" - }, - { - "src": "ios/50.png", - "sizes": "50x50" - }, - { - "src": "ios/57.png", - "sizes": "57x57" - }, - { - "src": "ios/58.png", - "sizes": "58x58" - }, - { - "src": "ios/60.png", - "sizes": "60x60" - }, - { - "src": "ios/64.png", - "sizes": "64x64" - }, - { - "src": "ios/72.png", - "sizes": "72x72" - }, - { - "src": "ios/76.png", - "sizes": "76x76" - }, - { - "src": "ios/80.png", - "sizes": "80x80" - }, - { - "src": "ios/87.png", - "sizes": "87x87" - }, - { - "src": "ios/100.png", - "sizes": "100x100" - }, - { - "src": "ios/114.png", - "sizes": "114x114" - }, - { - "src": "ios/120.png", - "sizes": "120x120" - }, - { - "src": "ios/128.png", - "sizes": "128x128" - }, - { - "src": "ios/144.png", - "sizes": "144x144" - }, - { - "src": "ios/152.png", - "sizes": "152x152" - }, - { - "src": "ios/167.png", - "sizes": "167x167" - }, - { - "src": "ios/180.png", - "sizes": "180x180" - }, - { - "src": "ios/192.png", - "sizes": "192x192" - }, - { - "src": "ios/256.png", - "sizes": "256x256" - }, - { - "src": "ios/512.png", - "sizes": "512x512" - }, - { - "src": "ios/1024.png", - "sizes": "1024x1024" - } - ] -} +{ + "name": "Linwood Setonix", + "short_name": "Setonix", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "Play games everywhere you like", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "windows11/SmallTile.scale-100.png", + "sizes": "71x71" + }, + { + "src": "windows11/SmallTile.scale-125.png", + "sizes": "89x89" + }, + { + "src": "windows11/SmallTile.scale-150.png", + "sizes": "107x107" + }, + { + "src": "windows11/SmallTile.scale-200.png", + "sizes": "142x142" + }, + { + "src": "windows11/SmallTile.scale-400.png", + "sizes": "284x284" + }, + { + "src": "windows11/Square150x150Logo.scale-100.png", + "sizes": "150x150" + }, + { + "src": "windows11/Square150x150Logo.scale-125.png", + "sizes": "188x188" + }, + { + "src": "windows11/Square150x150Logo.scale-150.png", + "sizes": "225x225" + }, + { + "src": "windows11/Square150x150Logo.scale-200.png", + "sizes": "300x300" + }, + { + "src": "windows11/Square150x150Logo.scale-400.png", + "sizes": "600x600" + }, + { + "src": "windows11/Wide310x150Logo.scale-100.png", + "sizes": "310x150" + }, + { + "src": "windows11/Wide310x150Logo.scale-125.png", + "sizes": "388x188" + }, + { + "src": "windows11/Wide310x150Logo.scale-150.png", + "sizes": "465x225" + }, + { + "src": "windows11/Wide310x150Logo.scale-200.png", + "sizes": "620x300" + }, + { + "src": "windows11/Wide310x150Logo.scale-400.png", + "sizes": "1240x600" + }, + { + "src": "windows11/LargeTile.scale-100.png", + "sizes": "310x310" + }, + { + "src": "windows11/LargeTile.scale-125.png", + "sizes": "388x388" + }, + { + "src": "windows11/LargeTile.scale-150.png", + "sizes": "465x465" + }, + { + "src": "windows11/LargeTile.scale-200.png", + "sizes": "620x620" + }, + { + "src": "windows11/LargeTile.scale-400.png", + "sizes": "1240x1240" + }, + { + "src": "windows11/Square44x44Logo.scale-100.png", + "sizes": "44x44" + }, + { + "src": "windows11/Square44x44Logo.scale-125.png", + "sizes": "55x55" + }, + { + "src": "windows11/Square44x44Logo.scale-150.png", + "sizes": "66x66" + }, + { + "src": "windows11/Square44x44Logo.scale-200.png", + "sizes": "88x88" + }, + { + "src": "windows11/Square44x44Logo.scale-400.png", + "sizes": "176x176" + }, + { + "src": "windows11/StoreLogo.scale-100.png", + "sizes": "50x50" + }, + { + "src": "windows11/StoreLogo.scale-125.png", + "sizes": "63x63" + }, + { + "src": "windows11/StoreLogo.scale-150.png", + "sizes": "75x75" + }, + { + "src": "windows11/StoreLogo.scale-200.png", + "sizes": "100x100" + }, + { + "src": "windows11/StoreLogo.scale-400.png", + "sizes": "200x200" + }, + { + "src": "windows11/SplashScreen.scale-100.png", + "sizes": "620x300" + }, + { + "src": "windows11/SplashScreen.scale-125.png", + "sizes": "775x375" + }, + { + "src": "windows11/SplashScreen.scale-150.png", + "sizes": "930x450" + }, + { + "src": "windows11/SplashScreen.scale-200.png", + "sizes": "1240x600" + }, + { + "src": "windows11/SplashScreen.scale-400.png", + "sizes": "2480x1200" + }, + { + "src": "windows11/Square44x44Logo.targetsize-16.png", + "sizes": "16x16" + }, + { + "src": "windows11/Square44x44Logo.targetsize-20.png", + "sizes": "20x20" + }, + { + "src": "windows11/Square44x44Logo.targetsize-24.png", + "sizes": "24x24" + }, + { + "src": "windows11/Square44x44Logo.targetsize-30.png", + "sizes": "30x30" + }, + { + "src": "windows11/Square44x44Logo.targetsize-32.png", + "sizes": "32x32" + }, + { + "src": "windows11/Square44x44Logo.targetsize-36.png", + "sizes": "36x36" + }, + { + "src": "windows11/Square44x44Logo.targetsize-40.png", + "sizes": "40x40" + }, + { + "src": "windows11/Square44x44Logo.targetsize-44.png", + "sizes": "44x44" + }, + { + "src": "windows11/Square44x44Logo.targetsize-48.png", + "sizes": "48x48" + }, + { + "src": "windows11/Square44x44Logo.targetsize-60.png", + "sizes": "60x60" + }, + { + "src": "windows11/Square44x44Logo.targetsize-64.png", + "sizes": "64x64" + }, + { + "src": "windows11/Square44x44Logo.targetsize-72.png", + "sizes": "72x72" + }, + { + "src": "windows11/Square44x44Logo.targetsize-80.png", + "sizes": "80x80" + }, + { + "src": "windows11/Square44x44Logo.targetsize-96.png", + "sizes": "96x96" + }, + { + "src": "windows11/Square44x44Logo.targetsize-256.png", + "sizes": "256x256" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-16.png", + "sizes": "16x16" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-20.png", + "sizes": "20x20" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-24.png", + "sizes": "24x24" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-30.png", + "sizes": "30x30" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-32.png", + "sizes": "32x32" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-36.png", + "sizes": "36x36" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-40.png", + "sizes": "40x40" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-44.png", + "sizes": "44x44" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-48.png", + "sizes": "48x48" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-60.png", + "sizes": "60x60" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-64.png", + "sizes": "64x64" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-72.png", + "sizes": "72x72" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-80.png", + "sizes": "80x80" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-96.png", + "sizes": "96x96" + }, + { + "src": "windows11/Square44x44Logo.altform-unplated_targetsize-256.png", + "sizes": "256x256" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-16.png", + "sizes": "16x16" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-20.png", + "sizes": "20x20" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-24.png", + "sizes": "24x24" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-30.png", + "sizes": "30x30" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-32.png", + "sizes": "32x32" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-36.png", + "sizes": "36x36" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-40.png", + "sizes": "40x40" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-44.png", + "sizes": "44x44" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-48.png", + "sizes": "48x48" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-60.png", + "sizes": "60x60" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-64.png", + "sizes": "64x64" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-72.png", + "sizes": "72x72" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-80.png", + "sizes": "80x80" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-96.png", + "sizes": "96x96" + }, + { + "src": "windows11/Square44x44Logo.altform-lightunplated_targetsize-256.png", + "sizes": "256x256" + }, + { + "src": "android/android-launchericon-512-512.png", + "sizes": "512x512" + }, + { + "src": "android/android-launchericon-192-192.png", + "sizes": "192x192" + }, + { + "src": "android/android-launchericon-144-144.png", + "sizes": "144x144" + }, + { + "src": "android/android-launchericon-96-96.png", + "sizes": "96x96" + }, + { + "src": "android/android-launchericon-72-72.png", + "sizes": "72x72" + }, + { + "src": "android/android-launchericon-48-48.png", + "sizes": "48x48" + }, + { + "src": "ios/16.png", + "sizes": "16x16" + }, + { + "src": "ios/20.png", + "sizes": "20x20" + }, + { + "src": "ios/29.png", + "sizes": "29x29" + }, + { + "src": "ios/32.png", + "sizes": "32x32" + }, + { + "src": "ios/40.png", + "sizes": "40x40" + }, + { + "src": "ios/50.png", + "sizes": "50x50" + }, + { + "src": "ios/57.png", + "sizes": "57x57" + }, + { + "src": "ios/58.png", + "sizes": "58x58" + }, + { + "src": "ios/60.png", + "sizes": "60x60" + }, + { + "src": "ios/64.png", + "sizes": "64x64" + }, + { + "src": "ios/72.png", + "sizes": "72x72" + }, + { + "src": "ios/76.png", + "sizes": "76x76" + }, + { + "src": "ios/80.png", + "sizes": "80x80" + }, + { + "src": "ios/87.png", + "sizes": "87x87" + }, + { + "src": "ios/100.png", + "sizes": "100x100" + }, + { + "src": "ios/114.png", + "sizes": "114x114" + }, + { + "src": "ios/120.png", + "sizes": "120x120" + }, + { + "src": "ios/128.png", + "sizes": "128x128" + }, + { + "src": "ios/144.png", + "sizes": "144x144" + }, + { + "src": "ios/152.png", + "sizes": "152x152" + }, + { + "src": "ios/167.png", + "sizes": "167x167" + }, + { + "src": "ios/180.png", + "sizes": "180x180" + }, + { + "src": "ios/192.png", + "sizes": "192x192" + }, + { + "src": "ios/256.png", + "sizes": "256x256" + }, + { + "src": "ios/512.png", + "sizes": "512x512" + }, + { + "src": "ios/1024.png", + "sizes": "1024x1024" + } + ] +} diff --git a/app/windows/.gitignore b/app/windows/.gitignore index d492d0d9..ec4098aa 100644 --- a/app/windows/.gitignore +++ b/app/windows/.gitignore @@ -1,17 +1,17 @@ -flutter/ephemeral/ - -# Visual Studio user-specific files. -*.suo -*.user -*.userosscache -*.sln.docstates - -# Visual Studio build-related files. -x64/ -x86/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/app/windows/CMakeLists.txt b/app/windows/CMakeLists.txt index 77aad058..7f3b461f 100644 --- a/app/windows/CMakeLists.txt +++ b/app/windows/CMakeLists.txt @@ -1,108 +1,108 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.14) -project(setonix LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "setonix") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(VERSION 3.14...3.25) - -# Define build configuration option. -get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" - CACHE STRING "" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") - endif() -endif() -# Define settings for the Profile build mode. -set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") -set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") - -# Use Unicode for all projects. -add_definitions(-DUNICODE -D_UNICODE) - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) - target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") - target_compile_options(${TARGET} PRIVATE /EHsc) - target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") - target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# Support files are copied into place next to the executable, so that it can -# run in place. This is done instead of making a separate bundle (as on Linux) -# so that building and running from within Visual Studio will work. -set(BUILD_BUNDLE_DIR "$") -# Make the "install" step default, as it's required to run. -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - CONFIGURATIONS Profile;Release - COMPONENT Runtime) +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(setonix LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "setonix") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/app/windows/flutter/CMakeLists.txt b/app/windows/flutter/CMakeLists.txt index 903f4899..efb62ebe 100644 --- a/app/windows/flutter/CMakeLists.txt +++ b/app/windows/flutter/CMakeLists.txt @@ -1,109 +1,109 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.14) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. -set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") - -# Set fallback configurations for older versions of the flutter tool. -if (NOT DEFINED FLUTTER_TARGET_PLATFORM) - set(FLUTTER_TARGET_PLATFORM "windows-x64") -endif() - -# === Flutter Library === -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "flutter_export.h" - "flutter_windows.h" - "flutter_messenger.h" - "flutter_plugin_registrar.h" - "flutter_texture_registrar.h" -) -list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") -add_dependencies(flutter flutter_assemble) - -# === Wrapper === -list(APPEND CPP_WRAPPER_SOURCES_CORE - "core_implementations.cc" - "standard_codec.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_PLUGIN - "plugin_registrar.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_APP - "flutter_engine.cc" - "flutter_view_controller.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") - -# Wrapper sources needed for a plugin. -add_library(flutter_wrapper_plugin STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} -) -apply_standard_settings(flutter_wrapper_plugin) -set_target_properties(flutter_wrapper_plugin PROPERTIES - POSITION_INDEPENDENT_CODE ON) -set_target_properties(flutter_wrapper_plugin PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) -target_include_directories(flutter_wrapper_plugin PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_plugin flutter_assemble) - -# Wrapper sources needed for the runner. -add_library(flutter_wrapper_app STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_APP} -) -apply_standard_settings(flutter_wrapper_app) -target_link_libraries(flutter_wrapper_app PUBLIC flutter) -target_include_directories(flutter_wrapper_app PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_app flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") -set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} - ${PHONY_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - ${FLUTTER_TARGET_PLATFORM} $ - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} -) +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/app/windows/runner/CMakeLists.txt b/app/windows/runner/CMakeLists.txt index 394917c0..2041a044 100644 --- a/app/windows/runner/CMakeLists.txt +++ b/app/windows/runner/CMakeLists.txt @@ -1,40 +1,40 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} WIN32 - "flutter_window.cpp" - "main.cpp" - "utils.cpp" - "win32_window.cpp" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" - "Runner.rc" - "runner.exe.manifest" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the build version. -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") - -# Disable Windows macros that collide with C++ standard library functions. -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") - -# Add dependency libraries and include directories. Add any application-specific -# dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/app/windows/runner/flutter_window.cpp b/app/windows/runner/flutter_window.cpp index 955ee303..c819cb08 100644 --- a/app/windows/runner/flutter_window.cpp +++ b/app/windows/runner/flutter_window.cpp @@ -1,71 +1,71 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - - flutter_controller_->engine()->SetNextFrameCallback([&]() { - this->Show(); - }); - - // Flutter can complete the first frame before the "show window" callback is - // registered. The following call ensures a frame is pending to ensure the - // window is shown. It is a no-op if the first frame hasn't completed yet. - flutter_controller_->ForceRedraw(); - - return true; -} - -void FlutterWindow::OnDestroy() { - if (flutter_controller_) { - flutter_controller_ = nullptr; - } - - Win32Window::OnDestroy(); -} - -LRESULT -FlutterWindow::MessageHandler(HWND hwnd, UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - // Give Flutter, including plugins, an opportunity to handle window messages. - if (flutter_controller_) { - std::optional result = - flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, - lparam); - if (result) { - return *result; - } - } - - switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; - } - - return Win32Window::MessageHandler(hwnd, message, wparam, lparam); -} +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/app/windows/runner/flutter_window.h b/app/windows/runner/flutter_window.h index 6da0652f..28c23839 100644 --- a/app/windows/runner/flutter_window.h +++ b/app/windows/runner/flutter_window.h @@ -1,33 +1,33 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/app/windows/runner/main.cpp b/app/windows/runner/main.cpp index e03c776d..1e66bd52 100644 --- a/app/windows/runner/main.cpp +++ b/app/windows/runner/main.cpp @@ -1,43 +1,43 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.Create(L"Setonix", origin, size)) { - return EXIT_FAILURE; - } - window.SetQuitOnClose(true); - - ::MSG msg; - while (::GetMessage(&msg, nullptr, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - ::CoUninitialize(); - return EXIT_SUCCESS; -} +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"Setonix", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/app/windows/runner/resource.h b/app/windows/runner/resource.h index 66a65d1e..ddc7f3ef 100644 --- a/app/windows/runner/resource.h +++ b/app/windows/runner/resource.h @@ -1,16 +1,16 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/app/windows/runner/runner.exe.manifest b/app/windows/runner/runner.exe.manifest index a42ea768..157e871f 100644 --- a/app/windows/runner/runner.exe.manifest +++ b/app/windows/runner/runner.exe.manifest @@ -1,20 +1,20 @@ - - - - - PerMonitorV2 - - - - - - - - - - - - - - - + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/app/windows/runner/utils.cpp b/app/windows/runner/utils.cpp index 3a0b4651..259d85bf 100644 --- a/app/windows/runner/utils.cpp +++ b/app/windows/runner/utils.cpp @@ -1,65 +1,65 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - unsigned int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); - std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { - return utf8_string; - } - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - input_length, utf8_string.data(), target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/app/windows/runner/utils.h b/app/windows/runner/utils.h index 3879d547..3f0e05cb 100644 --- a/app/windows/runner/utils.h +++ b/app/windows/runner/utils.h @@ -1,19 +1,19 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/app/windows/runner/win32_window.cpp b/app/windows/runner/win32_window.cpp index 60608d0f..b5ba2a09 100644 --- a/app/windows/runner/win32_window.cpp +++ b/app/windows/runner/win32_window.cpp @@ -1,288 +1,288 @@ -#include "win32_window.h" - -#include -#include - -#include "resource.h" - -namespace { - -/// Window attribute that enables dark mode window decorations. -/// -/// Redefined in case the developer's machine has a Windows SDK older than -/// version 10.0.22000.0. -/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute -#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE -#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 -#endif - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -/// Registry key for app theme preference. -/// -/// A value of 0 indicates apps should use dark mode. A non-zero or missing -/// value indicates apps should use light mode. -constexpr const wchar_t kGetPreferredBrightnessRegKey[] = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; -constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; - -// The number of Win32Window objects that currently exist. -static int g_active_window_count = 0; - -using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); - -// Scale helper to convert logical scaler values to physical using passed in -// scale factor -int Scale(int source, double scale_factor) { - return static_cast(source * scale_factor); -} - -// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. -// This API is only needed for PerMonitor V1 awareness mode. -void EnableFullDpiSupportIfAvailable(HWND hwnd) { - HMODULE user32_module = LoadLibraryA("User32.dll"); - if (!user32_module) { - return; - } - auto enable_non_client_dpi_scaling = - reinterpret_cast( - GetProcAddress(user32_module, "EnableNonClientDpiScaling")); - if (enable_non_client_dpi_scaling != nullptr) { - enable_non_client_dpi_scaling(hwnd); - } - FreeLibrary(user32_module); -} - -} // namespace - -// Manages the Win32Window's window class registration. -class WindowClassRegistrar { - public: - ~WindowClassRegistrar() = default; - - // Returns the singleton registrar instance. - static WindowClassRegistrar* GetInstance() { - if (!instance_) { - instance_ = new WindowClassRegistrar(); - } - return instance_; - } - - // Returns the name of the window class, registering the class if it hasn't - // previously been registered. - const wchar_t* GetWindowClass(); - - // Unregisters the window class. Should only be called if there are no - // instances of the window. - void UnregisterWindowClass(); - - private: - WindowClassRegistrar() = default; - - static WindowClassRegistrar* instance_; - - bool class_registered_ = false; -}; - -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; - -const wchar_t* WindowClassRegistrar::GetWindowClass() { - if (!class_registered_) { - WNDCLASS window_class{}; - window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - window_class.lpszClassName = kWindowClassName; - window_class.style = CS_HREDRAW | CS_VREDRAW; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = GetModuleHandle(nullptr); - window_class.hIcon = - LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); - window_class.hbrBackground = 0; - window_class.lpszMenuName = nullptr; - window_class.lpfnWndProc = Win32Window::WndProc; - RegisterClass(&window_class); - class_registered_ = true; - } - return kWindowClassName; -} - -void WindowClassRegistrar::UnregisterWindowClass() { - UnregisterClass(kWindowClassName, nullptr); - class_registered_ = false; -} - -Win32Window::Win32Window() { - ++g_active_window_count; -} - -Win32Window::~Win32Window() { - --g_active_window_count; - Destroy(); -} - -bool Win32Window::Create(const std::wstring& title, - const Point& origin, - const Size& size) { - Destroy(); - - const wchar_t* window_class = - WindowClassRegistrar::GetInstance()->GetWindowClass(); - - const POINT target_point = {static_cast(origin.x), - static_cast(origin.y)}; - HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); - UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); - double scale_factor = dpi / 96.0; - - HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW, - Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), - Scale(size.width, scale_factor), Scale(size.height, scale_factor), - nullptr, nullptr, GetModuleHandle(nullptr), this); - - if (!window) { - return false; - } - - UpdateTheme(window); - - return OnCreate(); -} - -bool Win32Window::Show() { - return ShowWindow(window_handle_, SW_SHOWNORMAL); -} - -// static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); - SetWindowLongPtr(window, GWLP_USERDATA, - reinterpret_cast(window_struct->lpCreateParams)); - - auto that = static_cast(window_struct->lpCreateParams); - EnableFullDpiSupportIfAvailable(window); - that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { - return that->MessageHandler(window, message, wparam, lparam); - } - - return DefWindowProc(window, message, wparam, lparam); -} - -LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; - } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; - } - - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; - - case WM_DWMCOLORIZATIONCOLORCHANGED: - UpdateTheme(hwnd); - return 0; - } - - return DefWindowProc(window_handle_, message, wparam, lparam); -} - -void Win32Window::Destroy() { - OnDestroy(); - - if (window_handle_) { - DestroyWindow(window_handle_); - window_handle_ = nullptr; - } - if (g_active_window_count == 0) { - WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); - } -} - -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( - GetWindowLongPtr(window, GWLP_USERDATA)); -} - -void Win32Window::SetChildContent(HWND content) { - child_content_ = content; - SetParent(content, window_handle_); - RECT frame = GetClientArea(); - - MoveWindow(content, frame.left, frame.top, frame.right - frame.left, - frame.bottom - frame.top, true); - - SetFocus(child_content_); -} - -RECT Win32Window::GetClientArea() { - RECT frame; - GetClientRect(window_handle_, &frame); - return frame; -} - -HWND Win32Window::GetHandle() { - return window_handle_; -} - -void Win32Window::SetQuitOnClose(bool quit_on_close) { - quit_on_close_ = quit_on_close; -} - -bool Win32Window::OnCreate() { - // No-op; provided for subclasses. - return true; -} - -void Win32Window::OnDestroy() { - // No-op; provided for subclasses. -} - -void Win32Window::UpdateTheme(HWND const window) { - DWORD light_mode; - DWORD light_mode_size = sizeof(light_mode); - LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, - kGetPreferredBrightnessRegValue, - RRF_RT_REG_DWORD, nullptr, &light_mode, - &light_mode_size); - - if (result == ERROR_SUCCESS) { - BOOL enable_dark_mode = light_mode == 0; - DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, - &enable_dark_mode, sizeof(enable_dark_mode)); - } -} +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/app/windows/runner/win32_window.h b/app/windows/runner/win32_window.h index e901dde6..49b847f0 100644 --- a/app/windows/runner/win32_window.h +++ b/app/windows/runner/win32_window.h @@ -1,102 +1,102 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates a win32 window with |title| that is positioned and sized using - // |origin| and |size|. New windows are created on the default monitor. Window - // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size this function will scale the inputted width and height as - // as appropriate for the default monitor. The window is invisible until - // |Show| is called. Returns true if the window was created successfully. - bool Create(const std::wstring& title, const Point& origin, const Size& size); - - // Show the current window. Returns true if the window was successfully shown. - bool Show(); - - // Release OS resources associated with window. - void Destroy(); - - // Inserts |content| into the window tree. - void SetChildContent(HWND content); - - // Returns the backing Window handle to enable clients to set icon and other - // window properties. Returns nullptr if the window has been destroyed. - HWND GetHandle(); - - // If true, closing this window will quit the application. - void SetQuitOnClose(bool quit_on_close); - - // Return a RECT representing the bounds of the current client area. - RECT GetClientArea(); - - protected: - // Processes and route salient window messages for mouse handling, - // size change and DPI. Delegates handling of these to member overloads that - // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Called when CreateAndShow is called, allowing subclass window-related - // setup. Subclasses should return false if setup fails. - virtual bool OnCreate(); - - // Called when Destroy is called. - virtual void OnDestroy(); - - private: - friend class WindowClassRegistrar; - - // OS callback called by message pump. Handles the WM_NCCREATE message which - // is passed when the non-client area is being created and enables automatic - // non-client DPI scaling so that the non-client area automatically - // responds to changes in DPI. All other messages are handled by - // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; - - // Update the window frame's theme to match the system theme. - static void UpdateTheme(HWND const window); - - bool quit_on_close_ = false; - - // window handle for top level window. - HWND window_handle_ = nullptr; - - // window handle for hosted content. - HWND child_content_ = nullptr; -}; - -#endif // RUNNER_WIN32_WINDOW_H_ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/docs/.gitignore b/docs/.gitignore index 6240da8b..a1465b14 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,21 +1,21 @@ -# build output -dist/ -# generated types -.astro/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - - -# environment variables -.env -.env.production - -# macOS-specific files -.DS_Store +# build output +dist/ +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/docs/README.md b/docs/README.md index 5a7e4cf8..f5a88ef3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,44 +1,44 @@ -# Setonix Documentation - -[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build) - -## 🚀 Project Structure - -Inside of your Astro + Starlight project, you'll see the following folders and files: - -``` -. -├── public/ -├── src/ -│ ├── assets/ -│ ├── content/ -│ │ ├── docs/ -│ │ └── config.ts -│ └── env.d.ts -├── astro.config.mjs -├── package.json -└── tsconfig.json -``` - -Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. - -Images can be added to `src/assets/` and embedded in Markdown with a relative link. - -Static assets, like favicons, can be placed in the `public/` directory. - -## 🧞 Commands - -All commands are run from the root of the project, from a terminal: - -| Command | Action | -| :--------------------- | :----------------------------------------------- | -| `pnpm install` | Installs dependencies | -| `pnpm dev` | Starts local dev server at `localhost:4321` | -| `pnpm build` | Build your production site to `./dist/` | -| `pnpm preview` | Preview your build locally, before deploying | -| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` | -| `pnpm astro -- --help` | Get help using the Astro CLI | - -## 👀 Want to learn more? - -Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). +# Setonix Documentation + +[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build) + +## 🚀 Project Structure + +Inside of your Astro + Starlight project, you'll see the following folders and files: + +``` +. +├── public/ +├── src/ +│ ├── assets/ +│ ├── content/ +│ │ ├── docs/ +│ │ └── config.ts +│ └── env.d.ts +├── astro.config.mjs +├── package.json +└── tsconfig.json +``` + +Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. + +Images can be added to `src/assets/` and embedded in Markdown with a relative link. + +Static assets, like favicons, can be placed in the `public/` directory. + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :--------------------- | :----------------------------------------------- | +| `pnpm install` | Installs dependencies | +| `pnpm dev` | Starts local dev server at `localhost:4321` | +| `pnpm build` | Build your production site to `./dist/` | +| `pnpm preview` | Preview your build locally, before deploying | +| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` | +| `pnpm astro -- --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). diff --git a/docs/package.json b/docs/package.json index 681b4b1d..4238f75b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -17,19 +17,20 @@ "@phosphor-icons/react": "^2.1.10", "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", - "astro": "^6.4.6", + "astro": "^6.4.8", "react": "^19.2.7", "react-dom": "^19.2.7", "remark-gemoji": "^8.0.0", "remark-heading-id": "^1.0.1", "typescript": "^6.0.3" }, - "packageManager": "pnpm@11.5.3", + "packageManager": "pnpm@11.7.0", "devDependencies": { "@vite-pwa/astro": "^1.2.0", - "sass": "^1.100.0", - "sharp": "^0.35.0", + "sass": "^1.101.0", + "sharp": "^0.35.1", "vite-plugin-pwa": "^1.3.0", + "workbox-build": "^7.4.1", "workbox-window": "^7.4.1" } } diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 4a1d8f12..34a59df1 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -13,10 +13,10 @@ importers: version: 0.9.9(prettier@3.8.4)(typescript@6.0.3) '@astrojs/react': specifier: ^5.0.7 - version: 5.0.7(@types/node@24.13.1)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + version: 5.0.7(@types/node@24.13.2)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) '@astrojs/starlight': specifier: ^0.40.0 - version: 0.40.0(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(typescript@6.0.3) + version: 0.40.0(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(typescript@6.0.3) '@linwooddev/style': specifier: github:LinwoodDev/style#efbdf8f05d4ef1cf6fec65c90194d30b68b3c64e&path:/packages/web version: https://codeload.github.com/LinwoodDev/style/tar.gz/efbdf8f05d4ef1cf6fec65c90194d30b68b3c64e#path:/packages/web @@ -30,8 +30,8 @@ importers: specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.17) astro: - specifier: ^6.4.6 - version: 6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + specifier: ^6.4.8 + version: 6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) react: specifier: ^19.2.7 version: 19.2.7 @@ -50,16 +50,19 @@ importers: devDependencies: '@vite-pwa/astro': specifier: ^1.2.0 - version: 1.2.0(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(vite-plugin-pwa@1.3.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.3.0(@types/babel__core@7.20.5))(workbox-window@7.4.1)) + version: 1.2.0(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(vite-plugin-pwa@1.3.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.4.1(@types/babel__core@7.20.5))(workbox-window@7.4.1)) sass: - specifier: ^1.100.0 - version: 1.100.0 + specifier: ^1.101.0 + version: 1.101.0 sharp: - specifier: ^0.35.0 - version: 0.35.0 + specifier: ^0.35.1 + version: 0.35.1 vite-plugin-pwa: specifier: ^1.3.0 - version: 1.3.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.3.0(@types/babel__core@7.20.5))(workbox-window@7.4.1) + version: 1.3.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.4.1(@types/babel__core@7.20.5))(workbox-window@7.4.1) + workbox-build: + specifier: ^7.4.1 + version: 7.4.1(@types/babel__core@7.20.5) workbox-window: specifier: ^7.4.1 version: 7.4.1 @@ -657,8 +660,8 @@ packages: resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} engines: {node: '>=6.9.0'} - '@capsizecss/unpack@4.0.0': - resolution: {integrity: sha512-VERIM64vtTP1C4mxQ5thVT9fK0apjPFobqybMtA1UdUujWka24ERHbRHFGmpbbhp73MhV+KSsHQH9C6uOTdEQA==} + '@capsizecss/unpack@4.0.1': + resolution: {integrity: sha512-CuNiSqg7+e1cO/GjffyMOm5Tt2jUF9CWHHnvQ/UkqvtkGfHdgwEC0wpmq7fkN3gxwpRnrAN0WzO3vREKmNolMQ==} engines: {node: '>=18'} '@clack/core@1.4.1': @@ -694,8 +697,8 @@ packages: '@emmetio/stream-reader@2.2.0': resolution: {integrity: sha512-fXVXEyFA5Yv3M3n8sUGT7+fvecGrZP4k6FnWWMSZVQf69kAq0LLpaBQLGcPR30m3zMmKYhECP4k/ZkzvhEW5kw==} - '@emnapi/runtime@1.11.0': - resolution: {integrity: sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==} + '@emnapi/runtime@1.11.1': + resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} '@esbuild/aix-ppc64@0.27.7': resolution: {integrity: sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==} @@ -875,8 +878,8 @@ packages: cpu: [arm64] os: [darwin] - '@img/sharp-darwin-arm64@0.35.0': - resolution: {integrity: sha512-ZgaYEwaj+lx/5n4W8GmZ2IYz0PQHjN5eqRcfijWGB+2Aq7ZInZGa0qJyAn6DEtyLuWHRSrmWOqT9q3qqTBvmUQ==} + '@img/sharp-darwin-arm64@0.35.1': + resolution: {integrity: sha512-T15JRWOubQ3f5+GxnWeIvo47u5qV0M9HBgJhT+f2gE1e9e6OhR6K73Re52Hm80qWcu1DNb3GweKmpr/MnuP2Ow==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [darwin] @@ -887,14 +890,14 @@ packages: cpu: [x64] os: [darwin] - '@img/sharp-darwin-x64@0.35.0': - resolution: {integrity: sha512-c1z9LFpKB0slQW3RchwBE8iSVzGp70TNjUUO9k4BZwwW4HH7JBGHeIy4b+kk4n/kcBASb9evKCE3/7Slmslgiw==} + '@img/sharp-darwin-x64@0.35.1': + resolution: {integrity: sha512-t1CPD0cr7XCHjwUj6tQ5MC0pCi866I+gUW6zbUX4aFPnKd1DFBtk0M+gWcjX8VeEzgfCNiSiNTVFZ6b7kvdbnQ==} engines: {node: '>=20.9.0'} cpu: [x64] os: [darwin] - '@img/sharp-freebsd-wasm32@0.35.0': - resolution: {integrity: sha512-Li2KTev0H90kEtnJHkI9xQojXt1AqWmFBMXiPw5kqd1jQgP7gi5HVK/qC5Rmh/59NuAwUuPzzPITmX22NomYYQ==} + '@img/sharp-freebsd-wasm32@0.35.1': + resolution: {integrity: sha512-MBSQXqNPThW9EcZ905H6N4sEdX5EwZEYzGx5EBq9ncDCGJALMiY1xPFJxNdzuB1iBjLOpIfxajM6YxdvwmQSLA==} engines: {node: '>=20.9.0'} os: [freebsd] @@ -1021,8 +1024,8 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-arm64@0.35.0': - resolution: {integrity: sha512-4+4XHLNT5wDT0roYlHTEmH9lDKt0acf9Tv+3hM3iceOirkxrR404/3WjAYZ9F9CkHrxeRcGLJXbi4vluMZ9O+A==} + '@img/sharp-linux-arm64@0.35.1': + resolution: {integrity: sha512-ErCRyGU7LeoaFBZ0xW8hhLlXzhAg80sc4vxePB86qvtEvW1jEhhmbiNBP4oEzZfPMnu6HwHXfzD2W2kBU+RnCw==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] @@ -1035,8 +1038,8 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-arm@0.35.0': - resolution: {integrity: sha512-VVlpEWwizEFIOom0zdoeKuO5nuTswzVE5uHcBNvHzmeHUpNFajY3HFfbQ+zIH4E2kVaZ/yVxmsShW56TtEy4uA==} + '@img/sharp-linux-arm@0.35.1': + resolution: {integrity: sha512-jygmR02PpCYypt7xB7nst1vqjZp/BpRA/Kf9nK7qRponJ/KrLPaZWEG4G15z1d2FZ6XqI+T0350ha3RSnKx24A==} engines: {node: '>=20.9.0'} cpu: [arm] os: [linux] @@ -1049,8 +1052,8 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-ppc64@0.35.0': - resolution: {integrity: sha512-N3hzbEpUTJC8pWpPVJvgzGxM+so/MAXc8O2s/53B0LL9ZGpfXpME7Wizkc5d/8fRBlBtkDjzoZGDCqqNDHqLEw==} + '@img/sharp-linux-ppc64@0.35.1': + resolution: {integrity: sha512-LUWZ2+r2UoLCd8j0RLCwQ4gL6w47+Y7igxtVnPIDXOOEjV86LpBkAHq5VpJeg+GHbw0KN/JWlPJOdZjyZnFqFQ==} engines: {node: '>=20.9.0'} cpu: [ppc64] os: [linux] @@ -1063,8 +1066,8 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-riscv64@0.35.0': - resolution: {integrity: sha512-l6vmKVPnbS0RhVMbyxP5meAARsbhCnBN4fy31qz0+3a6Rv4jEqfzDrT89y6ZPkCi0AJGnwp2En528yXo401Hpw==} + '@img/sharp-linux-riscv64@0.35.1': + resolution: {integrity: sha512-i7x6J3mwF4JgT0sM4V4WlAWdJ0bucPtA9rzO1bTji1n5qgBq/W5nn87RvOQPleuuxahNoLdTngByD8/vDDLArw==} engines: {node: '>=20.9.0'} cpu: [riscv64] os: [linux] @@ -1077,8 +1080,8 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-s390x@0.35.0': - resolution: {integrity: sha512-MYlMiPFiv/EKPAHnp3yNZ9AAWFsxga9c5Bkc6wkar6bqzHLlkGVJHRm0u1ei+VXnZxp3Mz9MG9ZIsI8vSOf3sQ==} + '@img/sharp-linux-s390x@0.35.1': + resolution: {integrity: sha512-0zSaTUjTF0kIWTSYxD4EG/nvCU4jez53+3RdURtoY3HvbXtIQ98W90JnrGz/oLRFuEnfIy9+7xeq883euc0ZWw==} engines: {node: '>=20.9.0'} cpu: [s390x] os: [linux] @@ -1091,8 +1094,8 @@ packages: os: [linux] libc: [glibc] - '@img/sharp-linux-x64@0.35.0': - resolution: {integrity: sha512-TYaItB5oj1ioXjhyn2xrR208vf+YuIIcHptQWRRaBmFhvIvL9D72DXN8w75xup0KXA8UdEAhQ9Qb2S49FD/9Cw==} + '@img/sharp-linux-x64@0.35.1': + resolution: {integrity: sha512-NbJD4mWdeyrNQKluO/tR/wBDOelcowSVGNBWxI0e3ZtlXc6F/UOVKDj1MLD4zl3oHTuvKW3s+MA9N54YTldAYw==} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] @@ -1105,8 +1108,8 @@ packages: os: [linux] libc: [musl] - '@img/sharp-linuxmusl-arm64@0.35.0': - resolution: {integrity: sha512-DSTb6ijQzqe6DdAaOBVqJ/SYf1vO8EW5bK6X6LRXufEBebf2722VCdvBUtZ3rtV0x2ApfPNDy/p7LrrjaWjiyQ==} + '@img/sharp-linuxmusl-arm64@0.35.1': + resolution: {integrity: sha512-VoW2sQCWI+0YIKQEmWJ8vzaQjTg9wIyfkFpvEfAS2h43X6iHu7GTk1hhOgB4IpSzCHe8UwQZIcx7b81VTaOrJA==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] @@ -1119,8 +1122,8 @@ packages: os: [linux] libc: [musl] - '@img/sharp-linuxmusl-x64@0.35.0': - resolution: {integrity: sha512-K7ykQ+26Rt6+4BTU80AuGgTPIYX86UxiAKT4rcXX/WNTo7k1ZxpKz+TguHnwVpCqQK3B5PK0vZ0ZBe6nz/ib1w==} + '@img/sharp-linuxmusl-x64@0.35.1': + resolution: {integrity: sha512-LjBoSd/c5JU0/K5MwzDMlgsSRP2bPn98JQGFFQAOLQ0bU/1z4ekxUdSKY9BmlwSh/cA+OrvpgsWqfZyYfVHBRw==} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] @@ -1131,12 +1134,12 @@ packages: engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [wasm32] - '@img/sharp-wasm32@0.35.0': - resolution: {integrity: sha512-9woLIFORERCr+6cWu87dQ22J34EExkhc73U1kZW0c+RclQqWetoodByp4dWZ/hN8/KVmTRAx2HOnUwib8AwZdA==} + '@img/sharp-wasm32@0.35.1': + resolution: {integrity: sha512-PCQUoQdZyE8tp3HpbevuihfUmgSP4qWI0FGEPWoeXqaS+cUrFfemabHQiebUmUmlUhCuNnQMxGrQ+CPqK4hnxg==} engines: {node: '>=20.9.0'} - '@img/sharp-webcontainers-wasm32@0.35.0': - resolution: {integrity: sha512-t+kie1TOyaDM6Dho+f+y0VqIUNhYQaKCUahuZVi0E0frgdiaOaPsDxDW3wfKacUdaNBCnK/ZDBMg33ydvHj8uA==} + '@img/sharp-webcontainers-wasm32@0.35.1': + resolution: {integrity: sha512-xU2ml2bU2OPxYVvW2A6ae4M1g5QKyhKG06P4FAt+YEaFQQO0919Qx+XxIZEUuWTMoDViLpMws2/dQwoe/VcA6A==} engines: {node: '>=20.9.0'} cpu: [wasm32] @@ -1146,8 +1149,8 @@ packages: cpu: [arm64] os: [win32] - '@img/sharp-win32-arm64@0.35.0': - resolution: {integrity: sha512-M5eKxug0dabbaWgFKvPa3odNs2OpaP+81NASfGKkt4GcYXpNhSu7CaeYxWkLNV6vHmUp4hnCxnxrUyhUJhXbKA==} + '@img/sharp-win32-arm64@0.35.1': + resolution: {integrity: sha512-IkmHwuFhYpd3bTsN5SAahjwhiAcyXPooBt8vEUgxY3T0IP70sSJ0nU1xiPzZY8AH/OB1XpV3j8aZSVSOSfTbdA==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [win32] @@ -1158,8 +1161,8 @@ packages: cpu: [ia32] os: [win32] - '@img/sharp-win32-ia32@0.35.0': - resolution: {integrity: sha512-z0+pZ03QCDvdVN0Ez9IX/yjWC19ikMlXrmdYMwYNLTh2BLPx3hXWPvyqWfquZ0BTO9O6GVOjIVoTcyyacMnWlQ==} + '@img/sharp-win32-ia32@0.35.1': + resolution: {integrity: sha512-wQahqCi9MD8Yxzg4gVM4fNrZxh+r6vD55PyIg+WJPaM5ZRUyF35iQpwJCuma3r6viU9/8Pxlc+XHV+woVa6nCQ==} engines: {node: ^20.9.0} cpu: [ia32] os: [win32] @@ -1170,12 +1173,16 @@ packages: cpu: [x64] os: [win32] - '@img/sharp-win32-x64@0.35.0': - resolution: {integrity: sha512-feNnlz5ZHKr0MY1LPHvZQyJeBkbo4ctsn0D8FvA53VTw5TC63rfEL2UrWbkSBR19htSE7Mw78xYVwdJqoMWVHw==} + '@img/sharp-win32-x64@0.35.1': + resolution: {integrity: sha512-WzBtkYtZHATLPe8XRharxZXxQ9cdLrQWHiwxt+BJ5rBsisQrKeeV86ErxPSVhcG6xCEuNhs0SqLpWr7XDa2k6w==} engines: {node: '>=20.9.0'} cpu: [x64] os: [win32] + '@isaacs/cliui@9.0.0': + resolution: {integrity: sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==} + engines: {node: '>=18'} + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -1341,19 +1348,21 @@ packages: '@rolldown/pluginutils@1.0.0-rc.3': resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==} - '@rollup/plugin-babel@5.3.1': - resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} - engines: {node: '>= 10.0.0'} + '@rollup/plugin-babel@6.1.0': + resolution: {integrity: sha512-dFZNuFD2YRcoomP4oYf+DvQNSUA9ih+A3vUqopQx5EdtPGo3WBnQcI/S8pwpz91UsGfL0HsMSOlaMld8HrbubA==} + engines: {node: '>=14.0.0'} peerDependencies: '@babel/core': ^7.0.0 '@types/babel__core': ^7.1.9 - rollup: ^1.20.0||^2.0.0 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: '@types/babel__core': optional: true + rollup: + optional: true - '@rollup/plugin-node-resolve@15.3.1': - resolution: {integrity: sha512-tgg6b91pAybXHJQMAAwW9VuWBO6Thi+q7BCNARLwSqlmsHz0XYURtGvh/AuwSADXSI4h/2uHbs7s4FzlZDGSGA==} + '@rollup/plugin-node-resolve@16.0.3': + resolution: {integrity: sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 @@ -1361,25 +1370,23 @@ packages: rollup: optional: true - '@rollup/plugin-replace@2.4.2': - resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - - '@rollup/plugin-terser@0.4.4': - resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} + '@rollup/plugin-replace@6.0.3': + resolution: {integrity: sha512-J4RZarRvQAm5IF0/LwUUg+obsm+xZhYnbMXmXROyoSE1ATJe3oXSb9L5MMppdxP2ylNSjv6zFBwKYjcKMucVfA==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^2.0.0||^3.0.0||^4.0.0 + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true - '@rollup/pluginutils@3.1.0': - resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} - engines: {node: '>= 8.0.0'} + '@rollup/plugin-terser@1.0.0': + resolution: {integrity: sha512-FnCxhTBx6bMOYQrar6C8h3scPt8/JwIzw3+AJ2K++6guogH5fYaIFia+zZuhqv0eo1RN7W1Pz630SyvLbDjhtQ==} + engines: {node: '>=20.0.0'} peerDependencies: - rollup: ^1.20.0||^2.0.0 + rollup: ^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true '@rollup/pluginutils@5.4.0': resolution: {integrity: sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==} @@ -1390,141 +1397,141 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.61.1': - resolution: {integrity: sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==} + '@rollup/rollup-android-arm-eabi@4.62.0': + resolution: {integrity: sha512-IPIQ55ythEHkfEd9jMEi32OQ7SxURsGA43JI22lj01OLZNt2NUbJX8YUHxkVWyQ6daHPNn0truF5nSj3DQp6YQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.61.1': - resolution: {integrity: sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==} + '@rollup/rollup-android-arm64@4.62.0': + resolution: {integrity: sha512-M6s9cr10MibETyo8JsOkq+Lo1+lU6hcvb1MApnUql5qte/5hMEgzlN8/ReIKNfRV8rrqX50W1BX9zoUhC192RA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.61.1': - resolution: {integrity: sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==} + '@rollup/rollup-darwin-arm64@4.62.0': + resolution: {integrity: sha512-BqCoMoIbn0keKys+dEAdBa70EtOwV1bEsQCUgU9FdiZmmMge/Zk7LlkYGqbrdHR+Frnt0E1FOanly+rlwvvQzw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.61.1': - resolution: {integrity: sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==} + '@rollup/rollup-darwin-x64@4.62.0': + resolution: {integrity: sha512-SIMzST3VFNXDAbeIWDWiFCNM5qncUBDWaEV7NfE7oZbDt2mgfW4MvbKdbYiGOLoM32gbTv608UMd0XktEYSD7w==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.61.1': - resolution: {integrity: sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==} + '@rollup/rollup-freebsd-arm64@4.62.0': + resolution: {integrity: sha512-ezjfSQMP7ArdUsbBwbQIfwAlhE84I2iVnzQNCFSveqV42q+BmKlzVpf7mxv5EchLcoWU4y6/heFzVg1F+hodUQ==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.61.1': - resolution: {integrity: sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==} + '@rollup/rollup-freebsd-x64@4.62.0': + resolution: {integrity: sha512-9+qTWGW9AZRhnUgwtTwzNwcPlL87ngkeN0LA+q1bADvmY9aNvWaF2TFW8BZgnQPYxpDI7+rMVLivcd4V737TAQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.61.1': - resolution: {integrity: sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==} + '@rollup/rollup-linux-arm-gnueabihf@4.62.0': + resolution: {integrity: sha512-T1dMEQhXA/jkJ/jyMIw9IovK8bSUq7A8kLIlvZTb/6YIVsp2zLavr4F3oyllHWo7eIVJRyE5n3tUjQJEbE1IuQ==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.61.1': - resolution: {integrity: sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==} + '@rollup/rollup-linux-arm-musleabihf@4.62.0': + resolution: {integrity: sha512-2as0LgT7qQpyceQq6VUJYnumUMUrgGQCWIiDIN9DE0/tglsk6o66uCB4f3djRawAltvfCNLyZZrsqbPA6inCsA==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.61.1': - resolution: {integrity: sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==} + '@rollup/rollup-linux-arm64-gnu@4.62.0': + resolution: {integrity: sha512-bVURMg+6eNN9C/yc0aVjooZcwTTtYF4YW3xta5pP0//r3o1V8gXEHXWCndj47w/HhwsFroZrFhR+6uQP5T0n0g==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.61.1': - resolution: {integrity: sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==} + '@rollup/rollup-linux-arm64-musl@4.62.0': + resolution: {integrity: sha512-Ful8pM/2yYI83PViWdFdpZhdI8HJ5qsXANe5atypbHDf+KIBBDsZsbyy8hbXnULVvW9NsTh5DHwbcBftyLTfiw==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.61.1': - resolution: {integrity: sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==} + '@rollup/rollup-linux-loong64-gnu@4.62.0': + resolution: {integrity: sha512-9Gp/DgrkzfUBmNPVTyPTvay+4xEP7M/clXpj3efXBcm6uTIVIgDg4rqUpqKXvLEuFRVuEpSAOkhgNeecvaZ4Cg==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.61.1': - resolution: {integrity: sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==} + '@rollup/rollup-linux-loong64-musl@4.62.0': + resolution: {integrity: sha512-m9tsJz54LUXkSYM8+8PG81B9IKK5r+2T0clMq4QrS16xFosufU7firBDAZEsDheDs7wTlP7h3++S7lMsU955HA==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.61.1': - resolution: {integrity: sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==} + '@rollup/rollup-linux-ppc64-gnu@4.62.0': + resolution: {integrity: sha512-3UvJ5PNVU16aJf6M3tFI24pWzAl2/ynfbyRN3ICyQajK1lSkrnVYNnLz3v04J32qKa0FczJc22zeToc0lr2A3w==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.61.1': - resolution: {integrity: sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==} + '@rollup/rollup-linux-ppc64-musl@4.62.0': + resolution: {integrity: sha512-vRWUAbYLGHBZS6Q8Msb2sfnf1fvJf+47t8l/TwOerM2qArzy+IeNMTHrYLHXh95h8MoatPHI5hhSZNs+mGXKPg==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.61.1': - resolution: {integrity: sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==} + '@rollup/rollup-linux-riscv64-gnu@4.62.0': + resolution: {integrity: sha512-c00T5SYENHAt86cfW47URaP3Us5vLC/4QO7GYud1G5VNRffCwwCuBspwqYrriuJB+5m0WFzClCn9wed0FBjKvg==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.61.1': - resolution: {integrity: sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==} + '@rollup/rollup-linux-riscv64-musl@4.62.0': + resolution: {integrity: sha512-krrCDilhXOwFkSkO3Wm9I/f9H0L92XHHwy2fwxjukxIbh0dem8gZqOW5Y8BsHrpJv5qwlRBV+Wl4ZFyRWhUpwg==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.61.1': - resolution: {integrity: sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==} + '@rollup/rollup-linux-s390x-gnu@4.62.0': + resolution: {integrity: sha512-7pfYFSTc4/rUC/FtAI0Qp6QthDBCIi6/AuP1xYqFk5vanI6KnL5dWKP60OM/05LOsbwTmIcvr6eXC4CJuJ75IA==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.61.1': - resolution: {integrity: sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==} + '@rollup/rollup-linux-x64-gnu@4.62.0': + resolution: {integrity: sha512-7SDIalKeIpG0Ifogbbdn58HmSotYMlf23K3dCJEmiVd9Fg36Vmni82iPQec27N3wY4Bvbxftkxz6vSx9OcouTg==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.61.1': - resolution: {integrity: sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==} + '@rollup/rollup-linux-x64-musl@4.62.0': + resolution: {integrity: sha512-eRZevouTH2i1HeAVLqJuLnt256krQkGY0TN6WsTmsIhuzbh457HuWDMakKwmi0Cjadux983CoSr8Lim2QhUIFw==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.61.1': - resolution: {integrity: sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==} + '@rollup/rollup-openbsd-x64@4.62.0': + resolution: {integrity: sha512-3oVS7FLGa4U1qcvao9ylGxrjXZyUQqR8UwxEcnUEyPX53O/C/mKDZegNXTdHCP+h3e6ta/f1EN38Yif1mmZHYg==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.61.1': - resolution: {integrity: sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==} + '@rollup/rollup-openharmony-arm64@4.62.0': + resolution: {integrity: sha512-yTB9TgfWj5wHe5QgktAgXTLLot1gvEjl1NiPPAUiCs4oPrIWFl5V4nC3GrkNdj9LaAU4s94nVrGbGOCqUpyWsg==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.61.1': - resolution: {integrity: sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==} + '@rollup/rollup-win32-arm64-msvc@4.62.0': + resolution: {integrity: sha512-5LOhoaesY3doG1c+ac/2JtgREpKoJr5bUHH8tKY0V8di7+uSV6BwLs2PlR0/yzefGOkR+wE7ZolZphHCsyG5Rw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.61.1': - resolution: {integrity: sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==} + '@rollup/rollup-win32-ia32-msvc@4.62.0': + resolution: {integrity: sha512-yYkWHhmbhRTWTnWos5HC4GcPQfjlzzCNbM9e/+GXrLuaBXYA3qSDR9f0Vgufd5S8yX81U8jPKp7ZnAjZFMtRnw==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.61.1': - resolution: {integrity: sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==} + '@rollup/rollup-win32-x64-gnu@4.62.0': + resolution: {integrity: sha512-SoTb6lPg25xZlA2ibwQ++ahCCnH+FP0qmEuafMJ4gznZKOlXioKEAeJLgCrqjM98ACziXM9V1amFjICVL4IFoA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.61.1': - resolution: {integrity: sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==} + '@rollup/rollup-win32-x64-msvc@4.62.0': + resolution: {integrity: sha512-5L+T1fMX4RIEBoZzT0+sQ0PhTS36NULFmMXtl1TZo44TMAROIMHbZufSOjVWt/Y622BtxgxtaNOokbTDvfsrZA==} cpu: [x64] os: [win32] @@ -1559,8 +1566,9 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@surma/rollup-plugin-off-main-thread@2.2.3': - resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==} + '@trickfilm400/rollup-plugin-off-main-thread@3.0.0-pre1': + resolution: {integrity: sha512-/67zpWDBLV+oYAEL682s1ktXL0HgqX76f6gaVGkGnVZlBbm1zd0v4Bz8MFF2GGhoX9rvfq3KSQHubFHwa6w6/Q==} + engines: {node: '>=12'} '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -1580,9 +1588,6 @@ packages: '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} - '@types/estree@0.0.39': - resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - '@types/estree@1.0.9': resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} @@ -1604,8 +1609,8 @@ packages: '@types/nlcst@2.0.3': resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} - '@types/node@24.13.1': - resolution: {integrity: sha512-RSpUJGmvsJ1ZeBehQZFhIdpsz+bIpES0nIQXko4Ybq+N+kX6XvOq3Jo+iJ82FWLdblFq85AsMikd3m35jgezYg==} + '@types/node@24.13.2': + resolution: {integrity: sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==} '@types/react-dom@19.2.3': resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} @@ -1680,8 +1685,8 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.16.0: - resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + acorn@8.17.0: + resolution: {integrity: sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==} engines: {node: '>=0.4.0'} hasBin: true @@ -1738,8 +1743,8 @@ packages: peerDependencies: astro: ^4.0.0-beta || ^5.0.0-beta || ^3.3.0 || ^6.0.0-beta - astro@6.4.6: - resolution: {integrity: sha512-48OBTBKR9ctbf+DQxpOuxGl8ebfn59zTuNQMBzptmG/Mi/H8IdfMSbJgGuX1I/4U6g9yazG1p4BHlf4+2hWU4Q==} + astro@6.4.8: + resolution: {integrity: sha512-KK5lX90uU9EeVaTjINyj3sy9/NFXVa59aowaqbWBDDKLXZh4rr7GwIaCFYVetE22MJtsCNFerQXn0vlCLmpP/Q==} engines: {node: '>=22.12.0', npm: '>=9.6.5', pnpm: '>=7.1.0'} hasBin: true @@ -1783,8 +1788,12 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - baseline-browser-mapping@2.10.35: - resolution: {integrity: sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + baseline-browser-mapping@2.10.38: + resolution: {integrity: sha512-31/02mVB4yuQU6adKk5SlY6m+mxDwUq5KZkyYgnLrrKl7TEm1+3PyDtDBz2kOv/wxZz41GHsvV1A/u6RmiyBvw==} engines: {node: '>=6.0.0'} hasBin: true @@ -1797,12 +1806,13 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - brace-expansion@1.1.15: - resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==} - brace-expansion@2.1.1: resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==} + brace-expansion@5.0.6: + resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} + engines: {node: 18 || 20 || >=22} + browserslist@4.28.2: resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -1823,8 +1833,8 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - caniuse-lite@1.0.30001797: - resolution: {integrity: sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==} + caniuse-lite@1.0.30001799: + resolution: {integrity: sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -1889,9 +1899,6 @@ packages: resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} engines: {node: '>=4.0.0'} - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} @@ -1905,6 +1912,10 @@ packages: core-js-compat@3.49.0: resolution: {integrity: sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + crossws@0.3.5: resolution: {integrity: sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==} @@ -2032,8 +2043,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.371: - resolution: {integrity: sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==} + electron-to-chromium@1.5.375: + resolution: {integrity: sha512-ZWP5eB4BVPW/ZYo9252hQZHZ5XavtsTgpbhcmMmRwymavC5AsLWQWBPaKMeNd2LW0KGby5HPXvj7+sr4ta5j/Q==} emmet@2.4.11: resolution: {integrity: sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ==} @@ -2049,6 +2060,10 @@ packages: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} + es-abstract-get@1.0.0: + resolution: {integrity: sha512-6PMWXpdhshVvFp+FoWYs1EvG1Nj0tvk0dZM+XcK0xMEM1czRVcP6ohqPWHy6qPagSpC8j4+p89WXlT+xXJs/fg==} + engines: {node: '>= 0.4'} + es-abstract@1.24.2: resolution: {integrity: sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==} engines: {node: '>= 0.4'} @@ -2072,8 +2087,8 @@ packages: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} - es-to-primitive@1.3.0: - resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + es-to-primitive@1.3.1: + resolution: {integrity: sha512-CxN9N56HYfd2m/acc/NOFrZQsN9kU4eh+2kk6A707Kz1krH8tKmfrs5RnftB8WNX80T0NS7vSQsDOlg23diR2g==} engines: {node: '>= 0.4'} esast-util-from-estree@2.0.0: @@ -2113,9 +2128,6 @@ packages: estree-util-visit@2.0.0: resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} - estree-walker@1.0.1: - resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} - estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -2126,6 +2138,10 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + eta@4.6.0: + resolution: {integrity: sha512-lW6is4T1NFOYnmqGZIfvixqj7A7sSvScF+DN8EK6K58xI5MZ5UvYe0GjopxOXQtZvUn4eDdVuZ8XSoYWTMEKwA==} + engines: {node: '>=20'} + eventemitter3@5.0.4: resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==} @@ -2180,13 +2196,14 @@ packages: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} + engines: {node: '>=14'} + fs-extra@9.1.0: resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} engines: {node: '>=10'} - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -2195,8 +2212,8 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - function.prototype.name@1.1.8: - resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} + function.prototype.name@1.2.0: + resolution: {integrity: sha512-jObKIik1P2QjPHP5nz5BaOtUlfgS0fWo8IUByNXkM+o+02sJOi94em77GwJKQSJ3gfPHdgzLNrHc1uokV4P/ew==} engines: {node: '>= 0.4'} functions-have-names@1.2.3: @@ -2239,9 +2256,11 @@ packages: github-slugger@2.0.0: resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + glob@11.1.0: + resolution: {integrity: sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==} + engines: {node: 20 || >=22} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + hasBin: true globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} @@ -2366,13 +2385,6 @@ packages: immutable@5.1.6: resolution: {integrity: sha512-q1swsS8K7L8usSHuOqF2TAoCCkonYz0SG38wLAggaa4Wml70zixIvt2ql4coQ2C2B3hTjltJry4r6bULwgAXLQ==} - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - inline-style-parser@0.2.7: resolution: {integrity: sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==} @@ -2434,6 +2446,10 @@ packages: engines: {node: '>=20'} hasBin: true + is-document.all@1.0.0: + resolution: {integrity: sha512-+XSoyS05OdBbhFuELhgTCpFNHkpBOJqtsZfUFFpe5QTw+9Sjbh8zitxhQkYAo6wV7e1Vb8cAPvpCk9jGam/82g==} + engines: {node: '>= 0.4'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -2536,6 +2552,13 @@ packages: isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + jackspeak@4.2.3: + resolution: {integrity: sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==} + engines: {node: 20 || >=22} + jake@10.9.4: resolution: {integrity: sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==} engines: {node: '>=10'} @@ -2605,9 +2628,6 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - magic-string@0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} - magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -2793,13 +2813,18 @@ packages: micromark@4.0.2: resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==} - minimatch@3.1.5: - resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} minimatch@5.1.9: resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} engines: {node: '>=10'} + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + mrmime@2.0.1: resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} engines: {node: '>=10'} @@ -2831,8 +2856,8 @@ packages: node-mock-http@1.0.4: resolution: {integrity: sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==} - node-releases@2.0.47: - resolution: {integrity: sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==} + node-releases@2.0.48: + resolution: {integrity: sha512-1uz8041X6LoI6ZSdZacM9lVY28vuzDlSKitnpbSNK0RfKoIJkX29NBPVEFXhnuSuEOA9Ww0xnPJ+ILWbGAv8DA==} engines: {node: '>=18'} normalize-path@3.0.0: @@ -2854,8 +2879,8 @@ packages: resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==} engines: {node: '>= 0.4'} - obug@2.1.2: - resolution: {integrity: sha512-AWGB9WFcRXOQs48Z/udjI5ZcZMHXwX8XPByNpOydgcGsDLIzjGizhoMWJyKAWze7AVW/2W1i+/gPX4YtKe5cyg==} + obug@2.1.3: + resolution: {integrity: sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==} engines: {node: '>=12.20.0'} ofetch@1.5.1: @@ -2864,9 +2889,6 @@ packages: ohash@2.0.11: resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==} - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - oniguruma-parser@0.12.2: resolution: {integrity: sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==} @@ -2889,6 +2911,9 @@ packages: resolution: {integrity: sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==} engines: {node: '>=20'} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + package-manager-detector@1.6.0: resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==} @@ -2908,13 +2933,17 @@ packages: path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} + piccolore@0.1.3: resolution: {integrity: sha512-o8bTeDWjE086iwKrROaDf31K0qC/BENdm15/uH9usSC/uZjJOKb2YGiVHfLY4GhwsERiPI1jmwI2XrA7ACOxVw==} @@ -2939,8 +2968,8 @@ packages: peerDependencies: postcss: ^8.2.14 - postcss-selector-parser@6.1.2: - resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} + postcss-selector-parser@6.1.4: + resolution: {integrity: sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==} engines: {node: '>=4'} postcss@8.5.15: @@ -2974,9 +3003,6 @@ packages: radix3@1.1.2: resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} - randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - react-dom@19.2.7: resolution: {integrity: sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==} peerDependencies: @@ -3043,8 +3069,8 @@ packages: regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} - regjsparser@0.13.1: - resolution: {integrity: sha512-dLsljMd9sqwRkby8zhO1gSg3PnJIBFid8f4CQj/sXx+7cKx+E7u0PKhZ+U4wmhx7EfmtvnA318oVaIkAB1lRJw==} + regjsparser@0.13.2: + resolution: {integrity: sha512-NgRBy2Nx/bE+9F27nVHnqcN5HjyLmecqsqx2PJHu3/IEtADD4WuxuXIVExD5PoSDFVrl78dOonfcOe5O+5nbzQ==} hasBin: true rehype-expressive-code@0.43.1: @@ -3131,13 +3157,8 @@ packages: retext@9.0.0: resolution: {integrity: sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA==} - rollup@2.80.0: - resolution: {integrity: sha512-cIFJOD1DESzpjOBl763Kp1AH7UE/0fcdHe6rZXUdQ9c50uvgigvW97u3IcSeBwOkgqL/PXPBktBCh0KEu5L8XQ==} - engines: {node: '>=10.0.0'} - hasBin: true - - rollup@4.61.1: - resolution: {integrity: sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==} + rollup@4.62.0: + resolution: {integrity: sha512-nc72Wgq62I7rtDV4izT5/aaS0zxy3kttkinf9586ApknY3jZO9NYsmtc24fUckA0X7Q2v+ML4a15pdUlV5V/jA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3145,9 +3166,6 @@ packages: resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==} engines: {node: '>=0.4'} - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-push-apply@1.0.0: resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} engines: {node: '>= 0.4'} @@ -3156,8 +3174,8 @@ packages: resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} - sass@1.100.0: - resolution: {integrity: sha512-B5j0rYMlinhhOo9tjQebMVVn0TfyXAF+wB3b2ggZUuJ/is/Y+7+JGjirAMxHZ9Z3hIP98NPfamlAkBHa1lAaXQ==} + sass@1.101.0: + resolution: {integrity: sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==} engines: {node: '>=20.19.0'} hasBin: true @@ -3177,8 +3195,9 @@ packages: engines: {node: '>=10'} hasBin: true - serialize-javascript@6.0.2: - resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + serialize-javascript@7.0.6: + resolution: {integrity: sha512-ATTK5Q4gFVg0YDp1my2vqygyvhcklD/UV5GIlYHooGTn/NogJqIzpetkD6E5kmuVULqz/S9inUL25XcAgDRJQg==} + engines: {node: '>=20.0.0'} set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} @@ -3196,10 +3215,18 @@ packages: resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - sharp@0.35.0: - resolution: {integrity: sha512-BqvG5XbwPZ4NV0DK90d86leEECMsoa8bO0nqnKWlBDYxri4GJ7c4EDInaF6q20lTh/mATmnDIKWJFfXnoVfH5g==} + sharp@0.35.1: + resolution: {integrity: sha512-lW979AMi+ESidzMv/Lnv+F9bknzLyxLqFI05Sm433vOeRcltgxQmXpnfOOFIAlKtwXU/ksupm2srQoFCkR214g==} engines: {node: '>=20.9.0'} + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + shiki@4.2.0: resolution: {integrity: sha512-hjNax6o/ylDy9lefQEaSDtzaT3iVNtZ3WmpQnbuQNoG4xvnSKf2kSKbihZVO4JRG1TTMejs7CmNRYlWgAL66pQ==} engines: {node: '>=20'} @@ -3220,6 +3247,10 @@ packages: resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==} engines: {node: '>= 0.4'} + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -3256,10 +3287,6 @@ packages: engines: {node: '>= 8'} deprecated: The work that was done in this beta branch won't be included in future versions - sourcemap-codec@1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead - space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} @@ -3751,57 +3778,56 @@ packages: resolution: {integrity: sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==} engines: {node: '>= 0.4'} - workbox-background-sync@7.3.0: - resolution: {integrity: sha512-PCSk3eK7Mxeuyatb22pcSx9dlgWNv3+M8PqPaYDokks8Y5/FX4soaOqj3yhAZr5k6Q5JWTOMYgaJBpbw11G9Eg==} + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true - workbox-broadcast-update@7.3.0: - resolution: {integrity: sha512-T9/F5VEdJVhwmrIAE+E/kq5at2OY6+OXXgOWQevnubal6sO92Gjo24v6dCVwQiclAF5NS3hlmsifRrpQzZCdUA==} + workbox-background-sync@7.4.1: + resolution: {integrity: sha512-HhT7KE8tOWDm02wRNshXUnUPofMlhenF2DBdUnDPOubhizzPeItkYTmAB6td1Z2cjYPa98vzEiPLEuzn5hN66g==} - workbox-build@7.3.0: - resolution: {integrity: sha512-JGL6vZTPlxnlqZRhR/K/msqg3wKP+m0wfEUVosK7gsYzSgeIxvZLi1ViJJzVL7CEeI8r7rGFV973RiEqkP3lWQ==} - engines: {node: '>=16.0.0'} + workbox-broadcast-update@7.4.1: + resolution: {integrity: sha512-uAlgslKLvbQY+suirIdnBCSYrcgBhjp81Nj4l1lj/Jmj0MJO2CJERnCJjT0GFVwmReV0N+zs78K6gqd5gr9/+A==} - workbox-cacheable-response@7.3.0: - resolution: {integrity: sha512-eAFERIg6J2LuyELhLlmeRcJFa5e16Mj8kL2yCDbhWE+HUun9skRQrGIFVUagqWj4DMaaPSMWfAolM7XZZxNmxA==} + workbox-build@7.4.1: + resolution: {integrity: sha512-SDhxIvEAde9Gy/5w4Yo1Jh/M49Z0qE3q0oteyE8zGq0DScxFqVBcCtIXFuLtmtxRQZCMbf0prco4VyEu3KBQuw==} + engines: {node: '>=20.0.0'} - workbox-core@7.3.0: - resolution: {integrity: sha512-Z+mYrErfh4t3zi7NVTvOuACB0A/jA3bgxUN3PwtAVHvfEsZxV9Iju580VEETug3zYJRc0Dmii/aixI/Uxj8fmw==} + workbox-cacheable-response@7.4.1: + resolution: {integrity: sha512-8xaFoJdDc2OjrlbbL3gEeBO1WKcMwRqwLRupgqahYXu75yXajPLuwrbXMrIGZuWYXrQwk0xDjOxZ/ujCy/oJYw==} workbox-core@7.4.1: resolution: {integrity: sha512-DT+vu46eh/2vRsSHTY4Xmc32Z1rr9PRlQUXr1Dx30ZuXRWwOsvZgGgcwxcasubQLQmbTNYZjv44LkBAQ4tT5tQ==} - workbox-expiration@7.3.0: - resolution: {integrity: sha512-lpnSSLp2BM+K6bgFCWc5bS1LR5pAwDWbcKt1iL87/eTSJRdLdAwGQznZE+1czLgn/X05YChsrEegTNxjM067vQ==} - - workbox-google-analytics@7.3.0: - resolution: {integrity: sha512-ii/tSfFdhjLHZ2BrYgFNTrb/yk04pw2hasgbM70jpZfLk0vdJAXgaiMAWsoE+wfJDNWoZmBYY0hMVI0v5wWDbg==} + workbox-expiration@7.4.1: + resolution: {integrity: sha512-lRKUF7b+OGbeXkQk1s6MHXOa3d7Xxf7Of31W6c6hCfipfIyrtdWZ89stq21AHZMaoG7VNFoHply4Ox+rU31TWg==} - workbox-navigation-preload@7.3.0: - resolution: {integrity: sha512-fTJzogmFaTv4bShZ6aA7Bfj4Cewaq5rp30qcxl2iYM45YD79rKIhvzNHiFj1P+u5ZZldroqhASXwwoyusnr2cg==} + workbox-google-analytics@7.4.1: + resolution: {integrity: sha512-Mks1JwLEt++ZAkF6sS1OpSh9RtAMIsiDgRpK+codiHGIPXeaUOgi4cPc3GFadUl8V5QPeypEk8Oxgl3HlwVzHw==} - workbox-precaching@7.3.0: - resolution: {integrity: sha512-ckp/3t0msgXclVAYaNndAGeAoWQUv7Rwc4fdhWL69CCAb2UHo3Cef0KIUctqfQj1p8h6aGyz3w8Cy3Ihq9OmIw==} + workbox-navigation-preload@7.4.1: + resolution: {integrity: sha512-C4KVsjPcYKJOhr631AxR9XoG2rLF3QiTk5aMv36MXOjtWvm8axwNFAtKUPGsWUwLXXAMgYM1En7fsvndaXeXRQ==} - workbox-range-requests@7.3.0: - resolution: {integrity: sha512-EyFmM1KpDzzAouNF3+EWa15yDEenwxoeXu9bgxOEYnFfCxns7eAxA9WSSaVd8kujFFt3eIbShNqa4hLQNFvmVQ==} + workbox-precaching@7.4.1: + resolution: {integrity: sha512-cdr/9qByww7yzEp7zg/qI4ukUrrNjQLgN+ONQRpjy/VqGQXwkgHwr00KksGJK8v0VifwDXBb8a4cWNZH71jn3Q==} - workbox-recipes@7.3.0: - resolution: {integrity: sha512-BJro/MpuW35I/zjZQBcoxsctgeB+kyb2JAP5EB3EYzePg8wDGoQuUdyYQS+CheTb+GhqJeWmVs3QxLI8EBP1sg==} + workbox-range-requests@7.4.1: + resolution: {integrity: sha512-7i2oxAUE82gHdAJBCAQ04JzNOdRPqzuOzGfoUyJpFSmeqBNYGPrAH8GPoPjUQTfp+NycwrD2H68VtuF8qxv0vQ==} - workbox-routing@7.3.0: - resolution: {integrity: sha512-ZUlysUVn5ZUzMOmQN3bqu+gK98vNfgX/gSTZ127izJg/pMMy4LryAthnYtjuqcjkN4HEAx1mdgxNiKJMZQM76A==} + workbox-recipes@7.4.1: + resolution: {integrity: sha512-gnbVfmV4/TtmQaM4x9AtuXhcdstJsep3XMVeztOrQVPT+R6+6DeBjGTCQ7fFCXm+4GEHUA5VEBTyi5+4gWGeog==} - workbox-strategies@7.3.0: - resolution: {integrity: sha512-tmZydug+qzDFATwX7QiEL5Hdf7FrkhjaF9db1CbB39sDmEZJg3l9ayDvPxy8Y18C3Y66Nrr9kkN1f/RlkDgllg==} + workbox-routing@7.4.1: + resolution: {integrity: sha512-yubJGErZOusuidAenaL5ypfhQOa7urxP/f8E0ws7FPb4039RiWXUWBAyUkmUoOL/BcQGen3h0J8872d51IYxtA==} - workbox-streams@7.3.0: - resolution: {integrity: sha512-SZnXucyg8x2Y61VGtDjKPO5EgPUG5NDn/v86WYHX+9ZqvAsGOytP0Jxp1bl663YUuMoXSAtsGLL+byHzEuMRpw==} + workbox-strategies@7.4.1: + resolution: {integrity: sha512-GZxpaw9NbmOelj7667uZ2kpk5BFpOGbO4X0qjwh5ls8XQ8C+Lha5LQchTiUzsTFSS+NlUpftYAyOVXvQUrcqOQ==} - workbox-sw@7.3.0: - resolution: {integrity: sha512-aCUyoAZU9IZtH05mn0ACUpyHzPs0lMeJimAYkQkBsOWiqaJLgusfDCR+yllkPkFRxWpZKF8vSvgHYeG7LwhlmA==} + workbox-streams@7.4.1: + resolution: {integrity: sha512-HWWtraKUbJknd9kgqGcpQ3G114HOPYvqs8HaJMDs2ebLNAimDkVDaWfAXE6Ybl+m8U6KsCE6pWyLYuigWmnAXw==} - workbox-window@7.3.0: - resolution: {integrity: sha512-qW8PDy16OV1UBaUNGlTVcepzrlzyzNW/ZJvFQQs2j2TzGsg6IKjcpZC1RSquqQnTOafl5pCj5bGfAHlCjOOjdA==} + workbox-sw@7.4.1: + resolution: {integrity: sha512-fez5f2DUlDJWTFYkCWQpY10N8gtztd849NswCbVFk0QlcSM4HT5A8x4g4ii650yem4I8tHY0R7JZahwp3ltIPw==} workbox-window@7.4.1: resolution: {integrity: sha512-notZDH2u8VXaqyuD7xaqIfEFi6SRM4SUSd7ewe9PDsVqADuepxX2ZMY3uvuZGxzY5ZOsGC/vD3A/3smFtJt4/A==} @@ -3810,9 +3836,6 @@ packages: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - xxhash-wasm@1.1.0: resolution: {integrity: sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==} @@ -3940,13 +3963,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/mdx@6.0.3(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))': + '@astrojs/mdx@6.0.3(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))': dependencies: '@astrojs/internal-helpers': 0.10.0 '@astrojs/markdown-remark': 7.2.0 '@mdx-js/mdx': 3.1.1 - acorn: 8.16.0 - astro: 6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + acorn: 8.17.0 + astro: 6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) es-module-lexer: 2.1.0 estree-util-visit: 2.0.0 hast-util-to-html: 9.0.5 @@ -3964,17 +3987,17 @@ snapshots: dependencies: prismjs: 1.30.0 - '@astrojs/react@5.0.7(@types/node@24.13.1)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)': + '@astrojs/react@5.0.7(@types/node@24.13.2)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)': dependencies: '@astrojs/internal-helpers': 0.10.0 '@types/react': 19.2.17 '@types/react-dom': 19.2.3(@types/react@19.2.17) - '@vitejs/plugin-react': 5.2.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)) + '@vitejs/plugin-react': 5.2.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)) devalue: 5.8.1 react: 19.2.7 react-dom: 19.2.7(react@19.2.7) ultrahtml: 1.6.0 - vite: 7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + vite: 7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) transitivePeerDependencies: - '@types/node' - jiti @@ -3995,17 +4018,17 @@ snapshots: stream-replace-string: 2.0.0 zod: 4.4.3 - '@astrojs/starlight@0.40.0(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(typescript@6.0.3)': + '@astrojs/starlight@0.40.0(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(typescript@6.0.3)': dependencies: '@astrojs/markdown-remark': 7.2.0 - '@astrojs/mdx': 6.0.3(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)) + '@astrojs/mdx': 6.0.3(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)) '@astrojs/sitemap': 3.7.3 '@pagefind/default-ui': 1.5.2 '@types/hast': 3.0.4 '@types/js-yaml': 4.0.9 '@types/mdast': 4.0.4 - astro: 6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) - astro-expressive-code: 0.43.1(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)) + astro: 6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) + astro-expressive-code: 0.43.1(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)) bcp-47: 2.1.0 hast-util-from-html: 2.0.3 hast-util-select: 6.0.4 @@ -4715,7 +4738,7 @@ snapshots: '@babel/helper-string-parser': 7.29.7 '@babel/helper-validator-identifier': 7.29.7 - '@capsizecss/unpack@4.0.0': + '@capsizecss/unpack@4.0.1': dependencies: fontkitten: 1.0.3 @@ -4756,7 +4779,7 @@ snapshots: '@emmetio/stream-reader@2.2.0': {} - '@emnapi/runtime@1.11.0': + '@emnapi/runtime@1.11.1': dependencies: tslib: 2.8.1 optional: true @@ -4871,7 +4894,7 @@ snapshots: '@img/sharp-libvips-darwin-arm64': 1.2.4 optional: true - '@img/sharp-darwin-arm64@0.35.0': + '@img/sharp-darwin-arm64@0.35.1': optionalDependencies: '@img/sharp-libvips-darwin-arm64': 1.3.0 optional: true @@ -4881,14 +4904,14 @@ snapshots: '@img/sharp-libvips-darwin-x64': 1.2.4 optional: true - '@img/sharp-darwin-x64@0.35.0': + '@img/sharp-darwin-x64@0.35.1': optionalDependencies: '@img/sharp-libvips-darwin-x64': 1.3.0 optional: true - '@img/sharp-freebsd-wasm32@0.35.0': + '@img/sharp-freebsd-wasm32@0.35.1': dependencies: - '@img/sharp-wasm32': 0.35.0 + '@img/sharp-wasm32': 0.35.1 optional: true '@img/sharp-libvips-darwin-arm64@1.2.4': @@ -4956,7 +4979,7 @@ snapshots: '@img/sharp-libvips-linux-arm64': 1.2.4 optional: true - '@img/sharp-linux-arm64@0.35.0': + '@img/sharp-linux-arm64@0.35.1': optionalDependencies: '@img/sharp-libvips-linux-arm64': 1.3.0 optional: true @@ -4966,7 +4989,7 @@ snapshots: '@img/sharp-libvips-linux-arm': 1.2.4 optional: true - '@img/sharp-linux-arm@0.35.0': + '@img/sharp-linux-arm@0.35.1': optionalDependencies: '@img/sharp-libvips-linux-arm': 1.3.0 optional: true @@ -4976,7 +4999,7 @@ snapshots: '@img/sharp-libvips-linux-ppc64': 1.2.4 optional: true - '@img/sharp-linux-ppc64@0.35.0': + '@img/sharp-linux-ppc64@0.35.1': optionalDependencies: '@img/sharp-libvips-linux-ppc64': 1.3.0 optional: true @@ -4986,7 +5009,7 @@ snapshots: '@img/sharp-libvips-linux-riscv64': 1.2.4 optional: true - '@img/sharp-linux-riscv64@0.35.0': + '@img/sharp-linux-riscv64@0.35.1': optionalDependencies: '@img/sharp-libvips-linux-riscv64': 1.3.0 optional: true @@ -4996,7 +5019,7 @@ snapshots: '@img/sharp-libvips-linux-s390x': 1.2.4 optional: true - '@img/sharp-linux-s390x@0.35.0': + '@img/sharp-linux-s390x@0.35.1': optionalDependencies: '@img/sharp-libvips-linux-s390x': 1.3.0 optional: true @@ -5006,7 +5029,7 @@ snapshots: '@img/sharp-libvips-linux-x64': 1.2.4 optional: true - '@img/sharp-linux-x64@0.35.0': + '@img/sharp-linux-x64@0.35.1': optionalDependencies: '@img/sharp-libvips-linux-x64': 1.3.0 optional: true @@ -5016,7 +5039,7 @@ snapshots: '@img/sharp-libvips-linuxmusl-arm64': 1.2.4 optional: true - '@img/sharp-linuxmusl-arm64@0.35.0': + '@img/sharp-linuxmusl-arm64@0.35.1': optionalDependencies: '@img/sharp-libvips-linuxmusl-arm64': 1.3.0 optional: true @@ -5026,44 +5049,46 @@ snapshots: '@img/sharp-libvips-linuxmusl-x64': 1.2.4 optional: true - '@img/sharp-linuxmusl-x64@0.35.0': + '@img/sharp-linuxmusl-x64@0.35.1': optionalDependencies: '@img/sharp-libvips-linuxmusl-x64': 1.3.0 optional: true '@img/sharp-wasm32@0.34.5': dependencies: - '@emnapi/runtime': 1.11.0 + '@emnapi/runtime': 1.11.1 optional: true - '@img/sharp-wasm32@0.35.0': + '@img/sharp-wasm32@0.35.1': dependencies: - '@emnapi/runtime': 1.11.0 + '@emnapi/runtime': 1.11.1 optional: true - '@img/sharp-webcontainers-wasm32@0.35.0': + '@img/sharp-webcontainers-wasm32@0.35.1': dependencies: - '@img/sharp-wasm32': 0.35.0 + '@img/sharp-wasm32': 0.35.1 optional: true '@img/sharp-win32-arm64@0.34.5': optional: true - '@img/sharp-win32-arm64@0.35.0': + '@img/sharp-win32-arm64@0.35.1': optional: true '@img/sharp-win32-ia32@0.34.5': optional: true - '@img/sharp-win32-ia32@0.35.0': + '@img/sharp-win32-ia32@0.35.1': optional: true '@img/sharp-win32-x64@0.34.5': optional: true - '@img/sharp-win32-x64@0.35.0': + '@img/sharp-win32-x64@0.35.1': optional: true + '@isaacs/cliui@9.0.0': {} + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -5096,7 +5121,7 @@ snapshots: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 '@types/mdx': 2.0.14 - acorn: 8.16.0 + acorn: 8.17.0 collapse-white-space: 2.1.0 devlop: 1.1.0 estree-util-is-identifier-name: 3.0.0 @@ -5105,7 +5130,7 @@ snapshots: hast-util-to-jsx-runtime: 2.3.6 markdown-extensions: 2.0.0 recma-build-jsx: 1.0.0 - recma-jsx: 1.0.1(acorn@8.16.0) + recma-jsx: 1.0.1(acorn@8.17.0) recma-stringify: 1.0.0 rehype-recma: 1.0.0 remark-mdx: 3.1.1 @@ -5213,129 +5238,123 @@ snapshots: '@rolldown/pluginutils@1.0.0-rc.3': {} - '@rollup/plugin-babel@5.3.1(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@2.80.0)': + '@rollup/plugin-babel@6.1.0(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@4.62.0)': dependencies: '@babel/core': 7.29.7 '@babel/helper-module-imports': 7.29.7 - '@rollup/pluginutils': 3.1.0(rollup@2.80.0) - rollup: 2.80.0 + '@rollup/pluginutils': 5.4.0(rollup@4.62.0) optionalDependencies: '@types/babel__core': 7.20.5 + rollup: 4.62.0 transitivePeerDependencies: - supports-color - '@rollup/plugin-node-resolve@15.3.1(rollup@2.80.0)': + '@rollup/plugin-node-resolve@16.0.3(rollup@4.62.0)': dependencies: - '@rollup/pluginutils': 5.4.0(rollup@2.80.0) + '@rollup/pluginutils': 5.4.0(rollup@4.62.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.12 optionalDependencies: - rollup: 2.80.0 + rollup: 4.62.0 - '@rollup/plugin-replace@2.4.2(rollup@2.80.0)': + '@rollup/plugin-replace@6.0.3(rollup@4.62.0)': dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.80.0) - magic-string: 0.25.9 - rollup: 2.80.0 + '@rollup/pluginutils': 5.4.0(rollup@4.62.0) + magic-string: 0.30.21 + optionalDependencies: + rollup: 4.62.0 - '@rollup/plugin-terser@0.4.4(rollup@2.80.0)': + '@rollup/plugin-terser@1.0.0(rollup@4.62.0)': dependencies: - serialize-javascript: 6.0.2 + serialize-javascript: 7.0.6 smob: 1.6.2 terser: 5.48.0 optionalDependencies: - rollup: 2.80.0 + rollup: 4.62.0 - '@rollup/pluginutils@3.1.0(rollup@2.80.0)': - dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.3.2 - rollup: 2.80.0 - - '@rollup/pluginutils@5.4.0(rollup@2.80.0)': + '@rollup/pluginutils@5.4.0(rollup@4.62.0)': dependencies: '@types/estree': 1.0.9 estree-walker: 2.0.2 picomatch: 4.0.4 optionalDependencies: - rollup: 2.80.0 + rollup: 4.62.0 - '@rollup/rollup-android-arm-eabi@4.61.1': + '@rollup/rollup-android-arm-eabi@4.62.0': optional: true - '@rollup/rollup-android-arm64@4.61.1': + '@rollup/rollup-android-arm64@4.62.0': optional: true - '@rollup/rollup-darwin-arm64@4.61.1': + '@rollup/rollup-darwin-arm64@4.62.0': optional: true - '@rollup/rollup-darwin-x64@4.61.1': + '@rollup/rollup-darwin-x64@4.62.0': optional: true - '@rollup/rollup-freebsd-arm64@4.61.1': + '@rollup/rollup-freebsd-arm64@4.62.0': optional: true - '@rollup/rollup-freebsd-x64@4.61.1': + '@rollup/rollup-freebsd-x64@4.62.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.61.1': + '@rollup/rollup-linux-arm-gnueabihf@4.62.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.61.1': + '@rollup/rollup-linux-arm-musleabihf@4.62.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.61.1': + '@rollup/rollup-linux-arm64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.61.1': + '@rollup/rollup-linux-arm64-musl@4.62.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.61.1': + '@rollup/rollup-linux-loong64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-loong64-musl@4.61.1': + '@rollup/rollup-linux-loong64-musl@4.62.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.61.1': + '@rollup/rollup-linux-ppc64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-ppc64-musl@4.61.1': + '@rollup/rollup-linux-ppc64-musl@4.62.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.61.1': + '@rollup/rollup-linux-riscv64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.61.1': + '@rollup/rollup-linux-riscv64-musl@4.62.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.61.1': + '@rollup/rollup-linux-s390x-gnu@4.62.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.61.1': + '@rollup/rollup-linux-x64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-x64-musl@4.61.1': + '@rollup/rollup-linux-x64-musl@4.62.0': optional: true - '@rollup/rollup-openbsd-x64@4.61.1': + '@rollup/rollup-openbsd-x64@4.62.0': optional: true - '@rollup/rollup-openharmony-arm64@4.61.1': + '@rollup/rollup-openharmony-arm64@4.62.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.61.1': + '@rollup/rollup-win32-arm64-msvc@4.62.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.61.1': + '@rollup/rollup-win32-ia32-msvc@4.62.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.61.1': + '@rollup/rollup-win32-x64-gnu@4.62.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.61.1': + '@rollup/rollup-win32-x64-msvc@4.62.0': optional: true '@shikijs/core@4.2.0': @@ -5378,11 +5397,11 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} - '@surma/rollup-plugin-off-main-thread@2.2.3': + '@trickfilm400/rollup-plugin-off-main-thread@3.0.0-pre1': dependencies: ejs: 3.1.10 json5: 2.2.3 - magic-string: 0.25.9 + magic-string: 0.30.21 string.prototype.matchall: 4.0.12 '@types/babel__core@7.20.5': @@ -5414,8 +5433,6 @@ snapshots: dependencies: '@types/estree': 1.0.9 - '@types/estree@0.0.39': {} - '@types/estree@1.0.9': {} '@types/hast@3.0.4': @@ -5436,7 +5453,7 @@ snapshots: dependencies: '@types/unist': 3.0.3 - '@types/node@24.13.1': + '@types/node@24.13.2': dependencies: undici-types: 7.18.2 @@ -5452,7 +5469,7 @@ snapshots: '@types/sax@1.2.7': dependencies: - '@types/node': 24.13.1 + '@types/node': 24.13.2 '@types/trusted-types@2.0.7': {} @@ -5462,12 +5479,12 @@ snapshots: '@ungap/structured-clone@1.3.1': {} - '@vite-pwa/astro@1.2.0(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(vite-plugin-pwa@1.3.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.3.0(@types/babel__core@7.20.5))(workbox-window@7.4.1))': + '@vite-pwa/astro@1.2.0(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(vite-plugin-pwa@1.3.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.4.1(@types/babel__core@7.20.5))(workbox-window@7.4.1))': dependencies: - astro: 6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) - vite-plugin-pwa: 1.3.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.3.0(@types/babel__core@7.20.5))(workbox-window@7.4.1) + astro: 6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) + vite-plugin-pwa: 1.3.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.4.1(@types/babel__core@7.20.5))(workbox-window@7.4.1) - '@vitejs/plugin-react@5.2.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))': + '@vitejs/plugin-react@5.2.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))': dependencies: '@babel/core': 7.29.7 '@babel/plugin-transform-react-jsx-self': 7.29.7(@babel/core@7.29.7) @@ -5475,7 +5492,7 @@ snapshots: '@rolldown/pluginutils': 1.0.0-rc.3 '@types/babel__core': 7.20.5 react-refresh: 0.18.0 - vite: 7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + vite: 7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) transitivePeerDependencies: - supports-color @@ -5529,11 +5546,11 @@ snapshots: '@vscode/l10n@0.0.18': {} - acorn-jsx@5.3.2(acorn@8.16.0): + acorn-jsx@5.3.2(acorn@8.17.0): dependencies: - acorn: 8.16.0 + acorn: 8.17.0 - acorn@8.16.0: {} + acorn@8.17.0: {} ajv-draft-04@1.0.0(ajv@8.20.0): optionalDependencies: @@ -5582,21 +5599,21 @@ snapshots: astring@1.9.0: {} - astro-expressive-code@0.43.1(astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)): + astro-expressive-code@0.43.1(astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)): dependencies: - astro: 6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + astro: 6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) rehype-expressive-code: 0.43.1 - astro@6.4.6(@types/node@24.13.1)(rollup@2.80.0)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0): + astro@6.4.8(@types/node@24.13.2)(rollup@4.62.0)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0): dependencies: '@astrojs/compiler': 4.0.0 '@astrojs/internal-helpers': 0.10.0 '@astrojs/markdown-remark': 7.2.0 '@astrojs/telemetry': 3.3.2 - '@capsizecss/unpack': 4.0.0 + '@capsizecss/unpack': 4.0.1 '@clack/prompts': 1.5.1 '@oslojs/encoding': 1.1.0 - '@rollup/pluginutils': 5.4.0(rollup@2.80.0) + '@rollup/pluginutils': 5.4.0(rollup@4.62.0) aria-query: 5.3.2 axobject-query: 4.1.0 ci-info: 4.4.0 @@ -5620,7 +5637,7 @@ snapshots: magicast: 0.5.3 mrmime: 2.0.1 neotraverse: 0.6.18 - obug: 2.1.2 + obug: 2.1.3 p-limit: 7.3.0 p-queue: 9.3.0 package-manager-detector: 1.6.0 @@ -5639,8 +5656,8 @@ snapshots: unist-util-visit: 5.1.0 unstorage: 1.17.5 vfile: 6.0.3 - vite: 7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) - vitefu: 1.1.3(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)) + vite: 7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) + vitefu: 1.1.3(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)) xxhash-wasm: 1.1.0 yargs-parser: 22.0.0 zod: 4.4.3 @@ -5720,7 +5737,9 @@ snapshots: balanced-match@1.0.2: {} - baseline-browser-mapping@2.10.35: {} + balanced-match@4.0.4: {} + + baseline-browser-mapping@2.10.38: {} bcp-47-match@2.0.3: {} @@ -5732,21 +5751,20 @@ snapshots: boolbase@1.0.0: {} - brace-expansion@1.1.15: + brace-expansion@2.1.1: dependencies: balanced-match: 1.0.2 - concat-map: 0.0.1 - brace-expansion@2.1.1: + brace-expansion@5.0.6: dependencies: - balanced-match: 1.0.2 + balanced-match: 4.0.4 browserslist@4.28.2: dependencies: - baseline-browser-mapping: 2.10.35 - caniuse-lite: 1.0.30001797 - electron-to-chromium: 1.5.371 - node-releases: 2.0.47 + baseline-browser-mapping: 2.10.38 + caniuse-lite: 1.0.30001799 + electron-to-chromium: 1.5.375 + node-releases: 2.0.48 update-browserslist-db: 1.2.3(browserslist@4.28.2) buffer-from@1.1.2: {} @@ -5768,7 +5786,7 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - caniuse-lite@1.0.30001797: {} + caniuse-lite@1.0.30001799: {} ccount@2.0.1: {} @@ -5816,8 +5834,6 @@ snapshots: common-tags@1.8.2: {} - concat-map@0.0.1: {} - convert-source-map@2.0.0: {} cookie-es@1.2.3: {} @@ -5828,6 +5844,12 @@ snapshots: dependencies: browserslist: 4.28.2 + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + crossws@0.3.5: dependencies: uncrypto: 0.1.3 @@ -5952,7 +5974,7 @@ snapshots: dependencies: jake: 10.9.4 - electron-to-chromium@1.5.371: {} + electron-to-chromium@1.5.375: {} emmet@2.4.11: dependencies: @@ -5965,6 +5987,13 @@ snapshots: entities@6.0.1: {} + es-abstract-get@1.0.0: + dependencies: + es-errors: 1.3.0 + es-object-atoms: 1.1.2 + is-callable: 1.2.7 + object-inspect: 1.13.4 + es-abstract@1.24.2: dependencies: array-buffer-byte-length: 1.0.2 @@ -5979,8 +6008,8 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.1.2 es-set-tostringtag: 2.1.0 - es-to-primitive: 1.3.0 - function.prototype.name: 1.1.8 + es-to-primitive: 1.3.1 + function.prototype.name: 1.2.0 get-intrinsic: 1.3.0 get-proto: 1.0.1 get-symbol-description: 1.1.0 @@ -6039,8 +6068,10 @@ snapshots: has-tostringtag: 1.0.2 hasown: 2.0.4 - es-to-primitive@1.3.0: + es-to-primitive@1.3.1: dependencies: + es-abstract-get: 1.0.0 + es-errors: 1.3.0 is-callable: 1.2.7 is-date-object: 1.1.0 is-symbol: 1.1.1 @@ -6055,7 +6086,7 @@ snapshots: esast-util-from-js@2.0.1: dependencies: '@types/estree-jsx': 1.0.5 - acorn: 8.16.0 + acorn: 8.17.0 esast-util-from-estree: 2.0.0 vfile-message: 4.0.3 @@ -6121,8 +6152,6 @@ snapshots: '@types/estree-jsx': 1.0.5 '@types/unist': 3.0.3 - estree-walker@1.0.1: {} - estree-walker@2.0.2: {} estree-walker@3.0.3: @@ -6131,6 +6160,8 @@ snapshots: esutils@2.0.3: {} + eta@4.6.0: {} + eventemitter3@5.0.4: {} expressive-code@0.43.1: @@ -6180,6 +6211,11 @@ snapshots: dependencies: is-callable: 1.2.7 + foreground-child@3.3.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + fs-extra@9.1.0: dependencies: at-least-node: 1.0.0 @@ -6187,21 +6223,22 @@ snapshots: jsonfile: 6.2.1 universalify: 2.0.1 - fs.realpath@1.0.0: {} - fsevents@2.3.3: optional: true function-bind@1.1.2: {} - function.prototype.name@1.1.8: + function.prototype.name@1.2.0: dependencies: call-bind: 1.0.9 call-bound: 1.0.4 - define-properties: 1.2.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 functions-have-names: 1.2.3 + has-property-descriptors: 1.0.2 hasown: 2.0.4 is-callable: 1.2.7 + is-document.all: 1.0.0 functions-have-names@1.2.3: {} @@ -6245,14 +6282,14 @@ snapshots: github-slugger@2.0.0: {} - glob@7.2.3: + glob@11.1.0: dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.5 - once: 1.4.0 - path-is-absolute: 1.0.1 + foreground-child: 3.3.1 + jackspeak: 4.2.3 + minimatch: 10.2.5 + minipass: 7.1.3 + package-json-from-dist: 1.0.1 + path-scurry: 2.0.2 globalthis@1.0.4: dependencies: @@ -6500,13 +6537,6 @@ snapshots: immutable@5.1.6: {} - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - inline-style-parser@0.2.7: {} internal-slot@1.1.0: @@ -6570,6 +6600,10 @@ snapshots: is-docker@4.0.0: {} + is-document.all@1.0.0: + dependencies: + call-bound: 1.0.4 + is-extglob@2.1.1: optional: true @@ -6662,6 +6696,12 @@ snapshots: isarray@2.0.5: {} + isexe@2.0.0: {} + + jackspeak@4.2.3: + dependencies: + '@isaacs/cliui': 9.0.0 + jake@10.9.4: dependencies: async: 3.2.6 @@ -6712,10 +6752,6 @@ snapshots: dependencies: yallist: 3.1.1 - magic-string@0.25.9: - dependencies: - sourcemap-codec: 1.4.8 - magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -7048,8 +7084,8 @@ snapshots: micromark-extension-mdxjs@3.0.0: dependencies: - acorn: 8.16.0 - acorn-jsx: 5.3.2(acorn@8.16.0) + acorn: 8.17.0 + acorn-jsx: 5.3.2(acorn@8.17.0) micromark-extension-mdx-expression: 3.0.1 micromark-extension-mdx-jsx: 3.0.2 micromark-extension-mdx-md: 2.0.0 @@ -7193,14 +7229,16 @@ snapshots: transitivePeerDependencies: - supports-color - minimatch@3.1.5: + minimatch@10.2.5: dependencies: - brace-expansion: 1.1.15 + brace-expansion: 5.0.6 minimatch@5.1.9: dependencies: brace-expansion: 2.1.1 + minipass@7.1.3: {} + mrmime@2.0.1: {} ms@2.1.3: {} @@ -7222,7 +7260,7 @@ snapshots: node-mock-http@1.0.4: {} - node-releases@2.0.47: {} + node-releases@2.0.48: {} normalize-path@3.0.0: {} @@ -7243,7 +7281,7 @@ snapshots: has-symbols: 1.1.0 object-keys: 1.1.1 - obug@2.1.2: {} + obug@2.1.3: {} ofetch@1.5.1: dependencies: @@ -7253,10 +7291,6 @@ snapshots: ohash@2.0.11: {} - once@1.4.0: - dependencies: - wrappy: 1.0.2 - oniguruma-parser@0.12.2: {} oniguruma-to-es@4.3.6: @@ -7282,6 +7316,8 @@ snapshots: p-timeout@7.0.1: {} + package-json-from-dist@1.0.1: {} + package-manager-detector@1.6.0: {} pagefind@1.5.2: @@ -7319,10 +7355,15 @@ snapshots: path-browserify@1.0.1: {} - path-is-absolute@1.0.1: {} + path-key@3.1.1: {} path-parse@1.0.7: {} + path-scurry@2.0.2: + dependencies: + lru-cache: 11.5.1 + minipass: 7.1.3 + piccolore@0.1.3: {} picocolors@1.1.1: {} @@ -7336,9 +7377,9 @@ snapshots: postcss-nested@6.2.0(postcss@8.5.15): dependencies: postcss: 8.5.15 - postcss-selector-parser: 6.1.2 + postcss-selector-parser: 6.1.4 - postcss-selector-parser@6.1.2: + postcss-selector-parser@6.1.4: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 @@ -7363,10 +7404,6 @@ snapshots: radix3@1.1.2: {} - randombytes@2.1.0: - dependencies: - safe-buffer: 5.2.1 - react-dom@19.2.7(react@19.2.7): dependencies: react: 19.2.7 @@ -7386,10 +7423,10 @@ snapshots: estree-util-build-jsx: 3.0.1 vfile: 6.0.3 - recma-jsx@1.0.1(acorn@8.16.0): + recma-jsx@1.0.1(acorn@8.17.0): dependencies: - acorn: 8.16.0 - acorn-jsx: 5.3.2(acorn@8.16.0) + acorn: 8.17.0 + acorn-jsx: 5.3.2(acorn@8.17.0) estree-util-to-js: 2.0.0 recma-parse: 1.0.0 recma-stringify: 1.0.0 @@ -7450,13 +7487,13 @@ snapshots: regenerate: 1.4.2 regenerate-unicode-properties: 10.2.2 regjsgen: 0.8.0 - regjsparser: 0.13.1 + regjsparser: 0.13.2 unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.2.1 regjsgen@0.8.0: {} - regjsparser@0.13.1: + regjsparser@0.13.2: dependencies: jsesc: 3.1.0 @@ -7612,39 +7649,35 @@ snapshots: retext-stringify: 4.0.0 unified: 11.0.5 - rollup@2.80.0: - optionalDependencies: - fsevents: 2.3.3 - - rollup@4.61.1: + rollup@4.62.0: dependencies: '@types/estree': 1.0.9 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.61.1 - '@rollup/rollup-android-arm64': 4.61.1 - '@rollup/rollup-darwin-arm64': 4.61.1 - '@rollup/rollup-darwin-x64': 4.61.1 - '@rollup/rollup-freebsd-arm64': 4.61.1 - '@rollup/rollup-freebsd-x64': 4.61.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.61.1 - '@rollup/rollup-linux-arm-musleabihf': 4.61.1 - '@rollup/rollup-linux-arm64-gnu': 4.61.1 - '@rollup/rollup-linux-arm64-musl': 4.61.1 - '@rollup/rollup-linux-loong64-gnu': 4.61.1 - '@rollup/rollup-linux-loong64-musl': 4.61.1 - '@rollup/rollup-linux-ppc64-gnu': 4.61.1 - '@rollup/rollup-linux-ppc64-musl': 4.61.1 - '@rollup/rollup-linux-riscv64-gnu': 4.61.1 - '@rollup/rollup-linux-riscv64-musl': 4.61.1 - '@rollup/rollup-linux-s390x-gnu': 4.61.1 - '@rollup/rollup-linux-x64-gnu': 4.61.1 - '@rollup/rollup-linux-x64-musl': 4.61.1 - '@rollup/rollup-openbsd-x64': 4.61.1 - '@rollup/rollup-openharmony-arm64': 4.61.1 - '@rollup/rollup-win32-arm64-msvc': 4.61.1 - '@rollup/rollup-win32-ia32-msvc': 4.61.1 - '@rollup/rollup-win32-x64-gnu': 4.61.1 - '@rollup/rollup-win32-x64-msvc': 4.61.1 + '@rollup/rollup-android-arm-eabi': 4.62.0 + '@rollup/rollup-android-arm64': 4.62.0 + '@rollup/rollup-darwin-arm64': 4.62.0 + '@rollup/rollup-darwin-x64': 4.62.0 + '@rollup/rollup-freebsd-arm64': 4.62.0 + '@rollup/rollup-freebsd-x64': 4.62.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.62.0 + '@rollup/rollup-linux-arm-musleabihf': 4.62.0 + '@rollup/rollup-linux-arm64-gnu': 4.62.0 + '@rollup/rollup-linux-arm64-musl': 4.62.0 + '@rollup/rollup-linux-loong64-gnu': 4.62.0 + '@rollup/rollup-linux-loong64-musl': 4.62.0 + '@rollup/rollup-linux-ppc64-gnu': 4.62.0 + '@rollup/rollup-linux-ppc64-musl': 4.62.0 + '@rollup/rollup-linux-riscv64-gnu': 4.62.0 + '@rollup/rollup-linux-riscv64-musl': 4.62.0 + '@rollup/rollup-linux-s390x-gnu': 4.62.0 + '@rollup/rollup-linux-x64-gnu': 4.62.0 + '@rollup/rollup-linux-x64-musl': 4.62.0 + '@rollup/rollup-openbsd-x64': 4.62.0 + '@rollup/rollup-openharmony-arm64': 4.62.0 + '@rollup/rollup-win32-arm64-msvc': 4.62.0 + '@rollup/rollup-win32-ia32-msvc': 4.62.0 + '@rollup/rollup-win32-x64-gnu': 4.62.0 + '@rollup/rollup-win32-x64-msvc': 4.62.0 fsevents: 2.3.3 safe-array-concat@1.1.4: @@ -7655,8 +7688,6 @@ snapshots: has-symbols: 1.1.0 isarray: 2.0.5 - safe-buffer@5.2.1: {} - safe-push-apply@1.0.0: dependencies: es-errors: 1.3.0 @@ -7668,7 +7699,7 @@ snapshots: es-errors: 1.3.0 is-regex: 1.2.1 - sass@1.100.0: + sass@1.101.0: dependencies: chokidar: 5.0.0 immutable: 5.1.6 @@ -7684,9 +7715,7 @@ snapshots: semver@7.8.4: {} - serialize-javascript@6.0.2: - dependencies: - randombytes: 2.1.0 + serialize-javascript@7.0.6: {} set-function-length@1.2.2: dependencies: @@ -7742,15 +7771,15 @@ snapshots: '@img/sharp-win32-x64': 0.34.5 optional: true - sharp@0.35.0: + sharp@0.35.1: dependencies: '@img/colour': 1.1.0 detect-libc: 2.1.2 semver: 7.8.4 optionalDependencies: - '@img/sharp-darwin-arm64': 0.35.0 - '@img/sharp-darwin-x64': 0.35.0 - '@img/sharp-freebsd-wasm32': 0.35.0 + '@img/sharp-darwin-arm64': 0.35.1 + '@img/sharp-darwin-x64': 0.35.1 + '@img/sharp-freebsd-wasm32': 0.35.1 '@img/sharp-libvips-darwin-arm64': 1.3.0 '@img/sharp-libvips-darwin-x64': 1.3.0 '@img/sharp-libvips-linux-arm': 1.3.0 @@ -7761,18 +7790,24 @@ snapshots: '@img/sharp-libvips-linux-x64': 1.3.0 '@img/sharp-libvips-linuxmusl-arm64': 1.3.0 '@img/sharp-libvips-linuxmusl-x64': 1.3.0 - '@img/sharp-linux-arm': 0.35.0 - '@img/sharp-linux-arm64': 0.35.0 - '@img/sharp-linux-ppc64': 0.35.0 - '@img/sharp-linux-riscv64': 0.35.0 - '@img/sharp-linux-s390x': 0.35.0 - '@img/sharp-linux-x64': 0.35.0 - '@img/sharp-linuxmusl-arm64': 0.35.0 - '@img/sharp-linuxmusl-x64': 0.35.0 - '@img/sharp-webcontainers-wasm32': 0.35.0 - '@img/sharp-win32-arm64': 0.35.0 - '@img/sharp-win32-ia32': 0.35.0 - '@img/sharp-win32-x64': 0.35.0 + '@img/sharp-linux-arm': 0.35.1 + '@img/sharp-linux-arm64': 0.35.1 + '@img/sharp-linux-ppc64': 0.35.1 + '@img/sharp-linux-riscv64': 0.35.1 + '@img/sharp-linux-s390x': 0.35.1 + '@img/sharp-linux-x64': 0.35.1 + '@img/sharp-linuxmusl-arm64': 0.35.1 + '@img/sharp-linuxmusl-x64': 0.35.1 + '@img/sharp-webcontainers-wasm32': 0.35.1 + '@img/sharp-win32-arm64': 0.35.1 + '@img/sharp-win32-ia32': 0.35.1 + '@img/sharp-win32-x64': 0.35.1 + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} shiki@4.2.0: dependencies: @@ -7813,11 +7848,13 @@ snapshots: side-channel-map: 1.0.1 side-channel-weakmap: 1.0.2 + signal-exit@4.1.0: {} + sisteransi@1.0.5: {} sitemap@9.0.1: dependencies: - '@types/node': 24.13.1 + '@types/node': 24.13.2 '@types/sax': 1.2.7 arg: 5.0.2 sax: 1.6.0 @@ -7841,8 +7878,6 @@ snapshots: dependencies: whatwg-url: 7.1.0 - sourcemap-codec@1.4.8: {} - space-separated-tokens@2.0.2: {} stop-iteration-iterator@1.1.0: @@ -7947,7 +7982,7 @@ snapshots: terser@5.48.0: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.16.0 + acorn: 8.17.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -8156,35 +8191,35 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite-plugin-pwa@1.3.0(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.3.0(@types/babel__core@7.20.5))(workbox-window@7.4.1): + vite-plugin-pwa@1.3.0(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0))(workbox-build@7.4.1(@types/babel__core@7.20.5))(workbox-window@7.4.1): dependencies: debug: 4.4.3 pretty-bytes: 6.1.1 tinyglobby: 0.2.17 - vite: 7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) - workbox-build: 7.3.0(@types/babel__core@7.20.5) + vite: 7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) + workbox-build: 7.4.1(@types/babel__core@7.20.5) workbox-window: 7.4.1 transitivePeerDependencies: - supports-color - vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0): + vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0): dependencies: esbuild: 0.27.7 fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 postcss: 8.5.15 - rollup: 4.61.1 + rollup: 4.62.0 tinyglobby: 0.2.17 optionalDependencies: - '@types/node': 24.13.1 + '@types/node': 24.13.2 fsevents: 2.3.3 - sass: 1.100.0 + sass: 1.101.0 terser: 5.48.0 yaml: 2.9.0 - vitefu@1.1.3(vite@7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0)): + vitefu@1.1.3(vite@7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0)): optionalDependencies: - vite: 7.3.5(@types/node@24.13.1)(sass@1.100.0)(terser@5.48.0)(yaml@2.9.0) + vite: 7.3.5(@types/node@24.13.2)(sass@1.101.0)(terser@5.48.0)(yaml@2.9.0) volar-service-css@0.0.70(@volar/language-service@2.4.28): dependencies: @@ -8313,7 +8348,7 @@ snapshots: which-builtin-type@1.2.1: dependencies: call-bound: 1.0.4 - function.prototype.name: 1.1.8 + function.prototype.name: 1.2.0 has-tostringtag: 1.0.2 is-async-function: 2.1.1 is-date-object: 1.1.0 @@ -8345,120 +8380,117 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 - workbox-background-sync@7.3.0: + which@2.0.2: + dependencies: + isexe: 2.0.0 + + workbox-background-sync@7.4.1: dependencies: idb: 7.1.1 - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-broadcast-update@7.3.0: + workbox-broadcast-update@7.4.1: dependencies: - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-build@7.3.0(@types/babel__core@7.20.5): + workbox-build@7.4.1(@types/babel__core@7.20.5): dependencies: '@apideck/better-ajv-errors': 0.3.7(ajv@8.20.0) '@babel/core': 7.29.7 '@babel/preset-env': 7.29.7(@babel/core@7.29.7) '@babel/runtime': 7.29.7 - '@rollup/plugin-babel': 5.3.1(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@2.80.0) - '@rollup/plugin-node-resolve': 15.3.1(rollup@2.80.0) - '@rollup/plugin-replace': 2.4.2(rollup@2.80.0) - '@rollup/plugin-terser': 0.4.4(rollup@2.80.0) - '@surma/rollup-plugin-off-main-thread': 2.2.3 + '@rollup/plugin-babel': 6.1.0(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@4.62.0) + '@rollup/plugin-node-resolve': 16.0.3(rollup@4.62.0) + '@rollup/plugin-replace': 6.0.3(rollup@4.62.0) + '@rollup/plugin-terser': 1.0.0(rollup@4.62.0) + '@trickfilm400/rollup-plugin-off-main-thread': 3.0.0-pre1 ajv: 8.20.0 common-tags: 1.8.2 + eta: 4.6.0 fast-json-stable-stringify: 2.1.0 fs-extra: 9.1.0 - glob: 7.2.3 - lodash: 4.18.1 + glob: 11.1.0 pretty-bytes: 5.6.0 - rollup: 2.80.0 + rollup: 4.62.0 source-map: 0.8.0-beta.0 stringify-object: 3.3.0 strip-comments: 2.0.1 tempy: 0.6.0 upath: 1.2.0 - workbox-background-sync: 7.3.0 - workbox-broadcast-update: 7.3.0 - workbox-cacheable-response: 7.3.0 - workbox-core: 7.3.0 - workbox-expiration: 7.3.0 - workbox-google-analytics: 7.3.0 - workbox-navigation-preload: 7.3.0 - workbox-precaching: 7.3.0 - workbox-range-requests: 7.3.0 - workbox-recipes: 7.3.0 - workbox-routing: 7.3.0 - workbox-strategies: 7.3.0 - workbox-streams: 7.3.0 - workbox-sw: 7.3.0 - workbox-window: 7.3.0 + workbox-background-sync: 7.4.1 + workbox-broadcast-update: 7.4.1 + workbox-cacheable-response: 7.4.1 + workbox-core: 7.4.1 + workbox-expiration: 7.4.1 + workbox-google-analytics: 7.4.1 + workbox-navigation-preload: 7.4.1 + workbox-precaching: 7.4.1 + workbox-range-requests: 7.4.1 + workbox-recipes: 7.4.1 + workbox-routing: 7.4.1 + workbox-strategies: 7.4.1 + workbox-streams: 7.4.1 + workbox-sw: 7.4.1 + workbox-window: 7.4.1 transitivePeerDependencies: - '@types/babel__core' - supports-color - workbox-cacheable-response@7.3.0: + workbox-cacheable-response@7.4.1: dependencies: - workbox-core: 7.3.0 - - workbox-core@7.3.0: {} + workbox-core: 7.4.1 workbox-core@7.4.1: {} - workbox-expiration@7.3.0: + workbox-expiration@7.4.1: dependencies: idb: 7.1.1 - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-google-analytics@7.3.0: + workbox-google-analytics@7.4.1: dependencies: - workbox-background-sync: 7.3.0 - workbox-core: 7.3.0 - workbox-routing: 7.3.0 - workbox-strategies: 7.3.0 + workbox-background-sync: 7.4.1 + workbox-core: 7.4.1 + workbox-routing: 7.4.1 + workbox-strategies: 7.4.1 - workbox-navigation-preload@7.3.0: + workbox-navigation-preload@7.4.1: dependencies: - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-precaching@7.3.0: + workbox-precaching@7.4.1: dependencies: - workbox-core: 7.3.0 - workbox-routing: 7.3.0 - workbox-strategies: 7.3.0 + workbox-core: 7.4.1 + workbox-routing: 7.4.1 + workbox-strategies: 7.4.1 - workbox-range-requests@7.3.0: + workbox-range-requests@7.4.1: dependencies: - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-recipes@7.3.0: + workbox-recipes@7.4.1: dependencies: - workbox-cacheable-response: 7.3.0 - workbox-core: 7.3.0 - workbox-expiration: 7.3.0 - workbox-precaching: 7.3.0 - workbox-routing: 7.3.0 - workbox-strategies: 7.3.0 + workbox-cacheable-response: 7.4.1 + workbox-core: 7.4.1 + workbox-expiration: 7.4.1 + workbox-precaching: 7.4.1 + workbox-routing: 7.4.1 + workbox-strategies: 7.4.1 - workbox-routing@7.3.0: + workbox-routing@7.4.1: dependencies: - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-strategies@7.3.0: + workbox-strategies@7.4.1: dependencies: - workbox-core: 7.3.0 + workbox-core: 7.4.1 - workbox-streams@7.3.0: + workbox-streams@7.4.1: dependencies: - workbox-core: 7.3.0 - workbox-routing: 7.3.0 - - workbox-sw@7.3.0: {} + workbox-core: 7.4.1 + workbox-routing: 7.4.1 - workbox-window@7.3.0: - dependencies: - '@types/trusted-types': 2.0.7 - workbox-core: 7.3.0 + workbox-sw@7.4.1: {} workbox-window@7.4.1: dependencies: @@ -8471,8 +8503,6 @@ snapshots: string-width: 4.2.3 strip-ansi: 6.0.1 - wrappy@1.0.2: {} - xxhash-wasm@1.1.0: {} y18n@5.0.8: {} diff --git a/docs/public/fonts/Inter/OFL.txt b/docs/public/fonts/Inter/OFL.txt index 63db4fa7..d05ec4b3 100644 --- a/docs/public/fonts/Inter/OFL.txt +++ b/docs/public/fonts/Inter/OFL.txt @@ -1,93 +1,93 @@ -Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -https://openfontlicense.org - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. +Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/public/img/docs.svg b/docs/public/img/docs.svg index 0660bda4..d4df4c0c 100644 --- a/docs/public/img/docs.svg +++ b/docs/public/img/docs.svg @@ -1,119 +1,119 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/public/img/logo.svg b/docs/public/img/logo.svg index fbf392b3..b9cdfa91 100644 --- a/docs/public/img/logo.svg +++ b/docs/public/img/logo.svg @@ -1,92 +1,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/components/ContentPanel.astro b/docs/src/components/ContentPanel.astro index 513fb13f..5ef25d13 100644 --- a/docs/src/components/ContentPanel.astro +++ b/docs/src/components/ContentPanel.astro @@ -1,8 +1,8 @@ ---- -import type { Props } from "@astrojs/starlight/props"; -import StarlightContentPanel from "@astrojs/starlight/components/ContentPanel.astro"; ---- - -
- -
+--- +import type { Props } from "@astrojs/starlight/props"; +import StarlightContentPanel from "@astrojs/starlight/components/ContentPanel.astro"; +--- + +
+ +
diff --git a/docs/src/components/DownloadButton.astro b/docs/src/components/DownloadButton.astro index c1bf1d7f..bbe79b4f 100644 --- a/docs/src/components/DownloadButton.astro +++ b/docs/src/components/DownloadButton.astro @@ -1,34 +1,34 @@ ---- -import { LinkCard } from "@astrojs/starlight/components"; - -export interface Props { - title: string; - href: string; - after?: string; -} - -const { title, href, after } = Astro.props; ---- - - - - +--- +import { LinkCard } from "@astrojs/starlight/components"; + +export interface Props { + title: string; + href: string; + after?: string; +} + +const { title, href, after } = Astro.props; +--- + + + + diff --git a/docs/src/components/Footer.astro b/docs/src/components/Footer.astro index 4cfd8035..1442e6f0 100644 --- a/docs/src/components/Footer.astro +++ b/docs/src/components/Footer.astro @@ -1,62 +1,62 @@ ---- -import type { Props } from "@astrojs/starlight/props"; -import StarlightFooter from "@astrojs/starlight/components/Footer.astro"; -import { Image } from "astro:assets"; ---- - - - - - - - +--- +import type { Props } from "@astrojs/starlight/props"; +import StarlightFooter from "@astrojs/starlight/components/Footer.astro"; +import { Image } from "astro:assets"; +--- + + + + + + + diff --git a/docs/src/components/Head.astro b/docs/src/components/Head.astro index 741481cb..82ee1c1a 100644 --- a/docs/src/components/Head.astro +++ b/docs/src/components/Head.astro @@ -1,13 +1,13 @@ ---- -import type { Props } from "@astrojs/starlight/props"; -import StarlightHead from "@astrojs/starlight/components/Head.astro"; -import { ClientRouter } from "astro:transitions"; -import { pwaInfo } from 'virtual:pwa-info'; ---- - -{pwaInfo && } - - - - - +--- +import type { Props } from "@astrojs/starlight/props"; +import StarlightHead from "@astrojs/starlight/components/Head.astro"; +import { ClientRouter } from "astro:transitions"; +import { pwaInfo } from 'virtual:pwa-info'; +--- + +{pwaInfo && } + + + + + diff --git a/docs/src/content.config.ts b/docs/src/content.config.ts index 7fbcf2c3..d71b3eac 100644 --- a/docs/src/content.config.ts +++ b/docs/src/content.config.ts @@ -1,7 +1,7 @@ -import { defineCollection } from "astro:content"; -import { docsLoader } from "@astrojs/starlight/loaders"; -import { docsSchema } from "@astrojs/starlight/schema"; - -export const collections = { - docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), -}; +import { defineCollection } from "astro:content"; +import { docsLoader } from "@astrojs/starlight/loaders"; +import { docsSchema } from "@astrojs/starlight/schema"; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index 80b1a451..954c84b7 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -1,11 +1,11 @@ ---- -title: "" -head: - - tag: title - content: Changelog | Linwood Setonix -tableOfContents: false ---- - -import Changelog from "/../CHANGELOG.md" - - +--- +title: "" +head: + - tag: title + content: Changelog | Linwood Setonix +tableOfContents: false +--- + +import Changelog from "/../CHANGELOG.md" + + diff --git a/docs/src/content/docs/community/branding.mdx b/docs/src/content/docs/community/branding.mdx index 3199d7bc..72c85d7e 100644 --- a/docs/src/content/docs/community/branding.mdx +++ b/docs/src/content/docs/community/branding.mdx @@ -1,61 +1,61 @@ ---- -title: Branding ---- - -import { LinkButton } from '@astrojs/starlight/components'; - -These assets are licensed under the [CC-BY-SA-4.0](https://github.com/LinwoodDev/Setonix/blob/develop/BRANDING_LICENSE). - -## Logo - -![Logo](/img/logo.svg) - -
-SVG -PNG -
- -## Nightly Logo - -![Logo](/img/nightly.svg) - -
-SVG -PNG -
- -## Banner - -![Banner](/img/banner.svg) - -
-SVG -PNG -
- -## Documentation - -![Documentation](/img/docs.svg) - -
-SVG -PNG -
- -## Colors - -* Primary: `#4d55d8` -* Accent: `#35EF53` - -## Fonts - -* Website: `Inter` -* App: `Comfortaa` - -## Screenshots - -> Used in the firefox responsive design mode - -* Phone: Galaxy S20 Ultra -* 7-inch tablet: Nexus 7 -* 10-inch tablet: Nexus 10 +--- +title: Branding +--- + +import { LinkButton } from '@astrojs/starlight/components'; + +These assets are licensed under the [CC-BY-SA-4.0](https://github.com/LinwoodDev/Setonix/blob/develop/BRANDING_LICENSE). + +## Logo + +![Logo](/img/logo.svg) + +
+SVG +PNG +
+ +## Nightly Logo + +![Logo](/img/nightly.svg) + +
+SVG +PNG +
+ +## Banner + +![Banner](/img/banner.svg) + +
+SVG +PNG +
+ +## Documentation + +![Documentation](/img/docs.svg) + +
+SVG +PNG +
+ +## Colors + +* Primary: `#4d55d8` +* Accent: `#35EF53` + +## Fonts + +* Website: `Inter` +* App: `Comfortaa` + +## Screenshots + +> Used in the firefox responsive design mode + +* Phone: Galaxy S20 Ultra +* 7-inch tablet: Nexus 7 +* 10-inch tablet: Nexus 10 diff --git a/docs/src/content/docs/community/code-of-conduct.mdx b/docs/src/content/docs/community/code-of-conduct.mdx index ab92188b..07d3af0c 100644 --- a/docs/src/content/docs/community/code-of-conduct.mdx +++ b/docs/src/content/docs/community/code-of-conduct.mdx @@ -1,11 +1,11 @@ ---- -title: "" -head: - - tag: title - content: Code of Conduct | Linwood Setonix -tableOfContents: false ---- - -import CodeOfConduct from "/../CODE_OF_CONDUCT.md" - - +--- +title: "" +head: + - tag: title + content: Code of Conduct | Linwood Setonix +tableOfContents: false +--- + +import CodeOfConduct from "/../CODE_OF_CONDUCT.md" + + diff --git a/docs/src/content/docs/community/contributing.mdx b/docs/src/content/docs/community/contributing.mdx index 46c17d1a..538c7277 100644 --- a/docs/src/content/docs/community/contributing.mdx +++ b/docs/src/content/docs/community/contributing.mdx @@ -1,11 +1,11 @@ ---- -title: "" -head: - - tag: title - content: Contributing | Linwood Setonix -tableOfContents: false ---- - -import Contributing from "/../CONTRIBUTING.md" - - +--- +title: "" +head: + - tag: title + content: Contributing | Linwood Setonix +tableOfContents: false +--- + +import Contributing from "/../CONTRIBUTING.md" + + diff --git a/docs/src/content/docs/community/faq.md b/docs/src/content/docs/community/faq.md index 0671c81b..d420f653 100644 --- a/docs/src/content/docs/community/faq.md +++ b/docs/src/content/docs/community/faq.md @@ -1,26 +1,26 @@ ---- -title: Frequently Asked Questions ---- - -Here are some frequently asked questions. - -## Web - -### How do I install the web version? - -You can install the web version by clicking on the install button in the title bar. -After that you can use this app offline. - -### Setonix does not load on Brave - -Brave Users who have set the 'Block Fingerprinting' Shield setting to Aggressive, need to change it to 'Standard' or just plain 'Block Fingerprinting'. -Click on the shield icon in the address bar to change the setting. -Try updating your browser to the latest version. - -## Mobile - -### iOS support - -> [#244](https://github.com/LinwoodDev/Setonix/issues/244) - -Setonix is available on iOS as preview. Click [here](https://setonix.world/downloads/ios) to download it. See [here](https://github.com/LinwoodDev/Butterfly/issues/244#issuecomment-1935460878) why it's not available on the App Store. +--- +title: Frequently Asked Questions +--- + +Here are some frequently asked questions. + +## Web + +### How do I install the web version? + +You can install the web version by clicking on the install button in the title bar. +After that you can use this app offline. + +### Setonix does not load on Brave + +Brave Users who have set the 'Block Fingerprinting' Shield setting to Aggressive, need to change it to 'Standard' or just plain 'Block Fingerprinting'. +Click on the shield icon in the address bar to change the setting. +Try updating your browser to the latest version. + +## Mobile + +### iOS support + +> [#244](https://github.com/LinwoodDev/Setonix/issues/244) + +Setonix is available on iOS as preview. Click [here](https://setonix.world/downloads/ios) to download it. See [here](https://github.com/LinwoodDev/Butterfly/issues/244#issuecomment-1935460878) why it's not available on the App Store. diff --git a/docs/src/content/docs/community/index.md b/docs/src/content/docs/community/index.md index 484f7680..6240f4db 100644 --- a/docs/src/content/docs/community/index.md +++ b/docs/src/content/docs/community/index.md @@ -1,22 +1,22 @@ ---- -title: Community ---- - -Welcome to the community section. - -## Acknowledgements - -A special thanks goes to: - -* [Flutter](https://github.com/flutter/flutter) for providing this useful crossplatform ui framework -* [window_manager](https://github.com/leanflutter/window_manager) for all this useful desktop window features -* [Starlight](https://github.com/withastro/starlight) for an easy-to-use static react documentation framework -* [Phosphor Icons](https://phosphoricons.com/) for the beautiful icons - -All other licenses can you found in the settings. - -## Useful links - -* [GitHub](https://github.com/LinwoodDev/Setonix) -* [Discord](https://go.linwood.dev/discord) -* [Matrix](https://go.linwood.dev/matrix) +--- +title: Community +--- + +Welcome to the community section. + +## Acknowledgements + +A special thanks goes to: + +* [Flutter](https://github.com/flutter/flutter) for providing this useful crossplatform ui framework +* [window_manager](https://github.com/leanflutter/window_manager) for all this useful desktop window features +* [Starlight](https://github.com/withastro/starlight) for an easy-to-use static react documentation framework +* [Phosphor Icons](https://phosphoricons.com/) for the beautiful icons + +All other licenses can you found in the settings. + +## Useful links + +* [GitHub](https://github.com/LinwoodDev/Setonix) +* [Discord](https://go.linwood.dev/discord) +* [Matrix](https://go.linwood.dev/matrix) diff --git a/docs/src/content/docs/community/nightly.md b/docs/src/content/docs/community/nightly.md index 3cd57660..61c2b17a 100644 --- a/docs/src/content/docs/community/nightly.md +++ b/docs/src/content/docs/community/nightly.md @@ -1,17 +1,17 @@ ---- -title: Nightly Builds ---- - -:::warning - -Do not use the nightly version of Setonix for production. - -::: - -Nightly builds are designed to give you the option to test the latest version and get the newest features -and give feedback. - -## Get the builds - -Go to the download pages of your platform. -All nightly builds get also published as pre-release on github. +--- +title: Nightly Builds +--- + +:::warning + +Do not use the nightly version of Setonix for production. + +::: + +Nightly builds are designed to give you the option to test the latest version and get the newest features +and give feedback. + +## Get the builds + +Go to the download pages of your platform. +All nightly builds get also published as pre-release on github. diff --git a/docs/src/content/docs/community/versions.mdx b/docs/src/content/docs/community/versions.mdx index e4414661..908cbe76 100644 --- a/docs/src/content/docs/community/versions.mdx +++ b/docs/src/content/docs/community/versions.mdx @@ -1,11 +1,11 @@ ---- -title: "" -head: - - tag: title - content: Versions | Linwood Setonix -tableOfContents: false ---- - -import Security from "/../SECURITY.md" - - +--- +title: "" +head: + - tag: title + content: Versions | Linwood Setonix +tableOfContents: false +--- + +import Security from "/../SECURITY.md" + + diff --git a/docs/src/content/docs/docs/v1/intro.mdx b/docs/src/content/docs/docs/v1/intro.mdx index e2bcb917..8d80c1ef 100644 --- a/docs/src/content/docs/docs/v1/intro.mdx +++ b/docs/src/content/docs/docs/v1/intro.mdx @@ -1,29 +1,29 @@ ---- -title: Introduction ---- - -![Banner](/img/banner.png) - ---- - -> Welcome to Setonix, the opensource table sandbox game. - -Setonix is a game table sandbox that is aiming for unified experience across all platforms. It provides simple UI with powerful customization. - -## Getting started - -> You can use the sidebar to navigate quickly through the wiki. - -To start working on the game you have two options: - -1. [Downloads](/downloads) the game version that is appropriate for your platform (Setonix can run on most mobile, desktop, and web platforms). -2. Use [web version](https://web.setonix.world) if you cannot find your platform or if you don't want to install it on it. - -> Once you open the game, continue reading. - -## Docs are in working - -The game is very new. I'm currently mainly focussing on developing the game. -Feel free to create a pull request on github to expand the docs. - -If you have questions, don't hestitate to visit [the discord server](https://linwood.dev/discord), [the matrix server](https://linwood.dev/matrix) or [the github discussion page](https://github.com/LinwoodDev/Setonix/discussions). +--- +title: Introduction +--- + +![Banner](/img/banner.png) + +--- + +> Welcome to Setonix, the opensource table sandbox game. + +Setonix is a game table sandbox that is aiming for unified experience across all platforms. It provides simple UI with powerful customization. + +## Getting started + +> You can use the sidebar to navigate quickly through the wiki. + +To start working on the game you have two options: + +1. [Downloads](/downloads) the game version that is appropriate for your platform (Setonix can run on most mobile, desktop, and web platforms). +2. Use [web version](https://web.setonix.world) if you cannot find your platform or if you don't want to install it on it. + +> Once you open the game, continue reading. + +## Docs are in working + +The game is very new. I'm currently mainly focussing on developing the game. +Feel free to create a pull request on github to expand the docs. + +If you have questions, don't hestitate to visit [the discord server](https://linwood.dev/discord), [the matrix server](https://linwood.dev/matrix) or [the github discussion page](https://github.com/LinwoodDev/Setonix/discussions). diff --git a/docs/src/content/docs/docs/v1/packs/meta.mdx b/docs/src/content/docs/docs/v1/packs/meta.mdx index 403afd50..4182504d 100644 --- a/docs/src/content/docs/docs/v1/packs/meta.mdx +++ b/docs/src/content/docs/docs/v1/packs/meta.mdx @@ -1,23 +1,23 @@ ---- -title: Packs Meta ---- - -This is a required file for a pack. It contains metadata about the pack. The file is in JSON format and contains the following fields: - -- `name`: The name of the pack. -- `description`: A description of the pack. -- `author`: The author of the pack. -- `version`: The version of the pack. -- `id`: The id of the pack. This is required to save the pack in the world file. - -## Example - -```json title="pack.json" -{ - "name": "Core pack", - "description": "Official general pack", - "author": "Linwood", - "version": "1.0.0", - "id": "abc" -} -``` +--- +title: Packs Meta +--- + +This is a required file for a pack. It contains metadata about the pack. The file is in JSON format and contains the following fields: + +- `name`: The name of the pack. +- `description`: A description of the pack. +- `author`: The author of the pack. +- `version`: The version of the pack. +- `id`: The id of the pack. This is required to save the pack in the world file. + +## Example + +```json title="pack.json" +{ + "name": "Core pack", + "description": "Official general pack", + "author": "Linwood", + "version": "1.0.0", + "id": "abc" +} +``` diff --git a/docs/src/content/docs/docs/v1/packs/overview.mdx b/docs/src/content/docs/docs/v1/packs/overview.mdx index dcd87a49..281e9e5e 100644 --- a/docs/src/content/docs/docs/v1/packs/overview.mdx +++ b/docs/src/content/docs/docs/v1/packs/overview.mdx @@ -1,51 +1,51 @@ ---- -title: Packs ---- - -There is one built-in core pack with basic cards, a dice and chips. See `app/pack` for reference. For creating your own pack, mirror the setup, change to your liking and create a zip directory (make sure there is no extra folder in there). Change the file extension to `.stnx` and you are ready to share it. -To import it, open the app and go to `Packs`. Then click on the import button in the top right corner. - -You can find the code for the core pack [here](https://github.com/LinwoodDev/Setonix/blob/develop/app/pack). - -## Pack Structure - -import { FileTree } from '@astrojs/starlight/components'; - - - -- backgrounds - - cards.json - - grid.json -- boards - - chess.json -- decks - - chess.json - - chips.json - - dices.json - - doko.json - - doko9.json - - full.json - - poker.json - - skat.json -- figures - - cards.json - - chess_black.json - - chess_white.json - - chips.json - - d6.json -- textures - - backgrounds - - cards.png - - grid.png - - boards - - chess.png - - figures - - cards.png - - chess.png - - chips.png - - d6.png -- translations - - en.json -- pack.json - - +--- +title: Packs +--- + +There is one built-in core pack with basic cards, a dice and chips. See `app/pack` for reference. For creating your own pack, mirror the setup, change to your liking and create a zip directory (make sure there is no extra folder in there). Change the file extension to `.stnx` and you are ready to share it. +To import it, open the app and go to `Packs`. Then click on the import button in the top right corner. + +You can find the code for the core pack [here](https://github.com/LinwoodDev/Setonix/blob/develop/app/pack). + +## Pack Structure + +import { FileTree } from '@astrojs/starlight/components'; + + + +- backgrounds + - cards.json + - grid.json +- boards + - chess.json +- decks + - chess.json + - chips.json + - dices.json + - doko.json + - doko9.json + - full.json + - poker.json + - skat.json +- figures + - cards.json + - chess_black.json + - chess_white.json + - chips.json + - d6.json +- textures + - backgrounds + - cards.png + - grid.png + - boards + - chess.png + - figures + - cards.png + - chess.png + - chips.png + - d6.png +- translations + - en.json +- pack.json + + diff --git a/docs/src/content/docs/docs/v1/server.md b/docs/src/content/docs/docs/v1/server.md index c95e2d3e..0572a483 100644 --- a/docs/src/content/docs/docs/v1/server.md +++ b/docs/src/content/docs/docs/v1/server.md @@ -1,100 +1,100 @@ ---- -title: Server ---- - -Servers can easily be started by running the executable in the console. The server will start on 28006 by default. -You can find all available options by running the executable with the `--help` flag. - -## Directory - -When starting the server, it will create a directory called `packs` in the current working directory. This directory will contain all the packs that are loaded into the server. -There should be a core pack already installed in the directory. This pack contains all the default cards, boards, and dice. -Put your custom packs in this directory to load them into the server. - -By default, the server will use an unsecure websocket connection using http. To use a secure connection with https, you need to provide a certificate and key file. This can be done by creating a directory called `certs` in the current working directory and putting the certificate (with name `server.crt`) and key file (with name `server.key`) in there. - -The world will be saved in the current working directory in a file called `world.stnx`. This file will contain all the data of the world, including the packs that are loaded into the server. This file is compatible with the single player world file. - -## Library - -The server software can also be used as a library. This allows you to create custom server software with your own logic. The server software is written in Dart. - -To create a new project with the server software, you can use the following command: - -```bash -dart create server -cd server -``` - -Now go to the `pubspec.yaml` file and add the following dependency: - -```yaml -dependencies: - setonix_server: - git: - url: https://github.com/LinwoodDev/Setonix.git - path: server - ref: -``` - -Replace `` with the version you want to use (for example `v0.1.0`). It's recommended to use the latest version. - -Now go to the `bin/main.dart` file and add the following code: - -```dart -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments); -} -``` - -Now you can run the server software with the following command: - -```bash -dart run -``` - -You will have the same setup as the server software, but you can now customize it to your needs. - -### Customization - -To further customize the server software, you can pass an `onLoad` function to the `runServer` function. This function will be called when the server loads. You can use this function to add custom logic to the server software. - -```dart -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments, onLoad); -} - -Future onLoad(SetonixServer server) async { - print("on load was called"); - // Add your custom code here - bool toggleCancel = false; - // Put the event you want to listen to in the brackets - server.eventSystem.on((e) { - print("Listener was called, cancel: $toggleCancel"); - // Cancel the event every second time and duplicate the objects instead - if (toggleCancel) { - final event = e.clientEvent; - final table = e.getTableOrDefault(event.table); - final cell = table.getCell(event.from); - final objects = List.from(table.getCell(event.to).objects); - for (final index in event.objects) { - final object = cell.objects[index]; - objects.add(object); - } - // Send the event to all clients - e.sendEvent(ObjectsSpawned(e.clientEvent.table, {event.to: objects})); - // Cancel the event - e.cancel(); - } - toggleCancel = !toggleCancel; - }); -} -``` - -See the [API documentation](https://api.setonix.world/) for more information about the server software. - -There are examples, you can find [here](https://github.com/LinwoodDev/Setonix/blob/develop/server/example). +--- +title: Server +--- + +Servers can easily be started by running the executable in the console. The server will start on 28006 by default. +You can find all available options by running the executable with the `--help` flag. + +## Directory + +When starting the server, it will create a directory called `packs` in the current working directory. This directory will contain all the packs that are loaded into the server. +There should be a core pack already installed in the directory. This pack contains all the default cards, boards, and dice. +Put your custom packs in this directory to load them into the server. + +By default, the server will use an unsecure websocket connection using http. To use a secure connection with https, you need to provide a certificate and key file. This can be done by creating a directory called `certs` in the current working directory and putting the certificate (with name `server.crt`) and key file (with name `server.key`) in there. + +The world will be saved in the current working directory in a file called `world.stnx`. This file will contain all the data of the world, including the packs that are loaded into the server. This file is compatible with the single player world file. + +## Library + +The server software can also be used as a library. This allows you to create custom server software with your own logic. The server software is written in Dart. + +To create a new project with the server software, you can use the following command: + +```bash +dart create server +cd server +``` + +Now go to the `pubspec.yaml` file and add the following dependency: + +```yaml +dependencies: + setonix_server: + git: + url: https://github.com/LinwoodDev/Setonix.git + path: server + ref: +``` + +Replace `` with the version you want to use (for example `v0.1.0`). It's recommended to use the latest version. + +Now go to the `bin/main.dart` file and add the following code: + +```dart +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments); +} +``` + +Now you can run the server software with the following command: + +```bash +dart run +``` + +You will have the same setup as the server software, but you can now customize it to your needs. + +### Customization + +To further customize the server software, you can pass an `onLoad` function to the `runServer` function. This function will be called when the server loads. You can use this function to add custom logic to the server software. + +```dart +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments, onLoad); +} + +Future onLoad(SetonixServer server) async { + print("on load was called"); + // Add your custom code here + bool toggleCancel = false; + // Put the event you want to listen to in the brackets + server.eventSystem.on((e) { + print("Listener was called, cancel: $toggleCancel"); + // Cancel the event every second time and duplicate the objects instead + if (toggleCancel) { + final event = e.clientEvent; + final table = e.getTableOrDefault(event.table); + final cell = table.getCell(event.from); + final objects = List.from(table.getCell(event.to).objects); + for (final index in event.objects) { + final object = cell.objects[index]; + objects.add(object); + } + // Send the event to all clients + e.sendEvent(ObjectsSpawned(e.clientEvent.table, {event.to: objects})); + // Cancel the event + e.cancel(); + } + toggleCancel = !toggleCancel; + }); +} +``` + +See the [API documentation](https://api.setonix.world/) for more information about the server software. + +There are examples, you can find [here](https://github.com/LinwoodDev/Setonix/blob/develop/server/example). diff --git a/docs/src/content/docs/downloads/android.mdx b/docs/src/content/docs/downloads/android.mdx index f49acdf1..ce5db5ae 100644 --- a/docs/src/content/docs/downloads/android.mdx +++ b/docs/src/content/docs/downloads/android.mdx @@ -1,37 +1,37 @@ ---- -title: Android ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -import {CardGrid, LinkCard, TabItem, Tabs} from '@astrojs/starlight/components'; -import DownloadButton from '/src/components/DownloadButton.astro'; - -## Minimum system requirements - -* Android 6.0 (API level 23) or higher. - -## Binaries - - - - - - - - - - - - -Read more about the nightly version of Setonix [here](/community/nightly). - -:::tip[What apk should I use?] - -**Universal** should work on all devices. If you want a smaller apk, use the one that matches your device's architecture. - -::: - -## The beta program on play store - -Click on [this link](https://play.google.com/apps/testing/dev.linwood.setonix) to register for the [nightly](/community/nightly) version of the app. Please note that this version can have bugs. The play store version will automatically be updated when a new nightly version is released. +--- +title: Android +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +import {CardGrid, LinkCard, TabItem, Tabs} from '@astrojs/starlight/components'; +import DownloadButton from '/src/components/DownloadButton.astro'; + +## Minimum system requirements + +* Android 6.0 (API level 23) or higher. + +## Binaries + + + + + + + + + + + + +Read more about the nightly version of Setonix [here](/community/nightly). + +:::tip[What apk should I use?] + +**Universal** should work on all devices. If you want a smaller apk, use the one that matches your device's architecture. + +::: + +## The beta program on play store + +Click on [this link](https://play.google.com/apps/testing/dev.linwood.setonix) to register for the [nightly](/community/nightly) version of the app. Please note that this version can have bugs. The play store version will automatically be updated when a new nightly version is released. diff --git a/docs/src/content/docs/downloads/index.mdx b/docs/src/content/docs/downloads/index.mdx index 8e294717..aff875cf 100644 --- a/docs/src/content/docs/downloads/index.mdx +++ b/docs/src/content/docs/downloads/index.mdx @@ -1,30 +1,30 @@ ---- -title: Downloads ---- - - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -## Choose your platform - -import { LinkCard, CardGrid } from '@astrojs/starlight/components'; - - - - - - - - - - - - - -## Useful links - -- [Changelog](/community/changelog) -- [Older releases](https://github.com/LinwoodDev/Setonix/releases) -- [Latest release](https://github.com/LinwoodDev/Setonix/releases/latest) -- [Support](https://discord.linwood.dev) +--- +title: Downloads +--- + + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +## Choose your platform + +import { LinkCard, CardGrid } from '@astrojs/starlight/components'; + + + + + + + + + + + + + +## Useful links + +- [Changelog](/community/changelog) +- [Older releases](https://github.com/LinwoodDev/Setonix/releases) +- [Latest release](https://github.com/LinwoodDev/Setonix/releases/latest) +- [Support](https://discord.linwood.dev) - [FAQ](/community/faq) \ No newline at end of file diff --git a/docs/src/content/docs/downloads/ios.mdx b/docs/src/content/docs/downloads/ios.mdx index 10e7ec2e..1ef1de2b 100644 --- a/docs/src/content/docs/downloads/ios.mdx +++ b/docs/src/content/docs/downloads/ios.mdx @@ -1,49 +1,49 @@ ---- -title: iOS ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -import {CardGrid, TabItem, Tabs} from '@astrojs/starlight/components'; -import DownloadButton from '/src/components/DownloadButton.astro'; - -:::warning - -The iOS version of Setonix is in preview and may not work as expected. -Click [here](https://github.com/LinwoodDev/Butterfly/issues/244) to visit the issue on GitHub to find current known bugs and updates. Please report any issues there. - -::: - -## Links - - - - - - - - - -Read more about the nightly version of Setonix [here](/community/nightly). - -## Installing - -The IPA file we distribute is unsigned. This means you'll have to sign it yourself before being able to install it onto your iOS device. \ -Fortunately, there are projects like [AltStore](https://altstore.io) (open source) or [sideloadly](https://sideloadly.io) (closed source). \ -\ -You do need an Apple ID for sideloading Setonix. We recommend creating a new one especially for this purpose. Please log into [Apple Developer](https://developer.apple.com) at least once and accept their terms. -\ -If your device is running iOS 16.0 or newer, enable developer mode in Settings/Privacy/Developer Mode. - -## Installing (AltStore) - -1. Set up AltStore using the instructions provided on the AltStore website. -2. Get a copy of the IPA file onto your device. The best way is to download it using a web browser or sending a zip file containing the IPA to yourself. Do not use Airdrop. Also, do not send the file directly to yourself. You might not be able to open it. -3. Open the IPA file, use the "share" menu and tap "AltStore". If your device is connected to your PC running AltServer (wired or wirelessly) it'll install automatically. - -## Installing (Sideloadly) - -1. Set up Sideloadly using the guides provided on sideloadly.io. -2. Open sideloadly on your PC. -3. Add the IPA in the top right corner, select your device and Apple ID. Click Start. The app will be installed onto your device. -If you get a popup saying a developer isn't trusted go to Settings/General/VPN and Device Management and change that. +--- +title: iOS +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +import {CardGrid, TabItem, Tabs} from '@astrojs/starlight/components'; +import DownloadButton from '/src/components/DownloadButton.astro'; + +:::warning + +The iOS version of Setonix is in preview and may not work as expected. +Click [here](https://github.com/LinwoodDev/Butterfly/issues/244) to visit the issue on GitHub to find current known bugs and updates. Please report any issues there. + +::: + +## Links + + + + + + + + + +Read more about the nightly version of Setonix [here](/community/nightly). + +## Installing + +The IPA file we distribute is unsigned. This means you'll have to sign it yourself before being able to install it onto your iOS device. \ +Fortunately, there are projects like [AltStore](https://altstore.io) (open source) or [sideloadly](https://sideloadly.io) (closed source). \ +\ +You do need an Apple ID for sideloading Setonix. We recommend creating a new one especially for this purpose. Please log into [Apple Developer](https://developer.apple.com) at least once and accept their terms. +\ +If your device is running iOS 16.0 or newer, enable developer mode in Settings/Privacy/Developer Mode. + +## Installing (AltStore) + +1. Set up AltStore using the instructions provided on the AltStore website. +2. Get a copy of the IPA file onto your device. The best way is to download it using a web browser or sending a zip file containing the IPA to yourself. Do not use Airdrop. Also, do not send the file directly to yourself. You might not be able to open it. +3. Open the IPA file, use the "share" menu and tap "AltStore". If your device is connected to your PC running AltServer (wired or wirelessly) it'll install automatically. + +## Installing (Sideloadly) + +1. Set up Sideloadly using the guides provided on sideloadly.io. +2. Open sideloadly on your PC. +3. Add the IPA in the top right corner, select your device and Apple ID. Click Start. The app will be installed onto your device. +If you get a popup saying a developer isn't trusted go to Settings/General/VPN and Device Management and change that. diff --git a/docs/src/content/docs/downloads/linux.mdx b/docs/src/content/docs/downloads/linux.mdx index b1878cf9..bb8fba17 100644 --- a/docs/src/content/docs/downloads/linux.mdx +++ b/docs/src/content/docs/downloads/linux.mdx @@ -1,36 +1,36 @@ ---- -title: Linux ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -import {CardGrid, LinkCard, TabItem, Tabs} from '@astrojs/starlight/components'; -import DownloadButton from '/src/components/DownloadButton.astro'; - -:::note - -~~Please use the flatpak version if possible.~~ (Not available since there is no stable release yet) -Otherwise you need to install `libsecret-1-dev` and `libjsoncpp-dev`. - -::: - -## Binaries - - - - - - - - - - - - - - - - - - -Read more about the nightly version of Setonix [here](/community/nightly). +--- +title: Linux +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +import {CardGrid, LinkCard, TabItem, Tabs} from '@astrojs/starlight/components'; +import DownloadButton from '/src/components/DownloadButton.astro'; + +:::note + +~~Please use the flatpak version if possible.~~ (Not available since there is no stable release yet) +Otherwise you need to install `libsecret-1-dev` and `libjsoncpp-dev`. + +::: + +## Binaries + + + + + + + + + + + + + + + + + + +Read more about the nightly version of Setonix [here](/community/nightly). diff --git a/docs/src/content/docs/downloads/macos.mdx b/docs/src/content/docs/downloads/macos.mdx index e231cc2e..0371cffb 100644 --- a/docs/src/content/docs/downloads/macos.mdx +++ b/docs/src/content/docs/downloads/macos.mdx @@ -1,22 +1,22 @@ ---- -title: MacOS ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -import { Tabs, TabItem, CardGrid } from '@astrojs/starlight/components'; -import DownloadButton from '/src/components/DownloadButton.astro'; - -## Links - - - - - - - - - - - -Read more about the nightly version of Setonix [here](/community/nightly). +--- +title: MacOS +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +import { Tabs, TabItem, CardGrid } from '@astrojs/starlight/components'; +import DownloadButton from '/src/components/DownloadButton.astro'; + +## Links + + + + + + + + + + + +Read more about the nightly version of Setonix [here](/community/nightly). diff --git a/docs/src/content/docs/downloads/post-windows.mdx b/docs/src/content/docs/downloads/post-windows.mdx index 8af712e2..06592b08 100644 --- a/docs/src/content/docs/downloads/post-windows.mdx +++ b/docs/src/content/docs/downloads/post-windows.mdx @@ -1,22 +1,22 @@ ---- -title: Thank you for downloading ---- - -import { LinkCard, CardGrid } from '@astrojs/starlight/components'; - - - - - - -## Windows SmartScreen - -Windows warns users when installing software without a certificate. - -![Smart screen](@assets/img/smart-screen.png) - -To install the app, you need to click on "More info". - -![Smart screen more info](@assets/img/smart-screen-more-info.png) - -Then, click on "Run anyway". +--- +title: Thank you for downloading +--- + +import { LinkCard, CardGrid } from '@astrojs/starlight/components'; + + + + + + +## Windows SmartScreen + +Windows warns users when installing software without a certificate. + +![Smart screen](@assets/img/smart-screen.png) + +To install the app, you need to click on "More info". + +![Smart screen more info](@assets/img/smart-screen-more-info.png) + +Then, click on "Run anyway". diff --git a/docs/src/content/docs/downloads/selfhosting.md b/docs/src/content/docs/downloads/selfhosting.md index 08b89fce..da223ef4 100644 --- a/docs/src/content/docs/downloads/selfhosting.md +++ b/docs/src/content/docs/downloads/selfhosting.md @@ -1,23 +1,23 @@ ---- -title: Selfhosting ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -It is very easy to host your own setonix web server. - -## Simple server - -Install flutter and build the app using: - -```bash -cd tools -dart pub get -cd .. -dart run tools/generate.dart -cd app -flutter pub get -flutter build web -``` - -All the files are in the `app/build/web` directory. +--- +title: Selfhosting +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +It is very easy to host your own setonix web server. + +## Simple server + +Install flutter and build the app using: + +```bash +cd tools +dart pub get +cd .. +dart run tools/generate.dart +cd app +flutter pub get +flutter build web +``` + +All the files are in the `app/build/web` directory. diff --git a/docs/src/content/docs/downloads/thank-you.mdx b/docs/src/content/docs/downloads/thank-you.mdx index cad3675f..7d6e802b 100644 --- a/docs/src/content/docs/downloads/thank-you.mdx +++ b/docs/src/content/docs/downloads/thank-you.mdx @@ -1,10 +1,10 @@ ---- -title: Thank you for downloading ---- - -import { LinkCard, CardGrid } from '@astrojs/starlight/components'; - - - - - +--- +title: Thank you for downloading +--- + +import { LinkCard, CardGrid } from '@astrojs/starlight/components'; + + + + + diff --git a/docs/src/content/docs/downloads/web.mdx b/docs/src/content/docs/downloads/web.mdx index 6cb9331b..56304af2 100644 --- a/docs/src/content/docs/downloads/web.mdx +++ b/docs/src/content/docs/downloads/web.mdx @@ -1,27 +1,27 @@ ---- -title: Web ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -import { CardGrid } from '@astrojs/starlight/components'; -import DownloadButton from '/src/components/DownloadButton.astro'; - -:::note - -This is a progressive web application. You can install it on your browser and use it offline. -All data is stored in your browser. - -::: - -## Links - - - - - - -## Versions - -The main and the preview (develop) versions of Setonix are not the same as the stable and nightly versions. -They are not directly associated with a release. They are updated as soon as a new commit is pushed to the repository. +--- +title: Web +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +import { CardGrid } from '@astrojs/starlight/components'; +import DownloadButton from '/src/components/DownloadButton.astro'; + +:::note + +This is a progressive web application. You can install it on your browser and use it offline. +All data is stored in your browser. + +::: + +## Links + + + + + + +## Versions + +The main and the preview (develop) versions of Setonix are not the same as the stable and nightly versions. +They are not directly associated with a release. They are updated as soon as a new commit is pushed to the repository. diff --git a/docs/src/content/docs/downloads/windows.mdx b/docs/src/content/docs/downloads/windows.mdx index c9e0f091..4c192099 100644 --- a/docs/src/content/docs/downloads/windows.mdx +++ b/docs/src/content/docs/downloads/windows.mdx @@ -1,26 +1,26 @@ ---- -title: Windows ---- - -![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) - -import {CardGrid, TabItem, Tabs} from '@astrojs/starlight/components'; -import DownloadButton from '/src/components/DownloadButton.astro'; - -## Minimum system requirements - -* Windows 10 or higher. - -## Binaries - - - - - - - - - - - -Read more about the nightly version of Setonix [here](/community/nightly). +--- +title: Windows +--- + +![Nightly release version](https://img.shields.io/badge/dynamic/yaml?color=f7d28c&label=Nightly&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2FLinwoodDev%2FSetonix%2Fnightly%2Fapp%2Fpubspec.yaml&style=for-the-badge) + +import {CardGrid, TabItem, Tabs} from '@astrojs/starlight/components'; +import DownloadButton from '/src/components/DownloadButton.astro'; + +## Minimum system requirements + +* Windows 10 or higher. + +## Binaries + + + + + + + + + + + +Read more about the nightly version of Setonix [here](/community/nightly). diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index 8725610a..1bebabb4 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -1,44 +1,44 @@ ---- -title: Linwood Setonix -description: 🃏 Powerful, customizable, cross-platform, opensource table sandbox game 🃏 -template: splash -hero: - tagline: 🃏 Powerful, customizable, cross-platform, opensource table sandbox game 🃏 - image: - file: /public/img/logo.svg - actions: - - text: Download - link: /downloads/ - icon: right-arrow - variant: primary - - text: Getting started - link: /docs/v1/intro/ - icon: external - - text: Web App - link: https://web.setonix.world - icon: rocket - - text: Blog - link: https://linwood.dev/setonix - icon: external - variant: secondary ---- -import { LinkCard, Card, CardGrid } from '@astrojs/starlight/components'; - -## Principles - - - - You can use the app on your phone, tablet, laptop, or desktop. The app is available on Linux, Android, and Windows. You can also use the app on the web. - - - Play games with your friends or alone. You can also play offline. The app is designed to work without an internet connection even in multiplayer mode. - - - Create custom cards, boards, and dice. You can also create custom rules with lua (coming soon). Configure everything inside the app. - - - The app is a sandbox game. No predefined rules are implemented yet. You can play without rules or load custom rules from a pack. - - - - +--- +title: Linwood Setonix +description: 🃏 Powerful, customizable, cross-platform, opensource table sandbox game 🃏 +template: splash +hero: + tagline: 🃏 Powerful, customizable, cross-platform, opensource table sandbox game 🃏 + image: + file: /public/img/logo.svg + actions: + - text: Download + link: /downloads/ + icon: right-arrow + variant: primary + - text: Getting started + link: /docs/v1/intro/ + icon: external + - text: Web App + link: https://web.setonix.world + icon: rocket + - text: Blog + link: https://linwood.dev/setonix + icon: external + variant: secondary +--- +import { LinkCard, Card, CardGrid } from '@astrojs/starlight/components'; + +## Principles + + + + You can use the app on your phone, tablet, laptop, or desktop. The app is available on Linux, Android, and Windows. You can also use the app on the web. + + + Play games with your friends or alone. You can also play offline. The app is designed to work without an internet connection even in multiplayer mode. + + + Create custom cards, boards, and dice. You can also create custom rules with lua (coming soon). Configure everything inside the app. + + + The app is a sandbox game. No predefined rules are implemented yet. You can play without rules or load custom rules from a pack. + + + + diff --git a/docs/src/content/docs/privacypolicy.md b/docs/src/content/docs/privacypolicy.md index 9eef31ac..9f8d1c92 100644 --- a/docs/src/content/docs/privacypolicy.md +++ b/docs/src/content/docs/privacypolicy.md @@ -1,71 +1,71 @@ ---- -title: Privacy Policy -tableOfContents: false ---- - -This is the privacy policy of the app. Please read it carefully. -Click [here](https://go.linwood.dev/privacypolicy) to read the privacy policy of the website. - -CodeDoctor built the Setonix app as an Open Source app. This SERVICE is provided by CodeDoctor at no cost and is intended for use as is. - -This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. - -If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the -Service. I will not use or share your information with anyone except as described in this Privacy Policy. - -The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Setonix unless otherwise defined in this Privacy Policy. - -**Information Collection and Use** - -For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and -is not collected by me in any way. - -The app does use third party services that may collect information used to identify you. - -Link to privacy policy of third party service providers used by the app - -* [Google Play Services](https://www.google.com/policies/privacy/) - -**Cookies** - -Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's -internal memory. - -This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option -to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service. - -**Service Providers** - -I may employ third-party companies and individuals due to the following reasons: - -* To facilitate our Service; -* To provide the Service on our behalf; -* To perform Service-related services; or -* To assist us in analyzing how our Service is used. - -I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated -not to disclose or use the information for any other purpose. - -**Security** - -I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, -or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. - -**Links to Other Sites** - -This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly -advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. - -**Changes to This Privacy Policy** - -I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this -page. - -This policy is effective as of 2021-02-07 - -**Contact Us** - -If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at contact@linwood.dev. - -This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated -by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/) +--- +title: Privacy Policy +tableOfContents: false +--- + +This is the privacy policy of the app. Please read it carefully. +Click [here](https://go.linwood.dev/privacypolicy) to read the privacy policy of the website. + +CodeDoctor built the Setonix app as an Open Source app. This SERVICE is provided by CodeDoctor at no cost and is intended for use as is. + +This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. + +If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the +Service. I will not use or share your information with anyone except as described in this Privacy Policy. + +The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Setonix unless otherwise defined in this Privacy Policy. + +**Information Collection and Use** + +For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and +is not collected by me in any way. + +The app does use third party services that may collect information used to identify you. + +Link to privacy policy of third party service providers used by the app + +* [Google Play Services](https://www.google.com/policies/privacy/) + +**Cookies** + +Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's +internal memory. + +This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option +to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service. + +**Service Providers** + +I may employ third-party companies and individuals due to the following reasons: + +* To facilitate our Service; +* To provide the Service on our behalf; +* To perform Service-related services; or +* To assist us in analyzing how our Service is used. + +I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated +not to disclose or use the information for any other purpose. + +**Security** + +I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, +or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. + +**Links to Other Sites** + +This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly +advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. + +**Changes to This Privacy Policy** + +I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this +page. + +This policy is effective as of 2021-02-07 + +**Contact Us** + +If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at contact@linwood.dev. + +This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated +by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/) diff --git a/docs/src/env.d.ts b/docs/src/env.d.ts index bd3c2f4e..59c18c59 100644 --- a/docs/src/env.d.ts +++ b/docs/src/env.d.ts @@ -1,5 +1,5 @@ -/// -/// - -/// -/// +/// +/// + +/// +/// diff --git a/docs/src/pages/meta.json.ts b/docs/src/pages/meta.json.ts index 69541ba7..422e447f 100644 --- a/docs/src/pages/meta.json.ts +++ b/docs/src/pages/meta.json.ts @@ -1,56 +1,56 @@ -// Fetch version value fromy yaml file https://raw.githubusercontent.com/LinwoodDev/Setonix/nightly/app/pubspec.yaml -const nightlyUrl = - "https://raw.githubusercontent.com/LinwoodDev/Setonix/nightly/app/pubspec.yaml"; -const nightlyVersion = await fetch(nightlyUrl) - .then((res) => res.text()) - .then((text) => { - const regex = /^version:\s(.+)\+(.+)$/gm; - const match = regex.exec(text); - return match?.[1]; - }); - -// stable -const stableUrl = - "https://raw.githubusercontent.com/LinwoodDev/Setonix/stable/app/pubspec.yaml"; -const stableVersion = await fetch(stableUrl) - .then((res) => res.text()) - .then((text) => { - const regex = /^version:\s(.+)\+(.+)$/gm; - const match = regex.exec(text); - return match?.[1]; - }); - -// develop -const developUrl = - "https://raw.githubusercontent.com/LinwoodDev/Setonix/develop/app/pubspec.yaml"; -const developVersion = await fetch(developUrl) - .then((res) => res.text()) - .then((text) => { - const regex = /^version:\s(.+)\+(.+)$/gm; - const match = regex.exec(text); - return match?.[1]; - }); - -// main -const mainUrl = - "https://raw.githubusercontent.com/LinwoodDev/Setonix/main/app/pubspec.yaml"; -const mainVersion = await fetch(mainUrl) - .then((res) => res.text()) - .then((text) => { - const regex = /^version:\s(.+)\+(.+)$/gm; - const match = regex.exec(text); - return match?.[1]; - }); - -export function GET() { - return new Response( - JSON.stringify({ - version: { - nightly: nightlyVersion, - stable: stableVersion, - develop: developVersion, - main: mainVersion, - }, - }) - ); -} +// Fetch version value fromy yaml file https://raw.githubusercontent.com/LinwoodDev/Setonix/nightly/app/pubspec.yaml +const nightlyUrl = + "https://raw.githubusercontent.com/LinwoodDev/Setonix/nightly/app/pubspec.yaml"; +const nightlyVersion = await fetch(nightlyUrl) + .then((res) => res.text()) + .then((text) => { + const regex = /^version:\s(.+)\+(.+)$/gm; + const match = regex.exec(text); + return match?.[1]; + }); + +// stable +const stableUrl = + "https://raw.githubusercontent.com/LinwoodDev/Setonix/stable/app/pubspec.yaml"; +const stableVersion = await fetch(stableUrl) + .then((res) => res.text()) + .then((text) => { + const regex = /^version:\s(.+)\+(.+)$/gm; + const match = regex.exec(text); + return match?.[1]; + }); + +// develop +const developUrl = + "https://raw.githubusercontent.com/LinwoodDev/Setonix/develop/app/pubspec.yaml"; +const developVersion = await fetch(developUrl) + .then((res) => res.text()) + .then((text) => { + const regex = /^version:\s(.+)\+(.+)$/gm; + const match = regex.exec(text); + return match?.[1]; + }); + +// main +const mainUrl = + "https://raw.githubusercontent.com/LinwoodDev/Setonix/main/app/pubspec.yaml"; +const mainVersion = await fetch(mainUrl) + .then((res) => res.text()) + .then((text) => { + const regex = /^version:\s(.+)\+(.+)$/gm; + const match = regex.exec(text); + return match?.[1]; + }); + +export function GET() { + return new Response( + JSON.stringify({ + version: { + nightly: nightlyVersion, + stable: stableVersion, + develop: developVersion, + main: mainVersion, + }, + }) + ); +} diff --git a/docs/src/scripts/pwa.ts b/docs/src/scripts/pwa.ts index 16d0f8c9..2743aa9c 100644 --- a/docs/src/scripts/pwa.ts +++ b/docs/src/scripts/pwa.ts @@ -1,12 +1,12 @@ -import { registerSW } from 'virtual:pwa-register' - -console.log("registering SW") -registerSW({ - immediate: true, - onRegisteredSW(swScriptUrl) { - console.log('SW registered: ', swScriptUrl) - }, - onOfflineReady() { - console.log('PWA application ready to work offline') - }, -}) +import { registerSW } from 'virtual:pwa-register' + +console.log("registering SW") +registerSW({ + immediate: true, + onRegisteredSW(swScriptUrl) { + console.log('SW registered: ', swScriptUrl) + }, + onOfflineReady() { + console.log('PWA application ready to work offline') + }, +}) diff --git a/docs/src/styles/custom.scss b/docs/src/styles/custom.scss index 709c5fd8..cfbee2ea 100644 --- a/docs/src/styles/custom.scss +++ b/docs/src/styles/custom.scss @@ -1,159 +1,159 @@ - -/* Background: #35EF53 with 0.1 chroma */ -/* Dark mode colors. */ -:root { - --sl-color-accent: #4d55d8; - --sl-color-white: #ffffff; - --sl-font-system: "Inter", sans-serif; -} -/* Light mode colors. */ -:root[data-theme="light"] { - --sl-color-accent-low: #e5d4bf; - --sl-color-accent: #4d55d8; - --sl-color-accent-high: #303482; - --sl-color-white: #151915; -} - -.inline-icon { - display: inline !important; - vertical-align: sub; - margin: 0 !important; - padding: 0; -} - -br { - display: block; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-BlackItalic.ttf") format("truetype"); - font-weight: 900; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Black.ttf") format("truetype"); - font-weight: 900; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-BoldItalic.ttf") format("truetype"); - font-weight: 700; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Bold.ttf") format("truetype"); - font-weight: 700; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-ExtraBoldItalic.ttf") format("truetype"); - font-weight: 800; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-ExtraBold.ttf") format("truetype"); - font-weight: 800; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-ExtraLightItalic.ttf") format("truetype"); - font-weight: 200; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-ExtraLight.ttf") format("truetype"); - font-weight: 200; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Italic.ttf") format("truetype"); - font-weight: 400; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-LightItalic.ttf") format("truetype"); - font-weight: 300; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Light.ttf") format("truetype"); - font-weight: 300; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-MediumItalic.ttf") format("truetype"); - font-weight: 500; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Medium.ttf") format("truetype"); - font-weight: 500; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Regular.ttf") format("truetype"); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-SemiBoldItalic.ttf") format("truetype"); - font-weight: 600; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-SemiBold.ttf") format("truetype"); - font-weight: 600; - font-style: normal; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-ThinItalic.ttf") format("truetype"); - font-weight: 100; - font-style: italic; -} - -@font-face { - font-family: "Inter"; - src: url("/fonts/Inter/Inter_18pt-Thin.ttf") format("truetype"); - font-weight: 100; - font-style: normal; -} - -.row { - display: flex; - flex-wrap: wrap; - gap: 0.5rem; - align-items: center; -} + +/* Background: #35EF53 with 0.1 chroma */ +/* Dark mode colors. */ +:root { + --sl-color-accent: #4d55d8; + --sl-color-white: #ffffff; + --sl-font-system: "Inter", sans-serif; +} +/* Light mode colors. */ +:root[data-theme="light"] { + --sl-color-accent-low: #e5d4bf; + --sl-color-accent: #4d55d8; + --sl-color-accent-high: #303482; + --sl-color-white: #151915; +} + +.inline-icon { + display: inline !important; + vertical-align: sub; + margin: 0 !important; + padding: 0; +} + +br { + display: block; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-BlackItalic.ttf") format("truetype"); + font-weight: 900; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Black.ttf") format("truetype"); + font-weight: 900; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-BoldItalic.ttf") format("truetype"); + font-weight: 700; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Bold.ttf") format("truetype"); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-ExtraBoldItalic.ttf") format("truetype"); + font-weight: 800; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-ExtraBold.ttf") format("truetype"); + font-weight: 800; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-ExtraLightItalic.ttf") format("truetype"); + font-weight: 200; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-ExtraLight.ttf") format("truetype"); + font-weight: 200; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Italic.ttf") format("truetype"); + font-weight: 400; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-LightItalic.ttf") format("truetype"); + font-weight: 300; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Light.ttf") format("truetype"); + font-weight: 300; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-MediumItalic.ttf") format("truetype"); + font-weight: 500; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Medium.ttf") format("truetype"); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Regular.ttf") format("truetype"); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-SemiBoldItalic.ttf") format("truetype"); + font-weight: 600; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-SemiBold.ttf") format("truetype"); + font-weight: 600; + font-style: normal; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-ThinItalic.ttf") format("truetype"); + font-weight: 100; + font-style: italic; +} + +@font-face { + font-family: "Inter"; + src: url("/fonts/Inter/Inter_18pt-Thin.ttf") format("truetype"); + font-weight: 100; + font-style: normal; +} + +.row { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + align-items: center; +} diff --git a/docs/src/styles/linwood-style.scss b/docs/src/styles/linwood-style.scss index 3038f650..1efd536c 100644 --- a/docs/src/styles/linwood-style.scss +++ b/docs/src/styles/linwood-style.scss @@ -1,128 +1,128 @@ -@use '@linwooddev/style/scss/mixins.scss' as lw; - -:root { - --ls-primary: var(--sl-color-accent); - --ls-primary-text: #fff; - --sl-color-accent-low: var(--sl-color-accent); - --sl-color-accent-high: var(--sl-color-accent); - --sl-color-black: var(--ls-background); - --sl-color-gray-1: var(--ls-elevation); - --sl-color-gray-2: var(--ls-elevation); - --sl-color-gray-3: var(--ls-elevation); - --sl-color-gray-4: var(--ls-elevation); - --sl-color-gray-5: var(--ls-elevation); - --sl-color-gray-6: var(--ls-elevation); - --sl-color-gray-7: var(--ls-elevation); - --sl-color-text: var(--ls-background-text); -} -:root[data-theme="light"] { - --ls-elevation: rgba(0, 0, 0, 0.1); - --ls-background-text: #000; - --ls-background: #fff; -} -header { - backdrop-filter: lw.$elevation-filter; -} -.tagline, label, .site-title { - color: var(--ls-background-text); -} - -.sl-link-button { - @include lw.button-base(); -} - -a.btn { - @include lw.button-base; -} - -.sl-markdown-content a:not(:where(.not-content *)) { - @include lw.link-base; -} - -.actions { - gap: 0.5rem; -} - -input { - @include lw.input-base(); -} -.label-icon { - z-index: 1; - margin-left: 0.5rem; -} -select { - @include lw.choice-base; - @include lw.select-enhancements(); - background-image: none; - width: revert-layer; - padding-left: 1.75rem; -} -option { - @include lw.option-base(); - color: var(--ls-background-text); -} -.sl-link-card a { - text-decoration: none; -} -.sidebar-content { - padding-left: 6px; - summary { - @extend .secondary; - @include lw.button-base; - justify-content: space-between; - margin-bottom: 4px; - &:hover { - text-decoration: none; - } - span { - color: inherit; - } - - } - li a { - @include lw.button-base; - justify-content: start; - } - [aria-current='page'], - [aria-current='page']:hover, - [aria-current='page']:focus { - @extend .primary; - } -} - -:where(site-search button):not(:where(site-search dialog button)) { - @include lw.input-base(); - width: revert-layer; -} - -.social-icons { - display: flex; - gap: 1.5rem; -} - -span { - --sl-color-gray-2: var(--ls-background-text); -} - -a { - --sl-color-gray-3: var(--ls-background-text); - --sl-color-gray-2: var(--ls-background-text); - - &[aria-current="true"] { - color: var(--ls-primary); - } - .tab &:hover { - text-decoration: none; - color: var(--ls-primary); - } - &:not(:where(.pagination-links *, .sl-link-button, .sl-link-card *, .tab *)):hover { - text-decoration: underline; - } -} - -.social-icons a { - @extend .secondary; - @include lw.button-base(); - padding: 0.5rem; - border-radius: 50%; -} +@use '@linwooddev/style/scss/mixins.scss' as lw; + +:root { + --ls-primary: var(--sl-color-accent); + --ls-primary-text: #fff; + --sl-color-accent-low: var(--sl-color-accent); + --sl-color-accent-high: var(--sl-color-accent); + --sl-color-black: var(--ls-background); + --sl-color-gray-1: var(--ls-elevation); + --sl-color-gray-2: var(--ls-elevation); + --sl-color-gray-3: var(--ls-elevation); + --sl-color-gray-4: var(--ls-elevation); + --sl-color-gray-5: var(--ls-elevation); + --sl-color-gray-6: var(--ls-elevation); + --sl-color-gray-7: var(--ls-elevation); + --sl-color-text: var(--ls-background-text); +} +:root[data-theme="light"] { + --ls-elevation: rgba(0, 0, 0, 0.1); + --ls-background-text: #000; + --ls-background: #fff; +} +header { + backdrop-filter: lw.$elevation-filter; +} +.tagline, label, .site-title { + color: var(--ls-background-text); +} + +.sl-link-button { + @include lw.button-base(); +} + +a.btn { + @include lw.button-base; +} + +.sl-markdown-content a:not(:where(.not-content *)) { + @include lw.link-base; +} + +.actions { + gap: 0.5rem; +} + +input { + @include lw.input-base(); +} +.label-icon { + z-index: 1; + margin-left: 0.5rem; +} +select { + @include lw.choice-base; + @include lw.select-enhancements(); + background-image: none; + width: revert-layer; + padding-left: 1.75rem; +} +option { + @include lw.option-base(); + color: var(--ls-background-text); +} +.sl-link-card a { + text-decoration: none; +} +.sidebar-content { + padding-left: 6px; + summary { + @extend .secondary; + @include lw.button-base; + justify-content: space-between; + margin-bottom: 4px; + &:hover { + text-decoration: none; + } + span { + color: inherit; + } + + } + li a { + @include lw.button-base; + justify-content: start; + } + [aria-current='page'], + [aria-current='page']:hover, + [aria-current='page']:focus { + @extend .primary; + } +} + +:where(site-search button):not(:where(site-search dialog button)) { + @include lw.input-base(); + width: revert-layer; +} + +.social-icons { + display: flex; + gap: 1.5rem; +} + +span { + --sl-color-gray-2: var(--ls-background-text); +} + +a { + --sl-color-gray-3: var(--ls-background-text); + --sl-color-gray-2: var(--ls-background-text); + + &[aria-current="true"] { + color: var(--ls-primary); + } + .tab &:hover { + text-decoration: none; + color: var(--ls-primary); + } + &:not(:where(.pagination-links *, .sl-link-button, .sl-link-card *, .tab *)):hover { + text-decoration: underline; + } +} + +.social-icons a { + @extend .secondary; + @include lw.button-base(); + padding: 0.5rem; + border-radius: 50%; +} diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 9b4a390f..9adbb196 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,11 +1,11 @@ -{ - "extends": "astro/tsconfigs/strictest", - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "react", - "baseUrl": ".", - "paths": { - "@assets/*": ["src/assets/*"] - } - } -} +{ + "extends": "astro/tsconfigs/strictest", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "react", + "baseUrl": ".", + "paths": { + "@assets/*": ["src/assets/*"] + } + } +} diff --git a/docs/webmanifest.json b/docs/webmanifest.json index 36289d86..9b381d3f 100644 --- a/docs/webmanifest.json +++ b/docs/webmanifest.json @@ -1,34 +1,34 @@ -{ - "$schema": "https://json.schemastore.org/web-manifest-combined.json", - "id": "linwood-setonix-docs", - "name": "Linwood Setonix Documentation", - "short_name": "Setonix Docs", - "description": "Documentation for the opensource Linwood Setonix project.", - "orientation": "any", - "display": "fullscreen", - "background_color": "#18191a", - "theme_color": "#0175c2", - "icons": [ - { - "src": "img/pwa-64x64.png", - "sizes": "64x64", - "type": "image/png" - }, - { - "src": "img/pwa-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "img/pwa-512x512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "img/maskable-icon-512x512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] +{ + "$schema": "https://json.schemastore.org/web-manifest-combined.json", + "id": "linwood-setonix-docs", + "name": "Linwood Setonix Documentation", + "short_name": "Setonix Docs", + "description": "Documentation for the opensource Linwood Setonix project.", + "orientation": "any", + "display": "fullscreen", + "background_color": "#18191a", + "theme_color": "#0175c2", + "icons": [ + { + "src": "img/pwa-64x64.png", + "sizes": "64x64", + "type": "image/png" + }, + { + "src": "img/pwa-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "img/pwa-512x512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "img/maskable-icon-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] } \ No newline at end of file diff --git a/metadata/en-US/changelogs/1.txt b/metadata/en-US/changelogs/1.txt index 22a98247..91186299 100644 --- a/metadata/en-US/changelogs/1.txt +++ b/metadata/en-US/changelogs/1.txt @@ -1 +1 @@ -First release 🎉 +First release 🎉 diff --git a/metadata/en-US/changelogs/10.txt b/metadata/en-US/changelogs/10.txt index 97e1c9c7..b019a5fd 100644 --- a/metadata/en-US/changelogs/10.txt +++ b/metadata/en-US/changelogs/10.txt @@ -1,23 +1,23 @@ -* Add lua scripting support to server - * Add game modes to packs - * Add scripts directory - * Add blackjack sample game mode -* Add waypoints -* Add action buttons support -* Add toolbar options -* Add welcome text to server -* Add checkbox and dropdown dialog components -* Improve message author display -* Fix home page header text color in certain themes -* Fix released server archives have no core pack -* Fix design name -* Fix kick command usage -* Fix cards stretches if texture is not rectangular -* Fix kick message -* Fix user system on server -* Rebuild event system -* Add legacy android build -* Modernize project structure -* Upgrade to flutter 3.38 - +* Add lua scripting support to server + * Add game modes to packs + * Add scripts directory + * Add blackjack sample game mode +* Add waypoints +* Add action buttons support +* Add toolbar options +* Add welcome text to server +* Add checkbox and dropdown dialog components +* Improve message author display +* Fix home page header text color in certain themes +* Fix released server archives have no core pack +* Fix design name +* Fix kick command usage +* Fix cards stretches if texture is not rectangular +* Fix kick message +* Fix user system on server +* Rebuild event system +* Add legacy android build +* Modernize project structure +* Upgrade to flutter 3.38 + Read more here: https://linwood.dev/setonix/0.6.0 \ No newline at end of file diff --git a/metadata/en-US/changelogs/11.txt b/metadata/en-US/changelogs/11.txt index c21ffe30..77798fdf 100644 --- a/metadata/en-US/changelogs/11.txt +++ b/metadata/en-US/changelogs/11.txt @@ -1,19 +1,19 @@ -* Add zoom gestures -* Add create from template -* Add high level scripting API for packs -* Add support for game modes and scripts in single-player -* Add game mode and scripts to editor -* Add localized names and descriptions for game modes -* Improve hand view UI animations and responsiveness -* Improve mouse and long-press input feedback for hand items -* Fix dragging on the hand view also moving the game world -* Fix jittering when dragging items from hand -* Fix spawning objects overwriting existing ones in a cell -* Fix server state dropping hidden card variations before script evaluation -* Fix server builds not created for released versions -* Improve server docs by ignoring generated files -* Improve hand view background design -* Improve hand item name visibility with a pill background -* Upgrade to flutter 3.41 - +* Add zoom gestures +* Add create from template +* Add high level scripting API for packs +* Add support for game modes and scripts in single-player +* Add game mode and scripts to editor +* Add localized names and descriptions for game modes +* Improve hand view UI animations and responsiveness +* Improve mouse and long-press input feedback for hand items +* Fix dragging on the hand view also moving the game world +* Fix jittering when dragging items from hand +* Fix spawning objects overwriting existing ones in a cell +* Fix server state dropping hidden card variations before script evaluation +* Fix server builds not created for released versions +* Improve server docs by ignoring generated files +* Improve hand view background design +* Improve hand item name visibility with a pill background +* Upgrade to flutter 3.41 + Read more here: https://linwood.dev/setonix/0.7.0 \ No newline at end of file diff --git a/metadata/en-US/changelogs/2.txt b/metadata/en-US/changelogs/2.txt index 9bc7dfaa..b7354fd7 100644 --- a/metadata/en-US/changelogs/2.txt +++ b/metadata/en-US/changelogs/2.txt @@ -1,2 +1,2 @@ -* Add internet permission to android +* Add internet permission to android * Fix app crashing if socket cannot be created \ No newline at end of file diff --git a/metadata/en-US/changelogs/3.txt b/metadata/en-US/changelogs/3.txt index 3f1310e0..50380504 100644 --- a/metadata/en-US/changelogs/3.txt +++ b/metadata/en-US/changelogs/3.txt @@ -1,11 +1,11 @@ -* Add protection to cells if they are hidden -* Add download for packs ([#39](https://github.com/LinwoodDev/Setonix/issues/39)) -* Add data metadata for packs -* Use hash of archive for signature -* Add dialog image support ([#40](https://github.com/LinwoodDev/Setonix/issues/40)) -* Fix multiple settings button on home page -* Disable packs item if client is not a server -* Use bolder monochrome icon for android -* Make build reproducable - +* Add protection to cells if they are hidden +* Add download for packs ([#39](https://github.com/LinwoodDev/Setonix/issues/39)) +* Add data metadata for packs +* Use hash of archive for signature +* Add dialog image support ([#40](https://github.com/LinwoodDev/Setonix/issues/40)) +* Fix multiple settings button on home page +* Disable packs item if client is not a server +* Use bolder monochrome icon for android +* Make build reproducable + Read more here: https://linwood.dev/setonix/0.2.0 \ No newline at end of file diff --git a/metadata/en-US/changelogs/4.txt b/metadata/en-US/changelogs/4.txt index 231d6c96..f3383d05 100644 --- a/metadata/en-US/changelogs/4.txt +++ b/metadata/en-US/changelogs/4.txt @@ -1,11 +1,11 @@ -* Add editor -* Fix importing of packs -* Fix packs not available on singleplayer -* Rework packs dialog -* Upgrade to flutter 3.27 -* Use minSdkVersion 23 instead of 21 (The minimum version of android is 6.0 (Marshmallow)) -* Upgrade to agb 8.8 -* Fix reproducable builds again -* Add linux arm - +* Add editor +* Fix importing of packs +* Fix packs not available on singleplayer +* Rework packs dialog +* Upgrade to flutter 3.27 +* Use minSdkVersion 23 instead of 21 (The minimum version of android is 6.0 (Marshmallow)) +* Upgrade to agb 8.8 +* Fix reproducable builds again +* Add linux arm + Read more here: https://linwood.dev/setonix/0.3.0 \ No newline at end of file diff --git a/metadata/en-US/changelogs/5.txt b/metadata/en-US/changelogs/5.txt index be8b9681..7ad8582a 100644 --- a/metadata/en-US/changelogs/5.txt +++ b/metadata/en-US/changelogs/5.txt @@ -1,18 +1,18 @@ -* Add importing system for editor -* Add launch app link for android ([#37](https://github.com/LinwoodDev/Setonix/issues/37)) -* Add option for server to send link information -* Add import and export settings -* Add density settings -* Add arrow key hand keyboard navigation -* Improve multiplayer ui -* Improve card rendering layout -* Add swamp multiplayer support -* Add scroll sensitivity setting -* Add remaining empty indicator to editor tabs -* Fix renaming teams not working ([#48](https://github.com/LinwoodDev/Setonix/issues/48)) -* Fix edit mode tooltip -* Migrate away from flutter_markdown -* Upgrade to flutter 3.32 -* Update to agb 8.9 - +* Add importing system for editor +* Add launch app link for android ([#37](https://github.com/LinwoodDev/Setonix/issues/37)) +* Add option for server to send link information +* Add import and export settings +* Add density settings +* Add arrow key hand keyboard navigation +* Improve multiplayer ui +* Improve card rendering layout +* Add swamp multiplayer support +* Add scroll sensitivity setting +* Add remaining empty indicator to editor tabs +* Fix renaming teams not working ([#48](https://github.com/LinwoodDev/Setonix/issues/48)) +* Fix edit mode tooltip +* Migrate away from flutter_markdown +* Upgrade to flutter 3.32 +* Update to agb 8.9 + Read more here: https://linwood.dev/setonix/0.4.0 \ No newline at end of file diff --git a/metadata/en-US/changelogs/6.txt b/metadata/en-US/changelogs/6.txt index 1f9eb2b2..1051290e 100644 --- a/metadata/en-US/changelogs/6.txt +++ b/metadata/en-US/changelogs/6.txt @@ -1,15 +1,15 @@ -* Improve parsing of server url -* Improve rendering of cards - * Make bottom panel smaller - * Fix items overflowing with size -* Add config system for server -* Add error handling for invalid packs -* Fix dragging cards on mobile -* Fix world not loading in multiplayer -* Fix team creation not working -* Fix team changes not being synced correctly in multiplayer -* Add support for defining host for server -* Fix core pack not included in build -* Fix server crash when invalid request is made - +* Improve parsing of server url +* Improve rendering of cards + * Make bottom panel smaller + * Fix items overflowing with size +* Add config system for server +* Add error handling for invalid packs +* Fix dragging cards on mobile +* Fix world not loading in multiplayer +* Fix team creation not working +* Fix team changes not being synced correctly in multiplayer +* Add support for defining host for server +* Fix core pack not included in build +* Fix server crash when invalid request is made + Read more here: https://linwood.dev/setonix/0.4.1 \ No newline at end of file diff --git a/metadata/en-US/changelogs/7.txt b/metadata/en-US/changelogs/7.txt index 5b216288..3a8b85fb 100644 --- a/metadata/en-US/changelogs/7.txt +++ b/metadata/en-US/changelogs/7.txt @@ -1,13 +1,13 @@ -* Add account system -* Add auth system -* Add loading screen -* Add server list -* Add kick message -* Add user system on server - * Local database - * Remote endpoint -* Add whitelist system on server -* Fix sensitivity setting not visible on web -* Fix editor not working on web - +* Add account system +* Add auth system +* Add loading screen +* Add server list +* Add kick message +* Add user system on server + * Local database + * Remote endpoint +* Add whitelist system on server +* Fix sensitivity setting not visible on web +* Fix editor not working on web + Read more here: https://linwood.dev/setonix/0.5.0 \ No newline at end of file diff --git a/metadata/en-US/changelogs/8.txt b/metadata/en-US/changelogs/8.txt index 87b6a448..83956ab3 100644 --- a/metadata/en-US/changelogs/8.txt +++ b/metadata/en-US/changelogs/8.txt @@ -1,8 +1,8 @@ -* Redesign cards to have higher resolution -* Redesign home page -* Upgrade to agb 8.11 -* Allow referencing user with name and fingerprint -* Fix serverlist route -* Add support for arm AppImage builds - +* Redesign cards to have higher resolution +* Redesign home page +* Upgrade to agb 8.11 +* Allow referencing user with name and fingerprint +* Fix serverlist route +* Add support for arm AppImage builds + Read more here: https://linwood.dev/setonix/0.5.1 \ No newline at end of file diff --git a/metadata/en-US/changelogs/9.txt b/metadata/en-US/changelogs/9.txt index ede0792a..eec4bf14 100644 --- a/metadata/en-US/changelogs/9.txt +++ b/metadata/en-US/changelogs/9.txt @@ -1,11 +1,11 @@ -* Add snap support -* Rename single player and multiplayer dialog -* Remove browse tab -* Improve textures of spades in cards and add better resolution to the card background, chips and dice -* Improve display of identifier of installed packs in dialog -* Swap board and figures in hand view -* Redesign chess figures -* Use minSdkVersion 24 instead of 23 (The minimum version of android is 7.0 (Nougat)) -* Upgrade to flutter 3.35 - +* Add snap support +* Rename single player and multiplayer dialog +* Remove browse tab +* Improve textures of spades in cards and add better resolution to the card background, chips and dice +* Improve display of identifier of installed packs in dialog +* Swap board and figures in hand view +* Redesign chess figures +* Use minSdkVersion 24 instead of 23 (The minimum version of android is 7.0 (Nougat)) +* Upgrade to flutter 3.35 + Read more here: https://linwood.dev/setonix/0.5.2 \ No newline at end of file diff --git a/metadata/en-US/full_description.txt b/metadata/en-US/full_description.txt index 9615b1d4..db276ce1 100644 --- a/metadata/en-US/full_description.txt +++ b/metadata/en-US/full_description.txt @@ -1,10 +1,10 @@ -Setonix is a table sandbox game where you can decide how to play. Spawn cards everywhere you like, add optional rules and play with your friends or alone without internet. - -* Play games with your friends or alone -* No internet connection required to play, multiplayer also works offline -* Configure if you want to play with or without rules -* Create custom cards, board and dices -* Pack them all into a package and share it with your friends -* Load the rules in the server and the client -* The app is available for android, windows, linux, and in the web. You can use it on your phone, tablet, or computer. -* The app is open source and free. You can contribute to the project and help to make it better. +Setonix is a table sandbox game where you can decide how to play. Spawn cards everywhere you like, add optional rules and play with your friends or alone without internet. + +* Play games with your friends or alone +* No internet connection required to play, multiplayer also works offline +* Configure if you want to play with or without rules +* Create custom cards, board and dices +* Pack them all into a package and share it with your friends +* Load the rules in the server and the client +* The app is available for android, windows, linux, and in the web. You can use it on your phone, tablet, or computer. +* The app is open source and free. You can contribute to the project and help to make it better. diff --git a/plugin/.gitignore b/plugin/.gitignore index 24476c5d..70ccb971 100644 --- a/plugin/.gitignore +++ b/plugin/.gitignore @@ -1,44 +1,44 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/plugin/README.md b/plugin/README.md index 5e34d93c..6b0ef9bd 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -1,3 +1,3 @@ -# Luau Scripting API - -The detailed Luau scripting documentation lives in the [docs](https://setonix.world/docs/v1/scripting/luau) and the API reference is available at [api.setonix.world](https://api.setonix.world/). +# Luau Scripting API + +The detailed Luau scripting documentation lives in the [docs](https://setonix.world/docs/v1/scripting/luau) and the API reference is available at [api.setonix.world](https://api.setonix.world/). diff --git a/plugin/analysis_options.yaml b/plugin/analysis_options.yaml index eabb6ff2..a2bccaef 100644 --- a/plugin/analysis_options.yaml +++ b/plugin/analysis_options.yaml @@ -1,7 +1,7 @@ -analyzer: - exclude: - - rust/target/**.dart # contains dumped debug info, instead of normal code - -linter: - rules: - - unawaited_futures +analyzer: + exclude: + - rust/target/**.dart # contains dumped debug info, instead of normal code + +linter: + rules: + - unawaited_futures diff --git a/plugin/build.yaml b/plugin/build.yaml index f6aa65e2..cb9dcd92 100644 --- a/plugin/build.yaml +++ b/plugin/build.yaml @@ -1,4 +1,4 @@ -global_options: - dart_mappable_builder: - options: - useNodoc: true +global_options: + dart_mappable_builder: + options: + useNodoc: true diff --git a/plugin/definitions/setonix.d.luau b/plugin/definitions/setonix.d.luau index 14b1ed12..f6af208c 100644 --- a/plugin/definitions/setonix.d.luau +++ b/plugin/definitions/setonix.d.luau @@ -1,145 +1,145 @@ ---!nocheck ---!nolint - -export type SetonixRaw = { - Events: any, - Server: any, - State: any, - events: any, - server: any, - state: any, -} - -export type SetonixWorld = { - currentTable: () -> any, - getTable: (table_name: string) -> any, - cell: (position_or_x: any, y: number?, table_name: string?) -> any, -} - -export type SetonixState = { - raw: () -> any, - tableName: () -> string, - tables: () -> any, - info: () -> any, - players: () -> any, - teamMembers: () -> any, - currentTable: () -> any, -} - -export type SetonixCollections = { - copy: (values: any) -> any, - shuffle: (values: any) -> any, -} - -export type SetonixScoring = { - bestTotal: (items: any, resolver: any, max_score: number?) -> number, -} - -export type SetonixEvents = { - on: (event_name: string, handler: (event: any) -> any) -> any, - listen: (event_name: string, handler: (event: any) -> any) -> any, - action: (action_id: string, handler: (event: any) -> any) -> any, -} - -export type SetonixCommands = { - register: (name: string, handler: (event: any) -> any, options: any?) -> any, -} - -export type SetonixTables = { - current: () -> any, - get: (table_name: string) -> any, -} - -export type SetonixServerEvents = { - cellSwitched: (cell: any, selected: boolean?, teleport: boolean?) -> any, - backgroundChanged: (background: any) -> any, - objectsSpawned: (table_name: string, objects: any) -> any, - objectsSpawnedAt: (cell: any, objects: any) -> any, - objectsRemoved: (objects: any, target: any?) -> any, - objectsMoved: (from_cell: any, to_cell: any, objects: any, target: any?) -> any, - cellHideChanged: (cell: any, object: any?, hide: boolean?) -> any, - message: (message: string, author: any?) -> any, - toolbarUpdated: (toolbar: any) -> any, - boardTilesSpawned: (table_name: string, tiles: any) -> any, - boardTilesChanged: (table_name: string, tiles: any) -> any, - dialogOpened: (dialog: any) -> any, - dialogsClosed: (id: any?) -> any, -} - -export type SetonixServer = { - send: (event: any, target: any?) -> any, - process: (event: any, force: boolean?) -> any, - message: (message: string, target: any?, author: any?) -> any, - broadcast: (message: string, author: any?) -> any, - setToolbar: (toolbar: any, target: any?) -> any, - toolbarAction: (id: string, label: string, enabled: boolean?) -> any, - events: SetonixServerEvents, -} - -export type SetonixRequests = { - teamJoin: (team: string, force: boolean?) -> any, - teamLeave: (team: string, force: boolean?) -> any, - cellRoll: (cell: any, object: any, force: boolean?) -> any, - shuffleCell: (cell: any, force: boolean?) -> any, - packsChange: (packs: any, force: boolean?) -> any, - boardsSpawn: (table_name: string, assets: any, force: boolean?) -> any, - boardRemove: (cell: any, index: number, force: boolean?) -> any, - boardMove: (table_name: string, from_cell: any, to_cell: any, index: number, force: boolean?) -> any, - dialogClose: (id: string, value: any, force: boolean?) -> any, - images: (ids: any, force: boolean?) -> any, - modeChange: (location: string, force: boolean?) -> any, - modePlain: (force: boolean?) -> any, - authenticate: (signature: string, public_key: string, force: boolean?) -> any, - toolbarAction: (action_id: string, force: boolean?) -> any, -} - -export type SetonixPlayers = ((self: SetonixPlayers) -> {any}) & { - all: () -> {any}, - get: (player_id: number) -> any, -} - -export type SetonixCells = ((self: SetonixCells, position_or_x: any, y: number?, table_name: string?) -> any) & { - get: (position_or_x: any, y: number?, table_name: string?) -> any, -} - -export type SetonixDef = { - raw: SetonixRaw, - world: SetonixWorld, - state: SetonixState, - collections: SetonixCollections, - scoring: SetonixScoring, - events: SetonixEvents, - commands: SetonixCommands, - tables: SetonixTables, - server: SetonixServer, - requests: SetonixRequests, - players: SetonixPlayers, - cells: SetonixCells, - - event: (event_type: string, payload: any?) -> any, - namespace: () -> string, - game: () -> string, - pluginId: () -> string, - getPlayers: () -> any, - player: (player_id: number) -> any, - currentTable: () -> any, - getTable: (table_name: string) -> any, - cell: (position_or_x: any, y: number?, table_name: string?) -> any, - position: (position_or_x: any, y: number?, table_name: string?) -> any, - object: (asset: string, options: any?) -> any, - send: (event: any, target: any?) -> any, - process: (event: any, force: boolean?) -> any, - log: (message: string) -> (), - message: (message: string, target: any?, author: any?) -> any, - broadcast: (message: string, author: any?) -> any, - toolbarAction: (id: string, label: string, enabled: boolean?) -> any, - setToolbar: (toolbar: any, target: any?) -> any, - moveObjects: (from_cell: any, to_cell: any, objects: any, target: any?) -> any, - on: (event_name: string, handler: (event: any) -> any) -> any, - listen: (event_name: string, handler: (event: any) -> any) -> any, - onAction: (action_id: string, handler: (event: any) -> any) -> any, - command: (name: string, handler: (event: any) -> any, options: any?) -> any, -} - -declare Setonix: SetonixDef -declare SetonixRaw: SetonixRaw +--!nocheck +--!nolint + +export type SetonixRaw = { + Events: any, + Server: any, + State: any, + events: any, + server: any, + state: any, +} + +export type SetonixWorld = { + currentTable: () -> any, + getTable: (table_name: string) -> any, + cell: (position_or_x: any, y: number?, table_name: string?) -> any, +} + +export type SetonixState = { + raw: () -> any, + tableName: () -> string, + tables: () -> any, + info: () -> any, + players: () -> any, + teamMembers: () -> any, + currentTable: () -> any, +} + +export type SetonixCollections = { + copy: (values: any) -> any, + shuffle: (values: any) -> any, +} + +export type SetonixScoring = { + bestTotal: (items: any, resolver: any, max_score: number?) -> number, +} + +export type SetonixEvents = { + on: (event_name: string, handler: (event: any) -> any) -> any, + listen: (event_name: string, handler: (event: any) -> any) -> any, + action: (action_id: string, handler: (event: any) -> any) -> any, +} + +export type SetonixCommands = { + register: (name: string, handler: (event: any) -> any, options: any?) -> any, +} + +export type SetonixTables = { + current: () -> any, + get: (table_name: string) -> any, +} + +export type SetonixServerEvents = { + cellSwitched: (cell: any, selected: boolean?, teleport: boolean?) -> any, + backgroundChanged: (background: any) -> any, + objectsSpawned: (table_name: string, objects: any) -> any, + objectsSpawnedAt: (cell: any, objects: any) -> any, + objectsRemoved: (objects: any, target: any?) -> any, + objectsMoved: (from_cell: any, to_cell: any, objects: any, target: any?) -> any, + cellHideChanged: (cell: any, object: any?, hide: boolean?) -> any, + message: (message: string, author: any?) -> any, + toolbarUpdated: (toolbar: any) -> any, + boardTilesSpawned: (table_name: string, tiles: any) -> any, + boardTilesChanged: (table_name: string, tiles: any) -> any, + dialogOpened: (dialog: any) -> any, + dialogsClosed: (id: any?) -> any, +} + +export type SetonixServer = { + send: (event: any, target: any?) -> any, + process: (event: any, force: boolean?) -> any, + message: (message: string, target: any?, author: any?) -> any, + broadcast: (message: string, author: any?) -> any, + setToolbar: (toolbar: any, target: any?) -> any, + toolbarAction: (id: string, label: string, enabled: boolean?) -> any, + events: SetonixServerEvents, +} + +export type SetonixRequests = { + teamJoin: (team: string, force: boolean?) -> any, + teamLeave: (team: string, force: boolean?) -> any, + cellRoll: (cell: any, object: any, force: boolean?) -> any, + shuffleCell: (cell: any, force: boolean?) -> any, + packsChange: (packs: any, force: boolean?) -> any, + boardsSpawn: (table_name: string, assets: any, force: boolean?) -> any, + boardRemove: (cell: any, index: number, force: boolean?) -> any, + boardMove: (table_name: string, from_cell: any, to_cell: any, index: number, force: boolean?) -> any, + dialogClose: (id: string, value: any, force: boolean?) -> any, + images: (ids: any, force: boolean?) -> any, + modeChange: (location: string, force: boolean?) -> any, + modePlain: (force: boolean?) -> any, + authenticate: (signature: string, public_key: string, force: boolean?) -> any, + toolbarAction: (action_id: string, force: boolean?) -> any, +} + +export type SetonixPlayers = ((self: SetonixPlayers) -> {any}) & { + all: () -> {any}, + get: (player_id: number) -> any, +} + +export type SetonixCells = ((self: SetonixCells, position_or_x: any, y: number?, table_name: string?) -> any) & { + get: (position_or_x: any, y: number?, table_name: string?) -> any, +} + +export type SetonixDef = { + raw: SetonixRaw, + world: SetonixWorld, + state: SetonixState, + collections: SetonixCollections, + scoring: SetonixScoring, + events: SetonixEvents, + commands: SetonixCommands, + tables: SetonixTables, + server: SetonixServer, + requests: SetonixRequests, + players: SetonixPlayers, + cells: SetonixCells, + + event: (event_type: string, payload: any?) -> any, + namespace: () -> string, + game: () -> string, + pluginId: () -> string, + getPlayers: () -> any, + player: (player_id: number) -> any, + currentTable: () -> any, + getTable: (table_name: string) -> any, + cell: (position_or_x: any, y: number?, table_name: string?) -> any, + position: (position_or_x: any, y: number?, table_name: string?) -> any, + object: (asset: string, options: any?) -> any, + send: (event: any, target: any?) -> any, + process: (event: any, force: boolean?) -> any, + log: (message: string) -> (), + message: (message: string, target: any?, author: any?) -> any, + broadcast: (message: string, author: any?) -> any, + toolbarAction: (id: string, label: string, enabled: boolean?) -> any, + setToolbar: (toolbar: any, target: any?) -> any, + moveObjects: (from_cell: any, to_cell: any, objects: any, target: any?) -> any, + on: (event_name: string, handler: (event: any) -> any) -> any, + listen: (event_name: string, handler: (event: any) -> any) -> any, + onAction: (action_id: string, handler: (event: any) -> any) -> any, + command: (name: string, handler: (event: any) -> any, options: any?) -> any, +} + +declare Setonix: SetonixDef +declare SetonixRaw: SetonixRaw diff --git a/plugin/flutter_rust_bridge.yaml b/plugin/flutter_rust_bridge.yaml index 4bbf5ab1..0271e651 100644 --- a/plugin/flutter_rust_bridge.yaml +++ b/plugin/flutter_rust_bridge.yaml @@ -1,4 +1,4 @@ -rust_input: rust/src/api/**/*.rs -dart_output: lib/src/rust -local: true -enable_lifetime: true +rust_input: rust/src/api/**/*.rs +dart_output: lib/src/rust +local: true +enable_lifetime: true diff --git a/plugin/hook/build.dart b/plugin/hook/build.dart index 7a23fa92..81cdeff2 100644 --- a/plugin/hook/build.dart +++ b/plugin/hook/build.dart @@ -1,11 +1,11 @@ -import 'package:hooks/hooks.dart'; -import 'package:native_toolchain_rust/native_toolchain_rust.dart'; - -void main(List args) async { - await build(args, (input, output) async { - await const RustBuilder( - assetName: 'src/rust/frb_generated.io.dart', - cratePath: 'rust', - ).run(input: input, output: output); - }); -} +import 'package:hooks/hooks.dart'; +import 'package:native_toolchain_rust/native_toolchain_rust.dart'; + +void main(List args) async { + await build(args, (input, output) async { + await const RustBuilder( + assetName: 'src/rust/frb_generated.io.dart', + cratePath: 'rust', + ).run(input: input, output: output); + }); +} diff --git a/plugin/lib/events.dart b/plugin/lib/events.dart index 70f96437..185628ac 100644 --- a/plugin/lib/events.dart +++ b/plugin/lib/events.dart @@ -1,5 +1,5 @@ -library; - -export 'src/events/model.dart'; -export 'src/events/system.dart'; -export 'src/plugin.dart'; +library; + +export 'src/events/model.dart'; +export 'src/events/system.dart'; +export 'src/plugin.dart'; diff --git a/plugin/lib/native.dart b/plugin/lib/native.dart index 4b519289..14a32757 100644 --- a/plugin/lib/native.dart +++ b/plugin/lib/native.dart @@ -1,35 +1,35 @@ -import 'dart:io'; - -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -import 'package:path/path.dart' as p; - -/// Load the setonix_plugin library from the lib/ directory relative to the executable. -/// This is used for compiled server binaries where the library is bundled alongside sqlite3. -Future loadExternalPluginLibrary() async { - try { - // Get the directory containing the executable - final executablePath = Platform.resolvedExecutable; - final executableDir = p.dirname(executablePath); - // Look for the library in ../lib/ relative to the executable (same as sqlite3) - final libDir = p.join(executableDir, '..', 'lib'); - - String libraryName; - if (Platform.isWindows) { - libraryName = 'setonix_plugin.dll'; - } else if (Platform.isMacOS) { - libraryName = 'libsetonix_plugin.dylib'; - } else { - libraryName = 'libsetonix_plugin.so'; - } - - final libraryPath = p.join(libDir, libraryName); - if (await File(libraryPath).exists()) { - return ExternalLibrary.open(libraryPath); - } - // Fallback: try the default loading mechanism - return null; - } catch (_) { - // Fallback: try the default loading mechanism - return null; - } -} +import 'dart:io'; + +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'package:path/path.dart' as p; + +/// Load the setonix_plugin library from the lib/ directory relative to the executable. +/// This is used for compiled server binaries where the library is bundled alongside sqlite3. +Future loadExternalPluginLibrary() async { + try { + // Get the directory containing the executable + final executablePath = Platform.resolvedExecutable; + final executableDir = p.dirname(executablePath); + // Look for the library in ../lib/ relative to the executable (same as sqlite3) + final libDir = p.join(executableDir, '..', 'lib'); + + String libraryName; + if (Platform.isWindows) { + libraryName = 'setonix_plugin.dll'; + } else if (Platform.isMacOS) { + libraryName = 'libsetonix_plugin.dylib'; + } else { + libraryName = 'libsetonix_plugin.so'; + } + + final libraryPath = p.join(libDir, libraryName); + if (await File(libraryPath).exists()) { + return ExternalLibrary.open(libraryPath); + } + // Fallback: try the default loading mechanism + return null; + } catch (_) { + // Fallback: try the default loading mechanism + return null; + } +} diff --git a/plugin/lib/src/events/model.dart b/plugin/lib/src/events/model.dart index 31028e8b..ac9c304c 100644 --- a/plugin/lib/src/events/model.dart +++ b/plugin/lib/src/events/model.dart @@ -1,176 +1,176 @@ -import 'dart:async'; -import 'dart:io'; -import 'dart:typed_data'; - -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:networker/networker.dart'; -import 'package:setonix_api/setonix_api.dart'; - -part 'model.mapper.dart'; - -const defaultWorldName = 'world'; - -base class Event { - final T clientEvent; - final Channel source; - final String worldName; - ServerWorldEvent? serverEvent; - Channel target; - bool cancelled = false; - Set? needsUpdate; - final List> _scheduledEvents = []; - - Event({ - required this.serverEvent, - required this.target, - required this.clientEvent, - required this.source, - this.worldName = defaultWorldName, - this.needsUpdate, - }); - - List> get scheduledEvents => - List.unmodifiable(_scheduledEvents); - - Event castEvent() { - return _LinkedEvent(this); - } - - void cancel() { - cancelled = true; - needsUpdate = null; - } - - void scheduleEvent( - PlayableWorldEvent event, [ - Channel channel = kAnyChannel, - ]) { - _scheduledEvents.add(NetworkerPacket(event, channel)); - } - - void scheduleEvents(Iterable> events) { - _scheduledEvents.addAll(events); - } -} - -// Allows casting an event to another -final class _LinkedEvent implements Event { - final Event parent; - - _LinkedEvent(this.parent); - - @override - bool get cancelled => parent.cancelled; - @override - set cancelled(bool value) => parent.cancelled = value; - - @override - ServerWorldEvent? get serverEvent => parent.serverEvent; - @override - set serverEvent(ServerWorldEvent? value) => parent.serverEvent = value; - - @override - Channel get target => parent.target; - @override - set target(Channel value) => parent.target = value; - - @override - void cancel() => parent.cancel(); - - @override - Event castEvent() => parent.castEvent(); - - @override - T get clientEvent => parent.clientEvent as T; - - @override - Channel get source => parent.source; - - @override - Set? get needsUpdate => parent.needsUpdate; - - @override - set needsUpdate(Set? value) => parent.needsUpdate = value; - - @override - String get worldName => parent.worldName; - - @override - void scheduleEvent( - PlayableWorldEvent event, [ - Channel channel = kAnyChannel, - ]) { - parent.scheduleEvent(event, channel); - } - - @override - void scheduleEvents(Iterable> events) { - parent.scheduleEvents(events); - } - - List> get _scheduledEvents => - parent._scheduledEvents; - @override - List> get scheduledEvents => - List.unmodifiable(_scheduledEvents); -} - -final class ServerPing { - final HttpRequest request; - GameProperty response; - - ServerPing({required this.request, required this.response}); -} - -final class UserLeaveCallback { - final Channel channel; - final ConnectionInfo info; - - UserLeaveCallback({required this.channel, required this.info}); -} - -class _ConvertedConnectionInfo extends ConnectionInfo { - final Uri address; - - _ConvertedConnectionInfo(this.address); - - @override - FutureOr close() {} - - @override - bool get isClosed => true; - - @override - FutureOr sendMessage(Uint8List data) {} -} - -class ConnectionInfoMapper extends SimpleMapper { - const ConnectionInfoMapper(); - - @override - ConnectionInfo decode(Object value) { - if (value is Map) { - return _ConvertedConnectionInfo( - Uri.parse(value['address'] as String? ?? 'http://localhost'), - ); - } - return _ConvertedConnectionInfo(Uri.parse('http://localhost')); - } - - @override - Object? encode(ConnectionInfo self) { - return { - 'address': self is _ConvertedConnectionInfo - ? self.address.toString() - : '', - }; - } -} - -@MappableClass(includeCustomMappers: [ConnectionInfoMapper()]) -final class UserJoined extends LocalWorldEvent with UserJoinedMappable { - final Channel channel; - final ConnectionInfo info; - - UserJoined({required this.channel, required this.info}); -} +import 'dart:async'; +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:networker/networker.dart'; +import 'package:setonix_api/setonix_api.dart'; + +part 'model.mapper.dart'; + +const defaultWorldName = 'world'; + +base class Event { + final T clientEvent; + final Channel source; + final String worldName; + ServerWorldEvent? serverEvent; + Channel target; + bool cancelled = false; + Set? needsUpdate; + final List> _scheduledEvents = []; + + Event({ + required this.serverEvent, + required this.target, + required this.clientEvent, + required this.source, + this.worldName = defaultWorldName, + this.needsUpdate, + }); + + List> get scheduledEvents => + List.unmodifiable(_scheduledEvents); + + Event castEvent() { + return _LinkedEvent(this); + } + + void cancel() { + cancelled = true; + needsUpdate = null; + } + + void scheduleEvent( + PlayableWorldEvent event, [ + Channel channel = kAnyChannel, + ]) { + _scheduledEvents.add(NetworkerPacket(event, channel)); + } + + void scheduleEvents(Iterable> events) { + _scheduledEvents.addAll(events); + } +} + +// Allows casting an event to another +final class _LinkedEvent implements Event { + final Event parent; + + _LinkedEvent(this.parent); + + @override + bool get cancelled => parent.cancelled; + @override + set cancelled(bool value) => parent.cancelled = value; + + @override + ServerWorldEvent? get serverEvent => parent.serverEvent; + @override + set serverEvent(ServerWorldEvent? value) => parent.serverEvent = value; + + @override + Channel get target => parent.target; + @override + set target(Channel value) => parent.target = value; + + @override + void cancel() => parent.cancel(); + + @override + Event castEvent() => parent.castEvent(); + + @override + T get clientEvent => parent.clientEvent as T; + + @override + Channel get source => parent.source; + + @override + Set? get needsUpdate => parent.needsUpdate; + + @override + set needsUpdate(Set? value) => parent.needsUpdate = value; + + @override + String get worldName => parent.worldName; + + @override + void scheduleEvent( + PlayableWorldEvent event, [ + Channel channel = kAnyChannel, + ]) { + parent.scheduleEvent(event, channel); + } + + @override + void scheduleEvents(Iterable> events) { + parent.scheduleEvents(events); + } + + List> get _scheduledEvents => + parent._scheduledEvents; + @override + List> get scheduledEvents => + List.unmodifiable(_scheduledEvents); +} + +final class ServerPing { + final HttpRequest request; + GameProperty response; + + ServerPing({required this.request, required this.response}); +} + +final class UserLeaveCallback { + final Channel channel; + final ConnectionInfo info; + + UserLeaveCallback({required this.channel, required this.info}); +} + +class _ConvertedConnectionInfo extends ConnectionInfo { + final Uri address; + + _ConvertedConnectionInfo(this.address); + + @override + FutureOr close() {} + + @override + bool get isClosed => true; + + @override + FutureOr sendMessage(Uint8List data) {} +} + +class ConnectionInfoMapper extends SimpleMapper { + const ConnectionInfoMapper(); + + @override + ConnectionInfo decode(Object value) { + if (value is Map) { + return _ConvertedConnectionInfo( + Uri.parse(value['address'] as String? ?? 'http://localhost'), + ); + } + return _ConvertedConnectionInfo(Uri.parse('http://localhost')); + } + + @override + Object? encode(ConnectionInfo self) { + return { + 'address': self is _ConvertedConnectionInfo + ? self.address.toString() + : '', + }; + } +} + +@MappableClass(includeCustomMappers: [ConnectionInfoMapper()]) +final class UserJoined extends LocalWorldEvent with UserJoinedMappable { + final Channel channel; + final ConnectionInfo info; + + UserJoined({required this.channel, required this.info}); +} diff --git a/plugin/lib/src/events/model.mapper.dart b/plugin/lib/src/events/model.mapper.dart index 2fd01ed3..2812af7d 100644 --- a/plugin/lib/src/events/model.mapper.dart +++ b/plugin/lib/src/events/model.mapper.dart @@ -1,149 +1,149 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'model.dart'; - -/// @nodoc -class UserJoinedMapper extends SubClassMapperBase { - UserJoinedMapper._(); - - static UserJoinedMapper? _instance; - static UserJoinedMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = UserJoinedMapper._()); - LocalWorldEventMapper.ensureInitialized().addSubMapper(_instance!); - MapperContainer.globals.useAll([ConnectionInfoMapper()]); - } - return _instance!; - } - - @override - final String id = 'UserJoined'; - - static int _$channel(UserJoined v) => v.channel; - static const Field _f$channel = Field('channel', _$channel); - static ConnectionInfo _$info(UserJoined v) => v.info; - static const Field _f$info = Field( - 'info', - _$info, - ); - - @override - final MappableFields fields = const { - #channel: _f$channel, - #info: _f$info, - }; - - @override - final String discriminatorKey = 'type'; - @override - final dynamic discriminatorValue = 'UserJoined'; - @override - late final ClassMapperBase superMapper = - LocalWorldEventMapper.ensureInitialized(); - - static UserJoined _instantiate(DecodingData data) { - return UserJoined(channel: data.dec(_f$channel), info: data.dec(_f$info)); - } - - @override - final Function instantiate = _instantiate; - - static UserJoined fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static UserJoined fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin UserJoinedMappable { - String toJson() { - return UserJoinedMapper.ensureInitialized().encodeJson( - this as UserJoined, - ); - } - - Map toMap() { - return UserJoinedMapper.ensureInitialized().encodeMap( - this as UserJoined, - ); - } - - UserJoinedCopyWith get copyWith => - _UserJoinedCopyWithImpl( - this as UserJoined, - $identity, - $identity, - ); - @override - String toString() { - return UserJoinedMapper.ensureInitialized().stringifyValue( - this as UserJoined, - ); - } - - @override - bool operator ==(Object other) { - return UserJoinedMapper.ensureInitialized().equalsValue( - this as UserJoined, - other, - ); - } - - @override - int get hashCode { - return UserJoinedMapper.ensureInitialized().hashValue(this as UserJoined); - } -} - -/// @nodoc -extension UserJoinedValueCopy<$R, $Out> - on ObjectCopyWith<$R, UserJoined, $Out> { - UserJoinedCopyWith<$R, UserJoined, $Out> get $asUserJoined => - $base.as((v, t, t2) => _UserJoinedCopyWithImpl<$R, $Out>(v, t, t2)); -} - -/// @nodoc -abstract class UserJoinedCopyWith<$R, $In extends UserJoined, $Out> - implements LocalWorldEventCopyWith<$R, $In, $Out> { - @override - $R call({int? channel, ConnectionInfo? info}); - UserJoinedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); -} - -/// @nodoc -class _UserJoinedCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, UserJoined, $Out> - implements UserJoinedCopyWith<$R, UserJoined, $Out> { - _UserJoinedCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - UserJoinedMapper.ensureInitialized(); - @override - $R call({int? channel, ConnectionInfo? info}) => $apply( - FieldCopyWithData({ - if (channel != null) #channel: channel, - if (info != null) #info: info, - }), - ); - @override - UserJoined $make(CopyWithData data) => UserJoined( - channel: data.get(#channel, or: $value.channel), - info: data.get(#info, or: $value.info), - ); - - @override - UserJoinedCopyWith<$R2, UserJoined, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _UserJoinedCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'model.dart'; + +/// @nodoc +class UserJoinedMapper extends SubClassMapperBase { + UserJoinedMapper._(); + + static UserJoinedMapper? _instance; + static UserJoinedMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = UserJoinedMapper._()); + LocalWorldEventMapper.ensureInitialized().addSubMapper(_instance!); + MapperContainer.globals.useAll([ConnectionInfoMapper()]); + } + return _instance!; + } + + @override + final String id = 'UserJoined'; + + static int _$channel(UserJoined v) => v.channel; + static const Field _f$channel = Field('channel', _$channel); + static ConnectionInfo _$info(UserJoined v) => v.info; + static const Field _f$info = Field( + 'info', + _$info, + ); + + @override + final MappableFields fields = const { + #channel: _f$channel, + #info: _f$info, + }; + + @override + final String discriminatorKey = 'type'; + @override + final dynamic discriminatorValue = 'UserJoined'; + @override + late final ClassMapperBase superMapper = + LocalWorldEventMapper.ensureInitialized(); + + static UserJoined _instantiate(DecodingData data) { + return UserJoined(channel: data.dec(_f$channel), info: data.dec(_f$info)); + } + + @override + final Function instantiate = _instantiate; + + static UserJoined fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static UserJoined fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin UserJoinedMappable { + String toJson() { + return UserJoinedMapper.ensureInitialized().encodeJson( + this as UserJoined, + ); + } + + Map toMap() { + return UserJoinedMapper.ensureInitialized().encodeMap( + this as UserJoined, + ); + } + + UserJoinedCopyWith get copyWith => + _UserJoinedCopyWithImpl( + this as UserJoined, + $identity, + $identity, + ); + @override + String toString() { + return UserJoinedMapper.ensureInitialized().stringifyValue( + this as UserJoined, + ); + } + + @override + bool operator ==(Object other) { + return UserJoinedMapper.ensureInitialized().equalsValue( + this as UserJoined, + other, + ); + } + + @override + int get hashCode { + return UserJoinedMapper.ensureInitialized().hashValue(this as UserJoined); + } +} + +/// @nodoc +extension UserJoinedValueCopy<$R, $Out> + on ObjectCopyWith<$R, UserJoined, $Out> { + UserJoinedCopyWith<$R, UserJoined, $Out> get $asUserJoined => + $base.as((v, t, t2) => _UserJoinedCopyWithImpl<$R, $Out>(v, t, t2)); +} + +/// @nodoc +abstract class UserJoinedCopyWith<$R, $In extends UserJoined, $Out> + implements LocalWorldEventCopyWith<$R, $In, $Out> { + @override + $R call({int? channel, ConnectionInfo? info}); + UserJoinedCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t); +} + +/// @nodoc +class _UserJoinedCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, UserJoined, $Out> + implements UserJoinedCopyWith<$R, UserJoined, $Out> { + _UserJoinedCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + UserJoinedMapper.ensureInitialized(); + @override + $R call({int? channel, ConnectionInfo? info}) => $apply( + FieldCopyWithData({ + if (channel != null) #channel: channel, + if (info != null) #info: info, + }), + ); + @override + UserJoined $make(CopyWithData data) => UserJoined( + channel: data.get(#channel, or: $value.channel), + info: data.get(#info, or: $value.info), + ); + + @override + UserJoinedCopyWith<$R2, UserJoined, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _UserJoinedCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/plugin/lib/src/events/system.dart b/plugin/lib/src/events/system.dart index ecc57366..7020e49b 100644 --- a/plugin/lib/src/events/system.dart +++ b/plugin/lib/src/events/system.dart @@ -1,96 +1,96 @@ -import 'dart:async'; -import 'dart:io'; - -import 'package:networker/networker.dart'; -import 'package:setonix_api/setonix_api.dart'; -import 'package:setonix_plugin/events.dart'; -import 'package:setonix_plugin/src/events/model.dart'; - -typedef EventHandler = - Future Function(Event event); - -final class EventSubscription { - final EventHandler _handler; - final EventBus _bus; - - EventSubscription(this._bus, this._handler); - - void cancel() { - _bus._handlers.remove(_handler); - } -} - -final class EventBus { - final Set> _handlers = {}; - - EventSubscription on( - FutureOr Function(Event) handler, - ) { - Future wrappedHandler(Event event) async { - if (event.clientEvent is U) { - await handler(event.castEvent()); - } - } - - _handlers.add(wrappedHandler); - return EventSubscription(this, wrappedHandler); - } - - Future fire(Event event) async { - for (final handler in _handlers) { - await handler(event); - } - } - - void clear() { - _handlers.clear(); - } - - LinkedEventBus castBus() { - return LinkedEventBus(); - } -} - -final class LinkedEventBus { - final EventBus _bus = EventBus(); - - EventSubscription on( - Future Function(Event) handler, - ) { - return _bus.on(handler); - } - - Future fire(Event event) async { - await _bus.fire(event); - } - - void clear() { - _bus.clear(); - } -} - -final class EventSystem extends EventBus { - final StreamController _pingController = - StreamController.broadcast(); - final StreamController _leaveController = - StreamController.broadcast(); - - Stream get ping => _pingController.stream; - Stream get leave => _leaveController.stream; - - GameProperty runPing(HttpRequest request, GameProperty property) { - final ping = ServerPing(request: request, response: property); - _pingController.add(ping); - return ping.response; - } - - void runLeaveCallback(Channel channel, ConnectionInfo info) { - final callback = UserLeaveCallback(channel: channel, info: info); - _leaveController.add(callback); - } - - void dispose() { - _pingController.close(); - _leaveController.close(); - } -} +import 'dart:async'; +import 'dart:io'; + +import 'package:networker/networker.dart'; +import 'package:setonix_api/setonix_api.dart'; +import 'package:setonix_plugin/events.dart'; +import 'package:setonix_plugin/src/events/model.dart'; + +typedef EventHandler = + Future Function(Event event); + +final class EventSubscription { + final EventHandler _handler; + final EventBus _bus; + + EventSubscription(this._bus, this._handler); + + void cancel() { + _bus._handlers.remove(_handler); + } +} + +final class EventBus { + final Set> _handlers = {}; + + EventSubscription on( + FutureOr Function(Event) handler, + ) { + Future wrappedHandler(Event event) async { + if (event.clientEvent is U) { + await handler(event.castEvent()); + } + } + + _handlers.add(wrappedHandler); + return EventSubscription(this, wrappedHandler); + } + + Future fire(Event event) async { + for (final handler in _handlers) { + await handler(event); + } + } + + void clear() { + _handlers.clear(); + } + + LinkedEventBus castBus() { + return LinkedEventBus(); + } +} + +final class LinkedEventBus { + final EventBus _bus = EventBus(); + + EventSubscription on( + Future Function(Event) handler, + ) { + return _bus.on(handler); + } + + Future fire(Event event) async { + await _bus.fire(event); + } + + void clear() { + _bus.clear(); + } +} + +final class EventSystem extends EventBus { + final StreamController _pingController = + StreamController.broadcast(); + final StreamController _leaveController = + StreamController.broadcast(); + + Stream get ping => _pingController.stream; + Stream get leave => _leaveController.stream; + + GameProperty runPing(HttpRequest request, GameProperty property) { + final ping = ServerPing(request: request, response: property); + _pingController.add(ping); + return ping.response; + } + + void runLeaveCallback(Channel channel, ConnectionInfo info) { + final callback = UserLeaveCallback(channel: channel, info: info); + _leaveController.add(callback); + } + + void dispose() { + _pingController.close(); + _leaveController.close(); + } +} diff --git a/plugin/lib/src/rust/api/luau.dart b/plugin/lib/src/rust/api/luau.dart index 46ec0ddc..4d0fafbd 100644 --- a/plugin/lib/src/rust/api/luau.dart +++ b/plugin/lib/src/rust/api/luau.dart @@ -1,34 +1,34 @@ -// This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.12.0. - -// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import - -import '../frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -import 'plugin.dart'; - -// These functions are ignored because they are not marked as `pub`: `construct_globals`, `construct_high_level_api`, `construct_on_print`, `construct_raw_api` -// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `LuaEventDetails` -// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `add_fields`, `add_methods`, `clone` - -// Rust type: RustOpaqueMoi> -abstract class LuauPlugin implements RustOpaqueInterface, RustPlugin { - factory LuauPlugin({ - required String code, - required PluginCallback callback, - }) => RustLib.instance.api.crateApiLuauLuauPluginNew( - code: code, - callback: callback, - ); - - Future run(); - - Future runEvent({ - required String eventType, - required String event, - String? serverEvent, - required int source, - required bool cancelled, - required int target, - }); -} +// This file is automatically generated, so please do not edit it. +// @generated by `flutter_rust_bridge`@ 2.12.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'plugin.dart'; + +// These functions are ignored because they are not marked as `pub`: `construct_globals`, `construct_high_level_api`, `construct_on_print`, `construct_raw_api` +// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `LuaEventDetails` +// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `add_fields`, `add_methods`, `clone` + +// Rust type: RustOpaqueMoi> +abstract class LuauPlugin implements RustOpaqueInterface, RustPlugin { + factory LuauPlugin({ + required String code, + required PluginCallback callback, + }) => RustLib.instance.api.crateApiLuauLuauPluginNew( + code: code, + callback: callback, + ); + + Future run(); + + Future runEvent({ + required String eventType, + required String event, + String? serverEvent, + required int source, + required bool cancelled, + required int target, + }); +} diff --git a/plugin/lib/src/rust/api/simple.dart b/plugin/lib/src/rust/api/simple.dart index b594d10c..6c1a9f2a 100644 --- a/plugin/lib/src/rust/api/simple.dart +++ b/plugin/lib/src/rust/api/simple.dart @@ -1,10 +1,10 @@ -// This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.12.0. - -// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import - -import '../frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; - -Future simpleAdderTwinNormal({required int a, required int b}) => - RustLib.instance.api.crateApiSimpleSimpleAdderTwinNormal(a: a, b: b); +// This file is automatically generated, so please do not edit it. +// @generated by `flutter_rust_bridge`@ 2.12.0. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +Future simpleAdderTwinNormal({required int a, required int b}) => + RustLib.instance.api.crateApiSimpleSimpleAdderTwinNormal(a: a, b: b); diff --git a/plugin/lib/src/rust/lib.dart b/plugin/lib/src/rust/lib.dart index 039f624a..7be972c7 100644 --- a/plugin/lib/src/rust/lib.dart +++ b/plugin/lib/src/rust/lib.dart @@ -1,10 +1,10 @@ -// This file is automatically generated, so please do not edit it. -// @generated by `flutter_rust_bridge`@ 2.7.1. - -// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import - -import 'frb_generated.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; - -// Rust type: RustOpaqueMoi> -abstract class PluginCallback implements RustOpaqueInterface {} +// This file is automatically generated, so please do not edit it. +// @generated by `flutter_rust_bridge`@ 2.7.1. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import 'frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +// Rust type: RustOpaqueMoi> +abstract class PluginCallback implements RustOpaqueInterface {} diff --git a/plugin/pubspec.lock b/plugin/pubspec.lock index a2589f00..7c953345 100644 --- a/plugin/pubspec.lock +++ b/plugin/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: cd6add6f846f35fb79f3c315296703c1a24f3cfd7f4739d91a74961c1c7e9f1b + sha256: "1b0e6a07425a3e460666e88bf1c949ccc7bb0116ad562ce94a1eca60fe820725" url: "https://pub.dev" source: hosted - version: "100.0.0" + version: "103.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "6ba98576948803398b69e3a444df24eacdbe12ed699c7014e120ea38552debbf" + sha256: "61c04d0c1bfed555c681ea079519933f071a5a026578ff73c4ff0df2d3462e5e" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "13.3.0" ansicolor: dependency: transitive description: @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: code_assets - sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.1" collection: dependency: "direct main" description: @@ -262,10 +262,10 @@ packages: dependency: "direct main" description: name: hooks - sha256: "025f060e86d2d4c3c47b56e33caf7f93bf9283340f26d23424ebcfccf34f621e" + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.2" http_multi_server: dependency: transitive description: @@ -310,8 +310,8 @@ packages: dependency: transitive description: path: "packages/lw_file_system_api" - ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" - resolved-ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" + ref: "37594211585889e35e65dad382d4fdcf29ac69a0" + resolved-ref: "37594211585889e35e65dad382d4fdcf29ac69a0" url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "1.0.0" @@ -327,10 +327,10 @@ packages: dependency: "direct main" description: name: meta - sha256: df0c643f44ad098eb37988027a8e2b2b5a031fd3977f06bbfd3a76637e8df739 + sha256: c82594181e3312f3d0695fc95aaaf7758d75b8d4ae2bbecf223b9fd5109a059d url: "https://pub.dev" source: hosted - version: "1.18.2" + version: "1.18.3" mime: dependency: transitive description: @@ -343,10 +343,10 @@ packages: dependency: "direct main" description: name: native_toolchain_rust - sha256: "26d4dcae954328af4ebfa8fc56cca0bf74b9ae8b4a6132de5da2071ac3d237b3" + sha256: faa57d2258a3b0fd2a634054f54e4496c9fcbd971977e7d2b7e6916d56892857 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.4+0" networker: dependency: "direct main" description: diff --git a/plugin/pubspec.yaml b/plugin/pubspec.yaml index c32ae12a..193b566c 100644 --- a/plugin/pubspec.yaml +++ b/plugin/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: meta: ^1.15.0 dart_mappable: ^4.3.0 native_toolchain_rust: ^1.0.4 - hooks: ^1.0.3 + hooks: ^2.0.2 dev_dependencies: build_runner: ^2.4.14 dart_mappable_builder: ^4.3.1 diff --git a/plugin/rust/.gitignore b/plugin/rust/.gitignore index 0104787a..37ab2be9 100644 --- a/plugin/rust/.gitignore +++ b/plugin/rust/.gitignore @@ -1,17 +1,17 @@ -# Generated by Cargo -# will have compiled files and executables -debug/ -target/ - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb - -# RustRover -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# RustRover +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ \ No newline at end of file diff --git a/plugin/rust/Cargo.lock b/plugin/rust/Cargo.lock index 03fd2a4e..0cb1b209 100644 --- a/plugin/rust/Cargo.lock +++ b/plugin/rust/Cargo.lock @@ -89,9 +89,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "block-buffer" @@ -138,9 +138,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.2.63" +version = "1.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556e016178bb5662a08681bbe0f00f8e17631781a4dfc8c45e466e4b185ec27f" +checksum = "dad887fd958be91b5098c0248def011f4523ab786cd411be668777e55063501f" dependencies = [ "find-msvc-tools", "jobserver", @@ -450,13 +450,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.99" +version = "0.3.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" +checksum = "03d04c30968dffe80775bd4d7fb676131cd04a1fb46d2686dbffbaec2d9dfd31" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -483,9 +482,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.30" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616ec5685824bcc94416c6d4a7a446eea774a31efd7062c8480ba6fd06d7a6e5" +checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" [[package]] name = "luau0-src" @@ -508,9 +507,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" [[package]] name = "miniz_oxide" @@ -685,9 +684,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" dependencies = [ "aho-corasick", "memchr", @@ -708,9 +707,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rustc-demangle" @@ -817,9 +816,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "strum" @@ -844,9 +843,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.117" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -897,18 +896,18 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasip2" -version = "1.0.3+wasi-0.2.9" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.122" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" +checksum = "8ddb3f79143bced6de84270411622a2699cee572fc0875aeaf1e7867cf9fca1a" dependencies = [ "cfg-if", "once_cell", @@ -919,9 +918,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.72" +version = "0.4.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" +checksum = "503b14d284f2c8dac03b819967e155ea753f573586193b2b2c95990cb5d69280" dependencies = [ "js-sys", "wasm-bindgen", @@ -929,9 +928,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.122" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" +checksum = "4e21a184b13fb19e157296e2c46056aec9092264fab83e4ba59e68c61b323c3d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -939,9 +938,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.122" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" +checksum = "fecefd9c35bd935a20fc3fc344b5f29138961e4f47fb03297d88f2587afb5ebd" dependencies = [ "bumpalo", "proc-macro2", @@ -952,18 +951,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.122" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" +checksum = "23939e44bb9a5d7576fa2b563dc2e136628f1224e88a8deed09e04858b77871f" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.99" +version = "0.3.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" +checksum = "a6430a72df5eb332242960fe84b3002a241163998241eb596d4f739b9757061d" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/plugin/rust/src/api/simple.rs b/plugin/rust/src/api/simple.rs index d4bc30fd..adb69516 100644 --- a/plugin/rust/src/api/simple.rs +++ b/plugin/rust/src/api/simple.rs @@ -1,3 +1,3 @@ -pub fn simple_adder_twin_normal(a: i32, b: i32) -> i32 { - a + b -} +pub fn simple_adder_twin_normal(a: i32, b: i32) -> i32 { + a + b +} diff --git a/plugin/rust/src/lib.rs b/plugin/rust/src/lib.rs index 93606027..0d9a3d92 100644 --- a/plugin/rust/src/lib.rs +++ b/plugin/rust/src/lib.rs @@ -1,2 +1,2 @@ -pub mod api; -mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ +pub mod api; +mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */ diff --git a/rust-toolchain.toml b/rust-toolchain.toml index bafe2080..681e7c7c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,17 +1,17 @@ -[toolchain] -channel = "1.96.0" -components = ["rustfmt"] -targets = [ - "armv7-linux-androideabi", - "aarch64-linux-android", - "x86_64-linux-android", - "aarch64-apple-ios", - "aarch64-apple-ios-sim", - "x86_64-apple-ios", - "aarch64-pc-windows-msvc", - "x86_64-pc-windows-msvc", - "aarch64-unknown-linux-gnu", - "x86_64-unknown-linux-gnu", - "aarch64-apple-darwin", - "x86_64-apple-darwin", -] +[toolchain] +channel = "1.96.0" +components = ["rustfmt"] +targets = [ + "armv7-linux-androideabi", + "aarch64-linux-android", + "x86_64-linux-android", + "aarch64-apple-ios", + "aarch64-apple-ios-sim", + "x86_64-apple-ios", + "aarch64-pc-windows-msvc", + "x86_64-pc-windows-msvc", + "aarch64-unknown-linux-gnu", + "x86_64-unknown-linux-gnu", + "aarch64-apple-darwin", + "x86_64-apple-darwin", +] diff --git a/server/LICENSE b/server/LICENSE index 7a4a3ea2..9b5e4019 100644 --- a/server/LICENSE +++ b/server/LICENSE @@ -1,202 +1,202 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and limitations under the License. \ No newline at end of file diff --git a/server/README.md b/server/README.md index ff4a1d8d..3fc341fb 100644 --- a/server/README.md +++ b/server/README.md @@ -1,66 +1,66 @@ -# Setonix Server - -This is the standalone server part of the Setonix game. -Read more [here](../README.md). - -## Use as a library - -You can use the server as a library in your own project. -Put the following in your `pubspec.yaml`: - -```yaml -dependencies: - setonix_server: - git: - url: git://github.com/LinwoodDev/Setonix.git - ref: - path: server -``` - -And then you can use the server in your code: - -```dart -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments); -} -``` - -## Configure - -You can configure the server by providing an onLoad function that will be called before the server starts. - -```dart -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments, onLoad); -} - -Future onLoad(SetonixServer server) async { - print("on load was called"); - // Add your custom code here - bool toggleCancel = false; - // Put the event you want to listen to in the brackets - server.eventSystem.on().listen((e) { - print("Listener was called, cancel: $toggleCancel"); - // Cancel the event every second time and duplicate the objects instead - if (toggleCancel) { - final event = e.clientEvent; - final table = e.getTableOrDefault(event.table); - final cell = table.getCell(event.from); - final objects = List.from(table.getCell(event.to).objects); - for (final index in event.objects) { - final object = cell.objects[index]; - objects.add(object); - } - // Send the event to all clients - e.sendEvent(ObjectsSpawned(e.clientEvent.table, {event.to: objects})); - // Cancel the event - e.cancel(); - } - toggleCancel = !toggleCancel; - }); -} -``` +# Setonix Server + +This is the standalone server part of the Setonix game. +Read more [here](../README.md). + +## Use as a library + +You can use the server as a library in your own project. +Put the following in your `pubspec.yaml`: + +```yaml +dependencies: + setonix_server: + git: + url: git://github.com/LinwoodDev/Setonix.git + ref: + path: server +``` + +And then you can use the server in your code: + +```dart +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments); +} +``` + +## Configure + +You can configure the server by providing an onLoad function that will be called before the server starts. + +```dart +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments, onLoad); +} + +Future onLoad(SetonixServer server) async { + print("on load was called"); + // Add your custom code here + bool toggleCancel = false; + // Put the event you want to listen to in the brackets + server.eventSystem.on().listen((e) { + print("Listener was called, cancel: $toggleCancel"); + // Cancel the event every second time and duplicate the objects instead + if (toggleCancel) { + final event = e.clientEvent; + final table = e.getTableOrDefault(event.table); + final cell = table.getCell(event.from); + final objects = List.from(table.getCell(event.to).objects); + for (final index in event.objects) { + final object = cell.objects[index]; + objects.add(object); + } + // Send the event to all clients + e.sendEvent(ObjectsSpawned(e.clientEvent.table, {event.to: objects})); + // Cancel the event + e.cancel(); + } + toggleCancel = !toggleCancel; + }); +} +``` diff --git a/server/analysis_options.yaml b/server/analysis_options.yaml index dee8927a..2be5f100 100644 --- a/server/analysis_options.yaml +++ b/server/analysis_options.yaml @@ -1,30 +1,30 @@ -# This file configures the static analysis results for your project (errors, -# warnings, and lints). -# -# This enables the 'recommended' set of lints from `package:lints`. -# This set helps identify many issues that may lead to problems when running -# or consuming Dart code, and enforces writing Dart using a single, idiomatic -# style and format. -# -# If you want a smaller set of lints you can change this to specify -# 'package:lints/core.yaml'. These are just the most critical lints -# (the recommended set includes the core lints). -# The core lints are also what is used by pub.dev for scoring packages. - -include: package:lints/recommended.yaml - -# Uncomment the following section to specify additional rules. - -# linter: -# rules: -# - camel_case_types - -# analyzer: -# exclude: -# - path/to/excluded/files/** - -# For more information about the core and recommended set of lints, see -# https://dart.dev/go/core-lints - -# For additional information about configuring this file, see -# https://dart.dev/guides/language/analysis-options +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/server/bin/setonix_server.dart b/server/bin/setonix_server.dart index fedc2d0e..0efa0ad3 100644 --- a/server/bin/setonix_server.dart +++ b/server/bin/setonix_server.dart @@ -1,5 +1,5 @@ -import 'package:setonix_server/src/main.dart'; - -Future main(List arguments) { - return runServer(arguments); -} +import 'package:setonix_server/src/main.dart'; + +Future main(List arguments) { + return runServer(arguments); +} diff --git a/server/build.yaml b/server/build.yaml index f6aa65e2..cb9dcd92 100644 --- a/server/build.yaml +++ b/server/build.yaml @@ -1,4 +1,4 @@ -global_options: - dart_mappable_builder: - options: - useNodoc: true +global_options: + dart_mappable_builder: + options: + useNodoc: true diff --git a/server/example/dialog.dart b/server/example/dialog.dart index c0a9a04e..87b27c05 100644 --- a/server/example/dialog.dart +++ b/server/example/dialog.dart @@ -1,75 +1,75 @@ -import 'dart:io'; - -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments, onLoad); -} - -// AI generated test text -const testContent = """ -## The Importance of Programming in Today's World - -Programming, once a niche skill, has become an essential tool in almost every industry. From healthcare to finance, from education to entertainment, programming underpins the technologies that drive our modern world. This article will explore the significance of programming in today's society. - -### 1. Technological Innovation -* **Driving Progress:** Programming is the catalyst for technological advancements. It's the language used to create new software, apps, and systems that improve our lives. -* **Automation and Efficiency:** Programming enables automation, streamlining tasks and increasing efficiency across various sectors. -* **Problem Solving:** Programmers are skilled problem solvers, developing innovative solutions to complex challenges. - -### 2. Economic Growth -* **Job Creation:** The programming industry has created numerous high-paying jobs, contributing significantly to economic growth. -* **Competitive Advantage:** Businesses that embrace programming and technology often have a competitive edge in the marketplace. -* **Digital Transformation:** Programming is essential for digital transformation, helping companies adapt to the changing technological landscape. - -### 3. Education and Research -* **Learning Tools:** Programming is used to create educational software, games, and simulations, making learning more engaging and effective. -* **Research Tools:** Researchers rely on programming to analyze data, develop models, and conduct experiments. -* **Accessibility:** Programming can be used to create assistive technologies for people with disabilities, promoting inclusivity. - -### 4. Global Connectivity -* **Communication and Collaboration:** Programming powers the internet and social media platforms, facilitating global communication and collaboration. -* **E-commerce:** Programming is essential for online shopping and e-commerce platforms, driving economic activity worldwide. -* **Remote Work:** Programming enables remote work, fostering a more flexible and global workforce. - -### 5. Creativity and Innovation -* **Digital Art and Design:** Programming is used to create digital art, animations, and interactive experiences. -* **Game Development:** Programmers play a crucial role in developing video games, a popular form of entertainment. -* **New Possibilities:** Programming allows for the creation of entirely new products, services, and industries. - -In conclusion, programming has become an indispensable skill in the modern world. It drives technological innovation, fuels economic growth, supports education and research, enables global connectivity, and fosters creativity. As technology continues to evolve, the importance of programming will only increase. -"""; - -Future onLoad(SetonixServer server) async { - print("on load was called"); - final image = await File("../app/images/logo.png").readAsBytes(); - server.process(ImagesUpdated.single('logo', image)); - server.defaultEventSystem - ..on((e) { - print("Listener was called, opening dialog"); - server.sendEvent( - DialogOpened( - GameDialog(id: "testDialog", title: "TestDialog", image: "logo") - .markdown(testContent) - .textField( - "TestTextField", - id: "testTextField", - placeholder: "TestPlaceholder", - multiline: true, - password: true, - ) - .action(GameDialogButton("TestButton")), - ), - ); - }) - ..on((e) { - print("play joined"); - }) - ..on((e) { - final value = e.clientEvent.value; - print("Dialog ${e.clientEvent.id} closed, got ${e.clientEvent.value}"); - if (value != null) { - e.cancel(); - } - }); -} +import 'dart:io'; + +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments, onLoad); +} + +// AI generated test text +const testContent = """ +## The Importance of Programming in Today's World + +Programming, once a niche skill, has become an essential tool in almost every industry. From healthcare to finance, from education to entertainment, programming underpins the technologies that drive our modern world. This article will explore the significance of programming in today's society. + +### 1. Technological Innovation +* **Driving Progress:** Programming is the catalyst for technological advancements. It's the language used to create new software, apps, and systems that improve our lives. +* **Automation and Efficiency:** Programming enables automation, streamlining tasks and increasing efficiency across various sectors. +* **Problem Solving:** Programmers are skilled problem solvers, developing innovative solutions to complex challenges. + +### 2. Economic Growth +* **Job Creation:** The programming industry has created numerous high-paying jobs, contributing significantly to economic growth. +* **Competitive Advantage:** Businesses that embrace programming and technology often have a competitive edge in the marketplace. +* **Digital Transformation:** Programming is essential for digital transformation, helping companies adapt to the changing technological landscape. + +### 3. Education and Research +* **Learning Tools:** Programming is used to create educational software, games, and simulations, making learning more engaging and effective. +* **Research Tools:** Researchers rely on programming to analyze data, develop models, and conduct experiments. +* **Accessibility:** Programming can be used to create assistive technologies for people with disabilities, promoting inclusivity. + +### 4. Global Connectivity +* **Communication and Collaboration:** Programming powers the internet and social media platforms, facilitating global communication and collaboration. +* **E-commerce:** Programming is essential for online shopping and e-commerce platforms, driving economic activity worldwide. +* **Remote Work:** Programming enables remote work, fostering a more flexible and global workforce. + +### 5. Creativity and Innovation +* **Digital Art and Design:** Programming is used to create digital art, animations, and interactive experiences. +* **Game Development:** Programmers play a crucial role in developing video games, a popular form of entertainment. +* **New Possibilities:** Programming allows for the creation of entirely new products, services, and industries. + +In conclusion, programming has become an indispensable skill in the modern world. It drives technological innovation, fuels economic growth, supports education and research, enables global connectivity, and fosters creativity. As technology continues to evolve, the importance of programming will only increase. +"""; + +Future onLoad(SetonixServer server) async { + print("on load was called"); + final image = await File("../app/images/logo.png").readAsBytes(); + server.process(ImagesUpdated.single('logo', image)); + server.defaultEventSystem + ..on((e) { + print("Listener was called, opening dialog"); + server.sendEvent( + DialogOpened( + GameDialog(id: "testDialog", title: "TestDialog", image: "logo") + .markdown(testContent) + .textField( + "TestTextField", + id: "testTextField", + placeholder: "TestPlaceholder", + multiline: true, + password: true, + ) + .action(GameDialogButton("TestButton")), + ), + ); + }) + ..on((e) { + print("play joined"); + }) + ..on((e) { + final value = e.clientEvent.value; + print("Dialog ${e.clientEvent.id} closed, got ${e.clientEvent.value}"); + if (value != null) { + e.cancel(); + } + }); +} diff --git a/server/example/duplicate.dart b/server/example/duplicate.dart index a0ad7f7e..c00b83d8 100644 --- a/server/example/duplicate.dart +++ b/server/example/duplicate.dart @@ -1,33 +1,33 @@ -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments, onLoad); -} - -Future onLoad(SetonixServer server) async { - print("on load was called"); - // Add your custom code here - bool toggleCancel = false; - // Put the event you want to listen to in the brackets - server.defaultEventSystem.on((e) { - print("Listener was called, cancel: $toggleCancel"); - // Cancel the event every second time and duplicate the objects instead - if (toggleCancel) { - final event = e.clientEvent; - final table = server.defaultState.getTableOrDefault(event.table); - final cell = table.getCell(event.from); - final objects = []; - for (final index in event.objects) { - final object = cell.objects[index]; - objects.add(object); - } - // Send the event to all clients - server.sendEvent( - ObjectsSpawned(e.clientEvent.table, {event.to: objects}), - ); - // Cancel the event - e.cancel(); - } - toggleCancel = !toggleCancel; - }); -} +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments, onLoad); +} + +Future onLoad(SetonixServer server) async { + print("on load was called"); + // Add your custom code here + bool toggleCancel = false; + // Put the event you want to listen to in the brackets + server.defaultEventSystem.on((e) { + print("Listener was called, cancel: $toggleCancel"); + // Cancel the event every second time and duplicate the objects instead + if (toggleCancel) { + final event = e.clientEvent; + final table = server.defaultState.getTableOrDefault(event.table); + final cell = table.getCell(event.from); + final objects = []; + for (final index in event.objects) { + final object = cell.objects[index]; + objects.add(object); + } + // Send the event to all clients + server.sendEvent( + ObjectsSpawned(e.clientEvent.table, {event.to: objects}), + ); + // Cancel the event + e.cancel(); + } + toggleCancel = !toggleCancel; + }); +} diff --git a/server/example/join.dart b/server/example/join.dart index 502a607b..d5b7c75a 100644 --- a/server/example/join.dart +++ b/server/example/join.dart @@ -1,37 +1,37 @@ -import 'package:setonix_server/setonix_server.dart'; - -Future main(List arguments) { - return runServer(arguments, onLoad); -} - -Future onLoad(SetonixServer server) async { - print("on load was called"); - server.defaultEventSystem - ..on((e) { - server.sendEvent( - DialogOpened( - GameDialog(id: "joinDialog", title: "Please login") - .textField("Username", id: "username") - .textField("Password", id: "password", password: true) - .action(GameDialogButton("Login", id: "login")) - .action(GameDialogButton("Register", id: "register")), - ), - ); - }) - ..on((e) { - final event = e.clientEvent; - if (event.id == "joinDialog") { - if (event.value?.buttonPressed == "login") { - print("successfully logged in"); - } else { - e.cancel(); - } - } - }) - ..on((e) { - final event = e.clientEvent; - if (event.message == "apple") { - e.cancel(); - } - }); -} +import 'package:setonix_server/setonix_server.dart'; + +Future main(List arguments) { + return runServer(arguments, onLoad); +} + +Future onLoad(SetonixServer server) async { + print("on load was called"); + server.defaultEventSystem + ..on((e) { + server.sendEvent( + DialogOpened( + GameDialog(id: "joinDialog", title: "Please login") + .textField("Username", id: "username") + .textField("Password", id: "password", password: true) + .action(GameDialogButton("Login", id: "login")) + .action(GameDialogButton("Register", id: "register")), + ), + ); + }) + ..on((e) { + final event = e.clientEvent; + if (event.id == "joinDialog") { + if (event.value?.buttonPressed == "login") { + print("successfully logged in"); + } else { + e.cancel(); + } + } + }) + ..on((e) { + final event = e.clientEvent; + if (event.message == "apple") { + e.cancel(); + } + }); +} diff --git a/server/lib/events.dart b/server/lib/events.dart index f4c56d24..e6d10746 100644 --- a/server/lib/events.dart +++ b/server/lib/events.dart @@ -1,4 +1,4 @@ -/// Official setonix server library -library; - -export 'package:setonix_api/event.dart'; +/// Official setonix server library +library; + +export 'package:setonix_api/event.dart'; diff --git a/server/lib/setonix_server.dart b/server/lib/setonix_server.dart index cc7ad2d2..18cb5e5e 100644 --- a/server/lib/setonix_server.dart +++ b/server/lib/setonix_server.dart @@ -1,18 +1,18 @@ -/// Official setonix server library -library; - -export 'package:setonix_api/setonix_api.dart'; -export 'package:setonix_plugin/setonix_plugin.dart'; -export 'src/asset.dart'; -export 'src/bloc.dart'; -export 'src/main.dart'; -export 'src/server.dart'; -export 'src/programs/kick.dart'; -export 'src/programs/packs.dart'; -export 'src/programs/players.dart'; -export 'src/programs/reset.dart'; -export 'src/programs/save.dart'; -export 'src/programs/say.dart'; -export 'src/programs/stop.dart'; -export 'src/programs/whitelist.dart'; -export 'package:networker/networker.dart'; +/// Official setonix server library +library; + +export 'package:setonix_api/setonix_api.dart'; +export 'package:setonix_plugin/setonix_plugin.dart'; +export 'src/asset.dart'; +export 'src/bloc.dart'; +export 'src/main.dart'; +export 'src/server.dart'; +export 'src/programs/kick.dart'; +export 'src/programs/packs.dart'; +export 'src/programs/players.dart'; +export 'src/programs/reset.dart'; +export 'src/programs/save.dart'; +export 'src/programs/say.dart'; +export 'src/programs/stop.dart'; +export 'src/programs/whitelist.dart'; +export 'package:networker/networker.dart'; diff --git a/server/lib/src/asset.dart b/server/lib/src/asset.dart index 03057285..fe0185a9 100644 --- a/server/lib/src/asset.dart +++ b/server/lib/src/asset.dart @@ -1,102 +1,102 @@ -import 'dart:io'; - -import 'package:consoler/consoler.dart'; -import 'package:dart_mappable/dart_mappable.dart'; -import 'package:path/path.dart' as p; -import 'package:setonix_api/setonix_api.dart'; - -part 'asset.mapper.dart'; - -@MappableClass() -final class ServerDataMetadata with ServerDataMetadataMappable { - final List downloadUrls; - - ServerDataMetadata({required this.downloadUrls}); -} - -class ServerAssetManager extends AssetManager { - final Map _packs = {}; - final Map _metadata = {}; - - static const _stnxExtension = 'stnx'; - static const _metadataExtension = 'json'; - - @override - Iterable> get packs => _packs.entries; - - Future init({ - required Consoler console, - bool verbose = false, - String rootPath = '.', - }) async { - _packs.clear(); - final directory = Directory(p.join(rootPath, 'packs')); - if (!await directory.exists()) { - await directory.create(); - console.print( - 'WARNING: No packs directory found. Please add packs to the server.', - level: LogLevel.warning, - ); - } - await for (final file in directory.list()) { - if (file is File) { - final fileName = p.basename(file.path); - final extension = fileName.split('.').last; - if (extension != _stnxExtension && extension != _metadataExtension) { - console.print( - 'WARNING: Invalid pack file extension: $fileName. Skipping.', - level: LogLevel.warning, - ); - continue; - } - var name = fileName.substring( - 0, - fileName.length - _stnxExtension.length - 1, - ); - if (name.isEmpty) name = kCorePackId; - if (extension == _stnxExtension) { - final data = SetonixData.fromData(await file.readAsBytes()); - _packs[name] = data; - } else { - final metadata = ServerDataMetadataMapper.fromJson( - await file.readAsString(), - ); - _metadata[name] = metadata; - } - } - } - final coreIncluded = _packs.containsKey(kCorePackId); - console.print( - 'Loaded ${_packs.length} pack(s). ${coreIncluded ? '(with core pack)' : '(without core pack)'}', - level: LogLevel.info, - ); - if (_packs.isEmpty) { - console.print('No packs loaded.', level: LogLevel.warning); - } else { - console.print( - 'Loaded pack(s): ${_packs.keys.join(', ')}', - level: LogLevel.verbose, - ); - } - } - - @override - SetonixData? getPack(String key) => _packs[key]; - - @override - bool hasPack(String key) => _packs.containsKey(key); - - @override - List? getDownloadUrls(String id) => _metadata[id]?.downloadUrls; - - Iterable getPackIds() => _packs.entries.map( - (e) => e.key == kCorePackId ? kCorePackId : e.value.identifier, - ); - - String? getPackId(String name) { - if (name == kCorePackId) return kCorePackId; - return _packs[name]?.identifier; - } - - String getPackIdOrDefault(String name) => getPackId(name) ?? name; -} +import 'dart:io'; + +import 'package:consoler/consoler.dart'; +import 'package:dart_mappable/dart_mappable.dart'; +import 'package:path/path.dart' as p; +import 'package:setonix_api/setonix_api.dart'; + +part 'asset.mapper.dart'; + +@MappableClass() +final class ServerDataMetadata with ServerDataMetadataMappable { + final List downloadUrls; + + ServerDataMetadata({required this.downloadUrls}); +} + +class ServerAssetManager extends AssetManager { + final Map _packs = {}; + final Map _metadata = {}; + + static const _stnxExtension = 'stnx'; + static const _metadataExtension = 'json'; + + @override + Iterable> get packs => _packs.entries; + + Future init({ + required Consoler console, + bool verbose = false, + String rootPath = '.', + }) async { + _packs.clear(); + final directory = Directory(p.join(rootPath, 'packs')); + if (!await directory.exists()) { + await directory.create(); + console.print( + 'WARNING: No packs directory found. Please add packs to the server.', + level: LogLevel.warning, + ); + } + await for (final file in directory.list()) { + if (file is File) { + final fileName = p.basename(file.path); + final extension = fileName.split('.').last; + if (extension != _stnxExtension && extension != _metadataExtension) { + console.print( + 'WARNING: Invalid pack file extension: $fileName. Skipping.', + level: LogLevel.warning, + ); + continue; + } + var name = fileName.substring( + 0, + fileName.length - _stnxExtension.length - 1, + ); + if (name.isEmpty) name = kCorePackId; + if (extension == _stnxExtension) { + final data = SetonixData.fromData(await file.readAsBytes()); + _packs[name] = data; + } else { + final metadata = ServerDataMetadataMapper.fromJson( + await file.readAsString(), + ); + _metadata[name] = metadata; + } + } + } + final coreIncluded = _packs.containsKey(kCorePackId); + console.print( + 'Loaded ${_packs.length} pack(s). ${coreIncluded ? '(with core pack)' : '(without core pack)'}', + level: LogLevel.info, + ); + if (_packs.isEmpty) { + console.print('No packs loaded.', level: LogLevel.warning); + } else { + console.print( + 'Loaded pack(s): ${_packs.keys.join(', ')}', + level: LogLevel.verbose, + ); + } + } + + @override + SetonixData? getPack(String key) => _packs[key]; + + @override + bool hasPack(String key) => _packs.containsKey(key); + + @override + List? getDownloadUrls(String id) => _metadata[id]?.downloadUrls; + + Iterable getPackIds() => _packs.entries.map( + (e) => e.key == kCorePackId ? kCorePackId : e.value.identifier, + ); + + String? getPackId(String name) { + if (name == kCorePackId) return kCorePackId; + return _packs[name]?.identifier; + } + + String getPackIdOrDefault(String name) => getPackId(name) ?? name; +} diff --git a/server/lib/src/asset.mapper.dart b/server/lib/src/asset.mapper.dart index 45e6d2fb..3785e925 100644 --- a/server/lib/src/asset.mapper.dart +++ b/server/lib/src/asset.mapper.dart @@ -1,152 +1,152 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off -// ignore_for_file: type=lint -// ignore_for_file: invalid_use_of_protected_member -// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member -// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter - -part of 'asset.dart'; - -/// @nodoc -class ServerDataMetadataMapper extends ClassMapperBase { - ServerDataMetadataMapper._(); - - static ServerDataMetadataMapper? _instance; - static ServerDataMetadataMapper ensureInitialized() { - if (_instance == null) { - MapperContainer.globals.use(_instance = ServerDataMetadataMapper._()); - } - return _instance!; - } - - @override - final String id = 'ServerDataMetadata'; - - static List _$downloadUrls(ServerDataMetadata v) => v.downloadUrls; - static const Field> _f$downloadUrls = Field( - 'downloadUrls', - _$downloadUrls, - ); - - @override - final MappableFields fields = const { - #downloadUrls: _f$downloadUrls, - }; - - static ServerDataMetadata _instantiate(DecodingData data) { - return ServerDataMetadata(downloadUrls: data.dec(_f$downloadUrls)); - } - - @override - final Function instantiate = _instantiate; - - static ServerDataMetadata fromMap(Map map) { - return ensureInitialized().decodeMap(map); - } - - static ServerDataMetadata fromJson(String json) { - return ensureInitialized().decodeJson(json); - } -} - -/// @nodoc -mixin ServerDataMetadataMappable { - String toJson() { - return ServerDataMetadataMapper.ensureInitialized() - .encodeJson(this as ServerDataMetadata); - } - - Map toMap() { - return ServerDataMetadataMapper.ensureInitialized() - .encodeMap(this as ServerDataMetadata); - } - - ServerDataMetadataCopyWith< - ServerDataMetadata, - ServerDataMetadata, - ServerDataMetadata - > - get copyWith => - _ServerDataMetadataCopyWithImpl( - this as ServerDataMetadata, - $identity, - $identity, - ); - @override - String toString() { - return ServerDataMetadataMapper.ensureInitialized().stringifyValue( - this as ServerDataMetadata, - ); - } - - @override - bool operator ==(Object other) { - return ServerDataMetadataMapper.ensureInitialized().equalsValue( - this as ServerDataMetadata, - other, - ); - } - - @override - int get hashCode { - return ServerDataMetadataMapper.ensureInitialized().hashValue( - this as ServerDataMetadata, - ); - } -} - -/// @nodoc -extension ServerDataMetadataValueCopy<$R, $Out> - on ObjectCopyWith<$R, ServerDataMetadata, $Out> { - ServerDataMetadataCopyWith<$R, ServerDataMetadata, $Out> - get $asServerDataMetadata => $base.as( - (v, t, t2) => _ServerDataMetadataCopyWithImpl<$R, $Out>(v, t, t2), - ); -} - -/// @nodoc -abstract class ServerDataMetadataCopyWith< - $R, - $In extends ServerDataMetadata, - $Out -> - implements ClassCopyWith<$R, $In, $Out> { - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get downloadUrls; - $R call({List? downloadUrls}); - ServerDataMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ); -} - -/// @nodoc -class _ServerDataMetadataCopyWithImpl<$R, $Out> - extends ClassCopyWithBase<$R, ServerDataMetadata, $Out> - implements ServerDataMetadataCopyWith<$R, ServerDataMetadata, $Out> { - _ServerDataMetadataCopyWithImpl(super.value, super.then, super.then2); - - @override - late final ClassMapperBase $mapper = - ServerDataMetadataMapper.ensureInitialized(); - @override - ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> - get downloadUrls => ListCopyWith( - $value.downloadUrls, - (v, t) => ObjectCopyWith(v, $identity, t), - (v) => call(downloadUrls: v), - ); - @override - $R call({List? downloadUrls}) => $apply( - FieldCopyWithData({if (downloadUrls != null) #downloadUrls: downloadUrls}), - ); - @override - ServerDataMetadata $make(CopyWithData data) => ServerDataMetadata( - downloadUrls: data.get(#downloadUrls, or: $value.downloadUrls), - ); - - @override - ServerDataMetadataCopyWith<$R2, ServerDataMetadata, $Out2> $chain<$R2, $Out2>( - Then<$Out2, $R2> t, - ) => _ServerDataMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); -} - +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// dart format off +// ignore_for_file: type=lint +// ignore_for_file: invalid_use_of_protected_member +// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member +// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter + +part of 'asset.dart'; + +/// @nodoc +class ServerDataMetadataMapper extends ClassMapperBase { + ServerDataMetadataMapper._(); + + static ServerDataMetadataMapper? _instance; + static ServerDataMetadataMapper ensureInitialized() { + if (_instance == null) { + MapperContainer.globals.use(_instance = ServerDataMetadataMapper._()); + } + return _instance!; + } + + @override + final String id = 'ServerDataMetadata'; + + static List _$downloadUrls(ServerDataMetadata v) => v.downloadUrls; + static const Field> _f$downloadUrls = Field( + 'downloadUrls', + _$downloadUrls, + ); + + @override + final MappableFields fields = const { + #downloadUrls: _f$downloadUrls, + }; + + static ServerDataMetadata _instantiate(DecodingData data) { + return ServerDataMetadata(downloadUrls: data.dec(_f$downloadUrls)); + } + + @override + final Function instantiate = _instantiate; + + static ServerDataMetadata fromMap(Map map) { + return ensureInitialized().decodeMap(map); + } + + static ServerDataMetadata fromJson(String json) { + return ensureInitialized().decodeJson(json); + } +} + +/// @nodoc +mixin ServerDataMetadataMappable { + String toJson() { + return ServerDataMetadataMapper.ensureInitialized() + .encodeJson(this as ServerDataMetadata); + } + + Map toMap() { + return ServerDataMetadataMapper.ensureInitialized() + .encodeMap(this as ServerDataMetadata); + } + + ServerDataMetadataCopyWith< + ServerDataMetadata, + ServerDataMetadata, + ServerDataMetadata + > + get copyWith => + _ServerDataMetadataCopyWithImpl( + this as ServerDataMetadata, + $identity, + $identity, + ); + @override + String toString() { + return ServerDataMetadataMapper.ensureInitialized().stringifyValue( + this as ServerDataMetadata, + ); + } + + @override + bool operator ==(Object other) { + return ServerDataMetadataMapper.ensureInitialized().equalsValue( + this as ServerDataMetadata, + other, + ); + } + + @override + int get hashCode { + return ServerDataMetadataMapper.ensureInitialized().hashValue( + this as ServerDataMetadata, + ); + } +} + +/// @nodoc +extension ServerDataMetadataValueCopy<$R, $Out> + on ObjectCopyWith<$R, ServerDataMetadata, $Out> { + ServerDataMetadataCopyWith<$R, ServerDataMetadata, $Out> + get $asServerDataMetadata => $base.as( + (v, t, t2) => _ServerDataMetadataCopyWithImpl<$R, $Out>(v, t, t2), + ); +} + +/// @nodoc +abstract class ServerDataMetadataCopyWith< + $R, + $In extends ServerDataMetadata, + $Out +> + implements ClassCopyWith<$R, $In, $Out> { + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> get downloadUrls; + $R call({List? downloadUrls}); + ServerDataMetadataCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ); +} + +/// @nodoc +class _ServerDataMetadataCopyWithImpl<$R, $Out> + extends ClassCopyWithBase<$R, ServerDataMetadata, $Out> + implements ServerDataMetadataCopyWith<$R, ServerDataMetadata, $Out> { + _ServerDataMetadataCopyWithImpl(super.value, super.then, super.then2); + + @override + late final ClassMapperBase $mapper = + ServerDataMetadataMapper.ensureInitialized(); + @override + ListCopyWith<$R, String, ObjectCopyWith<$R, String, String>> + get downloadUrls => ListCopyWith( + $value.downloadUrls, + (v, t) => ObjectCopyWith(v, $identity, t), + (v) => call(downloadUrls: v), + ); + @override + $R call({List? downloadUrls}) => $apply( + FieldCopyWithData({if (downloadUrls != null) #downloadUrls: downloadUrls}), + ); + @override + ServerDataMetadata $make(CopyWithData data) => ServerDataMetadata( + downloadUrls: data.get(#downloadUrls, or: $value.downloadUrls), + ); + + @override + ServerDataMetadataCopyWith<$R2, ServerDataMetadata, $Out2> $chain<$R2, $Out2>( + Then<$Out2, $R2> t, + ) => _ServerDataMetadataCopyWithImpl<$R2, $Out2>($value, $cast, t); +} + diff --git a/server/lib/src/programs/kick.dart b/server/lib/src/programs/kick.dart index 175b7f00..2c9851d9 100644 --- a/server/lib/src/programs/kick.dart +++ b/server/lib/src/programs/kick.dart @@ -1,39 +1,39 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_api/event.dart'; -import 'package:setonix_server/src/server.dart'; - -class KickProgram extends ConsoleProgram { - final SetonixServer server; - - KickProgram(this.server); - - @override - String getDescription() => "Kick a player"; - - @override - String getUsage() => ' [] []'; - - @override - Future run(String label, List args) async { - if (args.isEmpty || args.length > 3) { - server.log("Wrong usage, use ${getUsage()}", level: LogLevel.error); - } - final arg = await server.userManager.getUserIdByReference(args[0]); - if (arg == null) { - server.log("ID should be a number", level: LogLevel.error); - return; - } - KickMessage? reason; - if (args.length > 1) { - final reasonText = args[1]; - final link = args.length > 2 ? args[2] : null; - reason = KickMessage(message: reasonText, link: link); - } - final result = server.kick(arg, reason); - if (result) { - server.log("$arg successfully kicked.", level: LogLevel.info); - } else { - server.log("$arg could not be kicked.", level: LogLevel.error); - } - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_api/event.dart'; +import 'package:setonix_server/src/server.dart'; + +class KickProgram extends ConsoleProgram { + final SetonixServer server; + + KickProgram(this.server); + + @override + String getDescription() => "Kick a player"; + + @override + String getUsage() => ' [] []'; + + @override + Future run(String label, List args) async { + if (args.isEmpty || args.length > 3) { + server.log("Wrong usage, use ${getUsage()}", level: LogLevel.error); + } + final arg = await server.userManager.getUserIdByReference(args[0]); + if (arg == null) { + server.log("ID should be a number", level: LogLevel.error); + return; + } + KickMessage? reason; + if (args.length > 1) { + final reasonText = args[1]; + final link = args.length > 2 ? args[2] : null; + reason = KickMessage(message: reasonText, link: link); + } + final result = server.kick(arg, reason); + if (result) { + server.log("$arg successfully kicked.", level: LogLevel.info); + } else { + server.log("$arg could not be kicked.", level: LogLevel.error); + } + } +} diff --git a/server/lib/src/programs/packs.dart b/server/lib/src/programs/packs.dart index d6b73520..91540392 100644 --- a/server/lib/src/programs/packs.dart +++ b/server/lib/src/programs/packs.dart @@ -1,28 +1,28 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_api/setonix_api.dart'; -import 'package:setonix_server/src/server.dart'; - -class PacksProgram extends ConsoleProgram { - final SetonixServer server; - - PacksProgram(this.server); - - @override - String getDescription() => "Show all loaded packs"; - - @override - void run(String label, List args) { - print("-----"); - final packs = server.assetManager.packs.toList(); - print("Loaded ${packs.length} pack(s)."); - for (final pack in packs) { - final checksum = pack.value.identifier; - if (pack.key == kCorePackId) { - print("| Core pack ($checksum)"); - } else { - print("> ${pack.key} ($checksum)"); - } - } - print("-----"); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_api/setonix_api.dart'; +import 'package:setonix_server/src/server.dart'; + +class PacksProgram extends ConsoleProgram { + final SetonixServer server; + + PacksProgram(this.server); + + @override + String getDescription() => "Show all loaded packs"; + + @override + void run(String label, List args) { + print("-----"); + final packs = server.assetManager.packs.toList(); + print("Loaded ${packs.length} pack(s)."); + for (final pack in packs) { + final checksum = pack.value.identifier; + if (pack.key == kCorePackId) { + print("| Core pack ($checksum)"); + } else { + print("> ${pack.key} ($checksum)"); + } + } + print("-----"); + } +} diff --git a/server/lib/src/programs/players.dart b/server/lib/src/programs/players.dart index bde3945a..32e3a54a 100644 --- a/server/lib/src/programs/players.dart +++ b/server/lib/src/programs/players.dart @@ -1,25 +1,25 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_server/src/server.dart'; - -class PlayersProgram extends ConsoleProgram { - final SetonixServer server; - - PlayersProgram(this.server); - - @override - String getDescription() => "Show all connected players"; - - @override - void run(String label, List args) { - print("-----"); - final players = server.userManager.getUsers(); - print("${players.length} player(s) connected."); - for (final player in players) { - final connectionInfo = server.players[player.key]; - print( - "${connectionInfo?.address} | #${player.key}) | @${player.value.name} | *${player.value.fingerprint ?? 'No Fingerprint'}", - ); - } - print("-----"); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_server/src/server.dart'; + +class PlayersProgram extends ConsoleProgram { + final SetonixServer server; + + PlayersProgram(this.server); + + @override + String getDescription() => "Show all connected players"; + + @override + void run(String label, List args) { + print("-----"); + final players = server.userManager.getUsers(); + print("${players.length} player(s) connected."); + for (final player in players) { + final connectionInfo = server.players[player.key]; + print( + "${connectionInfo?.address} | #${player.key}) | @${player.value.name} | *${player.value.fingerprint ?? 'No Fingerprint'}", + ); + } + print("-----"); + } +} diff --git a/server/lib/src/programs/reset.dart b/server/lib/src/programs/reset.dart index 0e6f67b0..bd9342c0 100644 --- a/server/lib/src/programs/reset.dart +++ b/server/lib/src/programs/reset.dart @@ -1,26 +1,26 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_server/setonix_server.dart'; - -class ResetProgram extends ConsoleProgram { - final SetonixServer server; - - ResetProgram(this.server); - - @override - String getDescription() => - "Reset the world. Specify a game mode to allow playing games."; - - @override - String getUsage() => '[]'; - - @override - Future run(String label, List args) async { - if (args.length > 1) { - server.log("Wrong usage, use ${getUsage()}", level: LogLevel.error); - } - final worldName = args.elementAtOrNull(0) ?? defaultWorldName; - server.log("Resetting world...", level: LogLevel.info); - await server.getWorld(worldName)?.resetWorld(); - server.log("World reset successful", level: LogLevel.info); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_server/setonix_server.dart'; + +class ResetProgram extends ConsoleProgram { + final SetonixServer server; + + ResetProgram(this.server); + + @override + String getDescription() => + "Reset the world. Specify a game mode to allow playing games."; + + @override + String getUsage() => '[]'; + + @override + Future run(String label, List args) async { + if (args.length > 1) { + server.log("Wrong usage, use ${getUsage()}", level: LogLevel.error); + } + final worldName = args.elementAtOrNull(0) ?? defaultWorldName; + server.log("Resetting world...", level: LogLevel.info); + await server.getWorld(worldName)?.resetWorld(); + server.log("World reset successful", level: LogLevel.info); + } +} diff --git a/server/lib/src/programs/save.dart b/server/lib/src/programs/save.dart index a9b5d47f..4537b353 100644 --- a/server/lib/src/programs/save.dart +++ b/server/lib/src/programs/save.dart @@ -1,17 +1,17 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_server/src/server.dart'; - -class SaveProgram extends ConsoleProgram { - final SetonixServer server; - - SaveProgram(this.server); - @override - String getDescription() => "Saves the world manually"; - - @override - Future run(String label, List args) async { - server.consoler.print('Saving...', level: LogLevel.info); - await server.saveAll(force: true); - server.consoler.print('Saved.', level: LogLevel.info); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_server/src/server.dart'; + +class SaveProgram extends ConsoleProgram { + final SetonixServer server; + + SaveProgram(this.server); + @override + String getDescription() => "Saves the world manually"; + + @override + Future run(String label, List args) async { + server.consoler.print('Saving...', level: LogLevel.info); + await server.saveAll(force: true); + server.consoler.print('Saved.', level: LogLevel.info); + } +} diff --git a/server/lib/src/programs/say.dart b/server/lib/src/programs/say.dart index f6a38cca..d1a6ea66 100644 --- a/server/lib/src/programs/say.dart +++ b/server/lib/src/programs/say.dart @@ -1,19 +1,19 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_api/setonix_api.dart'; -import 'package:setonix_server/src/server.dart'; - -class SayProgram extends ConsoleProgram { - final SetonixServer server; - - SayProgram(this.server); - - @override - String getDescription() => "Send a message in the message"; - - @override - Future run(String label, List args) async { - final message = args.join(' '); - server.consoler.print("Sent $message", level: LogLevel.info); - server.process(MessageRequest(message)); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_api/setonix_api.dart'; +import 'package:setonix_server/src/server.dart'; + +class SayProgram extends ConsoleProgram { + final SetonixServer server; + + SayProgram(this.server); + + @override + String getDescription() => "Send a message in the message"; + + @override + Future run(String label, List args) async { + final message = args.join(' '); + server.consoler.print("Sent $message", level: LogLevel.info); + server.process(MessageRequest(message)); + } +} diff --git a/server/lib/src/programs/scripts.dart b/server/lib/src/programs/scripts.dart index 4a577ea2..497a1c91 100644 --- a/server/lib/src/programs/scripts.dart +++ b/server/lib/src/programs/scripts.dart @@ -1,28 +1,28 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_server/setonix_server.dart'; - -class ScriptsProgram extends ConsoleProgram { - final SetonixServer server; - - ScriptsProgram(this.server); - - @override - String getDescription() => "Show all loaded scripts"; - - @override - String getUsage() => "[world]"; - - @override - void run(String label, List args) { - String world = defaultWorldName; - if (args.length > 1) return print("Usage: $label [world]"); - if (args.length == 1) world = args[0]; - print("-----"); - final scripts = server.getWorld(world)?.pluginSystem.plugins.toList() ?? []; - print("Loaded ${scripts.length} script(s)."); - for (final script in scripts) { - print("> $script"); - } - print("-----"); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_server/setonix_server.dart'; + +class ScriptsProgram extends ConsoleProgram { + final SetonixServer server; + + ScriptsProgram(this.server); + + @override + String getDescription() => "Show all loaded scripts"; + + @override + String getUsage() => "[world]"; + + @override + void run(String label, List args) { + String world = defaultWorldName; + if (args.length > 1) return print("Usage: $label [world]"); + if (args.length == 1) world = args[0]; + print("-----"); + final scripts = server.getWorld(world)?.pluginSystem.plugins.toList() ?? []; + print("Loaded ${scripts.length} script(s)."); + for (final script in scripts) { + print("> $script"); + } + print("-----"); + } +} diff --git a/server/lib/src/programs/stop.dart b/server/lib/src/programs/stop.dart index 0cdd0473..31dc40db 100644 --- a/server/lib/src/programs/stop.dart +++ b/server/lib/src/programs/stop.dart @@ -1,15 +1,15 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_server/src/server.dart'; - -class StopProgram extends ConsoleProgram { - final SetonixServer server; - - StopProgram(this.server); - @override - String getDescription() => "Stops the server"; - - @override - void run(String label, List args) { - server.close(); - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_server/src/server.dart'; + +class StopProgram extends ConsoleProgram { + final SetonixServer server; + + StopProgram(this.server); + @override + String getDescription() => "Stops the server"; + + @override + void run(String label, List args) { + server.close(); + } +} diff --git a/server/lib/src/programs/whitelist.dart b/server/lib/src/programs/whitelist.dart index 7e02b79e..04d66597 100644 --- a/server/lib/src/programs/whitelist.dart +++ b/server/lib/src/programs/whitelist.dart @@ -1,71 +1,71 @@ -import 'package:consoler/consoler.dart'; -import 'package:setonix_server/src/server.dart'; - -class WhitelistProgram extends ConsoleProgram { - final SetonixServer server; - - WhitelistProgram(this.server); - - @override - String getUsage() => ' '; - - @override - String getDescription() => - "Add or remove a user from the whitelist. " - "Use 'add ' to add a user and 'remove ' to remove a user."; - - @override - Future run(String label, List args) async { - if (args.length != 2) { - server.log("Wrong usage, use ${getUsage()}", level: LogLevel.error); - return; - } - final action = args[0].toLowerCase(); - final user = await server.userManager.getUserByReference(args[1]); - if (user == null) { - server.log("User not found: ${args[1]}", level: LogLevel.error); - return; - } - final fingerprint = user.fingerprint; - if (fingerprint == null) { - server.log( - "User $user does not have a fingerprint. Cannot add to whitelist.", - level: LogLevel.error, - ); - return; - } - - if (action == 'add') { - final result = await server.userManager.service?.updateUser( - fingerprint, - onWhitelist: true, - ); - if (result != true) { - server.log( - "Failed to add user $user to whitelist", - level: LogLevel.error, - ); - return; - } - server.log("User $user added to whitelist", level: LogLevel.info); - } else if (action == 'remove') { - final result = await server.userManager.service?.updateUser( - fingerprint, - onWhitelist: false, - ); - if (result != true) { - server.log( - "Failed to remove user $user from whitelist", - level: LogLevel.error, - ); - return; - } - server.log("User $user removed from whitelist", level: LogLevel.info); - } else { - server.log( - "Unknown action: $action. Use 'add' or 'remove'.", - level: LogLevel.error, - ); - } - } -} +import 'package:consoler/consoler.dart'; +import 'package:setonix_server/src/server.dart'; + +class WhitelistProgram extends ConsoleProgram { + final SetonixServer server; + + WhitelistProgram(this.server); + + @override + String getUsage() => ' '; + + @override + String getDescription() => + "Add or remove a user from the whitelist. " + "Use 'add ' to add a user and 'remove ' to remove a user."; + + @override + Future run(String label, List args) async { + if (args.length != 2) { + server.log("Wrong usage, use ${getUsage()}", level: LogLevel.error); + return; + } + final action = args[0].toLowerCase(); + final user = await server.userManager.getUserByReference(args[1]); + if (user == null) { + server.log("User not found: ${args[1]}", level: LogLevel.error); + return; + } + final fingerprint = user.fingerprint; + if (fingerprint == null) { + server.log( + "User $user does not have a fingerprint. Cannot add to whitelist.", + level: LogLevel.error, + ); + return; + } + + if (action == 'add') { + final result = await server.userManager.service?.updateUser( + fingerprint, + onWhitelist: true, + ); + if (result != true) { + server.log( + "Failed to add user $user to whitelist", + level: LogLevel.error, + ); + return; + } + server.log("User $user added to whitelist", level: LogLevel.info); + } else if (action == 'remove') { + final result = await server.userManager.service?.updateUser( + fingerprint, + onWhitelist: false, + ); + if (result != true) { + server.log( + "Failed to remove user $user from whitelist", + level: LogLevel.error, + ); + return; + } + server.log("User $user removed from whitelist", level: LogLevel.info); + } else { + server.log( + "Unknown action: $action. Use 'add' or 'remove'.", + level: LogLevel.error, + ); + } + } +} diff --git a/server/lib/src/services/user/file.dart b/server/lib/src/services/user/file.dart index 4017931b..eceb8860 100644 --- a/server/lib/src/services/user/file.dart +++ b/server/lib/src/services/user/file.dart @@ -1,130 +1,130 @@ -import 'dart:async'; - -import 'package:path/path.dart' as p; -import 'package:setonix_api/setonix_api.dart'; -import 'package:setonix_server/src/services/user/migrations.dart'; -import 'package:sqlite3/sqlite3.dart'; - -final class FileUserService extends UserService { - Database? _database; - - Future setup({String rootPath = '.'}) async { - final database = sqlite3.open(p.join(rootPath, 'setonix.db')); - // Basic migration system - - final result = database.select('PRAGMA user_version'); - final currentVersion = result.isNotEmpty - ? result.first['user_version'] as int - : 0; - - for ( - var version = currentVersion + 1; - version <= migrations.length; - version++ - ) { - database.execute(migrations[version]!); - database.execute('PRAGMA user_version = $version;'); - } - _database = database; - } - - SetonixUser _fromRow(Row row) { - return SetonixUser( - fingerprint: row['fingerprint'] as String?, - name: row['name'] as String, - onWhitelist: row['on_whitelist'] == 1, - createdAt: row['created_at'] != null - ? DateTime.fromMillisecondsSinceEpoch(row['created_at'] as int) - : null, - updatedAt: row['updated_at'] != null - ? DateTime.fromMillisecondsSinceEpoch(row['updated_at'] as int) - : null, - lastLogin: row['last_login'] != null - ? DateTime.fromMillisecondsSinceEpoch(row['last_login'] as int) - : null, - ); - } - - @override - SetonixUser? getUser(String fingerprint) => _database - ?.select('SELECT * FROM users WHERE fingerprint = ?', [fingerprint]) - .map(_fromRow) - .firstOrNull; - - @override - SetonixUser? getUserFromName(String name) => _database - ?.select('SELECT * FROM users WHERE name = ?', [name]) - .map(_fromRow) - .firstOrNull; - - @override - bool updateUser( - String fingerprint, { - String? name, - bool? onWhitelist, - DateTime? lastLogin, - bool createIfNotExists = false, - }) { - final updates = []; - final values = []; - - if (name != null) { - updates.add('name = ?'); - values.add(name); - } - if (onWhitelist != null) { - updates.add('on_whitelist = ?'); - values.add(onWhitelist ? 1 : 0); - } - if (lastLogin != null) { - updates.add('last_login = ?'); - values.add(lastLogin.millisecondsSinceEpoch); - } - - if (updates.isEmpty && !createIfNotExists) return false; - - if (!createIfNotExists) { - values.add(fingerprint); - _database?.execute( - 'UPDATE users SET ${updates.join(', ')} WHERE fingerprint = ?', - values, - ); - return _database?.updatedRows == 1; - } - - final insertCols = ['fingerprint']; - final insertVals = [fingerprint]; - - if (name != null) { - insertCols.add('name'); - insertVals.add(name); - } - if (onWhitelist != null) { - insertCols.add('on_whitelist'); - insertVals.add(onWhitelist ? 1 : 0); - } - if (lastLogin != null) { - insertCols.add('last_login'); - insertVals.add(lastLogin.millisecondsSinceEpoch); - } - - final placeholders = List.filled(insertCols.length, '?').join(', '); - - if (updates.isEmpty) { - _database?.execute( - 'INSERT OR IGNORE INTO users (${insertCols.join(', ')}) VALUES ($placeholders)', - insertVals, - ); - } else { - _database?.execute( - ''' - INSERT INTO users (${insertCols.join(', ')}) - VALUES ($placeholders) - ON CONFLICT(fingerprint) DO UPDATE SET ${updates.join(', ')} - ''', - [...insertVals, ...values], - ); - } - return true; - } -} +import 'dart:async'; + +import 'package:path/path.dart' as p; +import 'package:setonix_api/setonix_api.dart'; +import 'package:setonix_server/src/services/user/migrations.dart'; +import 'package:sqlite3/sqlite3.dart'; + +final class FileUserService extends UserService { + Database? _database; + + Future setup({String rootPath = '.'}) async { + final database = sqlite3.open(p.join(rootPath, 'setonix.db')); + // Basic migration system + + final result = database.select('PRAGMA user_version'); + final currentVersion = result.isNotEmpty + ? result.first['user_version'] as int + : 0; + + for ( + var version = currentVersion + 1; + version <= migrations.length; + version++ + ) { + database.execute(migrations[version]!); + database.execute('PRAGMA user_version = $version;'); + } + _database = database; + } + + SetonixUser _fromRow(Row row) { + return SetonixUser( + fingerprint: row['fingerprint'] as String?, + name: row['name'] as String, + onWhitelist: row['on_whitelist'] == 1, + createdAt: row['created_at'] != null + ? DateTime.fromMillisecondsSinceEpoch(row['created_at'] as int) + : null, + updatedAt: row['updated_at'] != null + ? DateTime.fromMillisecondsSinceEpoch(row['updated_at'] as int) + : null, + lastLogin: row['last_login'] != null + ? DateTime.fromMillisecondsSinceEpoch(row['last_login'] as int) + : null, + ); + } + + @override + SetonixUser? getUser(String fingerprint) => _database + ?.select('SELECT * FROM users WHERE fingerprint = ?', [fingerprint]) + .map(_fromRow) + .firstOrNull; + + @override + SetonixUser? getUserFromName(String name) => _database + ?.select('SELECT * FROM users WHERE name = ?', [name]) + .map(_fromRow) + .firstOrNull; + + @override + bool updateUser( + String fingerprint, { + String? name, + bool? onWhitelist, + DateTime? lastLogin, + bool createIfNotExists = false, + }) { + final updates = []; + final values = []; + + if (name != null) { + updates.add('name = ?'); + values.add(name); + } + if (onWhitelist != null) { + updates.add('on_whitelist = ?'); + values.add(onWhitelist ? 1 : 0); + } + if (lastLogin != null) { + updates.add('last_login = ?'); + values.add(lastLogin.millisecondsSinceEpoch); + } + + if (updates.isEmpty && !createIfNotExists) return false; + + if (!createIfNotExists) { + values.add(fingerprint); + _database?.execute( + 'UPDATE users SET ${updates.join(', ')} WHERE fingerprint = ?', + values, + ); + return _database?.updatedRows == 1; + } + + final insertCols = ['fingerprint']; + final insertVals = [fingerprint]; + + if (name != null) { + insertCols.add('name'); + insertVals.add(name); + } + if (onWhitelist != null) { + insertCols.add('on_whitelist'); + insertVals.add(onWhitelist ? 1 : 0); + } + if (lastLogin != null) { + insertCols.add('last_login'); + insertVals.add(lastLogin.millisecondsSinceEpoch); + } + + final placeholders = List.filled(insertCols.length, '?').join(', '); + + if (updates.isEmpty) { + _database?.execute( + 'INSERT OR IGNORE INTO users (${insertCols.join(', ')}) VALUES ($placeholders)', + insertVals, + ); + } else { + _database?.execute( + ''' + INSERT INTO users (${insertCols.join(', ')}) + VALUES ($placeholders) + ON CONFLICT(fingerprint) DO UPDATE SET ${updates.join(', ')} + ''', + [...insertVals, ...values], + ); + } + return true; + } +} diff --git a/server/lib/src/services/user/migrations.dart b/server/lib/src/services/user/migrations.dart index 97728ef7..d337dc83 100644 --- a/server/lib/src/services/user/migrations.dart +++ b/server/lib/src/services/user/migrations.dart @@ -1,14 +1,14 @@ -final migrations = { - 1: ''' -CREATE TABLE users ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - role VARCHAR(50) NOT NULL DEFAULT '', - created_at INTEGER NOT NULL DEFAULT (strftime('%s','now')), - fingerprint TEXT NOT NULL UNIQUE, - updated_at INTEGER NOT NULL DEFAULT (strftime('%s','now')), - last_login INTEGER, - name TEXT NOT NULL UNIQUE, - on_whitelist INTEGER NOT NULL DEFAULT 0 -); -''', -}; +final migrations = { + 1: ''' +CREATE TABLE users ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + role VARCHAR(50) NOT NULL DEFAULT '', + created_at INTEGER NOT NULL DEFAULT (strftime('%s','now')), + fingerprint TEXT NOT NULL UNIQUE, + updated_at INTEGER NOT NULL DEFAULT (strftime('%s','now')), + last_login INTEGER, + name TEXT NOT NULL UNIQUE, + on_whitelist INTEGER NOT NULL DEFAULT 0 +); +''', +}; diff --git a/server/lib/src/services/user/remote.dart b/server/lib/src/services/user/remote.dart index 492efcc7..6baf5b24 100644 --- a/server/lib/src/services/user/remote.dart +++ b/server/lib/src/services/user/remote.dart @@ -1,94 +1,94 @@ -import 'dart:async'; -import 'dart:convert'; - -import 'package:http/http.dart' as http; -import 'package:setonix_server/setonix_server.dart'; - -final class RemoteUserService extends UserService { - static const requestTimeout = Duration(seconds: 10); - - final String apiEndpoint; - final String? endpointSecret; - - RemoteUserService({required this.apiEndpoint, this.endpointSecret}); - - Map get headers => - endpointSecret != null && endpointSecret!.isNotEmpty - ? {'Authorization': 'Bearer $endpointSecret'} - : {}; - - @override - Future getUser(String fingerprint) async { - final response = await http - .get( - Uri.parse('$apiEndpoint/user/${Uri.encodeComponent(fingerprint)}'), - headers: headers, - ) - .timeout(requestTimeout); - if (response.statusCode >= 200 && response.statusCode < 300) { - if (response.body.isEmpty) return null; // No user found - return SetonixUserMapper.fromJson(response.body); - } - throw KickMessage.fromString(response.body); - } - - @override - Future getUserFromName(String name) async { - final response = await http - .get( - Uri.parse('$apiEndpoint/user?name=${Uri.encodeComponent(name)}'), - headers: headers, - ) - .timeout(requestTimeout); - if (response.statusCode == 200) { - return SetonixUserMapper.fromJson(response.body); - } - return null; - } - - @override - Future updateUser( - String fingerprint, { - String? name, - bool? onWhitelist, - DateTime? lastLogin, - bool createIfNotExists = false, - }) async { - final body = jsonEncode({ - 'name': name, - 'onWhitelist': onWhitelist, - 'lastLogin': lastLogin?.millisecondsSinceEpoch, - }); - final response = await http - .patch( - Uri.parse('$apiEndpoint/user/${Uri.encodeComponent(fingerprint)}'), - headers: {...headers, 'Content-Type': 'application/json'}, - body: body, - ) - .timeout(requestTimeout); - - if (response.statusCode == 200) { - return true; - } else if (response.statusCode == 404) { - if (createIfNotExists) { - final createBody = jsonEncode({ - 'fingerprint': fingerprint, - 'name': name, - 'onWhitelist': onWhitelist, - 'lastLogin': lastLogin?.millisecondsSinceEpoch, - }); - final createResponse = await http - .post( - Uri.parse('$apiEndpoint/user'), - headers: {...headers, 'Content-Type': 'application/json'}, - body: createBody, - ) - .timeout(requestTimeout); - return createResponse.statusCode >= 200 && - createResponse.statusCode < 300; - } - return false; // User not found - } - throw Exception('Failed to update user: ${response.body}'); - } -} +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; +import 'package:setonix_server/setonix_server.dart'; + +final class RemoteUserService extends UserService { + static const requestTimeout = Duration(seconds: 10); + + final String apiEndpoint; + final String? endpointSecret; + + RemoteUserService({required this.apiEndpoint, this.endpointSecret}); + + Map get headers => + endpointSecret != null && endpointSecret!.isNotEmpty + ? {'Authorization': 'Bearer $endpointSecret'} + : {}; + + @override + Future getUser(String fingerprint) async { + final response = await http + .get( + Uri.parse('$apiEndpoint/user/${Uri.encodeComponent(fingerprint)}'), + headers: headers, + ) + .timeout(requestTimeout); + if (response.statusCode >= 200 && response.statusCode < 300) { + if (response.body.isEmpty) return null; // No user found + return SetonixUserMapper.fromJson(response.body); + } + throw KickMessage.fromString(response.body); + } + + @override + Future getUserFromName(String name) async { + final response = await http + .get( + Uri.parse('$apiEndpoint/user?name=${Uri.encodeComponent(name)}'), + headers: headers, + ) + .timeout(requestTimeout); + if (response.statusCode == 200) { + return SetonixUserMapper.fromJson(response.body); + } + return null; + } + + @override + Future updateUser( + String fingerprint, { + String? name, + bool? onWhitelist, + DateTime? lastLogin, + bool createIfNotExists = false, + }) async { + final body = jsonEncode({ + 'name': name, + 'onWhitelist': onWhitelist, + 'lastLogin': lastLogin?.millisecondsSinceEpoch, + }); + final response = await http + .patch( + Uri.parse('$apiEndpoint/user/${Uri.encodeComponent(fingerprint)}'), + headers: {...headers, 'Content-Type': 'application/json'}, + body: body, + ) + .timeout(requestTimeout); + + if (response.statusCode == 200) { + return true; + } else if (response.statusCode == 404) { + if (createIfNotExists) { + final createBody = jsonEncode({ + 'fingerprint': fingerprint, + 'name': name, + 'onWhitelist': onWhitelist, + 'lastLogin': lastLogin?.millisecondsSinceEpoch, + }); + final createResponse = await http + .post( + Uri.parse('$apiEndpoint/user'), + headers: {...headers, 'Content-Type': 'application/json'}, + body: createBody, + ) + .timeout(requestTimeout); + return createResponse.statusCode >= 200 && + createResponse.statusCode < 300; + } + return false; // User not found + } + throw Exception('Failed to update user: ${response.body}'); + } +} diff --git a/server/lib/src/user.dart b/server/lib/src/user.dart index 8b137891..d3f5a12f 100644 --- a/server/lib/src/user.dart +++ b/server/lib/src/user.dart @@ -1 +1 @@ - + diff --git a/server/pubspec.lock b/server/pubspec.lock index 49b22daf..c0a3fb07 100644 --- a/server/pubspec.lock +++ b/server/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "563c6992eaeda8625f45b87f6a6a0c547df16565d1c93d8271c7c11057710ca7" + sha256: "1b0e6a07425a3e460666e88bf1c949ccc7bb0116ad562ce94a1eca60fe820725" url: "https://pub.dev" source: hosted - version: "101.0.0" + version: "103.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: aa6a9365901532864cae51208f2a6bb18dd01972ebead19c431efc848f60080b + sha256: "61c04d0c1bfed555c681ea079519933f071a5a026578ff73c4ff0df2d3462e5e" url: "https://pub.dev" source: hosted - version: "13.1.0" + version: "13.3.0" ansicolor: dependency: transitive description: @@ -149,10 +149,10 @@ packages: dependency: transitive description: name: code_assets - sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.1" collection: dependency: transitive description: @@ -182,10 +182,10 @@ packages: dependency: transitive description: name: coverage - sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + sha256: "956a3de0725ca232ad353565a8290d3357592bf4250f6f298a185e2d949c5d3d" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.15.1" crypto: dependency: transitive description: @@ -295,10 +295,10 @@ packages: dependency: transitive description: name: hooks - sha256: "025f060e86d2d4c3c47b56e33caf7f93bf9283340f26d23424ebcfccf34f621e" + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.2" http: dependency: "direct main" description: @@ -359,8 +359,8 @@ packages: dependency: transitive description: path: "packages/lw_file_system_api" - ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" - resolved-ref: "5fd8a282404929e54c36a25fd80e43ca3a85bc46" + ref: "37594211585889e35e65dad382d4fdcf29ac69a0" + resolved-ref: "37594211585889e35e65dad382d4fdcf29ac69a0" url: "https://github.com/LinwoodDev/dart_pkgs.git" source: git version: "1.0.0" @@ -392,18 +392,18 @@ packages: dependency: transitive description: name: native_toolchain_c - sha256: "8aaead321425bd3f03bd5894aa27c8ea6993eab95531da7e59f5d39c6e5708ec" + sha256: f59351d28f49520cd3a74eb1f41c5f19ae15e53c65a3231d14af672e46510a96 url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.19.1" native_toolchain_rust: dependency: transitive description: name: native_toolchain_rust - sha256: "26d4dcae954328af4ebfa8fc56cca0bf74b9ae8b4a6132de5da2071ac3d237b3" + sha256: faa57d2258a3b0fd2a634054f54e4496c9fcbd971977e7d2b7e6916d56892857 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.4+0" networker: dependency: "direct main" description: @@ -576,10 +576,10 @@ packages: dependency: "direct main" description: name: sqlite3 - sha256: "9488c7d2cdb1091c91cacf7e207cff81b28bff8e366f042bad3afe7d34afe189" + sha256: "37356bcb56ce0d9404d602c41e4bdb7765e7e9732a3e47adb3d98c556a6abdad" url: "https://pub.dev" source: hosted - version: "3.3.2" + version: "3.3.3" stack_trace: dependency: transitive description: diff --git a/servers/.gitignore b/servers/.gitignore index 016b59ea..b86a2158 100644 --- a/servers/.gitignore +++ b/servers/.gitignore @@ -1,24 +1,24 @@ -# build output -dist/ - -# generated types -.astro/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# environment variables -.env -.env.production - -# macOS-specific files -.DS_Store - -# jetbrains setting folder -.idea/ +# build output +dist/ + +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# jetbrains setting folder +.idea/ diff --git a/servers/package.json b/servers/package.json index 3a9aa516..542e924a 100644 --- a/servers/package.json +++ b/servers/package.json @@ -8,11 +8,11 @@ "preview": "astro preview", "astro": "astro" }, - "packageManager": "pnpm@11.5.2", + "packageManager": "pnpm@11.7.0", "dependencies": { "@astrojs/node": "^10.1.4", "@cacheable/node-cache": "^3.0.1", "@linwooddev/style": "^0.4.2", - "astro": "^6.4.6" + "astro": "^6.4.8" } } \ No newline at end of file diff --git a/servers/pnpm-lock.yaml b/servers/pnpm-lock.yaml index 3dcdf83b..a67e91b3 100644 --- a/servers/pnpm-lock.yaml +++ b/servers/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@astrojs/node': specifier: ^10.1.4 - version: 10.1.4(astro@6.4.6(rollup@4.61.1)) + version: 10.1.4(astro@6.4.8(rollup@4.62.0)) '@cacheable/node-cache': specifier: ^3.0.1 version: 3.0.1 @@ -18,8 +18,8 @@ importers: specifier: ^0.4.2 version: 0.4.2 astro: - specifier: ^6.4.6 - version: 6.4.6(rollup@4.61.1) + specifier: ^6.4.8 + version: 6.4.8(rollup@4.62.0) packages: @@ -69,8 +69,8 @@ packages: '@cacheable/utils@2.4.1': resolution: {integrity: sha512-eiFgzCbIneyMlLOmNG4g9xzF7Hv3Mga4LjxjcSC/ues6VYq2+gUbQI8JqNuw/ZM8tJIeIaBGpswAsqV2V7ApgA==} - '@capsizecss/unpack@4.0.0': - resolution: {integrity: sha512-VERIM64vtTP1C4mxQ5thVT9fK0apjPFobqybMtA1UdUujWka24ERHbRHFGmpbbhp73MhV+KSsHQH9C6uOTdEQA==} + '@capsizecss/unpack@4.0.1': + resolution: {integrity: sha512-CuNiSqg7+e1cO/GjffyMOm5Tt2jUF9CWHHnvQ/UkqvtkGfHdgwEC0wpmq7fkN3gxwpRnrAN0WzO3vREKmNolMQ==} engines: {node: '>=18'} '@clack/core@1.4.1': @@ -81,8 +81,8 @@ packages: resolution: {integrity: sha512-zccHj2z2oCCO4yrDiRSlFOxWerGqRiysP7a5jPK6uoI9URKAquwY42Dd/iUP8JWHxEzdRe4TlbvZCo8z1/mhrw==} engines: {node: '>= 20.12.0'} - '@emnapi/runtime@1.11.0': - resolution: {integrity: sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==} + '@emnapi/runtime@1.11.1': + resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} '@esbuild/aix-ppc64@0.27.7': resolution: {integrity: sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==} @@ -414,141 +414,141 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.61.1': - resolution: {integrity: sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==} + '@rollup/rollup-android-arm-eabi@4.62.0': + resolution: {integrity: sha512-IPIQ55ythEHkfEd9jMEi32OQ7SxURsGA43JI22lj01OLZNt2NUbJX8YUHxkVWyQ6daHPNn0truF5nSj3DQp6YQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.61.1': - resolution: {integrity: sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==} + '@rollup/rollup-android-arm64@4.62.0': + resolution: {integrity: sha512-M6s9cr10MibETyo8JsOkq+Lo1+lU6hcvb1MApnUql5qte/5hMEgzlN8/ReIKNfRV8rrqX50W1BX9zoUhC192RA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.61.1': - resolution: {integrity: sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==} + '@rollup/rollup-darwin-arm64@4.62.0': + resolution: {integrity: sha512-BqCoMoIbn0keKys+dEAdBa70EtOwV1bEsQCUgU9FdiZmmMge/Zk7LlkYGqbrdHR+Frnt0E1FOanly+rlwvvQzw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.61.1': - resolution: {integrity: sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==} + '@rollup/rollup-darwin-x64@4.62.0': + resolution: {integrity: sha512-SIMzST3VFNXDAbeIWDWiFCNM5qncUBDWaEV7NfE7oZbDt2mgfW4MvbKdbYiGOLoM32gbTv608UMd0XktEYSD7w==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.61.1': - resolution: {integrity: sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==} + '@rollup/rollup-freebsd-arm64@4.62.0': + resolution: {integrity: sha512-ezjfSQMP7ArdUsbBwbQIfwAlhE84I2iVnzQNCFSveqV42q+BmKlzVpf7mxv5EchLcoWU4y6/heFzVg1F+hodUQ==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.61.1': - resolution: {integrity: sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==} + '@rollup/rollup-freebsd-x64@4.62.0': + resolution: {integrity: sha512-9+qTWGW9AZRhnUgwtTwzNwcPlL87ngkeN0LA+q1bADvmY9aNvWaF2TFW8BZgnQPYxpDI7+rMVLivcd4V737TAQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.61.1': - resolution: {integrity: sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==} + '@rollup/rollup-linux-arm-gnueabihf@4.62.0': + resolution: {integrity: sha512-T1dMEQhXA/jkJ/jyMIw9IovK8bSUq7A8kLIlvZTb/6YIVsp2zLavr4F3oyllHWo7eIVJRyE5n3tUjQJEbE1IuQ==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.61.1': - resolution: {integrity: sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==} + '@rollup/rollup-linux-arm-musleabihf@4.62.0': + resolution: {integrity: sha512-2as0LgT7qQpyceQq6VUJYnumUMUrgGQCWIiDIN9DE0/tglsk6o66uCB4f3djRawAltvfCNLyZZrsqbPA6inCsA==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.61.1': - resolution: {integrity: sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==} + '@rollup/rollup-linux-arm64-gnu@4.62.0': + resolution: {integrity: sha512-bVURMg+6eNN9C/yc0aVjooZcwTTtYF4YW3xta5pP0//r3o1V8gXEHXWCndj47w/HhwsFroZrFhR+6uQP5T0n0g==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.61.1': - resolution: {integrity: sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==} + '@rollup/rollup-linux-arm64-musl@4.62.0': + resolution: {integrity: sha512-Ful8pM/2yYI83PViWdFdpZhdI8HJ5qsXANe5atypbHDf+KIBBDsZsbyy8hbXnULVvW9NsTh5DHwbcBftyLTfiw==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.61.1': - resolution: {integrity: sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==} + '@rollup/rollup-linux-loong64-gnu@4.62.0': + resolution: {integrity: sha512-9Gp/DgrkzfUBmNPVTyPTvay+4xEP7M/clXpj3efXBcm6uTIVIgDg4rqUpqKXvLEuFRVuEpSAOkhgNeecvaZ4Cg==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.61.1': - resolution: {integrity: sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==} + '@rollup/rollup-linux-loong64-musl@4.62.0': + resolution: {integrity: sha512-m9tsJz54LUXkSYM8+8PG81B9IKK5r+2T0clMq4QrS16xFosufU7firBDAZEsDheDs7wTlP7h3++S7lMsU955HA==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.61.1': - resolution: {integrity: sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==} + '@rollup/rollup-linux-ppc64-gnu@4.62.0': + resolution: {integrity: sha512-3UvJ5PNVU16aJf6M3tFI24pWzAl2/ynfbyRN3ICyQajK1lSkrnVYNnLz3v04J32qKa0FczJc22zeToc0lr2A3w==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.61.1': - resolution: {integrity: sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==} + '@rollup/rollup-linux-ppc64-musl@4.62.0': + resolution: {integrity: sha512-vRWUAbYLGHBZS6Q8Msb2sfnf1fvJf+47t8l/TwOerM2qArzy+IeNMTHrYLHXh95h8MoatPHI5hhSZNs+mGXKPg==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.61.1': - resolution: {integrity: sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==} + '@rollup/rollup-linux-riscv64-gnu@4.62.0': + resolution: {integrity: sha512-c00T5SYENHAt86cfW47URaP3Us5vLC/4QO7GYud1G5VNRffCwwCuBspwqYrriuJB+5m0WFzClCn9wed0FBjKvg==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.61.1': - resolution: {integrity: sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==} + '@rollup/rollup-linux-riscv64-musl@4.62.0': + resolution: {integrity: sha512-krrCDilhXOwFkSkO3Wm9I/f9H0L92XHHwy2fwxjukxIbh0dem8gZqOW5Y8BsHrpJv5qwlRBV+Wl4ZFyRWhUpwg==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.61.1': - resolution: {integrity: sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==} + '@rollup/rollup-linux-s390x-gnu@4.62.0': + resolution: {integrity: sha512-7pfYFSTc4/rUC/FtAI0Qp6QthDBCIi6/AuP1xYqFk5vanI6KnL5dWKP60OM/05LOsbwTmIcvr6eXC4CJuJ75IA==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.61.1': - resolution: {integrity: sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==} + '@rollup/rollup-linux-x64-gnu@4.62.0': + resolution: {integrity: sha512-7SDIalKeIpG0Ifogbbdn58HmSotYMlf23K3dCJEmiVd9Fg36Vmni82iPQec27N3wY4Bvbxftkxz6vSx9OcouTg==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.61.1': - resolution: {integrity: sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==} + '@rollup/rollup-linux-x64-musl@4.62.0': + resolution: {integrity: sha512-eRZevouTH2i1HeAVLqJuLnt256krQkGY0TN6WsTmsIhuzbh457HuWDMakKwmi0Cjadux983CoSr8Lim2QhUIFw==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.61.1': - resolution: {integrity: sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==} + '@rollup/rollup-openbsd-x64@4.62.0': + resolution: {integrity: sha512-3oVS7FLGa4U1qcvao9ylGxrjXZyUQqR8UwxEcnUEyPX53O/C/mKDZegNXTdHCP+h3e6ta/f1EN38Yif1mmZHYg==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.61.1': - resolution: {integrity: sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==} + '@rollup/rollup-openharmony-arm64@4.62.0': + resolution: {integrity: sha512-yTB9TgfWj5wHe5QgktAgXTLLot1gvEjl1NiPPAUiCs4oPrIWFl5V4nC3GrkNdj9LaAU4s94nVrGbGOCqUpyWsg==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.61.1': - resolution: {integrity: sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==} + '@rollup/rollup-win32-arm64-msvc@4.62.0': + resolution: {integrity: sha512-5LOhoaesY3doG1c+ac/2JtgREpKoJr5bUHH8tKY0V8di7+uSV6BwLs2PlR0/yzefGOkR+wE7ZolZphHCsyG5Rw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.61.1': - resolution: {integrity: sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==} + '@rollup/rollup-win32-ia32-msvc@4.62.0': + resolution: {integrity: sha512-yYkWHhmbhRTWTnWos5HC4GcPQfjlzzCNbM9e/+GXrLuaBXYA3qSDR9f0Vgufd5S8yX81U8jPKp7ZnAjZFMtRnw==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.61.1': - resolution: {integrity: sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==} + '@rollup/rollup-win32-x64-gnu@4.62.0': + resolution: {integrity: sha512-SoTb6lPg25xZlA2ibwQ++ahCCnH+FP0qmEuafMJ4gznZKOlXioKEAeJLgCrqjM98ACziXM9V1amFjICVL4IFoA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.61.1': - resolution: {integrity: sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==} + '@rollup/rollup-win32-x64-msvc@4.62.0': + resolution: {integrity: sha512-5L+T1fMX4RIEBoZzT0+sQ0PhTS36NULFmMXtl1TZo44TMAROIMHbZufSOjVWt/Y622BtxgxtaNOokbTDvfsrZA==} cpu: [x64] os: [win32] @@ -621,8 +621,8 @@ packages: array-iterate@2.0.1: resolution: {integrity: sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==} - astro@6.4.6: - resolution: {integrity: sha512-48OBTBKR9ctbf+DQxpOuxGl8ebfn59zTuNQMBzptmG/Mi/H8IdfMSbJgGuX1I/4U6g9yazG1p4BHlf4+2hWU4Q==} + astro@6.4.8: + resolution: {integrity: sha512-KK5lX90uU9EeVaTjINyj3sy9/NFXVa59aowaqbWBDDKLXZh4rr7GwIaCFYVetE22MJtsCNFerQXn0vlCLmpP/Q==} engines: {node: '>=22.12.0', npm: '>=9.6.5', pnpm: '>=7.1.0'} hasBin: true @@ -1125,8 +1125,8 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - obug@2.1.2: - resolution: {integrity: sha512-AWGB9WFcRXOQs48Z/udjI5ZcZMHXwX8XPByNpOydgcGsDLIzjGizhoMWJyKAWze7AVW/2W1i+/gPX4YtKe5cyg==} + obug@2.1.3: + resolution: {integrity: sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==} engines: {node: '>=12.20.0'} ofetch@1.5.1: @@ -1254,8 +1254,8 @@ packages: retext@9.0.0: resolution: {integrity: sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA==} - rollup@4.61.1: - resolution: {integrity: sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==} + rollup@4.62.0: + resolution: {integrity: sha512-nc72Wgq62I7rtDV4izT5/aaS0zxy3kttkinf9586ApknY3jZO9NYsmtc24fUckA0X7Q2v+ML4a15pdUlV5V/jA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -1562,10 +1562,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/node@10.1.4(astro@6.4.6(rollup@4.61.1))': + '@astrojs/node@10.1.4(astro@6.4.8(rollup@4.62.0))': dependencies: '@astrojs/internal-helpers': 0.10.0 - astro: 6.4.6(rollup@4.61.1) + astro: 6.4.8(rollup@4.62.0) send: 1.2.1 server-destroy: 1.0.1 transitivePeerDependencies: @@ -1607,7 +1607,7 @@ snapshots: hashery: 1.5.1 keyv: 5.6.0 - '@capsizecss/unpack@4.0.0': + '@capsizecss/unpack@4.0.1': dependencies: fontkitten: 1.0.3 @@ -1623,7 +1623,7 @@ snapshots: fast-wrap-ansi: 0.2.2 sisteransi: 1.0.5 - '@emnapi/runtime@1.11.0': + '@emnapi/runtime@1.11.1': dependencies: tslib: 2.8.1 optional: true @@ -1791,7 +1791,7 @@ snapshots: '@img/sharp-wasm32@0.34.5': dependencies: - '@emnapi/runtime': 1.11.0 + '@emnapi/runtime': 1.11.1 optional: true '@img/sharp-win32-arm64@0.34.5': @@ -1811,87 +1811,87 @@ snapshots: '@oslojs/encoding@1.1.0': {} - '@rollup/pluginutils@5.4.0(rollup@4.61.1)': + '@rollup/pluginutils@5.4.0(rollup@4.62.0)': dependencies: '@types/estree': 1.0.9 estree-walker: 2.0.2 picomatch: 4.0.4 optionalDependencies: - rollup: 4.61.1 + rollup: 4.62.0 - '@rollup/rollup-android-arm-eabi@4.61.1': + '@rollup/rollup-android-arm-eabi@4.62.0': optional: true - '@rollup/rollup-android-arm64@4.61.1': + '@rollup/rollup-android-arm64@4.62.0': optional: true - '@rollup/rollup-darwin-arm64@4.61.1': + '@rollup/rollup-darwin-arm64@4.62.0': optional: true - '@rollup/rollup-darwin-x64@4.61.1': + '@rollup/rollup-darwin-x64@4.62.0': optional: true - '@rollup/rollup-freebsd-arm64@4.61.1': + '@rollup/rollup-freebsd-arm64@4.62.0': optional: true - '@rollup/rollup-freebsd-x64@4.61.1': + '@rollup/rollup-freebsd-x64@4.62.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.61.1': + '@rollup/rollup-linux-arm-gnueabihf@4.62.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.61.1': + '@rollup/rollup-linux-arm-musleabihf@4.62.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.61.1': + '@rollup/rollup-linux-arm64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.61.1': + '@rollup/rollup-linux-arm64-musl@4.62.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.61.1': + '@rollup/rollup-linux-loong64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-loong64-musl@4.61.1': + '@rollup/rollup-linux-loong64-musl@4.62.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.61.1': + '@rollup/rollup-linux-ppc64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-ppc64-musl@4.61.1': + '@rollup/rollup-linux-ppc64-musl@4.62.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.61.1': + '@rollup/rollup-linux-riscv64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.61.1': + '@rollup/rollup-linux-riscv64-musl@4.62.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.61.1': + '@rollup/rollup-linux-s390x-gnu@4.62.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.61.1': + '@rollup/rollup-linux-x64-gnu@4.62.0': optional: true - '@rollup/rollup-linux-x64-musl@4.61.1': + '@rollup/rollup-linux-x64-musl@4.62.0': optional: true - '@rollup/rollup-openbsd-x64@4.61.1': + '@rollup/rollup-openbsd-x64@4.62.0': optional: true - '@rollup/rollup-openharmony-arm64@4.61.1': + '@rollup/rollup-openharmony-arm64@4.62.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.61.1': + '@rollup/rollup-win32-arm64-msvc@4.62.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.61.1': + '@rollup/rollup-win32-ia32-msvc@4.62.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.61.1': + '@rollup/rollup-win32-x64-gnu@4.62.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.61.1': + '@rollup/rollup-win32-x64-msvc@4.62.0': optional: true '@shikijs/core@4.2.0': @@ -1969,16 +1969,16 @@ snapshots: array-iterate@2.0.1: {} - astro@6.4.6(rollup@4.61.1): + astro@6.4.8(rollup@4.62.0): dependencies: '@astrojs/compiler': 4.0.0 '@astrojs/internal-helpers': 0.10.0 '@astrojs/markdown-remark': 7.2.0 '@astrojs/telemetry': 3.3.2 - '@capsizecss/unpack': 4.0.0 + '@capsizecss/unpack': 4.0.1 '@clack/prompts': 1.5.1 '@oslojs/encoding': 1.1.0 - '@rollup/pluginutils': 5.4.0(rollup@4.61.1) + '@rollup/pluginutils': 5.4.0(rollup@4.62.0) aria-query: 5.3.2 axobject-query: 4.1.0 ci-info: 4.4.0 @@ -2002,7 +2002,7 @@ snapshots: magicast: 0.5.3 mrmime: 2.0.1 neotraverse: 0.6.18 - obug: 2.1.2 + obug: 2.1.3 p-limit: 7.3.0 p-queue: 9.3.0 package-manager-detector: 1.6.0 @@ -2763,7 +2763,7 @@ snapshots: dependencies: boolbase: 1.0.0 - obug@2.1.2: {} + obug@2.1.3: {} ofetch@1.5.1: dependencies: @@ -2938,35 +2938,35 @@ snapshots: retext-stringify: 4.0.0 unified: 11.0.5 - rollup@4.61.1: + rollup@4.62.0: dependencies: '@types/estree': 1.0.9 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.61.1 - '@rollup/rollup-android-arm64': 4.61.1 - '@rollup/rollup-darwin-arm64': 4.61.1 - '@rollup/rollup-darwin-x64': 4.61.1 - '@rollup/rollup-freebsd-arm64': 4.61.1 - '@rollup/rollup-freebsd-x64': 4.61.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.61.1 - '@rollup/rollup-linux-arm-musleabihf': 4.61.1 - '@rollup/rollup-linux-arm64-gnu': 4.61.1 - '@rollup/rollup-linux-arm64-musl': 4.61.1 - '@rollup/rollup-linux-loong64-gnu': 4.61.1 - '@rollup/rollup-linux-loong64-musl': 4.61.1 - '@rollup/rollup-linux-ppc64-gnu': 4.61.1 - '@rollup/rollup-linux-ppc64-musl': 4.61.1 - '@rollup/rollup-linux-riscv64-gnu': 4.61.1 - '@rollup/rollup-linux-riscv64-musl': 4.61.1 - '@rollup/rollup-linux-s390x-gnu': 4.61.1 - '@rollup/rollup-linux-x64-gnu': 4.61.1 - '@rollup/rollup-linux-x64-musl': 4.61.1 - '@rollup/rollup-openbsd-x64': 4.61.1 - '@rollup/rollup-openharmony-arm64': 4.61.1 - '@rollup/rollup-win32-arm64-msvc': 4.61.1 - '@rollup/rollup-win32-ia32-msvc': 4.61.1 - '@rollup/rollup-win32-x64-gnu': 4.61.1 - '@rollup/rollup-win32-x64-msvc': 4.61.1 + '@rollup/rollup-android-arm-eabi': 4.62.0 + '@rollup/rollup-android-arm64': 4.62.0 + '@rollup/rollup-darwin-arm64': 4.62.0 + '@rollup/rollup-darwin-x64': 4.62.0 + '@rollup/rollup-freebsd-arm64': 4.62.0 + '@rollup/rollup-freebsd-x64': 4.62.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.62.0 + '@rollup/rollup-linux-arm-musleabihf': 4.62.0 + '@rollup/rollup-linux-arm64-gnu': 4.62.0 + '@rollup/rollup-linux-arm64-musl': 4.62.0 + '@rollup/rollup-linux-loong64-gnu': 4.62.0 + '@rollup/rollup-linux-loong64-musl': 4.62.0 + '@rollup/rollup-linux-ppc64-gnu': 4.62.0 + '@rollup/rollup-linux-ppc64-musl': 4.62.0 + '@rollup/rollup-linux-riscv64-gnu': 4.62.0 + '@rollup/rollup-linux-riscv64-musl': 4.62.0 + '@rollup/rollup-linux-s390x-gnu': 4.62.0 + '@rollup/rollup-linux-x64-gnu': 4.62.0 + '@rollup/rollup-linux-x64-musl': 4.62.0 + '@rollup/rollup-openbsd-x64': 4.62.0 + '@rollup/rollup-openharmony-arm64': 4.62.0 + '@rollup/rollup-win32-arm64-msvc': 4.62.0 + '@rollup/rollup-win32-ia32-msvc': 4.62.0 + '@rollup/rollup-win32-x64-gnu': 4.62.0 + '@rollup/rollup-win32-x64-msvc': 4.62.0 fsevents: 2.3.3 sax@1.6.0: {} @@ -3177,7 +3177,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 postcss: 8.5.15 - rollup: 4.61.1 + rollup: 4.62.0 tinyglobby: 0.2.17 optionalDependencies: fsevents: 2.3.3 diff --git a/servers/public/favicon.svg b/servers/public/favicon.svg index fbf392b3..b9cdfa91 100644 --- a/servers/public/favicon.svg +++ b/servers/public/favicon.svg @@ -1,92 +1,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/servers/src/assets/astro.svg b/servers/src/assets/astro.svg index 8cf8fb0c..244f87ac 100644 --- a/servers/src/assets/astro.svg +++ b/servers/src/assets/astro.svg @@ -1 +1 @@ - + diff --git a/servers/src/assets/background.svg b/servers/src/assets/background.svg index 4b2be0ac..9c3ec09a 100644 --- a/servers/src/assets/background.svg +++ b/servers/src/assets/background.svg @@ -1 +1 @@ - + diff --git a/servers/src/data/servers.json b/servers/src/data/servers.json index 421ad1ad..3d8b37e7 100644 --- a/servers/src/data/servers.json +++ b/servers/src/data/servers.json @@ -1,3 +1,3 @@ -[ - {"address": "127.0.0.1", "secure": false} +[ + {"address": "127.0.0.1", "secure": false} ] \ No newline at end of file diff --git a/servers/src/pages/data.json.ts b/servers/src/pages/data.json.ts index 6c9e3ede..4e6abd1d 100644 --- a/servers/src/pages/data.json.ts +++ b/servers/src/pages/data.json.ts @@ -1,24 +1,24 @@ -import type { APIRoute } from "astro"; -import { loadServersFromConfig } from "../scripts/servers/list"; - -export async function GET() { - const servers = await loadServersFromConfig(); - return new Response(JSON.stringify({ servers }), { - status: 200, - headers: { - "Content-Type": "application/json", - "Access-Control-Allow-Origin": "*", - }, - }); -} - -export const OPTIONS: APIRoute = async () => { - return new Response(null, { - headers: { - "Access-Control-Allow-Origin": "*", - "Access-Control-Allow-Methods": "GET", - "Access-Control-Allow-Headers": "Content-Type", - "Access-Control-Max-Age": "21600", // 6 h cache - }, - }); -}; +import type { APIRoute } from "astro"; +import { loadServersFromConfig } from "../scripts/servers/list"; + +export async function GET() { + const servers = await loadServersFromConfig(); + return new Response(JSON.stringify({ servers }), { + status: 200, + headers: { + "Content-Type": "application/json", + "Access-Control-Allow-Origin": "*", + }, + }); +} + +export const OPTIONS: APIRoute = async () => { + return new Response(null, { + headers: { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET", + "Access-Control-Allow-Headers": "Content-Type", + "Access-Control-Max-Age": "21600", // 6 h cache + }, + }); +}; diff --git a/servers/tsconfig.json b/servers/tsconfig.json index 8bf91d3b..97e440df 100644 --- a/servers/tsconfig.json +++ b/servers/tsconfig.json @@ -1,5 +1,5 @@ -{ - "extends": "astro/tsconfigs/strict", - "include": [".astro/types.d.ts", "**/*"], - "exclude": ["dist"] -} +{ + "extends": "astro/tsconfigs/strict", + "include": [".astro/types.d.ts", "**/*"], + "exclude": ["dist"] +} diff --git a/tools/.gitignore b/tools/.gitignore index 8a0a0f43..9aea3be6 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -1,51 +1,51 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release - -# Linux related -AppDir -appimage-builder-cache -*.AppImage +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# Linux related +AppDir +appimage-builder-cache +*.AppImage diff --git a/tools/analysis_options.yaml b/tools/analysis_options.yaml index 28875d1c..d84a4080 100644 --- a/tools/analysis_options.yaml +++ b/tools/analysis_options.yaml @@ -1,29 +1,29 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:lints/recommended.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:lints/recommended.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/tools/broadcast_client.dart b/tools/broadcast_client.dart index a258d04e..178445fe 100644 --- a/tools/broadcast_client.dart +++ b/tools/broadcast_client.dart @@ -1,19 +1,19 @@ -import 'dart:io'; - -Future main() { - // Receive broadcast messages from the udp server - // and print them to the console. - final server = RawDatagramSocket.bind(InternetAddress.anyIPv4, 28007); - return server.then((RawDatagramSocket socket) { - socket.broadcastEnabled = true; - socket.listen((RawSocketEvent event) { - if (event == RawSocketEvent.read) { - final datagram = socket.receive(); - if (datagram != null) { - final message = String.fromCharCodes(datagram.data); - print(message); - } - } - }); - }); -} +import 'dart:io'; + +Future main() { + // Receive broadcast messages from the udp server + // and print them to the console. + final server = RawDatagramSocket.bind(InternetAddress.anyIPv4, 28007); + return server.then((RawDatagramSocket socket) { + socket.broadcastEnabled = true; + socket.listen((RawSocketEvent event) { + if (event == RawSocketEvent.read) { + final datagram = socket.receive(); + if (datagram != null) { + final message = String.fromCharCodes(datagram.data); + print(message); + } + } + }); + }); +} diff --git a/tools/broadcast_server.dart b/tools/broadcast_server.dart index a371d8a9..dfeff386 100644 --- a/tools/broadcast_server.dart +++ b/tools/broadcast_server.dart @@ -1,22 +1,22 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; - -Future main() { - final destination = InternetAddress('255.255.255.255'); - print('Sending to $destination'); - return RawDatagramSocket.bind(InternetAddress.anyIPv4, 28007).then(( - RawDatagramSocket udpSocket, - ) { - udpSocket.broadcastEnabled = true; - //List words = ['apple', 'banana', 'cherry', 'date', 'elderberry']; - Timer.periodic(Duration(seconds: 1), (Timer t) { - //String word = words[Random().nextInt(words.length)]; - var word = - '{"port":28006,"description":"A server for Setonix. ${DateTime.now()}"}'; - List data = utf8.encode(word); - udpSocket.send(data, destination, 28007); - print('sent $word'); - }); - }); -} +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +Future main() { + final destination = InternetAddress('255.255.255.255'); + print('Sending to $destination'); + return RawDatagramSocket.bind(InternetAddress.anyIPv4, 28007).then(( + RawDatagramSocket udpSocket, + ) { + udpSocket.broadcastEnabled = true; + //List words = ['apple', 'banana', 'cherry', 'date', 'elderberry']; + Timer.periodic(Duration(seconds: 1), (Timer t) { + //String word = words[Random().nextInt(words.length)]; + var word = + '{"port":28006,"description":"A server for Setonix. ${DateTime.now()}"}'; + List data = utf8.encode(word); + udpSocket.send(data, destination, 28007); + print('sent $word'); + }); + }); +} diff --git a/tools/generate.dart b/tools/generate.dart index 96460eaa..bf4a8457 100644 --- a/tools/generate.dart +++ b/tools/generate.dart @@ -1,13 +1,13 @@ -import 'dart:io'; - -import 'package:generate_leap/generate_leap.dart'; - -Future main() async { - final dir = Directory('app/pack'); - await zipReproducable(dir, 'app/assets/pack.stnx'); - // Copy to server/packs - final file = File('app/assets/pack.stnx'); - final output = File('server/packs/core.stnx'); - await output.parent.create(recursive: true); - await output.writeAsBytes(await file.readAsBytes()); -} +import 'dart:io'; + +import 'package:generate_leap/generate_leap.dart'; + +Future main() async { + final dir = Directory('app/pack'); + await zipReproducable(dir, 'app/assets/pack.stnx'); + // Copy to server/packs + final file = File('app/assets/pack.stnx'); + final output = File('server/packs/core.stnx'); + await output.parent.create(recursive: true); + await output.writeAsBytes(await file.readAsBytes()); +} diff --git a/tools/local_server.dart b/tools/local_server.dart index 2040ea21..b5e7124a 100644 --- a/tools/local_server.dart +++ b/tools/local_server.dart @@ -1,50 +1,50 @@ -import 'dart:io'; - -import 'package:shelf/shelf.dart'; -import 'package:shelf/shelf_io.dart' as io; -import 'package:shelf_static/shelf_static.dart'; -import 'package:shelf_web_socket/shelf_web_socket.dart'; - -void main(List args) { - final port = args.isEmpty ? 80 : int.parse(args.first); - final staticHandler = createStaticHandler( - 'app/build/web', - defaultDocument: 'index.html', - ); - - final socketHandler = webSocketHandler((webSocket, _) async { - final proxied = await WebSocket.connect('ws://localhost:10357'); - webSocket.stream.listen( - (message) { - proxied.add(message); - }, - onDone: () { - proxied.close(); - }, - ); - proxied.listen( - (message) { - webSocket.sink.add(message); - }, - onDone: () { - webSocket.sink.close(); - }, - ); - }); - - // Serve /connect requests with the web socket handler. - // Serve other requests with the static file handler. - handler(Request request) { - print(request.url.path); - if (request.url.path == 'connect') { - return socketHandler(request); - } else { - return staticHandler(request); - } - } - - // Serve on every ip - io.serve(handler, InternetAddress.anyIPv4, port).then((server) { - print('Serving at http://${server.address.host}:${server.port}'); - }); -} +import 'dart:io'; + +import 'package:shelf/shelf.dart'; +import 'package:shelf/shelf_io.dart' as io; +import 'package:shelf_static/shelf_static.dart'; +import 'package:shelf_web_socket/shelf_web_socket.dart'; + +void main(List args) { + final port = args.isEmpty ? 80 : int.parse(args.first); + final staticHandler = createStaticHandler( + 'app/build/web', + defaultDocument: 'index.html', + ); + + final socketHandler = webSocketHandler((webSocket, _) async { + final proxied = await WebSocket.connect('ws://localhost:10357'); + webSocket.stream.listen( + (message) { + proxied.add(message); + }, + onDone: () { + proxied.close(); + }, + ); + proxied.listen( + (message) { + webSocket.sink.add(message); + }, + onDone: () { + webSocket.sink.close(); + }, + ); + }); + + // Serve /connect requests with the web socket handler. + // Serve other requests with the static file handler. + handler(Request request) { + print(request.url.path); + if (request.url.path == 'connect') { + return socketHandler(request); + } else { + return staticHandler(request); + } + } + + // Serve on every ip + io.serve(handler, InternetAddress.anyIPv4, port).then((server) { + print('Serving at http://${server.address.host}:${server.port}'); + }); +} diff --git a/tools/pubspec.yaml b/tools/pubspec.yaml index 6ee6fe86..eaf136b4 100644 --- a/tools/pubspec.yaml +++ b/tools/pubspec.yaml @@ -1,20 +1,20 @@ -name: setonix_tools -environment: - sdk: ">=3.8.0 <4.0.0" -dependencies: - archive: ^4.0.1 - args: ^2.5.0 - lints: ^6.0.0 - shelf: ^1.4.1 - shelf_proxy: ^1.0.4 - shelf_static: ^1.1.2 - shelf_web_socket: ^3.0.0 - web_socket_channel: ^3.0.0 - yaml: ^3.1.2 - generate_leap: - git: - url: https://github.com/LinwoodDev/dart_pkgs - ref: 6b88b03823624f9b0537bc34a15b1cdaa0b3774d - path: packages/generate_leap -dev_dependencies: +name: setonix_tools +environment: + sdk: ">=3.8.0 <4.0.0" +dependencies: + archive: ^4.0.1 + args: ^2.5.0 + lints: ^6.0.0 + shelf: ^1.4.1 + shelf_proxy: ^1.0.4 + shelf_static: ^1.1.2 + shelf_web_socket: ^3.0.0 + web_socket_channel: ^3.0.0 + yaml: ^3.1.2 + generate_leap: + git: + url: https://github.com/LinwoodDev/dart_pkgs + ref: 6b88b03823624f9b0537bc34a15b1cdaa0b3774d + path: packages/generate_leap +dev_dependencies: intl: ^0.20.1 \ No newline at end of file diff --git a/tools/set_version.dart b/tools/set_version.dart index b04240c2..14aae170 100644 --- a/tools/set_version.dart +++ b/tools/set_version.dart @@ -1,156 +1,156 @@ -import 'dart:io'; - -import 'package:args/args.dart'; -import 'package:intl/intl.dart'; - -Future main(List args) async { - var parser = ArgParser() - ..addOption( - 'build-number', - abbr: 'b', - valueHelp: "Number, 'keep' or 'increment'", - defaultsTo: 'keep', - ) - ..addFlag( - 'changelog', - abbr: 'c', - defaultsTo: true, - help: 'Generate changelog', - ); - - var results = parser.parse(args); - - String buildNumber = results['build-number'].toString().toLowerCase(); - if (buildNumber != 'increment' && - buildNumber != 'keep' && - int.tryParse(buildNumber) == null) { - print( - "Please provide a valid build number or 'increment' as the build-number argument", - ); - return; - } - var version = results.rest.isEmpty ? null : results.rest[0]; - // Update the version in the pubspec.yaml - File pubspec = File('app/pubspec.yaml'); - String content = await pubspec.readAsString(); - // Get last version from pubspec.yaml - RegExp exp = RegExp(r'version:\s(?.+)\+(?.+)'); - var match = exp.firstMatch(content); - if (match == null) { - print('Could not find the version in the pubspec.yaml'); - exit(1); - } - var lastVersion = match.namedGroup('version') ?? ''; - version ??= lastVersion; - // Get build number from lastVersion - var lastBuildNumber = match.namedGroup('build') ?? '0'; - String newBuildNumber = buildNumber; - if (buildNumber == 'increment') { - newBuildNumber = (int.parse(lastBuildNumber) + 1).toString(); - } - if (buildNumber == 'keep') newBuildNumber = lastBuildNumber; - - var newVersion = '$version+$newBuildNumber'; - // Update the version in the pubspec.yaml - content = content.replaceAll(exp, 'version: $newVersion'); - - await pubspec.writeAsString(content); - print( - 'Updating the version in the pubspec.yaml from $lastVersion to $newVersion', - ); - - // Update api - final apiPubspec = File('api/pubspec.yaml'); - var apiContent = await apiPubspec.readAsString(); - apiContent = apiContent.replaceAll( - RegExp(r'version: .+'), - 'version: $version', - ); - await apiPubspec.writeAsString(apiContent); - print( - 'Updating the version in the api pubspec.yaml from $lastVersion to $newVersion', - ); - // Update server - final serverPubspec = File('server/pubspec.yaml'); - var serverContent = await serverPubspec.readAsString(); - serverContent = serverContent.replaceAll( - RegExp(r'version: .+'), - 'version: $version', - ); - await serverPubspec.writeAsString(serverContent); - print( - 'Updating the version in the server pubspec.yaml from $lastVersion to $newVersion', - ); - await updateDebianVersion(version); - if (results['changelog']) { - var changelogFile = File('metadata/en-US/changelogs/$newBuildNumber.txt'); - var changelog = await changelogFile.readAsString(); - await updateChangelog(version, changelog); - await updateAppData(version); - } - - // Run flutter pub get in app/server directory - await Process.run( - 'flutter', - ['pub', 'get'], - workingDirectory: 'app', - runInShell: true, - ); - await Process.run( - 'flutter', - ['pub', 'get'], - workingDirectory: 'plugin', - runInShell: true, - ); - await Process.run( - 'flutter', - ['pub', 'get'], - workingDirectory: 'server', - runInShell: true, - ); - - print('Successfully updated!'); -} - -Future updateDebianVersion(String version) async { - var file = File('app/linux/debian/DEBIAN/control'); - var lines = await file.readAsLines(); - lines[1] = 'Version: $version'; - lines.add(''); - await file.writeAsString(lines.join('\r\n')); - print('Successfully updated debian version to $version'); -} - -bool isPreRelease(String version) { - return version.contains('-'); -} - -Future updateAppData(String version) async { - var file = File( - 'app/linux/debian/usr/share/metainfo/dev.linwood.setonix.appdata.xml', - ); - if (isPreRelease(version)) { - return; - } - var currentDate = DateTime.now(); - var dateString = DateFormat('yyyy-MM-dd').format(currentDate); - var line = '\t\t'; - var lines = List.from(await file.readAsLines()); - lines.insert(43, line); - await file.writeAsString(lines.join('\n')); - print('Successfully updated appdata version to $version'); -} - -Future updateChangelog(String version, String changelog) async { - var currentDate = DateTime.now(); - final changelogRegex = RegExp(r''); - var dateString = DateFormat('yyyy-MM-dd').format(currentDate); - var file = File('CHANGELOG.md'); - var content = await file.readAsString(); - content = content.replaceAll( - changelogRegex, - '\r\n\r\n## $version ($dateString)\r\n\r\n$changelog', - ); - await file.writeAsString(content); - print('Successfully updated docs for version $version'); -} +import 'dart:io'; + +import 'package:args/args.dart'; +import 'package:intl/intl.dart'; + +Future main(List args) async { + var parser = ArgParser() + ..addOption( + 'build-number', + abbr: 'b', + valueHelp: "Number, 'keep' or 'increment'", + defaultsTo: 'keep', + ) + ..addFlag( + 'changelog', + abbr: 'c', + defaultsTo: true, + help: 'Generate changelog', + ); + + var results = parser.parse(args); + + String buildNumber = results['build-number'].toString().toLowerCase(); + if (buildNumber != 'increment' && + buildNumber != 'keep' && + int.tryParse(buildNumber) == null) { + print( + "Please provide a valid build number or 'increment' as the build-number argument", + ); + return; + } + var version = results.rest.isEmpty ? null : results.rest[0]; + // Update the version in the pubspec.yaml + File pubspec = File('app/pubspec.yaml'); + String content = await pubspec.readAsString(); + // Get last version from pubspec.yaml + RegExp exp = RegExp(r'version:\s(?.+)\+(?.+)'); + var match = exp.firstMatch(content); + if (match == null) { + print('Could not find the version in the pubspec.yaml'); + exit(1); + } + var lastVersion = match.namedGroup('version') ?? ''; + version ??= lastVersion; + // Get build number from lastVersion + var lastBuildNumber = match.namedGroup('build') ?? '0'; + String newBuildNumber = buildNumber; + if (buildNumber == 'increment') { + newBuildNumber = (int.parse(lastBuildNumber) + 1).toString(); + } + if (buildNumber == 'keep') newBuildNumber = lastBuildNumber; + + var newVersion = '$version+$newBuildNumber'; + // Update the version in the pubspec.yaml + content = content.replaceAll(exp, 'version: $newVersion'); + + await pubspec.writeAsString(content); + print( + 'Updating the version in the pubspec.yaml from $lastVersion to $newVersion', + ); + + // Update api + final apiPubspec = File('api/pubspec.yaml'); + var apiContent = await apiPubspec.readAsString(); + apiContent = apiContent.replaceAll( + RegExp(r'version: .+'), + 'version: $version', + ); + await apiPubspec.writeAsString(apiContent); + print( + 'Updating the version in the api pubspec.yaml from $lastVersion to $newVersion', + ); + // Update server + final serverPubspec = File('server/pubspec.yaml'); + var serverContent = await serverPubspec.readAsString(); + serverContent = serverContent.replaceAll( + RegExp(r'version: .+'), + 'version: $version', + ); + await serverPubspec.writeAsString(serverContent); + print( + 'Updating the version in the server pubspec.yaml from $lastVersion to $newVersion', + ); + await updateDebianVersion(version); + if (results['changelog']) { + var changelogFile = File('metadata/en-US/changelogs/$newBuildNumber.txt'); + var changelog = await changelogFile.readAsString(); + await updateChangelog(version, changelog); + await updateAppData(version); + } + + // Run flutter pub get in app/server directory + await Process.run( + 'flutter', + ['pub', 'get'], + workingDirectory: 'app', + runInShell: true, + ); + await Process.run( + 'flutter', + ['pub', 'get'], + workingDirectory: 'plugin', + runInShell: true, + ); + await Process.run( + 'flutter', + ['pub', 'get'], + workingDirectory: 'server', + runInShell: true, + ); + + print('Successfully updated!'); +} + +Future updateDebianVersion(String version) async { + var file = File('app/linux/debian/DEBIAN/control'); + var lines = await file.readAsLines(); + lines[1] = 'Version: $version'; + lines.add(''); + await file.writeAsString(lines.join('\r\n')); + print('Successfully updated debian version to $version'); +} + +bool isPreRelease(String version) { + return version.contains('-'); +} + +Future updateAppData(String version) async { + var file = File( + 'app/linux/debian/usr/share/metainfo/dev.linwood.setonix.appdata.xml', + ); + if (isPreRelease(version)) { + return; + } + var currentDate = DateTime.now(); + var dateString = DateFormat('yyyy-MM-dd').format(currentDate); + var line = '\t\t'; + var lines = List.from(await file.readAsLines()); + lines.insert(43, line); + await file.writeAsString(lines.join('\n')); + print('Successfully updated appdata version to $version'); +} + +Future updateChangelog(String version, String changelog) async { + var currentDate = DateTime.now(); + final changelogRegex = RegExp(r''); + var dateString = DateFormat('yyyy-MM-dd').format(currentDate); + var file = File('CHANGELOG.md'); + var content = await file.readAsString(); + content = content.replaceAll( + changelogRegex, + '\r\n\r\n## $version ($dateString)\r\n\r\n$changelog', + ); + await file.writeAsString(content); + print('Successfully updated docs for version $version'); +} From 21498a44a0ecb263878dea0136bb0bd5ee7a8a19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:10:31 +0000 Subject: [PATCH 2/2] Bump actions/setup-node from 4 to 6 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/servers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/servers.yml b/.github/workflows/servers.yml index bfb97623..ea99f723 100644 --- a/.github/workflows/servers.yml +++ b/.github/workflows/servers.yml @@ -21,7 +21,7 @@ jobs: with: package_json_file: docs/package.json - name: Use Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: 26 cache: "pnpm"