warscript 0.0.1-dev.ed60fea → 0.0.1-dev.ee6f224
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/attributes.d.ts +5 -0
- package/attributes.lua +8 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +1 -3
- package/core/types/effect.lua +26 -29
- package/core/types/frame.lua +24 -21
- package/core/types/player.lua +3 -1
- package/core/types/playerCamera.d.ts +2 -0
- package/core/types/playerCamera.lua +123 -5
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/tileCell.d.ts +9 -0
- package/core/types/tileCell.lua +92 -0
- package/core/types/timer.d.ts +8 -8
- package/core/types/timer.lua +39 -23
- package/core/util.lua +6 -1
- package/decl/native.d.ts +846 -790
- package/engine/behavior.d.ts +5 -0
- package/engine/behavior.lua +106 -27
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +32 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +9 -3
- package/engine/behaviour/ability/damage.lua +26 -38
- package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
- package/engine/behaviour/ability/emulate-impact.lua +18 -3
- package/engine/behaviour/ability/restore-mana.d.ts +1 -1
- package/engine/behaviour/ability/restore-mana.lua +6 -6
- package/engine/behaviour/ability.d.ts +7 -2
- package/engine/behaviour/ability.lua +42 -24
- package/engine/behaviour/unit/stun-immunity.d.ts +5 -3
- package/engine/behaviour/unit/stun-immunity.lua +43 -27
- package/engine/behaviour/unit.d.ts +32 -0
- package/engine/behaviour/unit.lua +185 -4
- package/engine/buff.d.ts +57 -44
- package/engine/buff.lua +273 -221
- package/engine/internal/ability.d.ts +7 -1
- package/engine/internal/ability.lua +49 -11
- package/engine/internal/item/ability.lua +82 -14
- package/engine/internal/item+owner.lua +12 -6
- package/engine/internal/item.d.ts +8 -7
- package/engine/internal/item.lua +153 -51
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/misc/frame-coordinates.d.ts +2 -0
- package/engine/internal/misc/frame-coordinates.lua +21 -0
- package/engine/internal/misc/get-terrain-z.d.ts +2 -0
- package/engine/internal/misc/get-terrain-z.lua +11 -0
- package/engine/internal/misc/player-local-handle.d.ts +2 -0
- package/engine/internal/misc/player-local-handle.lua +5 -0
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +63 -1
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +52 -0
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/bonus.d.ts +2 -0
- package/engine/internal/unit/bonus.lua +17 -0
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +5 -0
- package/engine/internal/unit/item.lua +3 -4
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit+ability.lua +10 -1
- package/engine/internal/unit+damage.d.ts +2 -11
- package/engine/internal/unit+damage.lua +10 -14
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-launch.lua +9 -2
- package/engine/internal/unit.d.ts +33 -10
- package/engine/internal/unit.lua +274 -113
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
- package/engine/object-data/auxiliary/armor-type.lua +46 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +19 -17
- package/engine/object-data/entry/ability-type.lua +82 -24
- package/engine/object-data/entry/buff-type/applicable.lua +18 -37
- package/engine/object-data/entry/buff-type.d.ts +6 -12
- package/engine/object-data/entry/buff-type.lua +13 -29
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.lua +4 -4
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +21 -5
- package/engine/object-data/entry/unit-type.lua +214 -93
- package/engine/object-data/entry/upgrade.d.ts +1 -1
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +16 -14
- package/engine/object-data/entry.lua +60 -32
- package/engine/object-field/ability.d.ts +4 -4
- package/engine/object-field/ability.lua +7 -6
- package/engine/object-field/unit.d.ts +57 -3
- package/engine/object-field/unit.lua +207 -7
- package/engine/object-field.d.ts +17 -6
- package/engine/object-field.lua +188 -92
- package/engine/random.d.ts +9 -0
- package/engine/random.lua +13 -0
- package/engine/standard/entries/buff-type.d.ts +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/fields/unit.d.ts +4 -0
- package/engine/standard/fields/unit.lua +7 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +249 -10
- package/engine/unit.d.ts +2 -0
- package/engine/unit.lua +2 -0
- package/objutil/buff.lua +1 -2
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/patch-lualib.lua +1 -1
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +3 -0
- package/utility/callback-array.d.ts +13 -0
- package/utility/callback-array.lua +46 -0
- package/utility/functions.d.ts +8 -0
- package/utility/functions.lua +13 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +3 -0
- package/utility/lua-maps.d.ts +15 -2
- package/utility/lua-maps.lua +53 -2
- package/utility/lua-sets.d.ts +2 -0
- package/utility/lua-sets.lua +7 -0
- package/utility/reflection.lua +11 -7
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
|
@@ -7,10 +7,11 @@ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
|
7
7
|
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
8
8
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
9
9
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
10
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
10
11
|
local __TS__StringSplit = ____lualib.__TS__StringSplit
|
|
11
12
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
12
13
|
local ____exports = {}
|
|
13
|
-
local booleanToData, dataToBoolean, numberToData, dataToNumber, stringToData, dataToString, objectDataEntryIdToData, dataToObjectDataEntryId, booleansToData, dataToBooleans, numbersToData, dataToNumbers, stringsToData, dataToStrings,
|
|
14
|
+
local booleanToData, dataToBoolean, numberToData, dataToNumber, stringToData, dataToString, objectDataEntryNumericIdToData, dataToObjectDataEntryNumericId, objectDataEntryIdToData, dataToObjectDataEntryId, booleansToData, dataToBooleans, numbersToData, dataToNumbers, stringsToData, dataToStrings, objectDataEntryNumericIdsToData, dataToObjectDataEntryNumericIds, isDataNotBlank
|
|
14
15
|
local ____attachment_2Dpreset = require("engine.object-data.auxiliary.attachment-preset")
|
|
15
16
|
local extractAttachmentPresetInputModelPath = ____attachment_2Dpreset.extractAttachmentPresetInputModelPath
|
|
16
17
|
local extractAttachmentPresetInputNodeFQN = ____attachment_2Dpreset.extractAttachmentPresetInputNodeFQN
|
|
@@ -124,7 +125,7 @@ function ObjectDataEntry.getAllByBaseIds(self, baseIds)
|
|
|
124
125
|
local constructor = self
|
|
125
126
|
for id, object in pairs(constructor:getObjectData(currentMap).all) do
|
|
126
127
|
if dataBaseIds[object.parentId or id] ~= nil then
|
|
127
|
-
local objectDataEntry = self:of(dataToObjectDataEntryId(id))
|
|
128
|
+
local objectDataEntry = self:of(dataToObjectDataEntryId(id, self.idType))
|
|
128
129
|
if objectDataEntry ~= nil and not objectDataEntry.isInternal then
|
|
129
130
|
result[#result + 1] = objectDataEntry
|
|
130
131
|
end
|
|
@@ -139,7 +140,7 @@ function ObjectDataEntry.getAll(self)
|
|
|
139
140
|
local constructor = self
|
|
140
141
|
local result = {}
|
|
141
142
|
for id in pairs(constructor:getObjectData(currentMap).all) do
|
|
142
|
-
local objectDataEntry = self:of(dataToObjectDataEntryId(id))
|
|
143
|
+
local objectDataEntry = self:of(dataToObjectDataEntryId(id, self.idType))
|
|
143
144
|
if objectDataEntry ~= nil and not objectDataEntry.isInternal then
|
|
144
145
|
result[#result + 1] = objectDataEntry
|
|
145
146
|
end
|
|
@@ -156,9 +157,9 @@ function ObjectDataEntry.of(self, id)
|
|
|
156
157
|
if object == nil then
|
|
157
158
|
return nil
|
|
158
159
|
end
|
|
159
|
-
local objectDataEntry = objectDataEntryByObjectDataEntryId[dataToObjectDataEntryId(object.id)]
|
|
160
|
+
local objectDataEntry = objectDataEntryByObjectDataEntryId[dataToObjectDataEntryId(object.id, self.idType)]
|
|
160
161
|
if objectDataEntry == nil then
|
|
161
|
-
if not constructor.IS_SYNTHETIC and (self.BASE_ID == 0 or dataToObjectDataEntryId(object.parentId) == self.BASE_ID) then
|
|
162
|
+
if not constructor.IS_SYNTHETIC and (self.BASE_ID == 0 or dataToObjectDataEntryId(object.parentId, self.idType) == self.BASE_ID) then
|
|
162
163
|
local AbstractObjectDataEntryView = __TS__Class()
|
|
163
164
|
AbstractObjectDataEntryView.name = "AbstractObjectDataEntryView"
|
|
164
165
|
__TS__ClassExtends(AbstractObjectDataEntryView, constructor)
|
|
@@ -231,13 +232,13 @@ function ObjectDataEntry.prototype.setStringField(self, field, value)
|
|
|
231
232
|
stringToData(value)
|
|
232
233
|
)
|
|
233
234
|
end
|
|
234
|
-
function ObjectDataEntry.prototype.
|
|
235
|
-
return
|
|
235
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdField(self, field)
|
|
236
|
+
return dataToObjectDataEntryNumericId(self.object:getField(field))
|
|
236
237
|
end
|
|
237
|
-
function ObjectDataEntry.prototype.
|
|
238
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdField(self, field, value)
|
|
238
239
|
self.object:setField(
|
|
239
240
|
field,
|
|
240
|
-
|
|
241
|
+
objectDataEntryNumericIdToData(value)
|
|
241
242
|
)
|
|
242
243
|
end
|
|
243
244
|
function ObjectDataEntry.prototype.getAttachmentPresetField(self, modelPathField, nodeFQNField)
|
|
@@ -285,13 +286,13 @@ function ObjectDataEntry.prototype.setStringsField(self, field, values)
|
|
|
285
286
|
stringsToData(values)
|
|
286
287
|
)
|
|
287
288
|
end
|
|
288
|
-
function ObjectDataEntry.prototype.
|
|
289
|
-
return
|
|
289
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdsField(self, field)
|
|
290
|
+
return dataToObjectDataEntryNumericIds(self.object:getField(field))
|
|
290
291
|
end
|
|
291
|
-
function ObjectDataEntry.prototype.
|
|
292
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdsField(self, field, values)
|
|
292
293
|
self.object:setField(
|
|
293
294
|
field,
|
|
294
|
-
|
|
295
|
+
objectDataEntryNumericIdsToData(values)
|
|
295
296
|
)
|
|
296
297
|
end
|
|
297
298
|
function ObjectDataEntry.prototype.getAttachmentPresetListField(self, modelPathListField, nodeFQNFields)
|
|
@@ -369,16 +370,16 @@ function ObjectDataEntry.prototype.setStringLevelField(self, field, values)
|
|
|
369
370
|
stringToData
|
|
370
371
|
)
|
|
371
372
|
end
|
|
372
|
-
function ObjectDataEntry.prototype.
|
|
373
|
-
return self:getLevelField(field,
|
|
373
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdLevelField(self, field)
|
|
374
|
+
return self:getLevelField(field, dataToObjectDataEntryNumericId)
|
|
374
375
|
end
|
|
375
|
-
function ObjectDataEntry.prototype.
|
|
376
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdLevelField(self, field, values)
|
|
376
377
|
self:setLevelField(
|
|
377
378
|
field,
|
|
378
379
|
values,
|
|
379
380
|
____exports.extractObjectDataEntryLevelFieldValue,
|
|
380
|
-
|
|
381
|
-
|
|
381
|
+
dataToObjectDataEntryNumericId,
|
|
382
|
+
objectDataEntryNumericIdToData
|
|
382
383
|
)
|
|
383
384
|
end
|
|
384
385
|
function ObjectDataEntry.prototype.getBooleansLevelField(self, field)
|
|
@@ -417,23 +418,26 @@ function ObjectDataEntry.prototype.setStringsLevelField(self, field, values)
|
|
|
417
418
|
stringsToData
|
|
418
419
|
)
|
|
419
420
|
end
|
|
420
|
-
function ObjectDataEntry.prototype.
|
|
421
|
-
return self:getLevelField(field,
|
|
421
|
+
function ObjectDataEntry.prototype.getObjectDataEntryNumericIdsLevelField(self, field)
|
|
422
|
+
return self:getLevelField(field, dataToObjectDataEntryNumericIds)
|
|
422
423
|
end
|
|
423
|
-
function ObjectDataEntry.prototype.
|
|
424
|
+
function ObjectDataEntry.prototype.setObjectDataEntryNumericIdsLevelField(self, field, values)
|
|
424
425
|
self:setLevelField(
|
|
425
426
|
field,
|
|
426
427
|
values,
|
|
427
428
|
____exports.extractObjectDataEntryLevelArrayFieldValue,
|
|
428
|
-
|
|
429
|
-
|
|
429
|
+
dataToObjectDataEntryNumericIds,
|
|
430
|
+
objectDataEntryNumericIdsToData
|
|
430
431
|
)
|
|
431
432
|
end
|
|
432
433
|
function ObjectDataEntry.prototype.getLevelField(self, field, dataToValue)
|
|
433
434
|
local values = {}
|
|
434
435
|
local object = self.object
|
|
435
436
|
for level = 1, tonumber(object:getField("levels")) or 1 do
|
|
436
|
-
values[level] = dataToValue(
|
|
437
|
+
values[level] = dataToValue(
|
|
438
|
+
object:getField((field .. "+") .. tostring(level)),
|
|
439
|
+
"number"
|
|
440
|
+
)
|
|
437
441
|
end
|
|
438
442
|
return values
|
|
439
443
|
end
|
|
@@ -473,6 +477,14 @@ function ObjectDataEntry.prototype.setLevelField(self, field, supplier, extracto
|
|
|
473
477
|
end
|
|
474
478
|
ObjectDataEntry.BASE_ID = 0
|
|
475
479
|
ObjectDataEntry.IS_SYNTHETIC = false
|
|
480
|
+
__TS__SetDescriptor(
|
|
481
|
+
ObjectDataEntry.prototype,
|
|
482
|
+
"type",
|
|
483
|
+
{get = function(self)
|
|
484
|
+
return self.constructor
|
|
485
|
+
end},
|
|
486
|
+
true
|
|
487
|
+
)
|
|
476
488
|
__TS__SetDescriptor(
|
|
477
489
|
ObjectDataEntry.prototype,
|
|
478
490
|
"isInternal",
|
|
@@ -491,11 +503,18 @@ __TS__SetDescriptor(
|
|
|
491
503
|
},
|
|
492
504
|
true
|
|
493
505
|
)
|
|
506
|
+
__TS__ObjectDefineProperty(
|
|
507
|
+
ObjectDataEntry,
|
|
508
|
+
"idType",
|
|
509
|
+
{get = function(self)
|
|
510
|
+
return type(self.BASE_ID) == "number" and "number" or "string"
|
|
511
|
+
end}
|
|
512
|
+
)
|
|
494
513
|
__TS__SetDescriptor(
|
|
495
514
|
ObjectDataEntry.prototype,
|
|
496
515
|
"id",
|
|
497
516
|
{get = function(self)
|
|
498
|
-
return dataToObjectDataEntryId(self.object.id)
|
|
517
|
+
return dataToObjectDataEntryId(self.object.id, self.type.idType)
|
|
499
518
|
end},
|
|
500
519
|
true
|
|
501
520
|
)
|
|
@@ -503,7 +522,7 @@ __TS__SetDescriptor(
|
|
|
503
522
|
ObjectDataEntry.prototype,
|
|
504
523
|
"baseId",
|
|
505
524
|
{get = function(self)
|
|
506
|
-
return dataToObjectDataEntryId(self.object.parentId or self.object.id)
|
|
525
|
+
return dataToObjectDataEntryId(self.object.parentId or self.object.id, self.type.idType)
|
|
507
526
|
end},
|
|
508
527
|
true
|
|
509
528
|
)
|
|
@@ -533,10 +552,10 @@ end
|
|
|
533
552
|
dataToString = function(data)
|
|
534
553
|
return tostring(data or "")
|
|
535
554
|
end
|
|
536
|
-
|
|
555
|
+
objectDataEntryNumericIdToData = function(value)
|
|
537
556
|
return value == 0 and "" or string.pack(">I4", value)
|
|
538
557
|
end
|
|
539
|
-
|
|
558
|
+
dataToObjectDataEntryNumericId = function(data)
|
|
540
559
|
local dataString = dataToString(data)
|
|
541
560
|
if isDataNotBlank(nil, dataString) then
|
|
542
561
|
return (string.unpack(">I4", dataString))
|
|
@@ -544,6 +563,15 @@ dataToObjectDataEntryId = function(data)
|
|
|
544
563
|
return 0
|
|
545
564
|
end
|
|
546
565
|
end
|
|
566
|
+
objectDataEntryIdToData = function(value)
|
|
567
|
+
return type(value) == "number" and objectDataEntryNumericIdToData(value) or value
|
|
568
|
+
end
|
|
569
|
+
dataToObjectDataEntryId = function(data, ____type)
|
|
570
|
+
if ____type == "number" then
|
|
571
|
+
return dataToObjectDataEntryNumericId(data)
|
|
572
|
+
end
|
|
573
|
+
return dataToString(data)
|
|
574
|
+
end
|
|
547
575
|
booleansToData = function(value)
|
|
548
576
|
return table.concat(
|
|
549
577
|
__TS__ArrayMap(
|
|
@@ -607,16 +635,16 @@ dataToStrings = function(data)
|
|
|
607
635
|
function(____, data) return dataToString(data) end
|
|
608
636
|
)
|
|
609
637
|
end
|
|
610
|
-
|
|
638
|
+
objectDataEntryNumericIdsToData = function(value)
|
|
611
639
|
return table.concat(
|
|
612
640
|
__TS__ArrayMap(
|
|
613
641
|
value,
|
|
614
|
-
function(____, objectDataEntryId) return
|
|
642
|
+
function(____, objectDataEntryId) return objectDataEntryNumericIdToData(objectDataEntryId) end
|
|
615
643
|
),
|
|
616
644
|
","
|
|
617
645
|
)
|
|
618
646
|
end
|
|
619
|
-
|
|
647
|
+
dataToObjectDataEntryNumericIds = function(data)
|
|
620
648
|
return __TS__ArrayMap(
|
|
621
649
|
__TS__ArrayFilter(
|
|
622
650
|
__TS__StringSplit(
|
|
@@ -625,7 +653,7 @@ dataToObjectDataEntryIds = function(data)
|
|
|
625
653
|
),
|
|
626
654
|
isDataNotBlank
|
|
627
655
|
),
|
|
628
|
-
function(____, data) return
|
|
656
|
+
function(____, data) return dataToObjectDataEntryNumericId(data) end
|
|
629
657
|
)
|
|
630
658
|
end
|
|
631
659
|
isDataNotBlank = function(self, data)
|
|
@@ -12,7 +12,7 @@ import { ReadonlyNonEmptyLinkedSet } from "../../utility/linked-set";
|
|
|
12
12
|
export declare abstract class AbilityField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType extends jabilityfield = jabilityfield> extends ObjectField<AbilityType, Ability, ValueType, NativeFieldType> {
|
|
13
13
|
protected get instanceClass(): typeof Ability;
|
|
14
14
|
protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
|
|
15
|
-
protected hasNativeFieldValue(
|
|
15
|
+
protected hasNativeFieldValue(abilityTypeId: AbilityTypeId): boolean;
|
|
16
16
|
static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<AbilityField>>;
|
|
17
17
|
}
|
|
18
18
|
export declare class AbilityBooleanField extends AbilityField<boolean, jabilitybooleanfield> {
|
|
@@ -48,7 +48,7 @@ export declare class AbilityStringField extends AbilityField<string, jabilitystr
|
|
|
48
48
|
export declare abstract class AbilityArrayField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType extends jabilityfield = jabilityfield> extends ObjectArrayField<AbilityType, Ability, ValueType, NativeFieldType> {
|
|
49
49
|
protected get instanceClass(): typeof Ability;
|
|
50
50
|
protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
|
|
51
|
-
protected hasNativeFieldValue(
|
|
51
|
+
protected hasNativeFieldValue(abilityTypeId: AbilityTypeId): boolean;
|
|
52
52
|
}
|
|
53
53
|
export declare class AbilityStringArrayField extends AbilityArrayField<string, jabilitystringlevelfield> {
|
|
54
54
|
protected get defaultValue(): string;
|
|
@@ -68,7 +68,7 @@ export declare abstract class AbilityLevelField<ValueType extends number | strin
|
|
|
68
68
|
protected get instanceClass(): typeof Ability;
|
|
69
69
|
protected getLevelCount(entry: AbilityType | Ability): number;
|
|
70
70
|
protected getObjectDataEntryId(instance: Ability): AbilityTypeId;
|
|
71
|
-
protected hasNativeFieldValue(
|
|
71
|
+
protected hasNativeFieldValue(abilityTypeId: AbilityTypeId): boolean;
|
|
72
72
|
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<ReadonlyObjectLevelFieldType<AbilityLevelField>>;
|
|
73
73
|
}
|
|
74
74
|
export declare class AbilityBooleanLevelField extends AbilityLevelField<boolean, boolean, jabilityintegerlevelfield> {
|
|
@@ -117,7 +117,7 @@ export declare abstract class AbilityEnumLevelField<T extends number> extends Ab
|
|
|
117
117
|
protected getNativeFieldById(id: number): jabilityintegerlevelfield;
|
|
118
118
|
protected getNativeFieldValue(instance: Ability, level: number): T;
|
|
119
119
|
protected setNativeFieldValue(instance: Ability, level: number, value: T): boolean;
|
|
120
|
-
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<
|
|
120
|
+
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<AbilityEnumLevelField<number>>;
|
|
121
121
|
}
|
|
122
122
|
export declare class AbilityBuffPolarityLevelField extends AbilityEnumLevelField<BuffPolarity> {
|
|
123
123
|
protected values: ReadonlyNonEmptyLinkedSet<BuffPolarity>;
|
|
@@ -7,6 +7,7 @@ local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
|
7
7
|
local ____exports = {}
|
|
8
8
|
local ____ability = require("engine.internal.ability")
|
|
9
9
|
local Ability = ____ability.Ability
|
|
10
|
+
local abilityTypeHasField = ____ability.abilityTypeHasField
|
|
10
11
|
local ____object_2Dfield = require("engine.object-field")
|
|
11
12
|
local ObjectArrayField = ____object_2Dfield.ObjectArrayField
|
|
12
13
|
local ObjectField = ____object_2Dfield.ObjectField
|
|
@@ -29,8 +30,8 @@ __TS__ClassExtends(AbilityField, ObjectField)
|
|
|
29
30
|
function AbilityField.prototype.getObjectDataEntryId(self, instance)
|
|
30
31
|
return instance.typeId
|
|
31
32
|
end
|
|
32
|
-
function AbilityField.prototype.hasNativeFieldValue(self,
|
|
33
|
-
return
|
|
33
|
+
function AbilityField.prototype.hasNativeFieldValue(self, abilityTypeId)
|
|
34
|
+
return abilityTypeHasField(abilityTypeId, self.nativeField)
|
|
34
35
|
end
|
|
35
36
|
__TS__SetDescriptor(
|
|
36
37
|
AbilityField.prototype,
|
|
@@ -197,8 +198,8 @@ __TS__ClassExtends(AbilityArrayField, ObjectArrayField)
|
|
|
197
198
|
function AbilityArrayField.prototype.getObjectDataEntryId(self, instance)
|
|
198
199
|
return instance.typeId
|
|
199
200
|
end
|
|
200
|
-
function AbilityArrayField.prototype.hasNativeFieldValue(self,
|
|
201
|
-
return
|
|
201
|
+
function AbilityArrayField.prototype.hasNativeFieldValue(self, abilityTypeId)
|
|
202
|
+
return abilityTypeHasField(abilityTypeId, self.nativeField)
|
|
202
203
|
end
|
|
203
204
|
__TS__SetDescriptor(
|
|
204
205
|
AbilityArrayField.prototype,
|
|
@@ -269,8 +270,8 @@ end
|
|
|
269
270
|
function AbilityLevelField.prototype.getObjectDataEntryId(self, instance)
|
|
270
271
|
return instance.typeId
|
|
271
272
|
end
|
|
272
|
-
function AbilityLevelField.prototype.hasNativeFieldValue(self,
|
|
273
|
-
return
|
|
273
|
+
function AbilityLevelField.prototype.hasNativeFieldValue(self, abilityTypeId)
|
|
274
|
+
return abilityTypeHasField(abilityTypeId, self.nativeField)
|
|
274
275
|
end
|
|
275
276
|
__TS__SetDescriptor(
|
|
276
277
|
AbilityLevelField.prototype,
|
|
@@ -1,16 +1,70 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { Unit } from "../internal/unit";
|
|
3
|
-
import { ObjectField } from "../object-field";
|
|
3
|
+
import { ObjectField, ObjectLevelField, ObjectLevelFieldValueChangeEvent, ReadonlyObjectLevelFieldType } from "../object-field";
|
|
4
4
|
import { UnitType, UnitTypeId } from "../object-data/entry/unit-type";
|
|
5
|
+
import { ReadonlyNonEmptyLinkedSet } from "../../utility/linked-set";
|
|
6
|
+
import { AttackType } from "../object-data/auxiliary/attack-type";
|
|
7
|
+
import { UnitClassifications } from "../object-data/auxiliary/unit-classification";
|
|
5
8
|
export declare abstract class UnitField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType = any> extends ObjectField<UnitType, Unit, ValueType, NativeFieldType> {
|
|
6
9
|
protected get instanceClass(): typeof Unit;
|
|
7
10
|
protected getObjectDataEntryId(instance: Unit): UnitTypeId;
|
|
11
|
+
protected hasNativeFieldValue(): boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class UnitBooleanField extends UnitField<boolean, junitbooleanfield> {
|
|
14
|
+
protected get defaultValue(): boolean;
|
|
15
|
+
protected getNativeFieldById(id: number): junitbooleanfield;
|
|
16
|
+
protected getNativeFieldValue(instance: Unit): boolean;
|
|
17
|
+
protected setNativeFieldValue(instance: Unit, value: boolean): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class UnitFloatField extends UnitField<number, junitrealfield> {
|
|
20
|
+
protected get defaultValue(): number;
|
|
21
|
+
protected getNativeFieldById(id: number): junitrealfield;
|
|
22
|
+
protected getNativeFieldValue(instance: Unit): number;
|
|
23
|
+
protected setNativeFieldValue(instance: Unit, value: number): boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class UnitIntegerField extends UnitField<number, junitintegerfield> {
|
|
26
|
+
protected get defaultValue(): number;
|
|
27
|
+
protected getNativeFieldById(id: number): junitintegerfield;
|
|
28
|
+
protected getNativeFieldValue(instance: Unit): number;
|
|
29
|
+
protected setNativeFieldValue(instance: Unit, value: number): boolean;
|
|
8
30
|
}
|
|
9
31
|
export declare class UnitStringField extends UnitField<string, junitstringfield> {
|
|
10
32
|
protected get defaultValue(): string;
|
|
11
33
|
protected getNativeFieldById(id: number): junitstringfield;
|
|
12
|
-
protected hasNativeFieldValue(): boolean;
|
|
13
34
|
protected getNativeFieldValue(instance: Unit): string;
|
|
14
|
-
protected getObjectDataEntryId(instance: Unit): UnitTypeId;
|
|
15
35
|
protected setNativeFieldValue(instance: Unit, value: string): boolean;
|
|
16
36
|
}
|
|
37
|
+
type junitweaponfield = junitweaponbooleanfield | junitweaponintegerfield | junitweaponrealfield | junitweaponstringfield;
|
|
38
|
+
export declare abstract class UnitWeaponField<ValueType extends number | string | boolean = number | string | boolean, InputValueType extends ValueType = never, NativeFieldType extends junitweaponfield = junitweaponfield> extends ObjectLevelField<UnitType, Unit, ValueType, InputValueType, NativeFieldType> {
|
|
39
|
+
protected get instanceClass(): typeof Unit;
|
|
40
|
+
protected getLevelCount(): number;
|
|
41
|
+
protected getObjectDataEntryId(instance: Unit): UnitTypeId;
|
|
42
|
+
protected hasNativeFieldValue(): boolean;
|
|
43
|
+
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<ReadonlyObjectLevelFieldType<UnitWeaponField>>;
|
|
44
|
+
}
|
|
45
|
+
export declare abstract class UnitNumberWeaponField<NativeFieldType extends junitweaponintegerfield | junitweaponrealfield = junitweaponintegerfield | junitweaponrealfield> extends UnitWeaponField<number, number, NativeFieldType> {
|
|
46
|
+
protected get defaultValue(): number;
|
|
47
|
+
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<UnitNumberWeaponField>;
|
|
48
|
+
}
|
|
49
|
+
export declare abstract class UnitEnumWeaponField<T extends number> extends UnitWeaponField<T, T, junitweaponintegerfield> {
|
|
50
|
+
protected abstract values: ReadonlyNonEmptyLinkedSet<T>;
|
|
51
|
+
protected get defaultValue(): T;
|
|
52
|
+
protected getNativeFieldById(id: number): junitweaponintegerfield;
|
|
53
|
+
protected getNativeFieldValue(instance: Unit, index: number): T;
|
|
54
|
+
protected setNativeFieldValue(instance: Unit, index: number, value: T): boolean;
|
|
55
|
+
static get valueChangeEvent(): ObjectLevelFieldValueChangeEvent<UnitEnumWeaponField<number>>;
|
|
56
|
+
}
|
|
57
|
+
export declare class UnitAttackTypeWeaponField extends UnitEnumWeaponField<AttackType> {
|
|
58
|
+
protected values: ReadonlyNonEmptyLinkedSet<AttackType>;
|
|
59
|
+
}
|
|
60
|
+
export declare class UnitClassificationsField extends UnitField<UnitClassifications, junitintegerfield> {
|
|
61
|
+
protected get defaultValue(): UnitClassifications;
|
|
62
|
+
protected getNativeFieldById(id: number): junitintegerfield;
|
|
63
|
+
protected getNativeFieldValue(instance: Unit): UnitClassifications;
|
|
64
|
+
protected setNativeFieldValue(instance: Unit, value: UnitClassifications): boolean;
|
|
65
|
+
}
|
|
66
|
+
export declare class UnitPropulsionWindowField extends UnitFloatField {
|
|
67
|
+
protected getNativeFieldValue(instance: Unit): number;
|
|
68
|
+
protected setNativeFieldValue(instance: Unit, value: number): boolean;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -2,11 +2,24 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
4
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
5
|
+
local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
|
|
5
6
|
local ____exports = {}
|
|
6
7
|
local ____unit = require("engine.internal.unit")
|
|
7
8
|
local Unit = ____unit.Unit
|
|
8
9
|
local ____object_2Dfield = require("engine.object-field")
|
|
9
10
|
local ObjectField = ____object_2Dfield.ObjectField
|
|
11
|
+
local ObjectLevelField = ____object_2Dfield.ObjectLevelField
|
|
12
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
13
|
+
local nonEmptyLinkedSetOf = ____linked_2Dset.nonEmptyLinkedSetOf
|
|
14
|
+
local convertUnitBooleanField = ConvertUnitBooleanField
|
|
15
|
+
local convertUnitIntegerField = ConvertUnitIntegerField
|
|
16
|
+
local convertUnitRealField = ConvertUnitRealField
|
|
17
|
+
local convertUnitStringField = ConvertUnitStringField
|
|
18
|
+
local convertUnitWeaponIntegerField = ConvertUnitWeaponIntegerField
|
|
19
|
+
local getUnitWeaponIntegerField = BlzGetUnitWeaponIntegerField
|
|
20
|
+
local setUnitWeaponIntegerField = BlzSetUnitWeaponIntegerField
|
|
21
|
+
local getUnitPropulsionWindow = GetUnitPropWindow
|
|
22
|
+
local setUnitPropulsionWindow = SetUnitPropWindow
|
|
10
23
|
____exports.UnitField = __TS__Class()
|
|
11
24
|
local UnitField = ____exports.UnitField
|
|
12
25
|
UnitField.name = "UnitField"
|
|
@@ -14,6 +27,9 @@ __TS__ClassExtends(UnitField, ObjectField)
|
|
|
14
27
|
function UnitField.prototype.getObjectDataEntryId(self, instance)
|
|
15
28
|
return instance.typeId
|
|
16
29
|
end
|
|
30
|
+
function UnitField.prototype.hasNativeFieldValue(self)
|
|
31
|
+
return true
|
|
32
|
+
end
|
|
17
33
|
__TS__SetDescriptor(
|
|
18
34
|
UnitField.prototype,
|
|
19
35
|
"instanceClass",
|
|
@@ -22,22 +38,79 @@ __TS__SetDescriptor(
|
|
|
22
38
|
end},
|
|
23
39
|
true
|
|
24
40
|
)
|
|
41
|
+
____exports.UnitBooleanField = __TS__Class()
|
|
42
|
+
local UnitBooleanField = ____exports.UnitBooleanField
|
|
43
|
+
UnitBooleanField.name = "UnitBooleanField"
|
|
44
|
+
__TS__ClassExtends(UnitBooleanField, ____exports.UnitField)
|
|
45
|
+
function UnitBooleanField.prototype.getNativeFieldById(self, id)
|
|
46
|
+
return convertUnitBooleanField(id)
|
|
47
|
+
end
|
|
48
|
+
function UnitBooleanField.prototype.getNativeFieldValue(self, instance)
|
|
49
|
+
return instance:getField(self.nativeField)
|
|
50
|
+
end
|
|
51
|
+
function UnitBooleanField.prototype.setNativeFieldValue(self, instance, value)
|
|
52
|
+
return instance:setField(self.nativeField, value)
|
|
53
|
+
end
|
|
54
|
+
__TS__SetDescriptor(
|
|
55
|
+
UnitBooleanField.prototype,
|
|
56
|
+
"defaultValue",
|
|
57
|
+
{get = function(self)
|
|
58
|
+
return false
|
|
59
|
+
end},
|
|
60
|
+
true
|
|
61
|
+
)
|
|
62
|
+
____exports.UnitFloatField = __TS__Class()
|
|
63
|
+
local UnitFloatField = ____exports.UnitFloatField
|
|
64
|
+
UnitFloatField.name = "UnitFloatField"
|
|
65
|
+
__TS__ClassExtends(UnitFloatField, ____exports.UnitField)
|
|
66
|
+
function UnitFloatField.prototype.getNativeFieldById(self, id)
|
|
67
|
+
return convertUnitRealField(id)
|
|
68
|
+
end
|
|
69
|
+
function UnitFloatField.prototype.getNativeFieldValue(self, instance)
|
|
70
|
+
return instance:getField(self.nativeField)
|
|
71
|
+
end
|
|
72
|
+
function UnitFloatField.prototype.setNativeFieldValue(self, instance, value)
|
|
73
|
+
return instance:setField(self.nativeField, value)
|
|
74
|
+
end
|
|
75
|
+
__TS__SetDescriptor(
|
|
76
|
+
UnitFloatField.prototype,
|
|
77
|
+
"defaultValue",
|
|
78
|
+
{get = function(self)
|
|
79
|
+
return 0
|
|
80
|
+
end},
|
|
81
|
+
true
|
|
82
|
+
)
|
|
83
|
+
____exports.UnitIntegerField = __TS__Class()
|
|
84
|
+
local UnitIntegerField = ____exports.UnitIntegerField
|
|
85
|
+
UnitIntegerField.name = "UnitIntegerField"
|
|
86
|
+
__TS__ClassExtends(UnitIntegerField, ____exports.UnitField)
|
|
87
|
+
function UnitIntegerField.prototype.getNativeFieldById(self, id)
|
|
88
|
+
return convertUnitIntegerField(id)
|
|
89
|
+
end
|
|
90
|
+
function UnitIntegerField.prototype.getNativeFieldValue(self, instance)
|
|
91
|
+
return instance:getField(self.nativeField)
|
|
92
|
+
end
|
|
93
|
+
function UnitIntegerField.prototype.setNativeFieldValue(self, instance, value)
|
|
94
|
+
return instance:setField(self.nativeField, value)
|
|
95
|
+
end
|
|
96
|
+
__TS__SetDescriptor(
|
|
97
|
+
UnitIntegerField.prototype,
|
|
98
|
+
"defaultValue",
|
|
99
|
+
{get = function(self)
|
|
100
|
+
return 0
|
|
101
|
+
end},
|
|
102
|
+
true
|
|
103
|
+
)
|
|
25
104
|
____exports.UnitStringField = __TS__Class()
|
|
26
105
|
local UnitStringField = ____exports.UnitStringField
|
|
27
106
|
UnitStringField.name = "UnitStringField"
|
|
28
107
|
__TS__ClassExtends(UnitStringField, ____exports.UnitField)
|
|
29
108
|
function UnitStringField.prototype.getNativeFieldById(self, id)
|
|
30
|
-
return
|
|
31
|
-
end
|
|
32
|
-
function UnitStringField.prototype.hasNativeFieldValue(self)
|
|
33
|
-
return true
|
|
109
|
+
return convertUnitStringField(id)
|
|
34
110
|
end
|
|
35
111
|
function UnitStringField.prototype.getNativeFieldValue(self, instance)
|
|
36
112
|
return instance:getField(self.nativeField)
|
|
37
113
|
end
|
|
38
|
-
function UnitStringField.prototype.getObjectDataEntryId(self, instance)
|
|
39
|
-
return instance.typeId
|
|
40
|
-
end
|
|
41
114
|
function UnitStringField.prototype.setNativeFieldValue(self, instance, value)
|
|
42
115
|
return instance:setField(self.nativeField, value)
|
|
43
116
|
end
|
|
@@ -49,4 +122,131 @@ __TS__SetDescriptor(
|
|
|
49
122
|
end},
|
|
50
123
|
true
|
|
51
124
|
)
|
|
125
|
+
____exports.UnitWeaponField = __TS__Class()
|
|
126
|
+
local UnitWeaponField = ____exports.UnitWeaponField
|
|
127
|
+
UnitWeaponField.name = "UnitWeaponField"
|
|
128
|
+
__TS__ClassExtends(UnitWeaponField, ObjectLevelField)
|
|
129
|
+
function UnitWeaponField.prototype.getLevelCount(self)
|
|
130
|
+
return 2
|
|
131
|
+
end
|
|
132
|
+
function UnitWeaponField.prototype.getObjectDataEntryId(self, instance)
|
|
133
|
+
return instance.typeId
|
|
134
|
+
end
|
|
135
|
+
function UnitWeaponField.prototype.hasNativeFieldValue(self)
|
|
136
|
+
return true
|
|
137
|
+
end
|
|
138
|
+
__TS__SetDescriptor(
|
|
139
|
+
UnitWeaponField.prototype,
|
|
140
|
+
"instanceClass",
|
|
141
|
+
{get = function(self)
|
|
142
|
+
return Unit
|
|
143
|
+
end},
|
|
144
|
+
true
|
|
145
|
+
)
|
|
146
|
+
__TS__ObjectDefineProperty(
|
|
147
|
+
UnitWeaponField,
|
|
148
|
+
"valueChangeEvent",
|
|
149
|
+
{get = function(self)
|
|
150
|
+
return self:getOrCreateValueChangeEvent()
|
|
151
|
+
end}
|
|
152
|
+
)
|
|
153
|
+
____exports.UnitNumberWeaponField = __TS__Class()
|
|
154
|
+
local UnitNumberWeaponField = ____exports.UnitNumberWeaponField
|
|
155
|
+
UnitNumberWeaponField.name = "UnitNumberWeaponField"
|
|
156
|
+
__TS__ClassExtends(UnitNumberWeaponField, ____exports.UnitWeaponField)
|
|
157
|
+
__TS__SetDescriptor(
|
|
158
|
+
UnitNumberWeaponField.prototype,
|
|
159
|
+
"defaultValue",
|
|
160
|
+
{get = function(self)
|
|
161
|
+
return 0
|
|
162
|
+
end},
|
|
163
|
+
true
|
|
164
|
+
)
|
|
165
|
+
__TS__ObjectDefineProperty(
|
|
166
|
+
UnitNumberWeaponField,
|
|
167
|
+
"valueChangeEvent",
|
|
168
|
+
{get = function(self)
|
|
169
|
+
return self:getOrCreateValueChangeEvent()
|
|
170
|
+
end}
|
|
171
|
+
)
|
|
172
|
+
____exports.UnitEnumWeaponField = __TS__Class()
|
|
173
|
+
local UnitEnumWeaponField = ____exports.UnitEnumWeaponField
|
|
174
|
+
UnitEnumWeaponField.name = "UnitEnumWeaponField"
|
|
175
|
+
__TS__ClassExtends(UnitEnumWeaponField, ____exports.UnitWeaponField)
|
|
176
|
+
function UnitEnumWeaponField.prototype.getNativeFieldById(self, id)
|
|
177
|
+
return convertUnitWeaponIntegerField(id)
|
|
178
|
+
end
|
|
179
|
+
function UnitEnumWeaponField.prototype.getNativeFieldValue(self, instance, index)
|
|
180
|
+
local value = getUnitWeaponIntegerField(instance.handle, self.nativeField, index)
|
|
181
|
+
if self.values:contains(value) then
|
|
182
|
+
return value
|
|
183
|
+
end
|
|
184
|
+
return self.values:first()
|
|
185
|
+
end
|
|
186
|
+
function UnitEnumWeaponField.prototype.setNativeFieldValue(self, instance, index, value)
|
|
187
|
+
return setUnitWeaponIntegerField(instance.handle, self.nativeField, index, value)
|
|
188
|
+
end
|
|
189
|
+
__TS__SetDescriptor(
|
|
190
|
+
UnitEnumWeaponField.prototype,
|
|
191
|
+
"defaultValue",
|
|
192
|
+
{get = function(self)
|
|
193
|
+
return self.values:first()
|
|
194
|
+
end},
|
|
195
|
+
true
|
|
196
|
+
)
|
|
197
|
+
__TS__ObjectDefineProperty(
|
|
198
|
+
UnitEnumWeaponField,
|
|
199
|
+
"valueChangeEvent",
|
|
200
|
+
{get = function(self)
|
|
201
|
+
return self:getOrCreateValueChangeEvent()
|
|
202
|
+
end}
|
|
203
|
+
)
|
|
204
|
+
____exports.UnitAttackTypeWeaponField = __TS__Class()
|
|
205
|
+
local UnitAttackTypeWeaponField = ____exports.UnitAttackTypeWeaponField
|
|
206
|
+
UnitAttackTypeWeaponField.name = "UnitAttackTypeWeaponField"
|
|
207
|
+
__TS__ClassExtends(UnitAttackTypeWeaponField, ____exports.UnitEnumWeaponField)
|
|
208
|
+
function UnitAttackTypeWeaponField.prototype.____constructor(self, ...)
|
|
209
|
+
UnitAttackTypeWeaponField.____super.prototype.____constructor(self, ...)
|
|
210
|
+
self.values = nonEmptyLinkedSetOf(
|
|
211
|
+
1,
|
|
212
|
+
2,
|
|
213
|
+
3,
|
|
214
|
+
0,
|
|
215
|
+
5,
|
|
216
|
+
4,
|
|
217
|
+
6
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
____exports.UnitClassificationsField = __TS__Class()
|
|
221
|
+
local UnitClassificationsField = ____exports.UnitClassificationsField
|
|
222
|
+
UnitClassificationsField.name = "UnitClassificationsField"
|
|
223
|
+
__TS__ClassExtends(UnitClassificationsField, ____exports.UnitField)
|
|
224
|
+
function UnitClassificationsField.prototype.getNativeFieldById(self, id)
|
|
225
|
+
return convertUnitIntegerField(id)
|
|
226
|
+
end
|
|
227
|
+
function UnitClassificationsField.prototype.getNativeFieldValue(self, instance)
|
|
228
|
+
return instance:getField(self.nativeField)
|
|
229
|
+
end
|
|
230
|
+
function UnitClassificationsField.prototype.setNativeFieldValue(self, instance, value)
|
|
231
|
+
return instance:setField(self.nativeField, value)
|
|
232
|
+
end
|
|
233
|
+
__TS__SetDescriptor(
|
|
234
|
+
UnitClassificationsField.prototype,
|
|
235
|
+
"defaultValue",
|
|
236
|
+
{get = function(self)
|
|
237
|
+
return 0
|
|
238
|
+
end},
|
|
239
|
+
true
|
|
240
|
+
)
|
|
241
|
+
____exports.UnitPropulsionWindowField = __TS__Class()
|
|
242
|
+
local UnitPropulsionWindowField = ____exports.UnitPropulsionWindowField
|
|
243
|
+
UnitPropulsionWindowField.name = "UnitPropulsionWindowField"
|
|
244
|
+
__TS__ClassExtends(UnitPropulsionWindowField, ____exports.UnitFloatField)
|
|
245
|
+
function UnitPropulsionWindowField.prototype.getNativeFieldValue(self, instance)
|
|
246
|
+
return getUnitPropulsionWindow(instance.handle)
|
|
247
|
+
end
|
|
248
|
+
function UnitPropulsionWindowField.prototype.setNativeFieldValue(self, instance, value)
|
|
249
|
+
setUnitPropulsionWindow(instance.handle, value)
|
|
250
|
+
return true
|
|
251
|
+
end
|
|
52
252
|
return ____exports
|