Repository navigation
Expand file tree
/
Copy pathGameplayKit.d.ts
More file actions
1211 lines (684 loc) · 40 KB
/
Copy pathGameplayKit.d.ts
File metadata and controls
1211 lines (684 loc) · 40 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference types="@nativescript/objc-node-api" />
/// <reference path="./Runtime.d.ts" />
declare const GKGameModelMinScore: number;
declare const GKGameModelMaxScore: number;
declare const GKRTreeSplitStrategy: {
Halve: 0,
Linear: 1,
Quadratic: 2,
ReduceOverlap: 3,
};
declare const GKMeshGraphTriangulationMode: {
Vertices: 1,
Centers: 2,
EdgeMidpoints: 4,
};
declare class GKBox {
constructor(init?: GKBox);
boxMin: unknown /* ext vector */;
boxMax: unknown /* ext vector */;
}
declare class GKTriangle {
constructor(init?: GKTriangle);
points: unknown /* const array */;
}
declare class GKQuad {
constructor(init?: GKQuad);
quadMin: unknown /* ext vector */;
quadMax: unknown /* ext vector */;
}
declare interface GKSceneRootNodeType extends NSObjectProtocol {
}
declare class GKSceneRootNodeType extends NativeObject implements GKSceneRootNodeType {
}
declare interface GKStrategist extends NSObjectProtocol {
gameModel: GKGameModel;
randomSource: GKRandom;
bestMoveForActivePlayer(): GKGameModelUpdate;
}
declare class GKStrategist extends NativeObject implements GKStrategist {
}
declare interface GKRandom {
nextInt(): number;
nextIntWithUpperBound(upperBound: number): number;
nextUniform(): number;
nextBool(): boolean;
}
declare class GKRandom extends NativeObject implements GKRandom {
}
declare interface GKGameModelPlayer extends NSObjectProtocol {
readonly playerId: number;
}
declare class GKGameModelPlayer extends NativeObject implements GKGameModelPlayer {
}
declare interface GKGameModelUpdate extends NSObjectProtocol {
value: number;
}
declare class GKGameModelUpdate extends NativeObject implements GKGameModelUpdate {
}
declare interface GKGameModel extends NSObjectProtocol, NSCopying {
readonly players: NSArray;
readonly activePlayer: GKGameModelPlayer;
setGameModel(gameModel: GKGameModel): void;
gameModelUpdatesForPlayer(player: GKGameModelPlayer): NSArray;
applyGameModelUpdate(gameModelUpdate: GKGameModelUpdate): void;
scoreForPlayer?(player: GKGameModelPlayer): number;
isWinForPlayer?(player: GKGameModelPlayer): boolean;
isLossForPlayer?(player: GKGameModelPlayer): boolean;
unapplyGameModelUpdate?(gameModelUpdate: GKGameModelUpdate): void;
}
declare class GKGameModel extends NativeObject implements GKGameModel {
}
declare interface GKAgentDelegate extends NSObjectProtocol {
agentWillUpdate?(agent: GKAgent): void;
agentDidUpdate?(agent: GKAgent): void;
}
declare class GKAgentDelegate extends NativeObject implements GKAgentDelegate {
}
declare class GKSKNodeComponent extends GKComponent implements GKAgentDelegate {
static componentWithNode<This extends abstract new (...args: any) => any>(this: This, node: SKNode): InstanceType<This>;
initWithNode(node: SKNode): this;
node: SKNode;
agentWillUpdate(agent: GKAgent): void;
agentDidUpdate(agent: GKAgent): void;
isEqual(object: interop.Object): boolean;
readonly hash: number;
readonly superclass: interop.Object;
class(): interop.Object;
self(): this;
performSelector(aSelector: string): interop.Object;
performSelectorWithObject(aSelector: string, object: interop.Object): interop.Object;
performSelectorWithObjectWithObject(aSelector: string, object1: interop.Object, object2: interop.Object): interop.Object;
readonly isProxy: boolean;
isKindOfClass(aClass: interop.Object): boolean;
isMemberOfClass(aClass: interop.Object): boolean;
conformsToProtocol(aProtocol: interop.PointerConvertible): boolean;
respondsToSelector(aSelector: string): boolean;
retain(): this;
release(): void;
autorelease(): this;
retainCount(): number;
readonly zone: interop.Pointer;
readonly description: string;
readonly debugDescription: string;
}
declare class GKState extends NSObject {
readonly stateMachine: GKStateMachine;
static state<This extends abstract new (...args: any) => any>(this: This): InstanceType<This>;
init(): this;
isValidNextState(stateClass: interop.Object): boolean;
didEnterWithPreviousState(previousState: GKState | null): void;
updateWithDeltaTime(seconds: number): void;
willExitWithNextState(nextState: GKState): void;
}
declare class GKNSPredicateRule extends GKRule {
readonly predicate: NSPredicate;
initWithPredicate(predicate: NSPredicate): this;
evaluatePredicateWithSystem(system: GKRuleSystem): boolean;
}
declare class GKRuleSystem extends NSObject {
init(): this;
evaluate(): void;
readonly state: NSMutableDictionary;
readonly rules: NSArray;
addRule(rule: GKRule): void;
addRulesFromArray(rules: NSArray<interop.Object> | Array<interop.Object>): void;
removeAllRules(): void;
readonly agenda: NSArray;
readonly executed: NSArray;
readonly facts: NSArray;
gradeForFact(fact: NSObject): number;
minimumGradeForFacts(facts: NSArray<interop.Object> | Array<interop.Object>): number;
maximumGradeForFacts(facts: NSArray<interop.Object> | Array<interop.Object>): number;
assertFact(fact: NSObject): void;
assertFactGrade(fact: NSObject, grade: number): void;
retractFact(fact: NSObject): void;
retractFactGrade(fact: NSObject, grade: number): void;
reset(): void;
}
declare class GKRTree<ElementType = interop.Object> extends NSObject {
queryReserve: number;
static treeWithMaxNumberOfChildren<ElementType, This extends abstract new (...args: any) => any>(this: This, maxNumberOfChildren: number): InstanceType<This>;
initWithMaxNumberOfChildren(maxNumberOfChildren: number): this;
addElementBoundingRectMinBoundingRectMaxSplitStrategy(element: ElementType, boundingRectMin: unknown /* ext vector */, boundingRectMax: unknown /* ext vector */, splitStrategy: interop.Enum<typeof GKRTreeSplitStrategy>): void;
removeElementBoundingRectMinBoundingRectMax(element: ElementType, boundingRectMin: unknown /* ext vector */, boundingRectMax: unknown /* ext vector */): void;
elementsInBoundingRectMinRectMax(rectMin: unknown /* ext vector */, rectMax: unknown /* ext vector */): NSArray;
}
declare class GKShuffledDistribution extends GKRandomDistribution {
}
declare class GKRandomDistribution extends NSObject implements GKRandom {
readonly lowestValue: number;
readonly highestValue: number;
readonly numberOfPossibleOutcomes: number;
initWithRandomSourceLowestValueHighestValue(source: GKRandom, lowestInclusive: number, highestInclusive: number): this;
nextInt(): number;
nextIntWithUpperBound(upperBound: number): number;
nextUniform(): number;
nextBool(): boolean;
static distributionWithLowestValueHighestValue<This extends abstract new (...args: any) => any>(this: This, lowestInclusive: number, highestInclusive: number): InstanceType<This>;
static distributionForDieWithSideCount<This extends abstract new (...args: any) => any>(this: This, sideCount: number): InstanceType<This>;
static d6<This extends abstract new (...args: any) => any>(this: This): InstanceType<This>;
static d20<This extends abstract new (...args: any) => any>(this: This): InstanceType<This>;
}
declare class GKQuadtree<ElementType = interop.Object> extends NSObject {
static quadtreeWithBoundingQuadMinimumCellSize<ElementType, This extends abstract new (...args: any) => any>(this: This, quad: GKQuad, minCellSize: number): InstanceType<This>;
initWithBoundingQuadMinimumCellSize(quad: GKQuad, minCellSize: number): this;
addElementWithPoint(element: ElementType, point: unknown /* ext vector */): GKQuadtreeNode;
addElementWithQuad(element: ElementType, quad: GKQuad): GKQuadtreeNode;
elementsAtPoint(point: unknown /* ext vector */): NSArray;
elementsInQuad(quad: GKQuad): NSArray;
removeElement(element: ElementType): boolean;
removeElementWithNode(data: ElementType, node: GKQuadtreeNode): boolean;
}
declare class GKQuadtreeNode extends NSObject {
readonly quad: GKQuad;
}
declare class GKOctree<ElementType = interop.Object> extends NSObject {
static octreeWithBoundingBoxMinimumCellSize<ElementType, This extends abstract new (...args: any) => any>(this: This, box: GKBox, minCellSize: number): InstanceType<This>;
initWithBoundingBoxMinimumCellSize(box: GKBox, minCellSize: number): this;
addElementWithPoint(element: ElementType, point: unknown /* ext vector */): GKOctreeNode;
addElementWithBox(element: ElementType, box: GKBox): GKOctreeNode;
elementsAtPoint(point: unknown /* ext vector */): NSArray;
elementsInBox(box: GKBox): NSArray;
removeElement(element: ElementType): boolean;
removeElementWithNode(element: ElementType, node: GKOctreeNode): boolean;
}
declare class GKOctreeNode extends NSObject {
readonly box: GKBox;
}
declare class GKNoiseMap extends NSObject {
readonly size: unknown /* ext vector */;
readonly origin: unknown /* ext vector */;
readonly sampleCount: unknown /* ext vector */;
readonly isSeamless: boolean;
init(): this;
static noiseMapWithNoise<This extends abstract new (...args: any) => any>(this: This, noise: GKNoise): InstanceType<This>;
static noiseMapWithNoiseSizeOriginSampleCountSeamless<This extends abstract new (...args: any) => any>(this: This, noise: GKNoise, size: unknown /* ext vector */, origin: unknown /* ext vector */, sampleCount: unknown /* ext vector */, seamless: boolean): InstanceType<This>;
initWithNoise(noise: GKNoise): this;
initWithNoiseSizeOriginSampleCountSeamless(noise: GKNoise, size: unknown /* ext vector */, origin: unknown /* ext vector */, sampleCount: unknown /* ext vector */, seamless: boolean): this;
valueAtPosition(position: unknown /* ext vector */): number;
interpolatedValueAtPosition(position: unknown /* ext vector */): number;
setValueAtPosition(value: number, position: unknown /* ext vector */): void;
}
declare class GKNoise extends NSObject {
get gradientColors(): NSDictionary;
set gradientColors(value: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object>);
init(): this;
static noiseWithNoiseSource<This extends abstract new (...args: any) => any>(this: This, noiseSource: GKNoiseSource): InstanceType<This>;
static noiseWithNoiseSourceGradientColors<This extends abstract new (...args: any) => any>(this: This, noiseSource: GKNoiseSource, gradientColors: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object>): InstanceType<This>;
initWithNoiseSource(noiseSource: GKNoiseSource): this;
initWithNoiseSourceGradientColors(noiseSource: GKNoiseSource, gradientColors: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object>): this;
static noiseWithComponentNoisesSelectionNoise<This extends abstract new (...args: any) => any>(this: This, noises: NSArray<interop.Object> | Array<interop.Object>, selectionNoise: GKNoise): InstanceType<This>;
static noiseWithComponentNoisesSelectionNoiseComponentBoundariesBoundaryBlendDistances<This extends abstract new (...args: any) => any>(this: This, noises: NSArray<interop.Object> | Array<interop.Object>, selectionNoise: GKNoise, componentBoundaries: NSArray<interop.Object> | Array<interop.Object>, blendDistances: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
valueAtPosition(position: unknown /* ext vector */): number;
applyAbsoluteValue(): void;
clampWithLowerBoundUpperBound(lowerBound: number, upperBound: number): void;
raiseToPower(power: number): void;
invert(): void;
applyTurbulenceWithFrequencyPowerRoughnessSeed(frequency: number, power: number, roughness: number, seed: number): void;
remapValuesToCurveWithControlPoints(controlPoints: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object>): void;
remapValuesToTerracesWithPeaksTerracesInverted(peakInputValues: NSArray<interop.Object> | Array<interop.Object>, inverted: boolean): void;
moveBy(delta: unknown /* ext vector */): void;
scaleBy(factor: unknown /* ext vector */): void;
rotateBy(radians: unknown /* ext vector */): void;
addWithNoise(noise: GKNoise): void;
multiplyWithNoise(noise: GKNoise): void;
minimumWithNoise(noise: GKNoise): void;
maximumWithNoise(noise: GKNoise): void;
raiseToPowerWithNoise(noise: GKNoise): void;
displaceXWithNoiseYWithNoiseZWithNoise(xDisplacementNoise: GKNoise, yDisplacementNoise: GKNoise, zDisplacementNoise: GKNoise): void;
}
declare class GKSpheresNoiseSource extends GKNoiseSource {
frequency: number;
static spheresNoiseWithFrequency<This extends abstract new (...args: any) => any>(this: This, frequency: number): InstanceType<This>;
initWithFrequency(frequency: number): this;
}
declare class GKCylindersNoiseSource extends GKNoiseSource {
frequency: number;
static cylindersNoiseWithFrequency<This extends abstract new (...args: any) => any>(this: This, frequency: number): InstanceType<This>;
initWithFrequency(frequency: number): this;
}
declare class GKConstantNoiseSource extends GKNoiseSource {
value: number;
static constantNoiseWithValue<This extends abstract new (...args: any) => any>(this: This, value: number): InstanceType<This>;
initWithValue(value: number): this;
}
declare class GKVoronoiNoiseSource extends GKNoiseSource {
frequency: number;
displacement: number;
isDistanceEnabled: boolean;
seed: number;
static voronoiNoiseWithFrequencyDisplacementDistanceEnabledSeed<This extends abstract new (...args: any) => any>(this: This, frequency: number, displacement: number, distanceEnabled: boolean, seed: number): InstanceType<This>;
initWithFrequencyDisplacementDistanceEnabledSeed(frequency: number, displacement: number, distanceEnabled: boolean, seed: number): this;
}
declare class GKRidgedNoiseSource extends GKCoherentNoiseSource {
static ridgedNoiseSourceWithFrequencyOctaveCountLacunaritySeed<This extends abstract new (...args: any) => any>(this: This, frequency: number, octaveCount: number, lacunarity: number, seed: number): InstanceType<This>;
initWithFrequencyOctaveCountLacunaritySeed(frequency: number, octaveCount: number, lacunarity: number, seed: number): this;
}
declare class GKBillowNoiseSource extends GKCoherentNoiseSource {
persistence: number;
static billowNoiseSourceWithFrequencyOctaveCountPersistenceLacunaritySeed<This extends abstract new (...args: any) => any>(this: This, frequency: number, octaveCount: number, persistence: number, lacunarity: number, seed: number): InstanceType<This>;
initWithFrequencyOctaveCountPersistenceLacunaritySeed(frequency: number, octaveCount: number, persistence: number, lacunarity: number, seed: number): this;
}
declare class GKPerlinNoiseSource extends GKCoherentNoiseSource {
persistence: number;
static perlinNoiseSourceWithFrequencyOctaveCountPersistenceLacunaritySeed<This extends abstract new (...args: any) => any>(this: This, frequency: number, octaveCount: number, persistence: number, lacunarity: number, seed: number): InstanceType<This>;
initWithFrequencyOctaveCountPersistenceLacunaritySeed(frequency: number, octaveCount: number, persistence: number, lacunarity: number, seed: number): this;
}
declare class GKDecisionNode extends NSObject {
createBranchWithValueAttribute(value: NSNumber, attribute: NSObject): this;
createBranchWithPredicateAttribute(predicate: NSPredicate, attribute: NSObject): this;
createBranchWithWeightAttribute(weight: number, attribute: NSObject): this;
}
declare class GKMonteCarloStrategist extends NSObject implements GKStrategist {
budget: number;
explorationParameter: number;
gameModel: GKGameModel;
randomSource: GKRandom;
bestMoveForActivePlayer(): GKGameModelUpdate;
isEqual(object: interop.Object): boolean;
readonly hash: number;
readonly superclass: interop.Object;
class(): interop.Object;
self(): this;
performSelector(aSelector: string): interop.Object;
performSelectorWithObject(aSelector: string, object: interop.Object): interop.Object;
performSelectorWithObjectWithObject(aSelector: string, object1: interop.Object, object2: interop.Object): interop.Object;
readonly isProxy: boolean;
isKindOfClass(aClass: interop.Object): boolean;
isMemberOfClass(aClass: interop.Object): boolean;
conformsToProtocol(aProtocol: interop.PointerConvertible): boolean;
respondsToSelector(aSelector: string): boolean;
retain(): this;
release(): void;
autorelease(): this;
retainCount(): number;
readonly zone: interop.Pointer;
readonly description: string;
readonly debugDescription: string;
}
declare class GKMinmaxStrategist extends NSObject implements GKStrategist {
maxLookAheadDepth: number;
bestMoveForPlayer(player: GKGameModelPlayer): GKGameModelUpdate;
randomMoveForPlayerFromNumberOfBestMoves(player: GKGameModelPlayer, numMovesToConsider: number): GKGameModelUpdate;
gameModel: GKGameModel;
randomSource: GKRandom;
bestMoveForActivePlayer(): GKGameModelUpdate;
isEqual(object: interop.Object): boolean;
readonly hash: number;
readonly superclass: interop.Object;
class(): interop.Object;
self(): this;
performSelector(aSelector: string): interop.Object;
performSelectorWithObject(aSelector: string, object: interop.Object): interop.Object;
performSelectorWithObjectWithObject(aSelector: string, object1: interop.Object, object2: interop.Object): interop.Object;
readonly isProxy: boolean;
isKindOfClass(aClass: interop.Object): boolean;
isMemberOfClass(aClass: interop.Object): boolean;
conformsToProtocol(aProtocol: interop.PointerConvertible): boolean;
respondsToSelector(aSelector: string): boolean;
retain(): this;
release(): void;
autorelease(): this;
retainCount(): number;
readonly zone: interop.Pointer;
readonly description: string;
readonly debugDescription: string;
}
declare class GKMeshGraph<NodeType = interop.Object> extends GKGraph {
readonly obstacles: NSArray;
readonly bufferRadius: number;
triangulationMode: interop.Enum<typeof GKMeshGraphTriangulationMode>;
readonly triangleCount: number;
static graphWithBufferRadiusMinCoordinateMaxCoordinateNodeClass<NodeType, This extends abstract new (...args: any) => any>(this: This, bufferRadius: number, min: unknown /* ext vector */, max: unknown /* ext vector */, nodeClass: interop.Object): InstanceType<This>;
initWithBufferRadiusMinCoordinateMaxCoordinateNodeClass(bufferRadius: number, min: unknown /* ext vector */, max: unknown /* ext vector */, nodeClass: interop.Object): this;
static graphWithBufferRadiusMinCoordinateMaxCoordinate<NodeType, This extends abstract new (...args: any) => any>(this: This, bufferRadius: number, min: unknown /* ext vector */, max: unknown /* ext vector */): InstanceType<This>;
initWithBufferRadiusMinCoordinateMaxCoordinate(bufferRadius: number, min: unknown /* ext vector */, max: unknown /* ext vector */): this;
addObstacles(obstacles: NSArray<interop.Object> | Array<interop.Object>): void;
removeObstacles(obstacles: NSArray<interop.Object> | Array<interop.Object>): void;
connectNodeUsingObstacles(node: NodeType): void;
triangulate(): void;
triangleAtIndex(index: number): GKTriangle;
classForGenericArgumentAtIndex(index: number): interop.Object;
}
declare class GKMersenneTwisterRandomSource extends GKRandomSource {
seed: number;
init(): this;
initWithSeed(seed: number): this;
}
declare class GKLinearCongruentialRandomSource extends GKRandomSource {
seed: number;
init(): this;
initWithSeed(seed: number): this;
}
declare class GKRandomSource extends NSObject implements GKRandom, NSSecureCoding, NSCopying {
init(): this;
initWithCoder(aDecoder: NSCoder): this;
static sharedRandom(): GKRandomSource;
arrayByShufflingObjectsInArray(array: NSArray<interop.Object> | Array<interop.Object>): NSArray;
nextInt(): number;
nextIntWithUpperBound(upperBound: number): number;
nextUniform(): number;
nextBool(): boolean;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
}
declare class GKGraphNode3D extends GKGraphNode {
position: unknown /* ext vector */;
static nodeWithPoint<This extends abstract new (...args: any) => any>(this: This, point: unknown /* ext vector */): InstanceType<This>;
initWithPoint(point: unknown /* ext vector */): this;
}
declare class GKGraphNode extends NSObject implements NSSecureCoding {
readonly connectedNodes: NSArray;
addConnectionsToNodesBidirectional(nodes: NSArray<interop.Object> | Array<interop.Object>, bidirectional: boolean): void;
removeConnectionsToNodesBidirectional(nodes: NSArray<interop.Object> | Array<interop.Object>, bidirectional: boolean): void;
estimatedCostToNode(node: GKGraphNode): number;
costToNode(node: GKGraphNode): number;
findPathToNode(goalNode: GKGraphNode): NSArray;
findPathFromNode(startNode: GKGraphNode): NSArray;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKGridGraph<NodeType = interop.Object> extends GKGraph {
readonly gridOrigin: unknown /* ext vector */;
readonly gridWidth: number;
readonly gridHeight: number;
readonly diagonalsAllowed: boolean;
static graphFromGridStartingAtWidthHeightDiagonalsAllowed<NodeType, This extends abstract new (...args: any) => any>(this: This, position: unknown /* ext vector */, width: number, height: number, diagonalsAllowed: boolean): InstanceType<This>;
initFromGridStartingAtWidthHeightDiagonalsAllowed(position: unknown /* ext vector */, width: number, height: number, diagonalsAllowed: boolean): this;
static graphFromGridStartingAtWidthHeightDiagonalsAllowedNodeClass<NodeType, This extends abstract new (...args: any) => any>(this: This, position: unknown /* ext vector */, width: number, height: number, diagonalsAllowed: boolean, nodeClass: interop.Object): InstanceType<This>;
initFromGridStartingAtWidthHeightDiagonalsAllowedNodeClass(position: unknown /* ext vector */, width: number, height: number, diagonalsAllowed: boolean, nodeClass: interop.Object): this;
nodeAtGridPosition(position: unknown /* ext vector */): NodeType;
connectNodeToAdjacentNodes(node: GKGridGraphNode): void;
classForGenericArgumentAtIndex(index: number): interop.Object;
}
declare class GKGraph extends NSObject implements NSCopying, NSSecureCoding {
readonly nodes: NSArray;
static graphWithNodes<This extends abstract new (...args: any) => any>(this: This, nodes: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
initWithNodes(nodes: NSArray<interop.Object> | Array<interop.Object>): this;
connectNodeToLowestCostNodeBidirectional(node: GKGraphNode, bidirectional: boolean): void;
removeNodes(nodes: NSArray<interop.Object> | Array<interop.Object>): void;
addNodes(nodes: NSArray<interop.Object> | Array<interop.Object>): void;
findPathFromNodeToNode(startNode: GKGraphNode, endNode: GKGraphNode): NSArray;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKEntity extends NSObject implements NSCopying, NSSecureCoding {
static entity<This extends abstract new (...args: any) => any>(this: This): InstanceType<This>;
init(): this;
updateWithDeltaTime(seconds: number): void;
readonly components: NSArray;
addComponent(component: GKComponent): void;
removeComponentForClass(componentClass: interop.Object): void;
componentForClass(componentClass: interop.Object): GKComponent;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
// @ts-ignore ClassDecl.tsIgnore
declare class GKCompositeBehavior extends GKBehavior {
readonly behaviorCount: number;
static behaviorWithBehaviors<This extends abstract new (...args: any) => any>(this: This, behaviors: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
static behaviorWithBehaviorsAndWeights<This extends abstract new (...args: any) => any>(this: This, behaviors: NSArray<interop.Object> | Array<interop.Object>, weights: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
setWeightForBehavior(weight: number, behavior: GKBehavior): void;
weightForBehavior(behavior: GKBehavior): number;
removeBehavior(behavior: GKBehavior): void;
removeAllBehaviors(): void;
// @ts-ignore MemberDecl.tsIgnore
objectAtIndexedSubscript(idx: number): GKBehavior;
// @ts-ignore MemberDecl.tsIgnore
setObjectForKeyedSubscript(weight: NSNumber, behavior: GKBehavior): void;
// @ts-ignore MemberDecl.tsIgnore
objectForKeyedSubscript(behavior: GKBehavior): NSNumber;
}
declare class GKAgent2D extends GKAgent implements NSSecureCoding {
position: unknown /* ext vector */;
readonly velocity: unknown /* ext vector */;
rotation: number;
updateWithDeltaTime(seconds: number): void;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKAgent extends GKComponent implements NSSecureCoding {
delegate: GKAgentDelegate;
behavior: GKBehavior;
mass: number;
radius: number;
speed: number;
maxAcceleration: number;
maxSpeed: number;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKGoal extends NSObject implements NSCopying {
static goalToSeekAgent<This extends abstract new (...args: any) => any>(this: This, agent: GKAgent): InstanceType<This>;
static goalToFleeAgent<This extends abstract new (...args: any) => any>(this: This, agent: GKAgent): InstanceType<This>;
static goalToAvoidObstaclesMaxPredictionTime<This extends abstract new (...args: any) => any>(this: This, obstacles: NSArray<interop.Object> | Array<interop.Object>, maxPredictionTime: number): InstanceType<This>;
static goalToAvoidAgentsMaxPredictionTime<This extends abstract new (...args: any) => any>(this: This, agents: NSArray<interop.Object> | Array<interop.Object>, maxPredictionTime: number): InstanceType<This>;
static goalToSeparateFromAgentsMaxDistanceMaxAngle<This extends abstract new (...args: any) => any>(this: This, agents: NSArray<interop.Object> | Array<interop.Object>, maxDistance: number, maxAngle: number): InstanceType<This>;
static goalToAlignWithAgentsMaxDistanceMaxAngle<This extends abstract new (...args: any) => any>(this: This, agents: NSArray<interop.Object> | Array<interop.Object>, maxDistance: number, maxAngle: number): InstanceType<This>;
static goalToCohereWithAgentsMaxDistanceMaxAngle<This extends abstract new (...args: any) => any>(this: This, agents: NSArray<interop.Object> | Array<interop.Object>, maxDistance: number, maxAngle: number): InstanceType<This>;
static goalToReachTargetSpeed<This extends abstract new (...args: any) => any>(this: This, targetSpeed: number): InstanceType<This>;
static goalToWander<This extends abstract new (...args: any) => any>(this: This, speed: number): InstanceType<This>;
static goalToInterceptAgentMaxPredictionTime<This extends abstract new (...args: any) => any>(this: This, target: GKAgent, maxPredictionTime: number): InstanceType<This>;
static goalToFollowPathMaxPredictionTimeForward<This extends abstract new (...args: any) => any>(this: This, path: GKPath, maxPredictionTime: number, forward: boolean): InstanceType<This>;
static goalToStayOnPathMaxPredictionTime<This extends abstract new (...args: any) => any>(this: This, path: GKPath, maxPredictionTime: number): InstanceType<This>;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
}
declare class GKBehavior extends NSObject implements NSFastEnumeration, NSCopying {
readonly goalCount: number;
static behaviorWithGoalWeight<This extends abstract new (...args: any) => any>(this: This, goal: GKGoal, weight: number): InstanceType<This>;
static behaviorWithGoals<This extends abstract new (...args: any) => any>(this: This, goals: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
static behaviorWithGoalsAndWeights<This extends abstract new (...args: any) => any>(this: This, goals: NSArray<interop.Object> | Array<interop.Object>, weights: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
static behaviorWithWeightedGoals<This extends abstract new (...args: any) => any>(this: This, weightedGoals: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object>): InstanceType<This>;
setWeightForGoal(weight: number, goal: GKGoal): void;
weightForGoal(goal: GKGoal): number;
removeGoal(goal: GKGoal): void;
removeAllGoals(): void;
objectAtIndexedSubscript(idx: number): GKGoal;
setObjectForKeyedSubscript(weight: NSNumber, goal: GKGoal): void;
objectForKeyedSubscript(goal: GKGoal): NSNumber;
countByEnumeratingWithStateObjectsCount(state: interop.PointerConvertible, buffer: interop.PointerConvertible, len: number): number;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
readonly [Symbol.iterator]: () => Iterator<any>;
}
declare class GKSphereObstacle extends GKObstacle {
radius: number;
position: unknown /* ext vector */;
static obstacleWithRadius<This extends abstract new (...args: any) => any>(this: This, radius: number): InstanceType<This>;
initWithRadius(radius: number): this;
}
declare class GKPolygonObstacle extends GKObstacle implements NSSecureCoding {
readonly vertexCount: number;
static obstacleWithPointsCount<This extends abstract new (...args: any) => any>(this: This, points: interop.PointerConvertible, numPoints: number): InstanceType<This>;
initWithPointsCount(points: interop.PointerConvertible, numPoints: number): this;
vertexAtIndex(index: number): unknown /* ext vector */;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKCircleObstacle extends GKObstacle {
radius: number;
position: unknown /* ext vector */;
static obstacleWithRadius<This extends abstract new (...args: any) => any>(this: This, radius: number): InstanceType<This>;
initWithRadius(radius: number): this;
}
declare class GKComponent extends NSObject implements NSCopying, NSSecureCoding {
readonly entity: GKEntity;
updateWithDeltaTime(seconds: number): void;
didAddToEntity(): void;
willRemoveFromEntity(): void;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKGraphNode2D extends GKGraphNode {
position: unknown /* ext vector */;
static nodeWithPoint<This extends abstract new (...args: any) => any>(this: This, point: unknown /* ext vector */): InstanceType<This>;
initWithPoint(point: unknown /* ext vector */): this;
}
declare class GKAgent3D extends GKAgent {
position: unknown /* ext vector */;
readonly velocity: unknown /* ext vector */;
rightHanded: boolean;
rotation: simd_float3x3;
updateWithDeltaTime(seconds: number): void;
}
declare class GKStateMachine extends NSObject {
readonly currentState: GKState;
static stateMachineWithStates<This extends abstract new (...args: any) => any>(this: This, states: NSArray<interop.Object> | Array<interop.Object>): InstanceType<This>;
initWithStates(states: NSArray<interop.Object> | Array<interop.Object>): this;
updateWithDeltaTime(sec: number): void;
stateForClass(stateClass: interop.Object): GKState;
canEnterState(stateClass: interop.Object): boolean;
enterState(stateClass: interop.Object): boolean;
}
declare class GKDecisionTree extends NSObject implements NSSecureCoding {
readonly rootNode: GKDecisionNode;
randomSource: GKRandomSource;
initWithAttribute(attribute: NSObject): this;
initWithExamplesActionsAttributes(examples: NSArray<interop.Object> | Array<interop.Object>, actions: NSArray<interop.Object> | Array<interop.Object>, attributes: NSArray<interop.Object> | Array<interop.Object>): this;
initWithURLError(url: NSURL, error: NSError | null): this;
exportToURLError(url: NSURL, error: NSError | null): boolean;
findActionForAnswers(answers: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object>): NSObject;
static readonly supportsSecureCoding: boolean;
encodeWithCoder(coder: NSCoder): void;
initWithCoder(coder: NSCoder): this;
}
declare class GKComponentSystem<ComponentType = interop.Object> extends NSObject implements NSFastEnumeration {
readonly componentClass: interop.Object;
readonly components: NSArray;
objectAtIndexedSubscript(idx: number): ComponentType;
initWithComponentClass(cls: interop.Object): this;
addComponent(component: ComponentType): void;
addComponentWithEntity(entity: GKEntity): void;
removeComponentWithEntity(entity: GKEntity): void;
removeComponent(component: ComponentType): void;
updateWithDeltaTime(seconds: number): void;
classForGenericArgumentAtIndex(index: number): interop.Object;
countByEnumeratingWithStateObjectsCount(state: interop.PointerConvertible, buffer: interop.PointerConvertible, len: number): number;
readonly [Symbol.iterator]: () => Iterator<ComponentType>;