forked from OpenRCT2/OpenRCT2
-
Notifications
You must be signed in to change notification settings - Fork 4
/
openrct2.d.ts
2737 lines (2357 loc) · 76.3 KB
/
openrct2.d.ts
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
/*****************************************************************************
* Copyright (c) 2014-2021 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
// OpenRCT2 Scripting API definition file
// To enable IntelliSense for your scripts in Visual Studio or Visual Studio Code,
// add the following line to the top of your script and change the path appropriately.
//
// /// <reference path="/path/to/openrct2.d.ts" />
//
export type PluginType = "local" | "remote";
declare global {
/**
* Global context for accessing all other APIs.
*/
/** APIs for cheats. */
var cheats: Cheats;
/** APIs for interacting with the stdout console. */
var console: Console;
/** Core APIs for plugins. */
var context: Context;
/** APIs for getting or setting the in-game date. */
var date: GameDate;
/** APIs for manipulating the map. */
var map: GameMap;
/** APIs for managing the server or interacting with the server or clients. */
var network: Network;
/** APIs for the park and management of it. */
var park: Park;
/** APIs for the current scenario. */
var scenario: Scenario;
/** APIs for the climate and weather. */
var climate: Climate;
/** APIs for performance profiling. */
var profiler: Profiler;
/**
* APIs for creating and editing title sequences.
* These will only be available to clients that are not running headless mode.
*/
var titleSequenceManager: TitleSequenceManager;
/**
* APIs for controlling the user interface.
* These will only be available to servers and clients that are not running headless mode.
* Plugin writers should check if ui is available using `typeof ui !== 'undefined'`.
*/
var ui: Ui;
/**
* Registers the plugin. This may only be called once.
* @param metadata Information about the plugin and the entry point.
*/
function registerPlugin(metadata: PluginMetadata): void;
/**
* Represents a JavaScript object that can or should be disposed when no longer needed.
*/
interface IDisposable {
dispose(): void;
}
/**
* A coordinate within the game's client screen in pixels.
*/
interface ScreenCoordsXY {
x: number;
y: number;
}
/**
* Represents the width and height in pixels.
*/
interface ScreenSize {
width: number;
height: number;
}
/**
* A coordinate within the game.
* Each in-game tile is a size of 32x32.
*/
interface CoordsXY {
x: number;
y: number;
}
/**
* A coordinate within the game.
* Each in-game tile is a size of 32x32.
* The z-coordinate raises 16 per land increment. A full-height wall is 32 in height.
*/
interface CoordsXYZ extends CoordsXY {
z: number;
}
/**
* A coordinate within the game.
* Each in-game tile is a size of 32x32.
* The z-coordinate raises 16 per land increment. A full-height wall is 32 in height.
* The direction is between 0 and 3.
*/
interface CoordsXYZD extends CoordsXYZ {
direction: number;
}
/**
* A rectangular area specified using two coordinates.
*/
interface MapRange {
leftTop: CoordsXY;
rightBottom: CoordsXY;
}
/**
* Represents lateral and vertical g-forces.
*/
interface GForces {
lateralG: number;
verticalG: number;
}
/**
* Represents information about the plugin such as type, name, author and version.
* It also includes the entry point.
*/
interface PluginMetadata {
name: string;
version: string;
authors: string | string[];
type: PluginType;
licence: string;
minApiVersion?: number;
targetApiVersion?: number;
main: () => void;
}
/**
* Console APIs
* Currently interact with stdout.
*/
interface Console {
clear(): void;
log(message?: any, ...optionalParams: any[]): void;
/**
* Executes a command using the legacy console REPL. This should not be used
* by plugins, and exists only for servers to continue using old commands until
* all functionality can be accomplished with this scripting API.
*
* @deprecated
* @param command The command and arguments to execute.
*/
executeLegacy(command: string): void;
}
/**
* Core APIs for storage and subscriptions.
*/
interface Context {
/**
* Gets the current version of the plugin api. This is an integer that increments
* by 1 every time a change to the plugin api is made.
*/
readonly apiVersion: number;
/**
* The user's current configuration.
*/
configuration: Configuration;
/**
* Shared generic storage for all plugins. Data is persistent across instances
* of OpenRCT2 and is stored externally as a single JSON file in the OpenRCT2
* user directory. Internally it is a JavaScript object. Objects and arrays
* are only copied by reference. The external file is only written when using
* the `set` method, do not rely on the file being saved by modifying your own
* objects. Functions and other internal structures will not be persisted.
*/
sharedStorage: Configuration;
/**
* Gets the storage for the current plugin if no name is specified.
* If a plugin name is specified, the storage for the plugin with that name will be returned.
* Data is persisted for the current loaded park, and is stored inside the .park file.
* Any references to objects, or arrays are copied by reference. If these arrays, objects,
* or any other arrays, or objects that they reference change without a subsequent call to
* the `set` method, their new state will still be serialised.
* Keep in mind that all data here will be serialised every time the park is
* saved, including when the park is periodically saved automatically.
* @param pluginName The name of the plugin to get a store for. If undefined, the
* current plugin's name will be used. Plugin names are case sensitive.
*/
getParkStorage(pluginName?: string): Configuration;
/**
* Render the current state of the map and save to disc.
* Useful for server administration and timelapse creation.
* @param options Options that control the capture and output file.
*/
captureImage(options: CaptureOptions): void;
/**
* Gets the loaded object at the given index.
* @param type The object type.
* @param index The index.
*/
getObject(type: ObjectType, index: number): LoadedObject;
getObject(type: "ride", index: number): RideObject;
getObject(type: "small_scenery", index: number): SmallSceneryObject;
getAllObjects(type: ObjectType): LoadedObject[];
getAllObjects(type: "ride"): RideObject[];
/**
* Gets a random integer within the specified range using the game's pseudo-
* random number generator. This is part of the game state and shared across
* all clients, you therefore must be in a context that can mutate the game
* state. Use this to generate random numbers instead of Math.Random during
* game logic routines such as hooks and game actions.
* @param min The minimum value inclusive.
* @param max The maximum value exclusive.
*/
getRandom(min: number, max: number): number;
/**
* Formats a new string using the given format string and the arguments.
* @param fmt The format string, e.g. "Guests: {COMMA16}"
* @param args The arguments to insert into the string.
*/
formatString(fmt: string, ...args: any[]): string;
/**
* Registers a new game action that allows clients to interact with the game.
* @param action The unique name of the action.
* @param query Logic for validating and returning a price for an action.
* @param execute Logic for validating and executing the action.
* @throws An error if the action has already been registered by this or another plugin.
*/
registerAction(
action: string,
query: (args: object) => GameActionResult,
execute: (args: object) => GameActionResult): void;
/**
* Query the result of running a game action. This allows you to check the outcome and validity of
* an action without actually executing it.
* @param action The name of the action.
* @param args The action parameters.
* @param callback The function to be called with the result of the action.
*/
queryAction(action: ActionType, args: object, callback?: (result: GameActionResult) => void): void;
queryAction(action: string, args: object, callback?: (result: GameActionResult) => void): void;
/**
* Executes a game action. In a network game, this will send a request to the server and wait
* for the server to reply.
* @param action The name of the action.
* @param args The action parameters.
* @param callback The function to be called with the result of the action.
*/
executeAction(action: ActionType, args: object, callback?: (result: GameActionResult) => void): void;
executeAction(action: string, args: object, callback?: (result: GameActionResult) => void): void;
/**
* Subscribes to the given hook.
*/
subscribe(hook: HookType, callback: Function): IDisposable;
subscribe(hook: "action.query", callback: (e: GameActionEventArgs) => void): IDisposable;
subscribe(hook: "action.execute", callback: (e: GameActionEventArgs) => void): IDisposable;
subscribe(hook: "interval.tick", callback: () => void): IDisposable;
subscribe(hook: "interval.day", callback: () => void): IDisposable;
subscribe(hook: "network.chat", callback: (e: NetworkChatEventArgs) => void): IDisposable;
subscribe(hook: "network.authenticate", callback: (e: NetworkAuthenticateEventArgs) => void): IDisposable;
subscribe(hook: "network.join", callback: (e: NetworkEventArgs) => void): IDisposable;
subscribe(hook: "network.leave", callback: (e: NetworkEventArgs) => void): IDisposable;
subscribe(hook: "ride.ratings.calculate", callback: (e: RideRatingsCalculateArgs) => void): IDisposable;
subscribe(hook: "action.location", callback: (e: ActionLocationArgs) => void): IDisposable;
subscribe(hook: "guest.generation", callback: (e: GuestGenerationArgs) => void): IDisposable;
subscribe(hook: "vehicle.crash", callback: (e: VehicleCrashArgs) => void): IDisposable;
subscribe(hook: "map.save", callback: () => void): IDisposable;
/**
* Registers a function to be called every so often in realtime, specified by the given delay.
* @param callback The function to call every time the delay has elapsed.
* @param delay The number of milliseconds to wait between each call to the given function.
*/
setInterval(callback: Function, delay: number): number;
/**
* Like `setInterval`, except the callback will only execute once after the given delay.
* @param callback The function to call after the given delay has elapsed.
* @param delay The number of milliseconds to wait for before calling the given function.
*/
setTimeout(callback: Function, delay: number): number;
/**
* Removes the registered interval specified by the numeric handle. The handles
* are shared with `setTimeout`.
* @param handle
*/
clearInterval(handle: number): void;
/**
* Removes the registered timeout specified by the numeric handle. The handles
* are shared with `setInterval`.
* @param handle The numerical handle of the registered timeout to remove.
*/
clearTimeout(handle: number): void;
}
interface Configuration {
getAll(namespace?: string): { [name: string]: any };
get<T>(key: string): T | undefined;
get<T>(key: string, defaultValue: T): T;
set<T>(key: string, value: T): void;
has(key: string): boolean;
}
interface CaptureOptions {
/**
* A relative filename from the screenshot directory to save the capture as.
* By default, the filename will be automatically generated using the system date and time.
*/
filename?: string;
/**
* Width of the capture in pixels.
* Do not set if you would like a giant screenshot.
*/
width?: number;
/**
* Height of the capture in pixels.
* Do not set if you would like a giant screenshot.
*/
height?: number;
/**
* Map position to centre the view on in map units.
* Do not set if you would like a giant screenshot.
*/
position?: CoordsXY;
/**
* The zoom level, 0 is 1:1, 1 is 2:1, 2 is 4:1 etc.
*/
zoom: number;
/**
* Rotation of the camera from 0 to 3.
*/
rotation: number;
/**
* Whether to enable transparency in the screenshot.
*/
transparent?: boolean;
}
type ObjectType =
"ride" |
"small_scenery" |
"large_scenery" |
"wall" |
"banner" |
"footpath" |
"footpath_addition" |
"scenery_group" |
"park_entrance" |
"water" |
"terrain_surface" |
"terrain_edge" |
"station" |
"music" |
"footpath_surface" |
"footpath_railings";
type HookType =
"interval.tick" | "interval.day" |
"network.chat" | "network.action" | "network.join" | "network.leave" |
"ride.ratings.calculate" | "action.location" | "vehicle.crash" |
"map.save";
type ExpenditureType =
"ride_construction" |
"ride_runningcosts" |
"land_purchase" |
"landscaping" |
"park_entrance_tickets" |
"park_ride_tickets" |
"shop_sales" |
"shop_stock" |
"food_drink_sales" |
"food_drink_stock" |
"wages" |
"marketing" |
"research" |
"interest";
type ActionType =
"balloonpress" |
"bannerplace" |
"bannerremove" |
"bannersetcolour" |
"bannersetname" |
"bannersetstyle" |
"changemapsize" |
"clearscenery" |
"climateset" |
"footpathplace" |
"footpathplacefromtrack" |
"footpathremove" |
"footpathadditionplace" |
"footpathadditionremove" |
"guestsetflags" |
"guestsetname" |
"landbuyrights" |
"landlower" |
"landraise" |
"landsetheight" |
"landsetrights" |
"landsmoothaction" |
"largesceneryplace" |
"largesceneryremove" |
"largescenerysetcolour" |
"loadorquit" |
"mazeplacetrack" |
"mazesettrack" |
"networkmodifygroup" |
"parkentranceremove" |
"parkmarketing" |
"parksetdate" |
"parksetloan" |
"parksetname" |
"parksetparameter" |
"parksetresearchfunding" |
"pausetoggle" |
"peeppickup" |
"placeparkentrance" |
"placepeepspawn" |
"playerkick" |
"playersetgroup" |
"ridecreate" |
"ridedemolish" |
"rideentranceexitplace" |
"rideentranceexitremove" |
"ridesetappearance" |
"ridesetcolourscheme" |
"ridesetname" |
"ridesetprice" |
"ridesetsetting" |
"ridesetstatus" |
"ridesetvehicles" |
"scenariosetsetting" |
"setcheataction" |
"setparkentrancefee" |
"signsetname" |
"smallsceneryplace" |
"smallsceneryremove" |
"stafffire" |
"staffhire" |
"staffsetcolour" |
"staffsetcostume" |
"staffsetname" |
"staffsetorders" |
"staffsetpatrolarea" |
"surfacesetstyle" |
"tilemodify" |
"trackdesign" |
"trackplace" |
"trackremove" |
"tracksetbrakespeed" |
"wallplace" |
"wallremove" |
"wallsetcolour" |
"waterlower" |
"waterraise" |
"watersetheight";
interface GameActionEventArgs {
readonly player: number;
readonly type: number;
readonly action: string;
readonly isClientOnly: boolean;
readonly args: object;
result: GameActionResult;
}
interface GameActionResult {
error?: number;
errorTitle?: string;
errorMessage?: string;
position?: CoordsXYZ;
cost?: number;
expenditureType?: ExpenditureType;
}
interface RideCreateGameActionResult extends GameActionResult {
readonly ride: number;
}
interface NetworkEventArgs {
readonly player: number;
}
interface NetworkChatEventArgs extends NetworkEventArgs {
message: string;
}
interface NetworkAuthenticateEventArgs {
readonly name: number;
readonly ipAddress: string;
readonly publicKeyHash: string;
cancel: boolean;
}
interface RideRatingsCalculateArgs {
readonly rideId: number;
excitement: number;
intensity: number;
nausea: number;
}
interface ActionLocationArgs {
readonly x: number;
readonly y: number;
readonly player: number;
readonly type: number;
readonly isClientOnly: boolean;
result: boolean;
}
interface GuestGenerationArgs {
readonly id: number;
}
type VehicleCrashIntoType = "another_vehicle" | "land" | "water";
interface VehicleCrashArgs {
readonly id: number;
readonly crashIntoType: VehicleCrashIntoType;
}
/**
* APIs for the in-game date.
*/
interface GameDate {
/**
* The total number of ticks that have elapsed since the beginning of the game / scenario. This
* should never reset.
*/
readonly ticksElapsed: number;
/**
* The total number of months that have elapsed. This will equate to 0 in March, Year 1 and
* increase by 1 every month, i.e. by 8 every year.
* Note: this represents the current date and may be reset by cheats or scripts.
*/
monthsElapsed: number;
/**
* The total number of years that have elapsed. This always equates to (monthsElapsed / 8).
*/
readonly yearsElapsed: number;
/**
* How far through the month we are between 0 and 65536. This is incremented by 4 each tick, so
* every month takes ~6.8 minutes to complete making a year take just under an hour.
*/
monthProgress: number;
/** The day of the month from 1 to 31. */
readonly day: number;
/** The current month of the year from 0 to 7, where 0 is March and 7 is October. */
readonly month: number;
/** The current year starting from 1. */
readonly year: number;
}
/**
* APIs for the map.
*/
interface GameMap {
readonly size: CoordsXY;
readonly numRides: number;
readonly numEntities: number;
readonly rides: Ride[];
getRide(id: number): Ride;
getTile(x: number, y: number): Tile;
getEntity(id: number): Entity;
getAllEntities(type: EntityType): Entity[];
/**
* @deprecated since version 34, use guest or staff instead.
*/
getAllEntities(type: "peep"): Peep[];
getAllEntities(type: "guest"): Guest[];
getAllEntities(type: "staff"): Staff[];
getAllEntities(type: "car"): Car[];
getAllEntities(type: "litter"): Litter[];
createEntity(type: EntityType, initializer: object): Entity;
}
type TileElementType =
"surface" | "footpath" | "track" | "small_scenery" | "wall" | "entrance" | "large_scenery" | "banner";
type Direction = 0 | 1 | 2 | 3;
type TileElement =
SurfaceElement | FootpathElement | TrackElement | SmallSceneryElement | WallElement | EntranceElement
| LargeSceneryElement | BannerElement;
interface BaseTileElement {
type: TileElementType;
baseHeight: number;
baseZ: number;
clearanceHeight: number;
clearanceZ: number;
occupiedQuadrants: number;
isGhost: boolean;
isHidden: boolean; /** Take caution when changing this field, it may invalidate TileElements you have stored in your script. */
}
interface SurfaceElement extends BaseTileElement {
type: "surface";
slope: number;
surfaceStyle: number;
edgeStyle: number;
waterHeight: number;
grassLength: number;
ownership: number;
parkFences: number;
readonly hasOwnership: boolean;
readonly hasConstructionRights: boolean;
}
interface FootpathElement extends BaseTileElement {
type: "footpath";
object: number | null; /** Legacy footpaths, still in use. */
surfaceObject: number | null; /** NSF footpaths */
railingsObject: number | null; /** NSF footpaths */
edges: number;
corners: number;
slopeDirection: number | null;
isBlockedByVehicle: boolean;
isWide: boolean;
isQueue: boolean;
queueBannerDirection: number | null;
ride: number | null;
station: number | null;
addition: number | null;
additionStatus: number | null;
isAdditionBroken: boolean | null;
isAdditionGhost: boolean | null;
}
interface TrackElement extends BaseTileElement {
type: "track";
direction: Direction;
trackType: number;
rideType: number;
sequence: number | null;
mazeEntry: number | null;
colourScheme: number | null;
seatRotation: number | null;
ride: number;
station: number | null;
brakeBoosterSpeed: number | null;
hasChainLift: boolean;
isInverted: boolean;
hasCableLift: boolean;
}
interface SmallSceneryElement extends BaseTileElement {
type: "small_scenery";
direction: Direction;
object: number;
primaryColour: number;
secondaryColour: number;
quadrant: number;
age: number;
}
interface WallElement extends BaseTileElement {
type: "wall";
direction: Direction;
object: number;
primaryColour: number;
secondaryColour: number;
tertiaryColour: number;
bannerIndex: number | null;
slope: Direction;
}
interface EntranceElement extends BaseTileElement {
type: "entrance";
direction: Direction;
object: number;
ride: number;
station: number;
sequence: number;
footpathObject: number | null;
footpathSurfaceObject: number | null;
}
interface LargeSceneryElement extends BaseTileElement {
type: "large_scenery";
direction: Direction;
object: number;
primaryColour: number;
secondaryColour: number;
bannerIndex: number | null;
sequence: number;
}
interface BannerElement extends BaseTileElement {
type: "banner";
direction: Direction;
bannerIndex: number;
}
/**
* Represents a tile containing tile elements on the map. This is a fixed handle
* for a given tile position. It can be re-used safely between game ticks.
*/
interface Tile {
/** The x position in tiles. */
readonly x: number;
/** The y position in tiles. */
readonly y: number;
/** Gets an array of all the tile elements on this tile. */
readonly elements: TileElement[];
/** Gets the number of tile elements on this tile. */
readonly numElements: number;
/**
* Gets or sets the raw data for this tile.
* This can provide more control and efficiency for tile manipulation but requires
* knowledge of tile element structures and may change between versions of OpenRCT2.
*/
data: Uint8Array;
/** Gets the tile element at the given index on this tile. */
getElement(index: number): TileElement;
/** Gets the tile element at the given index on this tile. */
getElement<T extends TileElement>(index: number): T;
/** Inserts a new tile element at the given index on this tile. */
insertElement(index: number): TileElement;
/** Removes the tile element at the given index from this tile. */
removeElement(index: number): void;
}
/**
* Represents the definition of a loaded object (.DAT or .json) such a ride type or scenery item.
*/
interface LoadedObject {
/**
* The object type.
*/
readonly type: ObjectType;
/**
* The index of the loaded object for the object type.
*/
readonly index: number;
/**
* The unique identifier of the object, e.g. "rct2.burgb".
* Only JSON objects will have an identifier.
*/
readonly identifier: string;
/**
* The original unique identifier of the object, e.g. "BURGB ".
* This may have trailing spaces if the name is shorter than 8 characters.
* Only .DAT objects or JSON objects based on .DAT objects will have legacy identifiers.
*/
readonly legacyIdentifier: string;
/**
* The name in the user's current language.
*/
readonly name: string;
}
/**
* Represents the object definition of a ride or stall.
*/
interface RideObject extends LoadedObject {
/**
* The description of the ride / stall in the player's current language.
*/
readonly description: string;
/**
* A text description describing the capacity of the ride in the player's current language.
*/
readonly capacity: string;
readonly flags: number;
readonly rideType: number[];
readonly minCarsInTrain: number;
readonly maxCarsInTrain: number;
readonly carsPerFlatRide: number;
readonly zeroCars: number;
readonly tabVehicle: number;
readonly defaultVehicle: number;
readonly frontVehicle: number;
readonly secondVehicle: number;
readonly rearVehicle: number;
readonly thirdVehicle: number;
readonly vehicles: RideObjectVehicle[];
readonly excitementMultiplier: number;
readonly intensityMultiplier: number;
readonly nauseaMultiplier: number;
readonly maxHeight: number;
readonly shopItem: number;
readonly shopItemSecondary: number;
}
/**
* Represents a defined vehicle within a Ride object definition.
*/
interface RideObjectVehicle {
readonly rotationFrameMask: number;
readonly numVerticalFrames: number;
readonly numHorizontalFrames: number;
readonly spacing: number;
readonly carMass: number;
readonly tabHeight: number;
readonly numSeats: number;
readonly spriteFlags: number;
readonly spriteWidth: number;
readonly spriteHeightNegative: number;
readonly spriteHeightPositive: number;
readonly animation: number;
readonly flags: number;
readonly baseNumFrames: number;
readonly baseImageId: number;
readonly restraintImageId: number;
readonly gentleSlopeImageId: number;
readonly steepSlopeImageId: number;
readonly verticalSlopeImageId: number;
readonly diagonalSlopeImageId: number;
readonly bankedImageId: number;
readonly inlineTwistImageId: number;
readonly flatToGentleBankImageId: number;
readonly diagonalToGentleSlopeBankImageId: number;
readonly gentleSlopeToBankImageId: number;
readonly gentleSlopeBankTurnImageId: number;
readonly flatBankToGentleSlopeImageId: number;
readonly curvedLiftHillImageId: number;
readonly corkscrewImageId: number;
readonly noVehicleImages: number;
readonly noSeatingRows: number;
readonly spinningInertia: number;
readonly spinningFriction: number;
readonly frictionSoundId: number;
readonly logFlumeReverserVehicleType: number;
readonly soundRange: number;
readonly doubleSoundFrequency: number;
readonly poweredAcceleration: number;
readonly poweredMaxSpeed: number;
readonly carVisual: number;
readonly effectVisual: number;
readonly drawOrder: number;
readonly numVerticalFramesOverride: number;
}
/**
* Represents the object definition of a small scenery item such a tree.
*/
interface SmallSceneryObject extends LoadedObject {
/**
* Raw bit flags that describe characteristics of the scenery item.
*/
readonly flags: number;
/**
* The default clearance height of the scenery item.
*/
readonly height: number;
/**
* How much the scenery item costs to build.
*/
readonly price: number;
/**
* How much the scenery item costs to remove.
*/
readonly removalPrice: number;
}
/**
* Represents a ride or stall within the park.
*/
interface Ride {
/**
* The object metadata for this ride.
*/
readonly object: RideObject;
/**
* The unique ID / index of the ride.
*/
readonly id: number;
/**
* The type of the ride represented as the internal built-in ride type ID.
*/
type: number;
/**
* Whether the ride is a ride, shop or facility.
*/
readonly classification: RideClassification;
/**
* The generated or custom name of the ride.
*/
name: string;
/**
* Whether the ride is open, closed or testing.
*/
readonly status: RideStatus;
/**
* Various flags related to the operation of the ride.
*/
lifecycleFlags: number;
/**
* The operation mode.
*/
mode: number;
/**
* Flags related to how trains depart.
*/
departFlags: number;
/**
* The minimum time a train will wait at the station before departing.
*/
minimumWaitingTime: number;
/**
* The maximum time a train will wait at the station before departing.
*/
maximumWaitingTime: number;
/**
* The head vehicle IDs associated with the ride, one for each train.
*/
readonly vehicles: number[];
/**
* The colour for each vehicle when the ride opens. Modifying this directly will not
* change the colour of any currently running trains nor will it reflect them if they
* have been modified.
*/
vehicleColours: VehicleColour[];
/**
* The track colour schemes for the ride.
*/
colourSchemes: TrackColour[];
/**
* The style used for the station, entrance, and exit building.
*/
stationStyle: number;
/**
* The music track to play at each station.
*/
music: number;
/**
* Information about each station.