warscript 0.0.1-dev.7b6a4ac → 0.0.1-dev.8a4aeae
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
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
+
/** @noSelfInFile */
|
|
3
|
+
export type Attribute<T> = {
|
|
4
|
+
readonly __attribute: unique symbol;
|
|
5
|
+
readonly __type: T;
|
|
6
|
+
} & symbol;
|
|
7
|
+
export declare namespace Attribute {
|
|
8
|
+
const create: <T>() => Attribute<T>;
|
|
9
|
+
}
|
|
10
|
+
export declare class AttributesHolder {
|
|
11
|
+
readonly get: (<T>(attribute: Attribute<T>) => T | undefined) & LuaExtension<"TableGetMethod">;
|
|
12
|
+
readonly set: (<T>(attribute: Attribute<T>, value: T | undefined) => void) & LuaExtension<"TableSetMethod">;
|
|
13
|
+
}
|
package/attributes.lua
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
____exports.Attribute = {}
|
|
5
|
+
local Attribute = ____exports.Attribute
|
|
6
|
+
do
|
|
7
|
+
Attribute.create = function()
|
|
8
|
+
return {}
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
____exports.AttributesHolder = __TS__Class()
|
|
12
|
+
local AttributesHolder = ____exports.AttributesHolder
|
|
13
|
+
AttributesHolder.name = "AttributesHolder"
|
|
14
|
+
function AttributesHolder.prototype.____constructor(self)
|
|
15
|
+
end
|
|
16
|
+
return ____exports
|
package/core/types/handle.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { Event } from "../../event";
|
|
3
|
+
import { AttributesHolder } from "../../attributes";
|
|
3
4
|
export type HandleConstructor<H extends jhandle, T extends Handle<H>, Args extends any[]> = new (handle: H, ...args: Args) => T;
|
|
4
5
|
export type HandleDestructor = {
|
|
5
6
|
readonly __handleDestructor: unique symbol;
|
|
@@ -11,7 +12,7 @@ type NoOverride = {
|
|
|
11
12
|
declare const enum HandlePropertyKey {
|
|
12
13
|
STATE = 0
|
|
13
14
|
}
|
|
14
|
-
export declare class Handle<H extends jhandle, DestroyParameters extends any[] = []> implements Destroyable {
|
|
15
|
+
export declare class Handle<H extends jhandle, DestroyParameters extends any[] = []> extends AttributesHolder implements Destroyable {
|
|
15
16
|
readonly handle: H;
|
|
16
17
|
private [HandlePropertyKey.STATE]?;
|
|
17
18
|
private onDestroyEvent?;
|
package/core/types/handle.lua
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
3
4
|
local __TS__New = ____lualib.__TS__New
|
|
4
5
|
local __TS__Delete = ____lualib.__TS__Delete
|
|
5
6
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
@@ -12,13 +13,17 @@ local getClass = ____reflection.getClass
|
|
|
12
13
|
local getSuperclass = ____reflection.getSuperclass
|
|
13
14
|
local ____exception = require("exception")
|
|
14
15
|
local IllegalStateException = ____exception.IllegalStateException
|
|
16
|
+
local ____attributes = require("attributes")
|
|
17
|
+
local AttributesHolder = ____attributes.AttributesHolder
|
|
15
18
|
local getHandleId = GetHandleId
|
|
16
19
|
local onCreateEventByHandleConstructor = {}
|
|
17
20
|
local onDestroyEventByHandleConstructor = {}
|
|
18
21
|
____exports.Handle = __TS__Class()
|
|
19
22
|
local Handle = ____exports.Handle
|
|
20
23
|
Handle.name = "Handle"
|
|
24
|
+
__TS__ClassExtends(Handle, AttributesHolder)
|
|
21
25
|
function Handle.prototype.____constructor(self, handle)
|
|
26
|
+
AttributesHolder.prototype.____constructor(self)
|
|
22
27
|
self[0] = 0
|
|
23
28
|
local id = getHandleId(handle)
|
|
24
29
|
local clazz = self.constructor
|
|
@@ -122,6 +122,12 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
|
|
|
122
122
|
set modelPathSD(modelPathSD: string);
|
|
123
123
|
get modelPathHD(): string;
|
|
124
124
|
set modelPathHD(modelPathHD: string);
|
|
125
|
+
get runSpeed(): number;
|
|
126
|
+
set runSpeed(runSpeed: number);
|
|
127
|
+
get runSpeedSD(): number;
|
|
128
|
+
set runSpeedSD(runSpeedSD: number);
|
|
129
|
+
get runSpeedHD(): number;
|
|
130
|
+
set runSpeedHD(runSpeedHD: number);
|
|
125
131
|
get selectionCircleScale(): number;
|
|
126
132
|
set selectionCircleScale(selectionCircleScale: number);
|
|
127
133
|
get selectionCircleScaleSD(): number;
|
|
@@ -154,6 +160,12 @@ export declare abstract class UnitType<Id extends UnitTypeId = UnitTypeId> exten
|
|
|
154
160
|
set shadowImageXOffset(shadowImageXOffset: number);
|
|
155
161
|
get shadowImageYOffset(): number;
|
|
156
162
|
set shadowImageYOffset(shadowImageYOffset: number);
|
|
163
|
+
get walkSpeed(): number;
|
|
164
|
+
set walkSpeed(walkSpeed: number);
|
|
165
|
+
get walkSpeedSD(): number;
|
|
166
|
+
set walkSpeedSD(walkSpeedSD: number);
|
|
167
|
+
get walkSpeedHD(): number;
|
|
168
|
+
set walkSpeedHD(walkSpeedHD: number);
|
|
157
169
|
get armorSoundType(): ArmorSoundType;
|
|
158
170
|
set armorSoundType(armorSoundType: ArmorSoundType);
|
|
159
171
|
get armorSoundTypeSD(): ArmorSoundType;
|
|
@@ -220,4 +232,8 @@ export declare abstract class HeroUnitType<Id extends HeroUnitTypeId = HeroUnitT
|
|
|
220
232
|
protected static generateId(): number;
|
|
221
233
|
get heroAbilityTypeIds(): AbilityTypeId[];
|
|
222
234
|
set heroAbilityTypeIds(heroAbilityTypeIds: AbilityTypeId[]);
|
|
235
|
+
get properNames(): string[];
|
|
236
|
+
set properNames(properNames: string | string[]);
|
|
237
|
+
get properNamesCount(): number;
|
|
238
|
+
set properNamesCount(properNamesCount: number);
|
|
223
239
|
}
|
|
@@ -3,6 +3,7 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
3
3
|
local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
6
|
+
local __TS__ArrayIsArray = ____lualib.__TS__ArrayIsArray
|
|
6
7
|
local ____exports = {}
|
|
7
8
|
local ____arrays = require("utility.arrays")
|
|
8
9
|
local arrayOfNotNull = ____arrays.arrayOfNotNull
|
|
@@ -727,6 +728,45 @@ __TS__SetDescriptor(
|
|
|
727
728
|
},
|
|
728
729
|
true
|
|
729
730
|
)
|
|
731
|
+
__TS__SetDescriptor(
|
|
732
|
+
UnitType.prototype,
|
|
733
|
+
"runSpeed",
|
|
734
|
+
{
|
|
735
|
+
get = function(self)
|
|
736
|
+
return self:getNumberField("urun")
|
|
737
|
+
end,
|
|
738
|
+
set = function(self, runSpeed)
|
|
739
|
+
self:setNumberField("urun", runSpeed)
|
|
740
|
+
end
|
|
741
|
+
},
|
|
742
|
+
true
|
|
743
|
+
)
|
|
744
|
+
__TS__SetDescriptor(
|
|
745
|
+
UnitType.prototype,
|
|
746
|
+
"runSpeedSD",
|
|
747
|
+
{
|
|
748
|
+
get = function(self)
|
|
749
|
+
return self:getNumberField("urun:sd")
|
|
750
|
+
end,
|
|
751
|
+
set = function(self, runSpeedSD)
|
|
752
|
+
self:setNumberField("urun:sd", runSpeedSD)
|
|
753
|
+
end
|
|
754
|
+
},
|
|
755
|
+
true
|
|
756
|
+
)
|
|
757
|
+
__TS__SetDescriptor(
|
|
758
|
+
UnitType.prototype,
|
|
759
|
+
"runSpeedHD",
|
|
760
|
+
{
|
|
761
|
+
get = function(self)
|
|
762
|
+
return self:getNumberField("urun:hd")
|
|
763
|
+
end,
|
|
764
|
+
set = function(self, runSpeedHD)
|
|
765
|
+
self:setNumberField("urun:hd", runSpeedHD)
|
|
766
|
+
end
|
|
767
|
+
},
|
|
768
|
+
true
|
|
769
|
+
)
|
|
730
770
|
__TS__SetDescriptor(
|
|
731
771
|
UnitType.prototype,
|
|
732
772
|
"selectionCircleScale",
|
|
@@ -935,6 +975,45 @@ __TS__SetDescriptor(
|
|
|
935
975
|
},
|
|
936
976
|
true
|
|
937
977
|
)
|
|
978
|
+
__TS__SetDescriptor(
|
|
979
|
+
UnitType.prototype,
|
|
980
|
+
"walkSpeed",
|
|
981
|
+
{
|
|
982
|
+
get = function(self)
|
|
983
|
+
return self:getNumberField("uwal")
|
|
984
|
+
end,
|
|
985
|
+
set = function(self, walkSpeed)
|
|
986
|
+
self:setNumberField("uwal", walkSpeed)
|
|
987
|
+
end
|
|
988
|
+
},
|
|
989
|
+
true
|
|
990
|
+
)
|
|
991
|
+
__TS__SetDescriptor(
|
|
992
|
+
UnitType.prototype,
|
|
993
|
+
"walkSpeedSD",
|
|
994
|
+
{
|
|
995
|
+
get = function(self)
|
|
996
|
+
return self:getNumberField("uwal:sd")
|
|
997
|
+
end,
|
|
998
|
+
set = function(self, walkSpeedSD)
|
|
999
|
+
self:setNumberField("uwal:sd", walkSpeedSD)
|
|
1000
|
+
end
|
|
1001
|
+
},
|
|
1002
|
+
true
|
|
1003
|
+
)
|
|
1004
|
+
__TS__SetDescriptor(
|
|
1005
|
+
UnitType.prototype,
|
|
1006
|
+
"walkSpeedHD",
|
|
1007
|
+
{
|
|
1008
|
+
get = function(self)
|
|
1009
|
+
return self:getNumberField("uwal:hd")
|
|
1010
|
+
end,
|
|
1011
|
+
set = function(self, walkSpeedHD)
|
|
1012
|
+
self:setNumberField("uwal:hd", walkSpeedHD)
|
|
1013
|
+
end
|
|
1014
|
+
},
|
|
1015
|
+
true
|
|
1016
|
+
)
|
|
938
1017
|
__TS__SetDescriptor(
|
|
939
1018
|
UnitType.prototype,
|
|
940
1019
|
"armorSoundType",
|
|
@@ -1337,6 +1416,37 @@ __TS__SetDescriptor(
|
|
|
1337
1416
|
},
|
|
1338
1417
|
true
|
|
1339
1418
|
)
|
|
1419
|
+
__TS__SetDescriptor(
|
|
1420
|
+
HeroUnitType.prototype,
|
|
1421
|
+
"properNames",
|
|
1422
|
+
{
|
|
1423
|
+
get = function(self)
|
|
1424
|
+
return self:getStringsField("upro")
|
|
1425
|
+
end,
|
|
1426
|
+
set = function(self, properNames)
|
|
1427
|
+
if __TS__ArrayIsArray(properNames) then
|
|
1428
|
+
self:setStringsField("upro", properNames)
|
|
1429
|
+
self:setNumberField("upru", #properNames)
|
|
1430
|
+
else
|
|
1431
|
+
self:setStringField("upro", properNames)
|
|
1432
|
+
end
|
|
1433
|
+
end
|
|
1434
|
+
},
|
|
1435
|
+
true
|
|
1436
|
+
)
|
|
1437
|
+
__TS__SetDescriptor(
|
|
1438
|
+
HeroUnitType.prototype,
|
|
1439
|
+
"properNamesCount",
|
|
1440
|
+
{
|
|
1441
|
+
get = function(self)
|
|
1442
|
+
return self:getNumberField("upru")
|
|
1443
|
+
end,
|
|
1444
|
+
set = function(self, properNamesCount)
|
|
1445
|
+
self:setNumberField("upru", properNamesCount)
|
|
1446
|
+
end
|
|
1447
|
+
},
|
|
1448
|
+
true
|
|
1449
|
+
)
|
|
1340
1450
|
implementReadonlyNumberIndexSupplier(
|
|
1341
1451
|
____exports.HeroUnitType,
|
|
1342
1452
|
function(id)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "warscript",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.8a4aeae",
|
|
5
5
|
"description": "A typescript library for Warcraft III using Warpack.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"warcraft",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@warscript/language-extensions": "^0.0.1",
|
|
25
|
-
"@warscript/tstl-plugin": "^0.0.
|
|
25
|
+
"@warscript/tstl-plugin": "^0.0.2",
|
|
26
26
|
"typescript-to-lua": "^1.24.1",
|
|
27
27
|
"lua-types": "^2.13.1",
|
|
28
28
|
"warpack": "0.0.1-dev.5bdabe5"
|