warscript 0.0.1-dev.9b0216a → 0.0.1-dev.9cbb1ff
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/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/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/timer.d.ts +6 -7
- package/core/types/timer.lua +18 -21
- package/core/util.lua +6 -1
- 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 +3 -0
- package/engine/behaviour/ability/damage.lua +2 -2
- package/engine/behaviour/ability/emulate-impact.lua +11 -5
- package/engine/behaviour/ability.d.ts +12 -3
- package/engine/behaviour/ability.lua +66 -7
- package/engine/behaviour/unit.d.ts +2 -0
- package/engine/buff.d.ts +56 -41
- package/engine/buff.lua +295 -228
- package/engine/internal/ability.lua +16 -15
- package/engine/internal/item/ability.lua +29 -4
- package/engine/internal/item.d.ts +2 -2
- package/engine/internal/item.lua +56 -25
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- 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/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/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.d.ts +13 -1
- package/engine/internal/unit.lua +74 -13
- 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/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- 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/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 +81 -21
- 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 +8 -1
- package/engine/object-data/entry/unit-type.lua +69 -10
- 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 +5 -2
- package/engine/object-field/ability.lua +3 -0
- package/engine/object-field.d.ts +11 -3
- package/engine/object-field.lua +162 -76
- 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/unit.d.ts +1 -0
- package/engine/unit.lua +1 -0
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +3 -0
- package/utility/lua-maps.d.ts +3 -0
- package/utility/lua-maps.lua +16 -0
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +3 -0
- package/utility/reflection.lua +11 -7
|
@@ -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)
|
|
@@ -45,9 +45,10 @@ export declare class AbilityStringField extends AbilityField<string, jabilitystr
|
|
|
45
45
|
protected setNativeFieldValue(instance: Ability, value: string): boolean;
|
|
46
46
|
static get valueChangeEvent(): ObjectFieldValueChangeEvent<AbilityStringField>;
|
|
47
47
|
}
|
|
48
|
-
export declare abstract class AbilityArrayField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType =
|
|
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(instance: Ability): boolean;
|
|
51
52
|
}
|
|
52
53
|
export declare class AbilityStringArrayField extends AbilityArrayField<string, jabilitystringlevelfield> {
|
|
53
54
|
protected get defaultValue(): string;
|
|
@@ -130,7 +131,9 @@ export declare class AbilityCombatClassificationsLevelField extends AbilityLevel
|
|
|
130
131
|
protected getNativeFieldValue(instance: Ability, level: number): CombatClassifications;
|
|
131
132
|
protected setNativeFieldValue(instance: Ability, level: number, value: CombatClassifications): boolean;
|
|
132
133
|
}
|
|
133
|
-
export type
|
|
134
|
+
export type ReadonlySubscribableAbilityDependentValue<ValueType extends boolean | number | string> = ValueType | ReadonlyObjectFieldType<AbilityField<ValueType>> | ReadonlyObjectLevelFieldType<AbilityLevelField<ValueType>>;
|
|
135
|
+
export type SubscribableAbilityDependentValue<ValueType extends boolean | number | string> = ValueType | AbilityField<ValueType> | AbilityLevelField<ValueType>;
|
|
136
|
+
export type AbilityDependentValue<ValueType extends boolean | number | string> = SubscribableAbilityDependentValue<ValueType> | ((ability: Ability) => ValueType);
|
|
134
137
|
export declare const resolveCurrentAbilityDependentValue: {
|
|
135
138
|
<ValueType extends boolean | number | string>(ability: Ability, value: AbilityDependentValue<ValueType>): ValueType;
|
|
136
139
|
<ValueType extends boolean | number | string>(ability: Ability, value?: AbilityDependentValue<ValueType>): ValueType | undefined;
|
|
@@ -197,6 +197,9 @@ __TS__ClassExtends(AbilityArrayField, ObjectArrayField)
|
|
|
197
197
|
function AbilityArrayField.prototype.getObjectDataEntryId(self, instance)
|
|
198
198
|
return instance.typeId
|
|
199
199
|
end
|
|
200
|
+
function AbilityArrayField.prototype.hasNativeFieldValue(self, instance)
|
|
201
|
+
return instance:hasField(self.nativeField)
|
|
202
|
+
end
|
|
200
203
|
__TS__SetDescriptor(
|
|
201
204
|
AbilityArrayField.prototype,
|
|
202
205
|
"instanceClass",
|
package/engine/object-field.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ declare abstract class ObjectFieldBase<ObjectDataEntryType extends ObjectDataEnt
|
|
|
16
16
|
readonly id: ObjectFieldId;
|
|
17
17
|
protected abstract getNativeFieldById(id: number): NativeFieldType;
|
|
18
18
|
protected abstract getObjectDataEntryId(instance: InstanceType): ObjectDataEntryIdType<ObjectDataEntryType>;
|
|
19
|
+
protected abstract hasNativeFieldValue(instance: InstanceType): boolean;
|
|
20
|
+
hasValue(instance: InstanceType): boolean;
|
|
19
21
|
constructor(id: number);
|
|
20
22
|
static create<T extends ObjectFieldBase<any, any, any, any>>(this: ObjectFieldConstructor<T>, id?: number): T & symbol;
|
|
21
23
|
static of<T extends ObjectFieldBase<any, any, any, any>>(this: ObjectFieldAbstractConstructor<T>, id: number): T | undefined;
|
|
@@ -33,15 +35,22 @@ export type ObjectFieldValueChangeEvent<T extends ObjectField<any, any, any, any
|
|
|
33
35
|
]> : never;
|
|
34
36
|
export type ReadonlyObjectFieldType<T extends ObjectField<any, any, any, any>> = Omit<T, "setValue" | "removeValue" | "trySetValue">;
|
|
35
37
|
type ReadonlyObjectFieldConstructor<T extends ObjectField> = OmitConstructor<typeof ObjectField> & (abstract new (...args: any[]) => ReadonlyObjectFieldType<T>);
|
|
38
|
+
type ObjectFieldModifier<InstanceType extends AnyNotNil, ValueType extends number | string | boolean> = (instance: InstanceType, currentValue: ValueType, originalValue: ValueType) => ValueType;
|
|
36
39
|
export declare abstract class ObjectField<ObjectDataEntryType extends ObjectDataEntry = ObjectDataEntry, InstanceType extends AnyNotNil = AnyNotNil, ValueType extends number | string | boolean = number | string | boolean, NativeFieldType = unknown> extends ObjectFieldBase<ObjectDataEntryType, InstanceType, ValueType, NativeFieldType> {
|
|
37
40
|
protected abstract readonly defaultValue: ValueType;
|
|
38
|
-
protected abstract hasNativeFieldValue(instance: InstanceType): boolean;
|
|
39
41
|
protected abstract getNativeFieldValue(instance: InstanceType): ValueType;
|
|
40
42
|
protected abstract setNativeFieldValue(instance: InstanceType, value: ValueType): boolean;
|
|
41
|
-
|
|
43
|
+
private originalValueByInstance?;
|
|
44
|
+
private modifiersByInstance?;
|
|
45
|
+
getValue(entry: ObjectDataEntryType | InstanceType, includeModifiers?: boolean): ValueType;
|
|
42
46
|
setValue(entry: ObjectDataEntryType | InstanceType, value: ValueType): boolean;
|
|
47
|
+
applyModifier(instance: InstanceType, modifier: ObjectFieldModifier<InstanceType, ValueType>): void;
|
|
48
|
+
removeModifier(instance: InstanceType, modifier: ObjectFieldModifier<InstanceType, ValueType>): boolean;
|
|
43
49
|
removeValue(entry: ObjectDataEntryType): boolean;
|
|
44
50
|
trySetValue(entry: ObjectDataEntryType | InstanceType, value: unknown): boolean;
|
|
51
|
+
private getActualValue;
|
|
52
|
+
private setActualValue;
|
|
53
|
+
private calculateActualValue;
|
|
45
54
|
private invokeValueChangeEvent;
|
|
46
55
|
private invokeValueChangeEventRecursive;
|
|
47
56
|
protected static getOrCreateValueChangeEvent<T extends ObjectField, R extends ReadonlyObjectFieldType<T>>(this: ReadonlyObjectFieldConstructor<T>): ObjectFieldValueChangeEvent<R>;
|
|
@@ -71,7 +80,6 @@ export declare abstract class ObjectArrayField<ObjectDataEntryType extends Objec
|
|
|
71
80
|
}
|
|
72
81
|
export declare abstract class ObjectLevelField<ObjectDataEntryType extends ObjectDataEntry = ObjectDataEntry, InstanceType extends AnyNotNil = AnyNotNil, ValueType extends number | string | boolean = number | string | boolean, InputValueType extends ValueType = never, NativeFieldType = unknown> extends ObjectFieldBase<ObjectDataEntryType, InstanceType, ValueType[], NativeFieldType> {
|
|
73
82
|
protected abstract readonly defaultValue: ValueType;
|
|
74
|
-
protected abstract hasNativeFieldValue(instance: InstanceType): boolean;
|
|
75
83
|
protected abstract getNativeFieldValue(instance: InstanceType, level: number): ValueType;
|
|
76
84
|
protected abstract setNativeFieldValue(instance: InstanceType, level: number, value: ValueType): boolean;
|
|
77
85
|
protected abstract getLevelCount(entry: ObjectDataEntryType | InstanceType): number;
|
package/engine/object-field.lua
CHANGED
|
@@ -20,6 +20,11 @@ local extractObjectDataEntryLevelFieldValue = ____entry.extractObjectDataEntryLe
|
|
|
20
20
|
local ObjectDataEntry = ____entry.ObjectDataEntry
|
|
21
21
|
local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.utility.object-data-entry-id-generator")
|
|
22
22
|
local ObjectDataEntryIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.ObjectDataEntryIdGenerator
|
|
23
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
24
|
+
local mutableLinkedSet = ____linked_2Dset.mutableLinkedSet
|
|
25
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
26
|
+
local getOrPut = ____lua_2Dmaps.getOrPut
|
|
27
|
+
local mutableWeakLuaMap = ____lua_2Dmaps.mutableWeakLuaMap
|
|
23
28
|
local compiletimeDefaultValueByObjectDataEntryIdByObjectFieldId = {}
|
|
24
29
|
local defaultValueByObjectDataEntryIdByObjectFieldId = postcompile(function() return compiletimeDefaultValueByObjectDataEntryIdByObjectFieldId end)
|
|
25
30
|
local objectFieldById = {}
|
|
@@ -46,6 +51,10 @@ end
|
|
|
46
51
|
function ObjectFieldBase.prototype.supports(self, instance)
|
|
47
52
|
return __TS__InstanceOf(instance, self.instanceClass)
|
|
48
53
|
end
|
|
54
|
+
function ObjectFieldBase.prototype.hasValue(self, instance)
|
|
55
|
+
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
56
|
+
return defaultValueByObjectDataEntryId ~= nil and defaultValueByObjectDataEntryId[self:getObjectDataEntryId(instance)] ~= nil or self:hasNativeFieldValue(instance)
|
|
57
|
+
end
|
|
49
58
|
function ObjectFieldBase.create(self, id)
|
|
50
59
|
return __TS__New(
|
|
51
60
|
self,
|
|
@@ -71,7 +80,7 @@ ____exports.ObjectField = __TS__Class()
|
|
|
71
80
|
local ObjectField = ____exports.ObjectField
|
|
72
81
|
ObjectField.name = "ObjectField"
|
|
73
82
|
__TS__ClassExtends(ObjectField, ObjectFieldBase)
|
|
74
|
-
function ObjectField.prototype.getValue(self, entry)
|
|
83
|
+
function ObjectField.prototype.getValue(self, entry, includeModifiers)
|
|
75
84
|
if __TS__InstanceOf(entry, ObjectDataEntry) then
|
|
76
85
|
local defaultValueByObjectDataEntryId = (warpack.compiletime and compiletimeDefaultValueByObjectDataEntryIdByObjectFieldId or defaultValueByObjectDataEntryIdByObjectFieldId)[self.id]
|
|
77
86
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
@@ -82,22 +91,16 @@ function ObjectField.prototype.getValue(self, entry)
|
|
|
82
91
|
end
|
|
83
92
|
return self.defaultValue
|
|
84
93
|
end
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
____self_valueByInstance_entry_0 = defaultValue
|
|
94
|
+
if includeModifiers == false then
|
|
95
|
+
local originalValueByInstance = self.originalValueByInstance
|
|
96
|
+
if originalValueByInstance ~= nil then
|
|
97
|
+
local originalValue = originalValueByInstance[entry]
|
|
98
|
+
if originalValue ~= nil then
|
|
99
|
+
return originalValue
|
|
92
100
|
end
|
|
93
|
-
return ____self_valueByInstance_entry_0
|
|
94
101
|
end
|
|
95
102
|
end
|
|
96
|
-
|
|
97
|
-
if ____temp_1 == nil then
|
|
98
|
-
____temp_1 = self.defaultValue
|
|
99
|
-
end
|
|
100
|
-
return ____temp_1
|
|
103
|
+
return self:getActualValue(entry)
|
|
101
104
|
end
|
|
102
105
|
function ObjectField.prototype.setValue(self, entry, value)
|
|
103
106
|
if __TS__InstanceOf(entry, ObjectDataEntry) then
|
|
@@ -112,37 +115,53 @@ function ObjectField.prototype.setValue(self, entry, value)
|
|
|
112
115
|
defaultValueByObjectDataEntryId[entry.id] = value
|
|
113
116
|
return true
|
|
114
117
|
end
|
|
115
|
-
local
|
|
116
|
-
if
|
|
117
|
-
local
|
|
118
|
-
if
|
|
119
|
-
local
|
|
120
|
-
if
|
|
121
|
-
|
|
118
|
+
local modifiersByInstance = self.modifiersByInstance
|
|
119
|
+
if modifiersByInstance ~= nil then
|
|
120
|
+
local modifiers = modifiersByInstance[entry]
|
|
121
|
+
if modifiers ~= nil and modifiers.size ~= 0 then
|
|
122
|
+
local originalValueByInstance = self.originalValueByInstance
|
|
123
|
+
if originalValueByInstance == nil then
|
|
124
|
+
originalValueByInstance = mutableWeakLuaMap()
|
|
125
|
+
self.originalValueByInstance = originalValueByInstance
|
|
122
126
|
end
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
____self_valueByInstance_entry_2_3 = self.defaultValue
|
|
126
|
-
end
|
|
127
|
-
local previousValue = ____self_valueByInstance_entry_2_3
|
|
128
|
-
if value ~= previousValue then
|
|
129
|
-
self.valueByInstance[entry] = value
|
|
130
|
-
self:invokeValueChangeEvent(entry, self, previousValue, value)
|
|
131
|
-
end
|
|
132
|
-
return true
|
|
127
|
+
originalValueByInstance[entry] = value
|
|
128
|
+
value = self:calculateActualValue(entry)
|
|
133
129
|
end
|
|
134
130
|
end
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
return self:setActualValue(entry, value)
|
|
132
|
+
end
|
|
133
|
+
function ObjectField.prototype.applyModifier(self, instance, modifier)
|
|
134
|
+
local modifiersByInstance = self.modifiersByInstance
|
|
135
|
+
if modifiersByInstance == nil then
|
|
136
|
+
modifiersByInstance = mutableWeakLuaMap()
|
|
137
|
+
self.modifiersByInstance = modifiersByInstance
|
|
138
|
+
end
|
|
139
|
+
if getOrPut(modifiersByInstance, instance, mutableLinkedSet):add(modifier) then
|
|
140
|
+
local originalValueByInstance = self.originalValueByInstance
|
|
141
|
+
if originalValueByInstance == nil then
|
|
142
|
+
originalValueByInstance = mutableWeakLuaMap()
|
|
143
|
+
self.originalValueByInstance = originalValueByInstance
|
|
144
|
+
end
|
|
145
|
+
originalValueByInstance[instance] = self:getActualValue(instance)
|
|
146
|
+
self:setActualValue(
|
|
147
|
+
instance,
|
|
148
|
+
self:calculateActualValue(instance)
|
|
149
|
+
)
|
|
137
150
|
end
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
end
|
|
152
|
+
function ObjectField.prototype.removeModifier(self, instance, modifier)
|
|
153
|
+
local modifiersByInstance = self.modifiersByInstance
|
|
154
|
+
if modifiersByInstance ~= nil then
|
|
155
|
+
local modifiers = modifiersByInstance[instance]
|
|
156
|
+
if modifiers ~= nil and modifiers:remove(modifier) then
|
|
157
|
+
self:setActualValue(
|
|
158
|
+
instance,
|
|
159
|
+
self:calculateActualValue(instance)
|
|
160
|
+
)
|
|
161
|
+
return true
|
|
142
162
|
end
|
|
143
|
-
self:invokeValueChangeEvent(entry, self, previousValue, value)
|
|
144
163
|
end
|
|
145
|
-
return
|
|
164
|
+
return false
|
|
146
165
|
end
|
|
147
166
|
function ObjectField.prototype.removeValue(self, entry)
|
|
148
167
|
if not warpack.compiletime then
|
|
@@ -164,6 +183,73 @@ function ObjectField.prototype.trySetValue(self, entry, value)
|
|
|
164
183
|
end
|
|
165
184
|
return self:setValue(entry, value)
|
|
166
185
|
end
|
|
186
|
+
function ObjectField.prototype.getActualValue(self, instance)
|
|
187
|
+
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
188
|
+
if defaultValueByObjectDataEntryId ~= nil then
|
|
189
|
+
local defaultValue = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(instance)]
|
|
190
|
+
if defaultValue ~= nil then
|
|
191
|
+
local ____self_valueByInstance_instance_0 = self.valueByInstance[instance]
|
|
192
|
+
if ____self_valueByInstance_instance_0 == nil then
|
|
193
|
+
____self_valueByInstance_instance_0 = defaultValue
|
|
194
|
+
end
|
|
195
|
+
return ____self_valueByInstance_instance_0
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
local ____temp_1 = self:getNativeFieldValue(instance)
|
|
199
|
+
if ____temp_1 == nil then
|
|
200
|
+
____temp_1 = self.defaultValue
|
|
201
|
+
end
|
|
202
|
+
return ____temp_1
|
|
203
|
+
end
|
|
204
|
+
function ObjectField.prototype.setActualValue(self, instance, value)
|
|
205
|
+
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
206
|
+
if defaultValueByObjectDataEntryId ~= nil then
|
|
207
|
+
local defaultValue = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(instance)]
|
|
208
|
+
if defaultValue ~= nil then
|
|
209
|
+
local ____self_valueByInstance_instance_2 = self.valueByInstance[instance]
|
|
210
|
+
if ____self_valueByInstance_instance_2 == nil then
|
|
211
|
+
____self_valueByInstance_instance_2 = defaultValue
|
|
212
|
+
end
|
|
213
|
+
local ____self_valueByInstance_instance_2_3 = ____self_valueByInstance_instance_2
|
|
214
|
+
if ____self_valueByInstance_instance_2_3 == nil then
|
|
215
|
+
____self_valueByInstance_instance_2_3 = self.defaultValue
|
|
216
|
+
end
|
|
217
|
+
local previousValue = ____self_valueByInstance_instance_2_3
|
|
218
|
+
if value ~= previousValue then
|
|
219
|
+
self.valueByInstance[instance] = value
|
|
220
|
+
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
221
|
+
end
|
|
222
|
+
return true
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
if not self:hasNativeFieldValue(instance) then
|
|
226
|
+
return false
|
|
227
|
+
end
|
|
228
|
+
local previousValue = self:getNativeFieldValue(instance)
|
|
229
|
+
if value ~= previousValue then
|
|
230
|
+
if not self:setNativeFieldValue(instance, value) then
|
|
231
|
+
return false
|
|
232
|
+
end
|
|
233
|
+
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
234
|
+
end
|
|
235
|
+
return true
|
|
236
|
+
end
|
|
237
|
+
function ObjectField.prototype.calculateActualValue(self, instance)
|
|
238
|
+
local ____opt_4 = self.originalValueByInstance
|
|
239
|
+
local originalValue = ____opt_4 and ____opt_4[instance]
|
|
240
|
+
local ____opt_6 = self.modifiersByInstance
|
|
241
|
+
local modifiers = ____opt_6 and ____opt_6[instance]
|
|
242
|
+
if originalValue ~= nil then
|
|
243
|
+
local value = originalValue
|
|
244
|
+
if modifiers ~= nil then
|
|
245
|
+
for modifier in pairs(modifiers) do
|
|
246
|
+
value = modifier(instance, value, originalValue)
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
return value
|
|
250
|
+
end
|
|
251
|
+
return self.defaultValue
|
|
252
|
+
end
|
|
167
253
|
function ObjectField.prototype.invokeValueChangeEvent(self, ...)
|
|
168
254
|
self:invokeValueChangeEventRecursive(
|
|
169
255
|
getClass(self),
|
|
@@ -217,17 +303,17 @@ function ObjectArrayField.prototype.getValue(self, entry, index)
|
|
|
217
303
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
218
304
|
local value = defaultValueByObjectDataEntryId[entry.id]
|
|
219
305
|
if value ~= nil then
|
|
220
|
-
local
|
|
306
|
+
local ____temp_9
|
|
221
307
|
if index == nil then
|
|
222
|
-
|
|
308
|
+
____temp_9 = value
|
|
223
309
|
else
|
|
224
|
-
local
|
|
225
|
-
if
|
|
226
|
-
|
|
310
|
+
local ____value_index_8 = value[index + 1]
|
|
311
|
+
if ____value_index_8 == nil then
|
|
312
|
+
____value_index_8 = self.defaultValue
|
|
227
313
|
end
|
|
228
|
-
|
|
314
|
+
____temp_9 = ____value_index_8
|
|
229
315
|
end
|
|
230
|
-
return
|
|
316
|
+
return ____temp_9
|
|
231
317
|
end
|
|
232
318
|
end
|
|
233
319
|
return index == nil and ({}) or self.defaultValue
|
|
@@ -237,17 +323,17 @@ function ObjectArrayField.prototype.getValue(self, entry, index)
|
|
|
237
323
|
local defaultValue = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(entry)]
|
|
238
324
|
if defaultValue ~= nil then
|
|
239
325
|
local value = self.valueByInstance[entry] or defaultValue
|
|
240
|
-
local
|
|
326
|
+
local ____temp_11
|
|
241
327
|
if index == nil then
|
|
242
|
-
|
|
328
|
+
____temp_11 = value
|
|
243
329
|
else
|
|
244
|
-
local
|
|
245
|
-
if
|
|
246
|
-
|
|
330
|
+
local ____value_index_10 = value[index + 1]
|
|
331
|
+
if ____value_index_10 == nil then
|
|
332
|
+
____value_index_10 = self.defaultValue
|
|
247
333
|
end
|
|
248
|
-
|
|
334
|
+
____temp_11 = ____value_index_10
|
|
249
335
|
end
|
|
250
|
-
return
|
|
336
|
+
return ____temp_11
|
|
251
337
|
end
|
|
252
338
|
end
|
|
253
339
|
if index ~= nil then
|
|
@@ -292,11 +378,11 @@ function ObjectLevelField.prototype.getValue(self, entry, level)
|
|
|
292
378
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
293
379
|
local valueByLevel = defaultValueByObjectDataEntryId[entry.id]
|
|
294
380
|
if valueByLevel ~= nil then
|
|
295
|
-
local
|
|
296
|
-
if
|
|
297
|
-
|
|
381
|
+
local ____valueByLevel_index_12 = valueByLevel[level + 1]
|
|
382
|
+
if ____valueByLevel_index_12 == nil then
|
|
383
|
+
____valueByLevel_index_12 = self.defaultValue
|
|
298
384
|
end
|
|
299
|
-
return
|
|
385
|
+
return ____valueByLevel_index_12
|
|
300
386
|
end
|
|
301
387
|
end
|
|
302
388
|
return self.defaultValue
|
|
@@ -305,23 +391,23 @@ function ObjectLevelField.prototype.getValue(self, entry, level)
|
|
|
305
391
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
306
392
|
local defaultValueByLevel = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(entry)]
|
|
307
393
|
if defaultValueByLevel ~= nil then
|
|
308
|
-
local
|
|
309
|
-
local
|
|
310
|
-
if
|
|
311
|
-
|
|
394
|
+
local ____opt_13 = self.valueByInstance[entry]
|
|
395
|
+
local ____temp_15 = ____opt_13 and ____opt_13[level + 1]
|
|
396
|
+
if ____temp_15 == nil then
|
|
397
|
+
____temp_15 = defaultValueByLevel[level + 1]
|
|
312
398
|
end
|
|
313
|
-
local
|
|
314
|
-
if
|
|
315
|
-
|
|
399
|
+
local ____temp_15_16 = ____temp_15
|
|
400
|
+
if ____temp_15_16 == nil then
|
|
401
|
+
____temp_15_16 = self.defaultValue
|
|
316
402
|
end
|
|
317
|
-
return
|
|
403
|
+
return ____temp_15_16
|
|
318
404
|
end
|
|
319
405
|
end
|
|
320
|
-
local
|
|
321
|
-
if
|
|
322
|
-
|
|
406
|
+
local ____temp_17 = self:getNativeFieldValue(entry, level)
|
|
407
|
+
if ____temp_17 == nil then
|
|
408
|
+
____temp_17 = self.defaultValue
|
|
323
409
|
end
|
|
324
|
-
return
|
|
410
|
+
return ____temp_17
|
|
325
411
|
end
|
|
326
412
|
function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
|
|
327
413
|
if value == nil then
|
|
@@ -370,15 +456,15 @@ function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
|
|
|
370
456
|
valueByLevel = {}
|
|
371
457
|
self.valueByInstance[entry] = valueByLevel
|
|
372
458
|
end
|
|
373
|
-
local
|
|
374
|
-
if
|
|
375
|
-
|
|
459
|
+
local ____valueByLevel_index_18 = valueByLevel[level + 1]
|
|
460
|
+
if ____valueByLevel_index_18 == nil then
|
|
461
|
+
____valueByLevel_index_18 = defaultValueByLevel[level + 1]
|
|
376
462
|
end
|
|
377
|
-
local
|
|
378
|
-
if
|
|
379
|
-
|
|
463
|
+
local ____valueByLevel_index_18_19 = ____valueByLevel_index_18
|
|
464
|
+
if ____valueByLevel_index_18_19 == nil then
|
|
465
|
+
____valueByLevel_index_18_19 = self.defaultValue
|
|
380
466
|
end
|
|
381
|
-
local previousValue =
|
|
467
|
+
local previousValue = ____valueByLevel_index_18_19
|
|
382
468
|
if value ~= previousValue then
|
|
383
469
|
valueByLevel[level + 1] = value
|
|
384
470
|
self:invokeValueChangeEvent(
|