peachsim 0.1.2400 → 0.1.2401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cli/bin.ts +1 -1
- package/cli/catalog/content.ts +520 -0
- package/cli/catalog/index.ts +4 -0
- package/cli/catalog/meta.ts +3881 -0
- package/cli/catalog/renderers.ts +659 -0
- package/cli/catalog/routes.ts +237 -0
- package/cli/catalog/types.ts +96 -0
- package/cli/commands/inspect.ts +3 -3
- package/cli/commands/record.ts +1 -1
- package/cli/dev-build-freshness.ts +1 -0
- package/cli/help-core.ts +6 -6
- package/cli/hidden-runtime-alias.ts +1 -1
- package/cli/parse-args.ts +1 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +32 -32
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +31 -31
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +32 -32
- package/dist-lib/host/fetch-proxy-handler.cjs +43 -40
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +47 -44
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +52 -49
- package/dist-lib/native-app-identity-project.cjs +22 -19
- package/dist-lib/native-app-identity-project.mjs +4 -3
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +59 -59
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +47 -47
- package/dist-lib/swift-compile.cjs +28 -30
- package/dist-lib/swift-compile.mjs +24 -26
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +29 -31
- package/dist-lib/vite.cjs +38 -35
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +2 -2
- package/package.json +1 -3
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GKState.h +78 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GKStateMachine.h +69 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.apinotes +269 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.h +15 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKitBase.h +38 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Modules/module.modulemap +6 -0
- package/src/wasm-optimize.ts +23 -24
- package/src/worklets-babel.ts +2 -6
- package/cli/registry.ts +0 -2
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2401 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -3244,7 +3244,7 @@ var STANDIN_SOURCE_DIGEST;
|
|
|
3244
3244
|
var init_swift_standin_digest = __esm({
|
|
3245
3245
|
"src/swift-standin-digest.ts"() {
|
|
3246
3246
|
"use strict";
|
|
3247
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
3247
|
+
STANDIN_SOURCE_DIGEST = true ? "452e58b6d6a9ad1b373b2d6df2ddb32802505c8bd43da19f49858f006a4f0464" : standinSourceDigest();
|
|
3248
3248
|
}
|
|
3249
3249
|
});
|
|
3250
3250
|
|
|
@@ -4715,12 +4715,13 @@ var init_wasm_narrow_boundary = __esm({
|
|
|
4715
4715
|
});
|
|
4716
4716
|
|
|
4717
4717
|
// src/wasm-optimize.ts
|
|
4718
|
-
var
|
|
4718
|
+
var import_node_child_process7, import_node_util3, FEATURES, KEEP_WASM_NAMES, LOWERING, BINARYEN_VERSION, runBinaryen, WASM_LOWER_IDENTITY;
|
|
4719
4719
|
var init_wasm_optimize = __esm({
|
|
4720
4720
|
"src/wasm-optimize.ts"() {
|
|
4721
4721
|
"use strict";
|
|
4722
|
+
import_node_child_process7 = require("node:child_process");
|
|
4723
|
+
import_node_util3 = require("node:util");
|
|
4722
4724
|
init_src();
|
|
4723
|
-
import_wasm_opt = require("wasm-opt");
|
|
4724
4725
|
init_admitted_mac_build();
|
|
4725
4726
|
init_home_paths();
|
|
4726
4727
|
init_wasm_narrow_boundary();
|
|
@@ -4739,7 +4740,9 @@ var init_wasm_optimize = __esm({
|
|
|
4739
4740
|
];
|
|
4740
4741
|
KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
|
|
4741
4742
|
LOWERING = ["--memory64-lowering", "--table64-lowering"];
|
|
4742
|
-
|
|
4743
|
+
BINARYEN_VERSION = "132";
|
|
4744
|
+
runBinaryen = (0, import_node_util3.promisify)(import_node_child_process7.execFile);
|
|
4745
|
+
WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} unoptimized-names`;
|
|
4743
4746
|
}
|
|
4744
4747
|
});
|
|
4745
4748
|
|
|
@@ -4778,19 +4781,19 @@ var init_icuData = __esm({
|
|
|
4778
4781
|
});
|
|
4779
4782
|
|
|
4780
4783
|
// src/swift-icu.ts
|
|
4781
|
-
var
|
|
4784
|
+
var import_node_child_process8, import_node_util4, import_node_zlib2, run3, deflate, compressBrotli, inflateGzip;
|
|
4782
4785
|
var init_swift_icu = __esm({
|
|
4783
4786
|
"src/swift-icu.ts"() {
|
|
4784
4787
|
"use strict";
|
|
4785
|
-
|
|
4786
|
-
|
|
4788
|
+
import_node_child_process8 = require("node:child_process");
|
|
4789
|
+
import_node_util4 = require("node:util");
|
|
4787
4790
|
import_node_zlib2 = require("node:zlib");
|
|
4788
4791
|
init_icuData();
|
|
4789
4792
|
init_swift_toolchain();
|
|
4790
|
-
run3 = (0,
|
|
4791
|
-
deflate = (0,
|
|
4792
|
-
compressBrotli = (0,
|
|
4793
|
-
inflateGzip = (0,
|
|
4793
|
+
run3 = (0, import_node_util4.promisify)(import_node_child_process8.execFile);
|
|
4794
|
+
deflate = (0, import_node_util4.promisify)(import_node_zlib2.gzip);
|
|
4795
|
+
compressBrotli = (0, import_node_util4.promisify)(import_node_zlib2.brotliCompress);
|
|
4796
|
+
inflateGzip = (0, import_node_util4.promisify)(import_node_zlib2.gunzip);
|
|
4794
4797
|
}
|
|
4795
4798
|
});
|
|
4796
4799
|
|
|
@@ -4959,7 +4962,7 @@ var init_swift_compile = __esm({
|
|
|
4959
4962
|
FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
4960
4963
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
4961
4964
|
).join("");
|
|
4962
|
-
compilerSourceDigest = true ? "
|
|
4965
|
+
compilerSourceDigest = true ? "e9903c7ebf2ae396a07925e2a04b37ce38e5f1731c5bc94f6f0e83a9d6bc2cbf" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
4963
4966
|
C_WORDS = new Set(
|
|
4964
4967
|
"auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
|
|
4965
4968
|
" "
|
|
@@ -5160,13 +5163,13 @@ var init_swift_distribution = __esm({
|
|
|
5160
5163
|
});
|
|
5161
5164
|
|
|
5162
5165
|
// src/swift-package-manifest.ts
|
|
5163
|
-
var
|
|
5166
|
+
var import_node_child_process9, import_node_path17, import_node_util5, cacheDir3, execFileAsync;
|
|
5164
5167
|
var init_swift_package_manifest = __esm({
|
|
5165
5168
|
"src/swift-package-manifest.ts"() {
|
|
5166
5169
|
"use strict";
|
|
5167
|
-
|
|
5170
|
+
import_node_child_process9 = require("node:child_process");
|
|
5168
5171
|
import_node_path17 = __toESM(require("node:path"), 1);
|
|
5169
|
-
|
|
5172
|
+
import_node_util5 = require("node:util");
|
|
5170
5173
|
init_git_repo_env();
|
|
5171
5174
|
init_home_paths();
|
|
5172
5175
|
init_swift_distribution();
|
|
@@ -5174,7 +5177,7 @@ var init_swift_package_manifest = __esm({
|
|
|
5174
5177
|
init_swift_package();
|
|
5175
5178
|
init_swift_toolchain();
|
|
5176
5179
|
cacheDir3 = import_node_path17.default.join(cacheDir(), "swift-manifests");
|
|
5177
|
-
execFileAsync = (0,
|
|
5180
|
+
execFileAsync = (0, import_node_util5.promisify)(import_node_child_process9.execFile);
|
|
5178
5181
|
}
|
|
5179
5182
|
});
|
|
5180
5183
|
|
|
@@ -5354,12 +5357,12 @@ var init_swift_shipped_binaries = __esm({
|
|
|
5354
5357
|
});
|
|
5355
5358
|
|
|
5356
5359
|
// src/swift-packages.ts
|
|
5357
|
-
var
|
|
5360
|
+
var import_node_child_process10, import_node_util6, execFileAsync2;
|
|
5358
5361
|
var init_swift_packages = __esm({
|
|
5359
5362
|
"src/swift-packages.ts"() {
|
|
5360
5363
|
"use strict";
|
|
5361
|
-
|
|
5362
|
-
|
|
5364
|
+
import_node_child_process10 = require("node:child_process");
|
|
5365
|
+
import_node_util6 = require("node:util");
|
|
5363
5366
|
init_git_repo_env();
|
|
5364
5367
|
init_home_paths();
|
|
5365
5368
|
init_native_git();
|
|
@@ -5369,7 +5372,7 @@ var init_swift_packages = __esm({
|
|
|
5369
5372
|
init_swift_package();
|
|
5370
5373
|
init_swift_package_manifest();
|
|
5371
5374
|
init_swift_shipped_binaries();
|
|
5372
|
-
execFileAsync2 = (0,
|
|
5375
|
+
execFileAsync2 = (0, import_node_util6.promisify)(import_node_child_process10.execFile);
|
|
5373
5376
|
}
|
|
5374
5377
|
});
|
|
5375
5378
|
|
|
@@ -5638,27 +5641,27 @@ var init_installed_native_libraries = __esm({
|
|
|
5638
5641
|
});
|
|
5639
5642
|
|
|
5640
5643
|
// src/turbo-codegen-intake.ts
|
|
5641
|
-
var
|
|
5644
|
+
var import_node_child_process11, import_node_util7, run4;
|
|
5642
5645
|
var init_turbo_codegen_intake = __esm({
|
|
5643
5646
|
"src/turbo-codegen-intake.ts"() {
|
|
5644
5647
|
"use strict";
|
|
5645
|
-
|
|
5646
|
-
|
|
5648
|
+
import_node_child_process11 = require("node:child_process");
|
|
5649
|
+
import_node_util7 = require("node:util");
|
|
5647
5650
|
init_forked_script_contract();
|
|
5648
5651
|
init_is_record();
|
|
5649
5652
|
init_nitro_source();
|
|
5650
5653
|
init_podspec_sources();
|
|
5651
|
-
run4 = (0,
|
|
5654
|
+
run4 = (0, import_node_util7.promisify)(import_node_child_process11.execFile);
|
|
5652
5655
|
}
|
|
5653
5656
|
});
|
|
5654
5657
|
|
|
5655
5658
|
// src/turbo-source.ts
|
|
5656
|
-
var
|
|
5659
|
+
var import_node_child_process12, import_node_util8, execFileAsync3;
|
|
5657
5660
|
var init_turbo_source = __esm({
|
|
5658
5661
|
"src/turbo-source.ts"() {
|
|
5659
5662
|
"use strict";
|
|
5660
|
-
|
|
5661
|
-
|
|
5663
|
+
import_node_child_process12 = require("node:child_process");
|
|
5664
|
+
import_node_util8 = require("node:util");
|
|
5662
5665
|
init_home_paths();
|
|
5663
5666
|
init_installed_native_libraries();
|
|
5664
5667
|
init_answeredNativePackages();
|
|
@@ -5671,7 +5674,7 @@ var init_turbo_source = __esm({
|
|
|
5671
5674
|
init_swiftContract();
|
|
5672
5675
|
init_turbo_codegen_intake();
|
|
5673
5676
|
init_xcode_project();
|
|
5674
|
-
execFileAsync3 = (0,
|
|
5677
|
+
execFileAsync3 = (0, import_node_util8.promisify)(import_node_child_process12.execFile);
|
|
5675
5678
|
}
|
|
5676
5679
|
});
|
|
5677
5680
|
|
|
@@ -10002,8 +10005,8 @@ var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
|
10002
10005
|
|
|
10003
10006
|
// src/expo-swift-host.ts
|
|
10004
10007
|
var import_node_async_hooks3 = require("node:async_hooks");
|
|
10005
|
-
var
|
|
10006
|
-
var
|
|
10008
|
+
var import_node_child_process13 = require("node:child_process");
|
|
10009
|
+
var import_node_util9 = require("node:util");
|
|
10007
10010
|
init_answeredNativePackages();
|
|
10008
10011
|
init_expo_autolinking();
|
|
10009
10012
|
|
|
@@ -10075,7 +10078,7 @@ init_swift_standins();
|
|
|
10075
10078
|
init_swift_submit();
|
|
10076
10079
|
init_swift_toolchain();
|
|
10077
10080
|
init_turbo_source();
|
|
10078
|
-
var run5 = (0,
|
|
10081
|
+
var run5 = (0, import_node_util9.promisify)(import_node_child_process13.execFile);
|
|
10079
10082
|
var scriptEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" };
|
|
10080
10083
|
var traceStore = new import_node_async_hooks3.AsyncLocalStorage();
|
|
10081
10084
|
var openPreparations = new NativePreparationReceipts();
|
|
@@ -15225,17 +15228,17 @@ function readOneNativeAppCatalog(entryConfig, root) {
|
|
|
15225
15228
|
}
|
|
15226
15229
|
|
|
15227
15230
|
// src/one-widget-metadata.ts
|
|
15228
|
-
var
|
|
15231
|
+
var import_node_child_process14 = require("node:child_process");
|
|
15229
15232
|
var import_node_crypto6 = require("node:crypto");
|
|
15230
15233
|
var import_node_fs18 = __toESM(require("node:fs"), 1);
|
|
15231
15234
|
var import_node_module2 = require("node:module");
|
|
15232
15235
|
var import_node_path25 = __toESM(require("node:path"), 1);
|
|
15233
|
-
var
|
|
15236
|
+
var import_node_util10 = require("node:util");
|
|
15234
15237
|
init_forked_script_contract();
|
|
15235
15238
|
init_is_record();
|
|
15236
15239
|
init_swift_source_file();
|
|
15237
15240
|
init_swift_submit();
|
|
15238
|
-
var run6 = (0,
|
|
15241
|
+
var run6 = (0, import_node_util10.promisify)(import_node_child_process14.execFile);
|
|
15239
15242
|
var configs = /* @__PURE__ */ new Map();
|
|
15240
15243
|
var reads = /* @__PURE__ */ new Map();
|
|
15241
15244
|
var CONFIG_CHILD = `
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2401 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/kotlin/sdk.tar.gz
CHANGED
|
Binary file
|
package/kotlin/toolchain.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"url": "https://github.com/JetBrains/kotlin/releases/download/v2.4.20/kotlin-compiler-2.4.20.zip",
|
|
5
5
|
"sha256": "59e9ca74c7904ef2c122b12114937673ccce68de820a663f0ed66ccf8799e0b7",
|
|
6
6
|
"jar": {
|
|
7
|
-
"url": "https://r2.rnxsim.com/peach-kotlin-fork/
|
|
8
|
-
"sha256": "
|
|
7
|
+
"url": "https://r2.rnxsim.com/peach-kotlin-fork/2328ddf16943f8a656f87bc3339983583887df352083b98445fa72327f9bad7d/kotlin-compiler.jar",
|
|
8
|
+
"sha256": "2328ddf16943f8a656f87bc3339983583887df352083b98445fa72327f9bad7d"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"libraries": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peachsim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2401",
|
|
4
4
|
"description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
|
|
5
5
|
"author": "Tamagui LLC",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -370,7 +370,6 @@
|
|
|
370
370
|
"sucrase": "3.35.1",
|
|
371
371
|
"svgpath": "2.6.0",
|
|
372
372
|
"terser": "^5.49.0",
|
|
373
|
-
"wasm-opt": "2.0.1",
|
|
374
373
|
"valibot": "^1.3.1",
|
|
375
374
|
"ws": "^8.18.0",
|
|
376
375
|
"zod": "4.6.7"
|
|
@@ -388,7 +387,6 @@
|
|
|
388
387
|
"@peach/box": "workspace:*",
|
|
389
388
|
"@peach/compat": "workspace:*",
|
|
390
389
|
"@peach/globals": "workspace:*",
|
|
391
|
-
"@peach/skills": "workspace:*",
|
|
392
390
|
"@types/plist": "3.0.5",
|
|
393
391
|
"@types/ws": "^8.5.13",
|
|
394
392
|
"json5": "^2.2.3",
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GKState.h
|
|
3
|
+
// GameplayKit
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2014 Apple. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <GameplayKit/GameplayKit.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@class GKStateMachine;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents a single state in a state machine.
|
|
16
|
+
* By default, states allow transitions freely to and from the states in the machine.
|
|
17
|
+
*
|
|
18
|
+
* If a more restricted set of valid transitions are needed in the state machine, you may override isValidNextState: where applicable.
|
|
19
|
+
*
|
|
20
|
+
* @see GKStateMachine
|
|
21
|
+
* @see isValidNextState:
|
|
22
|
+
*/
|
|
23
|
+
GK_BASE_AVAILABILITY @interface GKState : NSObject
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The state machine that this state is associated with.
|
|
27
|
+
* This is nil if this state hasn't been added to a state machine yet.
|
|
28
|
+
*/
|
|
29
|
+
@property (nullable, nonatomic, readonly, weak) GKStateMachine *stateMachine;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new state to be used in a state machine.
|
|
33
|
+
*
|
|
34
|
+
* @see GKStateMachine
|
|
35
|
+
*/
|
|
36
|
+
+ (instancetype)state;
|
|
37
|
+
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns YES if the given class is a valid next state to enter.
|
|
41
|
+
*
|
|
42
|
+
* By default GKState will return YES for any class that is subclass of GKState.
|
|
43
|
+
* Override this in a subclass to enforce limited edge traversals in the state machine.
|
|
44
|
+
*
|
|
45
|
+
* @see GKStateMachine.canEnterState:
|
|
46
|
+
* @see GKStateMachine.enterState:
|
|
47
|
+
*
|
|
48
|
+
* @param stateClass the class to be checked
|
|
49
|
+
* @return YES if the class is kind of GKState and the state transition is valid, else NO.
|
|
50
|
+
*/
|
|
51
|
+
- (BOOL)isValidNextState:(Class)stateClass;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Called by GKStateMachine when this state is entered.
|
|
55
|
+
*
|
|
56
|
+
* @param previousState the state that was exited to enter this state. This is nil if this is the state machine's first entered state.
|
|
57
|
+
* @see stateMachineWithStates:initialStateClass:
|
|
58
|
+
*/
|
|
59
|
+
- (void)didEnterWithPreviousState:(nullable GKState *)previousState;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Called by GKStateMachine when it is updated
|
|
63
|
+
*
|
|
64
|
+
* @param seconds the time in seconds since the last update
|
|
65
|
+
*/
|
|
66
|
+
- (void)updateWithDeltaTime:(NSTimeInterval)seconds;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Called by GKStateMachine when this state is exited
|
|
70
|
+
*
|
|
71
|
+
* @param nextState the state that is being entered next
|
|
72
|
+
*/
|
|
73
|
+
- (void)willExitWithNextState:(GKState *)nextState;
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@end
|
|
77
|
+
|
|
78
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GKStateMachine.h
|
|
3
|
+
// GameplayKit
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2014 Apple. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <GameplayKit/GameplayKit.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@class GKState;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Models a finite state machine that has a single current state.
|
|
16
|
+
*/
|
|
17
|
+
GK_BASE_AVAILABILITY @interface GKStateMachine : NSObject
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The current state that the state machine is in.
|
|
21
|
+
* Prior to the first called to enterState this is equal to nil.
|
|
22
|
+
*/
|
|
23
|
+
@property (nullable, nonatomic, readonly) GKState* currentState;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates a state machine with an array of possible states and an initial state.
|
|
27
|
+
*
|
|
28
|
+
* @param states a list of possible states for this state machine.
|
|
29
|
+
*/
|
|
30
|
+
+ (instancetype)stateMachineWithStates:(NSArray<GKState *> *)states;
|
|
31
|
+
- (instancetype)initWithStates:(NSArray<GKState *> *)states NS_DESIGNATED_INITIALIZER;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Updates the current state machine.
|
|
35
|
+
*
|
|
36
|
+
* @param sec the time, in seconds, since the last frame
|
|
37
|
+
*/
|
|
38
|
+
- (void)updateWithDeltaTime:(NSTimeInterval)sec;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Gets the instance of the indicated state class from this state machine.
|
|
42
|
+
* Returns nil if the state does not exist
|
|
43
|
+
*
|
|
44
|
+
* @param stateClass the class of the state to be retrieved
|
|
45
|
+
*/
|
|
46
|
+
- (nullable GKState*)stateForClass:(Class)stateClass NS_SWIFT_UNAVAILABLE("Exposed in Swift as stateForClass<StateType: GKState>(stateClass: StateType.Type) -> StateType?");
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns YES if the indicated class is a a valid next state or if currentState is nil
|
|
50
|
+
*
|
|
51
|
+
* @param stateClass the class of the state to be tested
|
|
52
|
+
*/
|
|
53
|
+
- (BOOL)canEnterState:(Class)stateClass;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Calls canEnterState to check if we can enter the given state and then enters that state if so.
|
|
57
|
+
* [GKState willExitWithNextState:] is called on the old current state.
|
|
58
|
+
* [GKState didEnterWithPreviousState:] is called on the new state.
|
|
59
|
+
*
|
|
60
|
+
* @param stateClass the class of the state to switch to
|
|
61
|
+
* @return YES if state was entered. NO otherwise.
|
|
62
|
+
*/
|
|
63
|
+
- (BOOL)enterState:(Class)stateClass;
|
|
64
|
+
|
|
65
|
+
@end
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
NS_ASSUME_NONNULL_END
|
|
69
|
+
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
---
|
|
2
|
+
Name: GameplayKit
|
|
3
|
+
Classes:
|
|
4
|
+
- Name: GKComponent
|
|
5
|
+
Methods:
|
|
6
|
+
- Selector: 'updateWithDeltaTime:'
|
|
7
|
+
SwiftName: update(deltaTime:)
|
|
8
|
+
MethodKind: Instance
|
|
9
|
+
- Name: GKComponentSystem
|
|
10
|
+
Methods:
|
|
11
|
+
- Selector: 'addComponentWithEntity:'
|
|
12
|
+
SwiftName: addComponent(foundIn:)
|
|
13
|
+
MethodKind: Instance
|
|
14
|
+
- Selector: 'removeComponentWithEntity:'
|
|
15
|
+
SwiftName: removeComponent(foundIn:)
|
|
16
|
+
MethodKind: Instance
|
|
17
|
+
- Selector: 'updateWithDeltaTime:'
|
|
18
|
+
SwiftName: update(deltaTime:)
|
|
19
|
+
MethodKind: Instance
|
|
20
|
+
- Name: GKCompositeBehavior
|
|
21
|
+
Methods:
|
|
22
|
+
- Selector: 'behaviorWithBehaviors:andWeights:'
|
|
23
|
+
SwiftName: init(behaviors:weights:)
|
|
24
|
+
MethodKind: Instance
|
|
25
|
+
- Name: GKDecisionNode
|
|
26
|
+
Methods:
|
|
27
|
+
- Selector: 'createBranchWithValue:attribute:'
|
|
28
|
+
SwiftName: createBranch(value:attribute:)
|
|
29
|
+
MethodKind: Instance
|
|
30
|
+
- Selector: 'createBranchWithPredicate:attribute:'
|
|
31
|
+
SwiftName: createBranch(predicate:attribute:)
|
|
32
|
+
MethodKind: Instance
|
|
33
|
+
- Selector: 'createBranchWithWeight:attribute:'
|
|
34
|
+
SwiftName: createBranch(weight:attribute:)
|
|
35
|
+
MethodKind: Instance
|
|
36
|
+
- Name: GKEntity
|
|
37
|
+
Methods:
|
|
38
|
+
- Selector: 'updateWithDeltaTime:'
|
|
39
|
+
SwiftName: update(deltaTime:)
|
|
40
|
+
MethodKind: Instance
|
|
41
|
+
- Name: GKGameModel
|
|
42
|
+
Methods:
|
|
43
|
+
- Selector: 'unapplyGameModelUpdate:'
|
|
44
|
+
SwiftName: unapply(_:)
|
|
45
|
+
MethodKind: Instance
|
|
46
|
+
- Name: GKGoal
|
|
47
|
+
Methods:
|
|
48
|
+
- Selector: 'goalToSeekAgent:'
|
|
49
|
+
SwiftName: init(toSeek:)
|
|
50
|
+
MethodKind: Instance
|
|
51
|
+
- Selector: 'goalToFleeAgent:'
|
|
52
|
+
SwiftName: init(toFlee:)
|
|
53
|
+
MethodKind: Instance
|
|
54
|
+
- Selector: 'goalToInterceptAgent:maxPredictionTime:'
|
|
55
|
+
SwiftName: init(toIntercept:maxPredictionTime:)
|
|
56
|
+
MethodKind: Instance
|
|
57
|
+
- Name: GKGraph
|
|
58
|
+
Methods:
|
|
59
|
+
- Selector: 'initWithNodes:'
|
|
60
|
+
SwiftName: init(_:)
|
|
61
|
+
MethodKind: Instance
|
|
62
|
+
- Selector: 'connectNodeToLowestCostNode:bidirectional:'
|
|
63
|
+
SwiftName: connectToLowestCostNode(node:bidirectional:)
|
|
64
|
+
MethodKind: Instance
|
|
65
|
+
- Selector: 'removeNodes:'
|
|
66
|
+
SwiftName: remove(_:)
|
|
67
|
+
MethodKind: Instance
|
|
68
|
+
- Selector: 'addNodes:'
|
|
69
|
+
SwiftName: add(_:)
|
|
70
|
+
MethodKind: Instance
|
|
71
|
+
- Name: GKGridGraph
|
|
72
|
+
Methods:
|
|
73
|
+
- Selector: 'nodeAtGridPosition:'
|
|
74
|
+
SwiftName: node(atGridPosition:)
|
|
75
|
+
MethodKind: Instance
|
|
76
|
+
- Selector: 'connectNodeToAdjacentNodes:'
|
|
77
|
+
SwiftName: connectToAdjacentNodes(node:)
|
|
78
|
+
MethodKind: Instance
|
|
79
|
+
- Selector: 'initWithNodes:'
|
|
80
|
+
SwiftName: init(_:)
|
|
81
|
+
MethodKind: Instance
|
|
82
|
+
- Name: GKMeshGraph
|
|
83
|
+
Methods:
|
|
84
|
+
- Selector: 'connectNodeUsingObstacles:'
|
|
85
|
+
SwiftName: connectUsingObstacles(node:)
|
|
86
|
+
MethodKind: Instance
|
|
87
|
+
- Selector: 'initWithNodes:'
|
|
88
|
+
SwiftName: init(_:)
|
|
89
|
+
MethodKind: Instance
|
|
90
|
+
- Name: GKNoise
|
|
91
|
+
Methods:
|
|
92
|
+
- Selector: 'initWithNoiseSource:'
|
|
93
|
+
SwiftName: init(_:)
|
|
94
|
+
MethodKind: Instance
|
|
95
|
+
- Selector: 'initWithNoiseSource:gradientColors:'
|
|
96
|
+
SwiftName: init(_:gradientColors:)
|
|
97
|
+
MethodKind: Instance
|
|
98
|
+
- Selector: 'clampWithLowerBound:upperBound:'
|
|
99
|
+
SwiftName: clamp(lowerBound:upperBound:)
|
|
100
|
+
MethodKind: Instance
|
|
101
|
+
- Selector: 'raiseToPower:'
|
|
102
|
+
SwiftName: raiseToPower(_:)
|
|
103
|
+
MethodKind: Instance
|
|
104
|
+
- Selector: 'applyTurbulenceWithFrequency:power:roughness:seed:'
|
|
105
|
+
SwiftName: applyTurbulence(frequency:power:roughness:seed:)
|
|
106
|
+
MethodKind: Instance
|
|
107
|
+
- Selector: 'remapValuesToCurveWithControlPoints:'
|
|
108
|
+
SwiftName: remapValues(toCurveWithControlPoints:)
|
|
109
|
+
MethodKind: Instance
|
|
110
|
+
- Selector: 'remapValuesToTerracesWithPeaks:terracesInverted:'
|
|
111
|
+
SwiftName: remapValues(toTerracesWithPeaks:terracesInverted:)
|
|
112
|
+
MethodKind: Instance
|
|
113
|
+
- Selector: 'addWithNoise:'
|
|
114
|
+
SwiftName: add(_:)
|
|
115
|
+
MethodKind: Instance
|
|
116
|
+
- Selector: 'multiplyWithNoise:'
|
|
117
|
+
SwiftName: multiply(_:)
|
|
118
|
+
MethodKind: Instance
|
|
119
|
+
- Selector: 'minimumWithNoise:'
|
|
120
|
+
SwiftName: minimum(_:)
|
|
121
|
+
MethodKind: Instance
|
|
122
|
+
- Selector: 'maximumWithNoise:'
|
|
123
|
+
SwiftName: maximum(_:)
|
|
124
|
+
MethodKind: Instance
|
|
125
|
+
- Selector: 'raiseToPowerWithNoise:'
|
|
126
|
+
SwiftName: raiseToPower(_:)
|
|
127
|
+
MethodKind: Instance
|
|
128
|
+
- Selector: 'displaceXWithNoise:yWithNoise:zWithNoise:'
|
|
129
|
+
SwiftName: displaceWithNoises(x:y:z:)
|
|
130
|
+
MethodKind: Instance
|
|
131
|
+
- Name: GKNoiseMap
|
|
132
|
+
Methods:
|
|
133
|
+
- Selector: 'initWithNoise:'
|
|
134
|
+
SwiftName: init(_:)
|
|
135
|
+
MethodKind: Instance
|
|
136
|
+
- Selector: 'initWithNoise:size:origin:sampleCount:seamless:'
|
|
137
|
+
SwiftName: init(_:size:origin:sampleCount:seamless:)
|
|
138
|
+
MethodKind: Instance
|
|
139
|
+
- Selector: 'valueAtPosition:'
|
|
140
|
+
SwiftName: value(at:)
|
|
141
|
+
MethodKind: Instance
|
|
142
|
+
- Selector: 'interpolatedValueAtPosition:'
|
|
143
|
+
SwiftName: interpolatedValue(at:)
|
|
144
|
+
MethodKind: Instance
|
|
145
|
+
- Selector: 'setValue:atPosition:'
|
|
146
|
+
SwiftName: setValue(_:at:)
|
|
147
|
+
MethodKind: Instance
|
|
148
|
+
- Name: GKObstacleGraph
|
|
149
|
+
Methods:
|
|
150
|
+
- Selector: 'connectNodeUsingObstacles:'
|
|
151
|
+
SwiftName: connectUsingObstacles(node:)
|
|
152
|
+
MethodKind: Instance
|
|
153
|
+
- Selector: 'connectNodeUsingObstacles:ignoringObstacles:'
|
|
154
|
+
SwiftName: connectUsingObstacles(node:ignoring:)
|
|
155
|
+
MethodKind: Instance
|
|
156
|
+
- Selector: 'connectNodeUsingObstacles:ignoringBufferRadiusOfObstacles:'
|
|
157
|
+
SwiftName: connectUsingObstacles(node:ignoringBufferRadiusOf:)
|
|
158
|
+
MethodKind: Instance
|
|
159
|
+
- Selector: 'initWithNodes:'
|
|
160
|
+
SwiftName: init(_:)
|
|
161
|
+
MethodKind: Instance
|
|
162
|
+
- Name: GKOctree
|
|
163
|
+
Methods:
|
|
164
|
+
- Selector: 'addElement:withPoint:'
|
|
165
|
+
SwiftName: add(_:at:)
|
|
166
|
+
MethodKind: Instance
|
|
167
|
+
- Selector: 'addElement:withBox:'
|
|
168
|
+
SwiftName: add(_:in:)
|
|
169
|
+
MethodKind: Instance
|
|
170
|
+
- Selector: 'elementsAtPoint:'
|
|
171
|
+
SwiftName: elements(at:)
|
|
172
|
+
MethodKind: Instance
|
|
173
|
+
- Selector: 'removeElement:'
|
|
174
|
+
SwiftName: remove(_:)
|
|
175
|
+
MethodKind: Instance
|
|
176
|
+
- Selector: 'removeElement:withNode:'
|
|
177
|
+
SwiftName: remove(_:using:)
|
|
178
|
+
MethodKind: Instance
|
|
179
|
+
- Name: GKQuadtree
|
|
180
|
+
Methods:
|
|
181
|
+
- Selector: 'addElement:withPoint:'
|
|
182
|
+
SwiftName: add(_:at:)
|
|
183
|
+
MethodKind: Instance
|
|
184
|
+
- Selector: 'addElement:withQuad:'
|
|
185
|
+
SwiftName: add(_:in:)
|
|
186
|
+
MethodKind: Instance
|
|
187
|
+
- Selector: 'elementsAtPoint:'
|
|
188
|
+
SwiftName: elements(at:)
|
|
189
|
+
MethodKind: Instance
|
|
190
|
+
- Selector: 'removeElement:'
|
|
191
|
+
SwiftName: remove(_:)
|
|
192
|
+
MethodKind: Instance
|
|
193
|
+
- Selector: 'removeElement:withNode:'
|
|
194
|
+
SwiftName: remove(_:using:)
|
|
195
|
+
MethodKind: Instance
|
|
196
|
+
- Name: GKRtree
|
|
197
|
+
Methods:
|
|
198
|
+
- Selector: 'addElement:boundingRectMin:boundingRectMax:splitStrategy:'
|
|
199
|
+
SwiftName: add(_:boundingRectMin:boundingRectMax:splitStrategy:)
|
|
200
|
+
MethodKind: Instance
|
|
201
|
+
- Selector: 'removeElement:boundingRectMin:boundingRectMax:'
|
|
202
|
+
SwiftName: remove(_:boundingRectMin:boundingRectMax:)
|
|
203
|
+
MethodKind: Instance
|
|
204
|
+
- Name: NSArray
|
|
205
|
+
Methods:
|
|
206
|
+
- Selector: 'shuffledArrayWithRandomSource:'
|
|
207
|
+
SwiftName: shuffled(using:)
|
|
208
|
+
MethodKind: Instance
|
|
209
|
+
- Name: GKARC4RandomSource
|
|
210
|
+
Methods:
|
|
211
|
+
- Selector: 'dropValuesWithCount:'
|
|
212
|
+
SwiftName: dropValues(_:)
|
|
213
|
+
MethodKind: Instance
|
|
214
|
+
- Name: GKRuleSystem
|
|
215
|
+
Methods:
|
|
216
|
+
- Selector: 'addRule:'
|
|
217
|
+
SwiftName: add(_:)
|
|
218
|
+
MethodKind: Instance
|
|
219
|
+
- Selector: 'addRulesFromArray:'
|
|
220
|
+
SwiftName: add(_:)
|
|
221
|
+
MethodKind: Instance
|
|
222
|
+
- Name: GKRule
|
|
223
|
+
Methods:
|
|
224
|
+
- Selector: 'evaluatePredicateWithSystem:'
|
|
225
|
+
SwiftName: evaluatePredicate(in:)
|
|
226
|
+
MethodKind: Instance
|
|
227
|
+
- Selector: 'performActionWithSystem:'
|
|
228
|
+
SwiftName: performAction(in:)
|
|
229
|
+
MethodKind: Instance
|
|
230
|
+
- Selector: 'ruleWithBlockPredicate:action:'
|
|
231
|
+
SwiftName: init(evaluator:action:)
|
|
232
|
+
MethodKind: Instance
|
|
233
|
+
- Name: GKState
|
|
234
|
+
Methods:
|
|
235
|
+
- Selector: 'didEnterWithPreviousState:'
|
|
236
|
+
SwiftName: didEnter(from:)
|
|
237
|
+
MethodKind: Instance
|
|
238
|
+
- Selector: 'updateWithDeltaTime:'
|
|
239
|
+
SwiftName: update(deltaTime:)
|
|
240
|
+
MethodKind: Instance
|
|
241
|
+
- Selector: 'willExitWithNextState:'
|
|
242
|
+
SwiftName: willExit(to:)
|
|
243
|
+
MethodKind: Instance
|
|
244
|
+
- Name: GKStateMachine
|
|
245
|
+
Methods:
|
|
246
|
+
- Selector: 'updateWithDeltaTime:'
|
|
247
|
+
SwiftName: update(deltaTime:)
|
|
248
|
+
MethodKind: Instance
|
|
249
|
+
- Selector: 'canEnterState:'
|
|
250
|
+
SwiftName: canEnter(:_)
|
|
251
|
+
MethodKind: Instance
|
|
252
|
+
- Selector: 'enterState:'
|
|
253
|
+
SwiftName: enter(_:)
|
|
254
|
+
MethodKind: Instance
|
|
255
|
+
- Selector: 'stateForClass:'
|
|
256
|
+
MethodKind: Instance
|
|
257
|
+
SwiftPrivate: true
|
|
258
|
+
- Name: SKTileMapNode
|
|
259
|
+
Methods:
|
|
260
|
+
- Selector: 'tileMapNodesWithTileSet:columns:rows:tileSize:fromNoiseMap:tileTypeNoiseMapThresholds:'
|
|
261
|
+
SwiftName: tileMapNodes(tileSet:columns:rows:tileSize:from:tileTypeNoiseMapThresholds:)
|
|
262
|
+
MethodKind: Class
|
|
263
|
+
|
|
264
|
+
Protocols:
|
|
265
|
+
- Name: GKRandom
|
|
266
|
+
Methods:
|
|
267
|
+
- Selector: 'nextIntWithUpperBound:'
|
|
268
|
+
SwiftName: nextInt(upperBound:)
|
|
269
|
+
MethodKind: Instance
|