-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.lua
711 lines (565 loc) · 18.7 KB
/
api.lua
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
--- @class Prototype : Object
Prototype = {}
--- @class Instance : Object
Instance = {}
--- @class Vec3i
--- @field zero Vec3i = (0, 0, 0)
--- @field one Vec3i = (1, 1, 1)
--- @field left Vec3i = (0, 1, 0)
--- @field right Vec3i = (0, -1, 0)
--- @field up Vec3i = (0, 0, 1)
--- @field down Vec3i = (0, 0, -1)
--- @field front Vec3i = (1, 0, 0)
--- @field back Vec3i = (-1, 0, 0)
Vec3i = {}
--- @class Vec3
--- @field zero Vec3 = (0, 0, 0)
--- @field one Vec3 = (1, 1, 1)
--- @field left Vec3 = (0, 1, 0)
--- @field right Vec3 = (0, -1, 0)
--- @field up Vec3 = (0, 0, 1)
--- @field down Vec3 = (0, 0, -1)
--- @field front Vec3 = (1, 0, 0)
--- @field back Vec3 = (-1, 0, 0)
Vec3 = {}
--- @param x integer
--- @param y integer
--- @param z integer
--- @return Vec3i
function Vec3i.new(x, y, z) end
--- @class Vec2i
--- @field zero Vec2i
--- @field one Vec2i
Vec2i = {}
--- @param x integer
--- @param y integer
--- @return Vec2i
function Vec2i.new(x, y) end
--- @class Vector
Vector = {}
--- @class Class
Class = {}
--- @class Texture
Texture = {}
--- @class Material
Material = {}
--- @param path string Path to the object
--- @return Material
function Material.load(path) end
--- @class Object
Object = {}
--- @class DB
db = {}
--- @class RegionMap
regions = {}
--- @class Loc
Loc = {}
--- Create new Loc object
--- @param key string
--- @param table string
--- @return Loc
function Loc.new(key, table) end
--- Resolve key value to localized string
--- @param key string
--- @param table string
--- @return string
function Loc.get(key, table) end
--- Resolve Loc object to localized string
--- @return string
function Loc:get() end
--- Get number as string for GUI (3000 -> 3.0k)
--- @param value number
--- @return string
function Loc.gui_number(value) end
-- end of common --
--- @class AbstractCrafter : BlockLogic
--- @field recipes RecipeDictionary
--- @field load_independent boolean
--- @field stable_supply boolean
--- @field input_gathered boolean
--- @field switch_on boolean
--- @field ticks_passed integer
--- @field real_ticks_passed integer
--- @field total_production integer
--- @field speed integer
--- @field energy_input_inventory ResourceInventory
--- @field energy_output_inventory ResourceInventory
--- @field crafter_input_container ResourceInventory
--- @field crafter_output_container ResourceInventory
AbstractCrafter = {}
--- Creates a new AbstractCrafter instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return AbstractCrafter
function AbstractCrafter.new(parent, new_name) end
--- Return AbstractCrafter class object
--- @return Class
function AbstractCrafter.get_class() end
--- Trying to cast Object into AbstractCrafter
--- @param object Object to cast
--- @return AbstractCrafter
function AbstractCrafter.cast(object) end
--- @class Accessor : Instance
--- @field side Vec3i
--- @field pos Vec3i
--- @field cover StaticCover
Accessor = {}
--- Creates a new Accessor instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return Accessor
function Accessor.new(parent, new_name) end
--- Return Accessor class object
--- @return Class
function Accessor.get_class() end
--- Trying to cast Object into Accessor
--- @param object Object to cast
--- @return Accessor
function Accessor.cast(object) end
--- @class AutosizeInventory : Inventory
AutosizeInventory = {}
--- Creates a new AutosizeInventory instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return AutosizeInventory
function AutosizeInventory.new(parent, new_name) end
--- Return AutosizeInventory class object
--- @return Class
function AutosizeInventory.get_class() end
--- Trying to cast Object into AutosizeInventory
--- @param object Object to cast
--- @return AutosizeInventory
function AutosizeInventory.cast(object) end
--- @class BaseInventory : InventoryAccess
BaseInventory = {}
--- Creates a new BaseInventory instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return BaseInventory
function BaseInventory.new(parent, new_name) end
--- Return BaseInventory class object
--- @return Class
function BaseInventory.get_class() end
--- Trying to cast Object into BaseInventory
--- @param object Object to cast
--- @return BaseInventory
function BaseInventory.cast(object) end
--- @class BlockLogic : Instance
--- @field static_block StaticBlock comment
BlockLogic = {}
--- Creates a new BlockLogic instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return BlockLogic
function BlockLogic.new(parent, new_name) end
--- Return BlockLogic class object
--- @return Class
function BlockLogic.get_class() end
--- Trying to cast Object into BlockLogic
--- @param object Object to cast
--- @return BlockLogic
function BlockLogic.cast(object) end
--- @class ConductorBlockLogic : StorageBlockLogic
--- @field side_cover StaticCover
--- @field center_cover StaticCover
--- @field resistance integer mOhm
--- @field voltage integer Volt
--- @field conductor_channel integer
ConductorBlockLogic = {}
---Add side wire
---@param acc ResourceAccessor
function ConductorBlockLogic:add_wire(acc) end
--- Creates a new ConductorBlockLogic instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return ConductorBlockLogic
function ConductorBlockLogic.new(parent, new_name) end
--- Return ConductorBlockLogic class object
--- @return Class
function ConductorBlockLogic.get_class() end
--- Trying to cast Object into ConductorBlockLogic
--- @param object Object to cast
--- @return ConductorBlockLogic
function ConductorBlockLogic.cast(object) end
--- @class DB : Instance
DB = {}
---Register Prototype in DB
---@param proto Prototype Prototype to register
function DB:reg(proto) end
---Register mod table
---@param table table Mod table
function DB:mod(table) end
--- Creates a new MainGameModLoader instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return MainGameModLoader
function MainGameModLoader.new(parent, new_name) end
--- Return MainGameModLoader class object
--- @return Class
function MainGameModLoader.get_class() end
--- Trying to cast Object into MainGameModLoader
--- @param object Object to cast
--- @return MainGameModLoader
function MainGameModLoader.cast(object) end
--- @class Dimension : Actor
--- @field settings GameSessionData
Dimension = {}
--- @class EventSystem : Object
EventSystem = {}
--- Get global instance of EventSystem
--- @return EventSystem
function EventSystem.get_instance() end
--- Subscribe
--- @param event integer Event id
--- @param action function Triggering action
--- @return integer Subscription id
function EventSystem:sub(event, action) end
--- Unsubscribe
--- @param event integer Event id
--- @param id integer Subscription id
function EventSystem:unsub(event, id) end
--- Emmit
--- @param event integer Event id
--- @param context table Context table
function EventSystem:unsub(event, id) end
--- @class ExtractionData : Object
--- @field item StaticItem
--- @field speed number
ExtractionData = {}
--- Create new instance of ExtractionData
--- @return ExtractionData
function ExtractionData.new() end
--- @class GameSessionData : Object
--- @field infinite_ore boolean
GameSessionData = {}
--- @class Inventory : BaseInventory
Inventory = {}
--- Creates a new Inventory instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return Inventory
function Inventory.new(parent, new_name) end
--- Return Inventory class object
--- @return Class
function Inventory.get_class() end
--- Trying to cast Object into Inventory
--- @param object Object to cast
--- @return Inventory
function Inventory.cast(object) end
--- @class InventoryAccess : InventoryReader
InventoryAccess = {}
--- Creates a new InventoryAccess instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return InventoryAccess
function InventoryAccess.new(parent, new_name) end
--- Return InventoryAccess class object
--- @return Class
function InventoryAccess.get_class() end
--- Trying to cast Object into InventoryAccess
--- @param object Object to cast
--- @return InventoryAccess
function InventoryAccess.cast(object) end
--- @class InventoryReader : Instance
InventoryReader = {}
--- Creates a new InventoryReader instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return InventoryReader
function InventoryReader.new(parent, new_name) end
--- Return InventoryReader class object
--- @return Class
function InventoryReader.get_class() end
--- Trying to cast Object into InventoryReader
--- @param object Object to cast
--- @return InventoryReader
function InventoryReader.cast(object) end
--- @class MapStructure : Object
--- @field offset Vec2i
--- @field structure StaticStructure
MapStructure = {}
--- Create new instance of MapStructure
--- @return MapStructure
function MapStructure.new() end
--- @class RecipeDictionary : Prototype
RecipeDictionary = {}
--- Creates a new RecipeDictionary static object
--- @param new_name string The name of the object
--- @return RecipeDictionary
function RecipeDictionary.new(new_name) end
--- Searching for RecipeDictionary in db
--- @param name string The name of the object
--- @return RecipeDictionary
function RecipeDictionary.find(name) end
--- Return RecipeDictionary class object
--- @return Class
function RecipeDictionary.get_class() end
--- Trying to cast Object into RecipeDictionary
--- @param object Object to cast
--- @return RecipeDictionary
function RecipeDictionary.cast(object) end
--- @class Region : Instance
Region = {}
---Add source to this Region
---@param spos SourceData
function Region:add_source(spos) end
--- Creates a new Region instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return Region
function Region.new(parent, new_name) end
--- Return Region class object
--- @return Class
function Region.get_class() end
--- Trying to cast Object into Region
--- @param object Object to cast
--- @return Region
function Region.cast(object) end
--- @class RegionMap : Instance
RegionMap = {}
---Get Region by its position
---@param spos Vec2i position in RegionMap grid
---@return Region
function RegionMap:get_region(spos) end
---Convert Block World position to RegionMap grid cell that contains this position
---@param bpos Vec3i
--- @return Vec2i RegionMap grid position
function RegionMap.world_block_to_grid(bpos) end
--- Creates a new RegionMap instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return RegionMap
function RegionMap.new(parent, new_name) end
--- Return RegionMap class object
--- @return Class
function RegionMap.get_class() end
--- Trying to cast Object into RegionMap
--- @param object Object to cast
--- @return RegionMap
function RegionMap.cast(object) end
--- @class ResourceAccessor : Accessor
--- @field inventory ResourceInventory
--- @field is_input boolean
--- @field is_output boolean
ResourceAccessor = {}
--- Creates a new ResourceAccessor instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return ResourceAccessor
function ResourceAccessor.new(parent, new_name) end
--- Return ResourceAccessor class object
--- @return Class
function ResourceAccessor.get_class() end
--- Trying to cast Object into ResourceAccessor
--- @param object Object to cast
--- @return ResourceAccessor
function ResourceAccessor.cast(object) end
--- @class ResourceInventory : SingleSlotInventory
--- @field drain integer
ResourceInventory = {}
--- Creates a new ResourceInventory instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return ResourceInventory
function ResourceInventory.new(parent, new_name) end
--- Return ResourceInventory class object
--- @return Class
function ResourceInventory.get_class() end
--- Trying to cast Object into ResourceInventory
--- @param object Object to cast
--- @return ResourceInventory
function ResourceInventory.cast(object) end
--- @class SingleSlotInventory : BaseInventory
--- @field capacity integer
SingleSlotInventory = {}
--- Creates a new SingleSlotInventory instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return SingleSlotInventory
function SingleSlotInventory.new(parent, new_name) end
--- Return SingleSlotInventory class object
--- @return Class
function SingleSlotInventory.get_class() end
--- Trying to cast Object into SingleSlotInventory
--- @param object Object to cast
--- @return SingleSlotInventory
function SingleSlotInventory.cast(object) end
--- @class SourceData : Instance
--- @field item StaticItem item to mine
SourceData = {}
--- Creates a new SourceData instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return SourceData
function SourceData.new(parent, new_name) end
--- Return SourceData class object
--- @return Class
function SourceData.get_class() end
--- Trying to cast Object into SourceData
--- @param object Object to cast
--- @return SourceData
function SourceData.cast(object) end
--- @class StaticAttach : StaticObject
--- @field mesh StaticItem
--- @field no_collision boolean
StaticAttach = {}
--- Creates a new StaticAttach static object
--- @param new_name string The name of the object
--- @return StaticAttach
function StaticAttach.new(new_name) end
--- Searching for StaticAttach in db
--- @param name string The name of the object
--- @return StaticAttach
function StaticAttach.find(name) end
--- Return StaticAttach class object
--- @return Class
function StaticAttach.get_class() end
--- Trying to cast Object into StaticAttach
--- @param object Object to cast
--- @return StaticAttach
function StaticAttach.cast(object) end
--- @class StaticBlock : StaticObject
--- @field logic Class
--- @field actor Class
--- @field selector Class
--- @field tesselator Tesselator
--- @field color_side Vector
--- @field color_top Vector
--- @field tier integer
--- @field level integer
--- @field lua table
StaticBlock = {}
--- Creates a new StaticBlock static object
--- @param new_name string The name of the object
--- @return StaticBlock
function StaticBlock.new(new_name) end
--- Searching for StaticBlock in db
--- @param name string The name of the object
--- @return StaticBlock
function StaticBlock.find(name) end
--- Return StaticBlock class object
--- @return Class
function StaticBlock.get_class() end
--- Trying to cast Object into StaticBlock
--- @param object Object to cast
--- @return StaticBlock
function StaticBlock.cast(object) end
--- @class StaticCover : StaticAttach
StaticCover = {}
--- Creates a new StaticCover static object
--- @param new_name string The name of the object
--- @return StaticCover
function StaticCover.new(new_name) end
--- Searching for StaticCover in db
--- @param name string The name of the object
--- @return StaticCover
function StaticCover.find(name) end
--- Return StaticCover class object
--- @return Class
function StaticCover.get_class() end
--- Trying to cast Object into StaticCover
--- @param object Object to cast
--- @return StaticCover
function StaticCover.cast(object) end
--- @class StaticItem : Prototype
--- @field image Texture
--- @field stack_size integer
--- @field unit_mul number
--- @field mesh StaticMesh
--- @field craftable boolean
StaticItem = {}
--- Creates a new StaticItem static object
--- @param new_name string The name of the object
--- @return StaticItem
function StaticItem.new(new_name) end
--- Searching for StaticItem in db
--- @param name string The name of the object
--- @return StaticItem
function StaticItem.find(name) end
--- Return StaticItem class object
--- @return Class
function StaticItem.get_class() end
--- Trying to cast Object into StaticItem
--- @param object Object to cast
--- @return StaticItem
function StaticItem.cast(object) end
--- @class StaticObject : Prototype
--- @field item StaticItem
StaticObject = {}
--- Creates a new StaticObject static object
--- @param new_name string The name of the object
--- @return StaticObject
function StaticObject.new(new_name) end
--- Searching for StaticObject in db
--- @param name string The name of the object
--- @return StaticObject
function StaticObject.find(name) end
--- Return StaticObject class object
--- @return Class
function StaticObject.get_class() end
--- Trying to cast Object into StaticObject
--- @param object Object to cast
--- @return StaticObject
function StaticObject.cast(object) end
--- @class StaticProp : StaticObject
--- @field lock_xy boolean
--- @field lock_all boolean
--- @field project_to_terrain_power number
--- @field additive_elevation number
--- @field cull_begin number
--- @field cull_end number
--- @field maximum_height number
--- @field minimum_height number
--- @field floating boolean
--- @field is_big boolean
--- @field mesh StaticItem
--- @field no_collision boolean
StaticProp = {}
--- Creates a new StaticProp static object
--- @param new_name string The name of the object
--- @return StaticProp
function StaticProp.new(new_name) end
--- Searching for StaticProp in db
--- @param name string The name of the object
--- @return StaticProp
function StaticProp.find(name) end
--- Return StaticProp class object
--- @return Class
function StaticProp.get_class() end
--- Trying to cast Object into StaticProp
--- @param object Object to cast
--- @return StaticProp
function StaticProp.cast(object) end
--- @class StaticStructure : Instance
--- @field generate function
--- @field size Vec2i
StaticStructure = {}
--- Creates a new StaticStructure static object
--- @param new_name string The name of the object
--- @return StaticStructure
function StaticStructure.new(new_name) end
--- Searching for StaticStructure in db
--- @param name string The name of the object
--- @return StaticStructure
function StaticStructure.find(name) end
--- Return StaticStructure class object
--- @return Class
function StaticStructure.get_class() end
--- Trying to cast Object into StaticStructure
--- @param object Object to cast
--- @return StaticStructure
function StaticStructure.cast(object) end
--- @class StorageBlockLogic : BlockLogic
StorageBlockLogic = {}
--- Creates a new StorageBlockLogic instance
--- @param parent Object Object of parent
--- @param new_name string The name of the instance
--- @return StorageBlockLogic
function StorageBlockLogic.new(parent, new_name) end
--- Return StorageBlockLogic class object
--- @return Class
function StorageBlockLogic.get_class() end
--- Trying to cast Object into StorageBlockLogic
--- @param object Object to cast
--- @return StorageBlockLogic
function StorageBlockLogic.cast(object) end