warscript 0.0.1-dev.dd8349d → 0.0.1-dev.e147c49

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.
Files changed (313) hide show
  1. package/attributes.d.ts +1 -0
  2. package/attributes.lua +9 -0
  3. package/core/types/frame.d.ts +1 -0
  4. package/core/types/frame.lua +136 -58
  5. package/core/types/handle.lua +9 -9
  6. package/core/types/item.d.ts +1 -0
  7. package/core/types/item.lua +1 -0
  8. package/core/types/player.d.ts +18 -1
  9. package/core/types/player.lua +76 -26
  10. package/core/types/playerCamera.d.ts +2 -0
  11. package/core/types/playerCamera.lua +123 -5
  12. package/core/types/playerColor.lua +4 -3
  13. package/core/types/sound.d.ts +1 -1
  14. package/core/types/sound.lua +14 -9
  15. package/core/types/tileCell.d.ts +11 -1
  16. package/core/types/tileCell.lua +97 -0
  17. package/core/types/timer.d.ts +3 -1
  18. package/core/types/timer.lua +27 -2
  19. package/core/types/unit.d.ts +4 -0
  20. package/core/types/unit.lua +4 -0
  21. package/decl/native.d.ts +711 -11
  22. package/destroyable.d.ts +1 -0
  23. package/destroyable.lua +9 -0
  24. package/engine/behavior.d.ts +14 -1
  25. package/engine/behavior.lua +230 -70
  26. package/engine/behaviour/ability/apply-buff.lua +5 -5
  27. package/engine/behaviour/ability/damage.d.ts +3 -0
  28. package/engine/behaviour/ability/damage.lua +18 -15
  29. package/engine/behaviour/ability/emulate-impact.d.ts +1 -1
  30. package/engine/behaviour/ability/emulate-impact.lua +16 -7
  31. package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
  32. package/engine/behaviour/ability/remove-buffs.lua +21 -0
  33. package/engine/behaviour/ability/restore-mana.d.ts +1 -1
  34. package/engine/behaviour/ability/restore-mana.lua +6 -6
  35. package/engine/behaviour/ability.d.ts +12 -6
  36. package/engine/behaviour/ability.lua +49 -17
  37. package/engine/behaviour/unit/stun-immunity.d.ts +12 -6
  38. package/engine/behaviour/unit/stun-immunity.lua +57 -31
  39. package/engine/behaviour/unit.d.ts +28 -5
  40. package/engine/behaviour/unit.lua +186 -27
  41. package/engine/buff.d.ts +75 -28
  42. package/engine/buff.lua +433 -196
  43. package/engine/index.d.ts +2 -1
  44. package/engine/internal/ability.d.ts +9 -1
  45. package/engine/internal/ability.lua +96 -44
  46. package/engine/internal/item/ability.lua +51 -1
  47. package/engine/internal/item/fields.d.ts +12 -0
  48. package/engine/internal/item/fields.lua +33 -0
  49. package/engine/internal/item+owner.d.ts +1 -0
  50. package/engine/internal/item+owner.lua +19 -6
  51. package/engine/internal/item.d.ts +24 -14
  52. package/engine/internal/item.lua +176 -85
  53. package/engine/internal/mechanics/cast-ability.lua +6 -3
  54. package/engine/internal/misc/frame-coordinates.lua +21 -0
  55. package/engine/internal/misc/get-terrain-z.d.ts +2 -0
  56. package/engine/internal/misc/get-terrain-z.lua +11 -0
  57. package/engine/internal/misc/player-local-handle.d.ts +2 -0
  58. package/engine/internal/misc/player-local-handle.lua +5 -0
  59. package/engine/internal/object-data/armor-bonus.d.ts +2 -0
  60. package/engine/internal/object-data/attribute-bonus.lua +2 -2
  61. package/engine/internal/object-data/health-bonus.d.ts +2 -0
  62. package/engine/internal/object-data/health-bonus.lua +16 -0
  63. package/engine/internal/object-data/mana-bonus.d.ts +2 -0
  64. package/engine/internal/object-data/mana-bonus.lua +16 -0
  65. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.d.ts +2 -0
  66. package/engine/internal/object-data/mana-regeneration-rate-increase-factor.lua +16 -0
  67. package/engine/internal/unit/ability.d.ts +35 -0
  68. package/engine/internal/unit/ability.lua +113 -12
  69. package/engine/internal/unit/appearance.d.ts +15 -0
  70. package/engine/internal/unit/appearance.lua +85 -0
  71. package/engine/internal/unit/attributes.d.ts +17 -0
  72. package/engine/internal/unit/attributes.lua +46 -0
  73. package/engine/internal/unit/bag.d.ts +18 -0
  74. package/engine/internal/unit/bag.lua +63 -0
  75. package/engine/internal/unit/bonus.d.ts +6 -0
  76. package/engine/internal/unit/bonus.lua +33 -3
  77. package/engine/internal/unit/buff.d.ts +2 -2
  78. package/engine/internal/unit/buff.lua +34 -19
  79. package/engine/internal/unit/equipment.d.ts +36 -0
  80. package/engine/internal/unit/equipment.lua +169 -0
  81. package/engine/internal/unit/fly-height.d.ts +7 -0
  82. package/engine/internal/unit/fly-height.lua +20 -0
  83. package/engine/internal/unit/interrupts.d.ts +12 -0
  84. package/engine/internal/unit/interrupts.lua +28 -0
  85. package/engine/internal/unit/{item.d.ts → inventory.d.ts} +3 -3
  86. package/engine/internal/unit/{item.lua → inventory.lua} +25 -26
  87. package/engine/internal/unit/main-selected.lua +12 -27
  88. package/engine/internal/unit/order.d.ts +20 -0
  89. package/engine/internal/unit/order.lua +136 -0
  90. package/engine/internal/unit/pseudo-passive-abilities.d.ts +2 -0
  91. package/engine/internal/unit/pseudo-passive-abilities.lua +11 -0
  92. package/engine/internal/unit/range-event.d.ts +12 -0
  93. package/engine/internal/unit/range-event.lua +90 -0
  94. package/engine/internal/unit/scale.d.ts +7 -0
  95. package/engine/internal/unit/scale.lua +20 -0
  96. package/engine/internal/unit+ability.lua +10 -1
  97. package/engine/internal/unit+bonus.lua +3 -3
  98. package/engine/internal/unit+damage.d.ts +9 -0
  99. package/engine/internal/unit+damage.lua +33 -0
  100. package/engine/internal/unit-missile-data.lua +58 -32
  101. package/engine/internal/unit-missile-launch.lua +52 -14
  102. package/engine/internal/unit.d.ts +19 -24
  103. package/engine/internal/unit.lua +233 -246
  104. package/engine/local-client.d.ts +27 -0
  105. package/engine/local-client.lua +518 -54
  106. package/engine/object-data/auxiliary/armor-type.d.ts +11 -0
  107. package/engine/object-data/auxiliary/armor-type.lua +46 -0
  108. package/engine/object-data/auxiliary/equipment-slot.d.ts +12 -0
  109. package/engine/object-data/auxiliary/equipment-slot.lua +2 -0
  110. package/engine/object-data/auxiliary/equipment-type.d.ts +13 -0
  111. package/engine/object-data/auxiliary/equipment-type.lua +2 -0
  112. package/engine/object-data/auxiliary/health-regeneration-type.d.ts +8 -0
  113. package/engine/object-data/auxiliary/health-regeneration-type.lua +2 -0
  114. package/engine/object-data/auxiliary/item-tag.d.ts +12 -0
  115. package/engine/object-data/auxiliary/item-tag.lua +2 -0
  116. package/engine/object-data/auxiliary/sound-set-name.d.ts +14 -3
  117. package/engine/object-data/auxiliary/unit-attribute.lua +1 -1
  118. package/engine/object-data/entry/ability-type/apprehend.d.ts +22 -0
  119. package/engine/object-data/entry/ability-type/apprehend.lua +66 -0
  120. package/engine/object-data/entry/ability-type/armor-bonus.d.ts +8 -0
  121. package/engine/object-data/entry/ability-type/{armor-increase.lua → armor-bonus.lua} +9 -9
  122. package/engine/object-data/entry/ability-type/banshee.d.ts +8 -0
  123. package/engine/object-data/entry/ability-type/banshee.lua +13 -0
  124. package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.d.ts +12 -0
  125. package/engine/object-data/entry/ability-type/banshees-wail-damage-amp.lua +27 -0
  126. package/engine/object-data/entry/ability-type/banshees-wail.d.ts +31 -0
  127. package/engine/object-data/entry/ability-type/banshees-wail.lua +117 -0
  128. package/engine/object-data/entry/ability-type/battering-ram.d.ts +33 -0
  129. package/engine/object-data/entry/ability-type/battering-ram.lua +130 -0
  130. package/engine/object-data/entry/ability-type/blank-configurable.d.ts +3 -0
  131. package/engine/object-data/entry/ability-type/blank-configurable.lua +30 -0
  132. package/engine/object-data/entry/ability-type/cleansing-fire.d.ts +27 -0
  133. package/engine/object-data/entry/ability-type/cleansing-fire.lua +104 -0
  134. package/engine/object-data/entry/ability-type/consecration.d.ts +15 -0
  135. package/engine/object-data/entry/ability-type/consecration.lua +52 -0
  136. package/engine/object-data/entry/ability-type/cooldown-reduction.d.ts +12 -0
  137. package/engine/object-data/entry/ability-type/cooldown-reduction.lua +39 -0
  138. package/engine/object-data/entry/ability-type/critical-strike-system.d.ts +18 -0
  139. package/engine/object-data/entry/ability-type/critical-strike-system.lua +65 -0
  140. package/engine/object-data/entry/ability-type/deathseeker-arrows.d.ts +21 -0
  141. package/engine/object-data/entry/ability-type/deathseeker-arrows.lua +78 -0
  142. package/engine/object-data/entry/ability-type/equipment-inventory-interface.d.ts +8 -0
  143. package/engine/object-data/entry/ability-type/equipment-inventory-interface.lua +13 -0
  144. package/engine/object-data/entry/ability-type/equipment-inventory.d.ts +13 -0
  145. package/engine/object-data/entry/ability-type/equipment-inventory.lua +27 -0
  146. package/engine/object-data/entry/ability-type/equipment.d.ts +13 -0
  147. package/engine/object-data/entry/ability-type/equipment.lua +27 -0
  148. package/engine/object-data/entry/ability-type/grant-talent-point.d.ts +8 -0
  149. package/engine/object-data/entry/ability-type/grant-talent-point.lua +13 -0
  150. package/engine/object-data/entry/ability-type/grim-conviction.d.ts +36 -0
  151. package/engine/object-data/entry/ability-type/grim-conviction.lua +131 -0
  152. package/engine/object-data/entry/ability-type/grit.d.ts +18 -0
  153. package/engine/object-data/entry/ability-type/grit.lua +65 -0
  154. package/engine/object-data/entry/ability-type/guiding-hand.d.ts +27 -0
  155. package/engine/object-data/entry/ability-type/guiding-hand.lua +104 -0
  156. package/engine/object-data/entry/ability-type/headsplitter.d.ts +27 -0
  157. package/engine/object-data/entry/ability-type/headsplitter.lua +104 -0
  158. package/engine/object-data/entry/ability-type/{armor-increase.d.ts → healing-modifier.d.ts} +4 -3
  159. package/engine/object-data/entry/ability-type/healing-modifier.lua +26 -0
  160. package/engine/object-data/entry/ability-type/health-bonus.d.ts +8 -0
  161. package/engine/object-data/entry/ability-type/health-bonus.lua +26 -0
  162. package/engine/object-data/entry/ability-type/heroic-slash.d.ts +18 -0
  163. package/engine/object-data/entry/ability-type/heroic-slash.lua +65 -0
  164. package/engine/object-data/entry/ability-type/holy-wrath.d.ts +30 -0
  165. package/engine/object-data/entry/ability-type/holy-wrath.lua +117 -0
  166. package/engine/object-data/entry/ability-type/inspire-courage.d.ts +18 -0
  167. package/engine/object-data/entry/ability-type/inspire-courage.lua +65 -0
  168. package/engine/object-data/entry/ability-type/lights-mercy.d.ts +27 -0
  169. package/engine/object-data/entry/ability-type/lights-mercy.lua +104 -0
  170. package/engine/object-data/entry/ability-type/mana-bonus.d.ts +8 -0
  171. package/engine/object-data/entry/ability-type/mana-bonus.lua +26 -0
  172. package/engine/object-data/entry/ability-type/mana-efficiency.d.ts +12 -0
  173. package/engine/object-data/entry/ability-type/mana-efficiency.lua +39 -0
  174. package/engine/object-data/entry/ability-type/mana-regeneration.d.ts +8 -0
  175. package/engine/object-data/entry/ability-type/mana-regeneration.lua +26 -0
  176. package/engine/object-data/entry/ability-type/mind-control.d.ts +21 -0
  177. package/engine/object-data/entry/ability-type/mind-control.lua +78 -0
  178. package/engine/object-data/entry/ability-type/on-attack-cast-spell.d.ts +21 -0
  179. package/engine/object-data/entry/ability-type/on-attack-cast-spell.lua +52 -0
  180. package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.d.ts +19 -0
  181. package/engine/object-data/entry/ability-type/on-basic-attack-cast-spell.lua +65 -0
  182. package/engine/object-data/entry/ability-type/on-hit-cast-spell.d.ts +15 -0
  183. package/engine/object-data/entry/ability-type/on-hit-cast-spell.lua +26 -0
  184. package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.d.ts +6 -0
  185. package/engine/object-data/entry/ability-type/on-magic-attack-cast-spell.lua +12 -0
  186. package/engine/object-data/entry/ability-type/provoke.d.ts +21 -0
  187. package/engine/object-data/entry/ability-type/provoke.lua +66 -0
  188. package/engine/object-data/entry/ability-type/raise-the-banner.d.ts +9 -0
  189. package/engine/object-data/entry/ability-type/raise-the-banner.lua +26 -0
  190. package/engine/object-data/entry/ability-type/reincarnation.d.ts +8 -0
  191. package/engine/object-data/entry/ability-type/reincarnation.lua +26 -0
  192. package/engine/object-data/entry/ability-type/resolve.d.ts +12 -0
  193. package/engine/object-data/entry/ability-type/resolve.lua +39 -0
  194. package/engine/object-data/entry/ability-type/righteous-fury.d.ts +33 -0
  195. package/engine/object-data/entry/ability-type/righteous-fury.lua +130 -0
  196. package/engine/object-data/entry/ability-type/sacred-aura.d.ts +27 -0
  197. package/engine/object-data/entry/ability-type/sacred-aura.lua +104 -0
  198. package/engine/object-data/entry/ability-type/soul-lantern.d.ts +30 -0
  199. package/engine/object-data/entry/ability-type/soul-lantern.lua +117 -0
  200. package/engine/object-data/entry/ability-type/spell-amp.d.ts +15 -0
  201. package/engine/object-data/entry/ability-type/spell-amp.lua +52 -0
  202. package/engine/object-data/entry/ability-type/spell-critical-strike.d.ts +12 -0
  203. package/engine/object-data/entry/ability-type/spell-critical-strike.lua +39 -0
  204. package/engine/object-data/entry/ability-type/spell-vamp.d.ts +12 -0
  205. package/engine/object-data/entry/ability-type/spell-vamp.lua +39 -0
  206. package/engine/object-data/entry/ability-type/stackable-evasion.d.ts +9 -0
  207. package/engine/object-data/entry/ability-type/stackable-evasion.lua +13 -0
  208. package/engine/object-data/entry/ability-type/stackable-hardened-skin.d.ts +21 -0
  209. package/engine/object-data/entry/ability-type/stackable-hardened-skin.lua +78 -0
  210. package/engine/object-data/entry/ability-type/stackable-life-steal.d.ts +9 -0
  211. package/engine/object-data/entry/ability-type/stackable-life-steal.lua +26 -0
  212. package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.d.ts +9 -0
  213. package/engine/object-data/entry/ability-type/stackable-spell-damage-reduction.lua +13 -0
  214. package/engine/object-data/entry/ability-type/stackable-thorn-shield.d.ts +9 -0
  215. package/engine/object-data/entry/ability-type/stackable-thorn-shield.lua +13 -0
  216. package/engine/object-data/entry/ability-type/stat-details.d.ts +12 -0
  217. package/engine/object-data/entry/ability-type/stat-details.lua +27 -0
  218. package/engine/object-data/entry/ability-type/surge-of-light.d.ts +33 -0
  219. package/engine/object-data/entry/ability-type/surge-of-light.lua +130 -0
  220. package/engine/object-data/entry/ability-type/sweeping-strike.d.ts +57 -0
  221. package/engine/object-data/entry/ability-type/sweeping-strike.lua +234 -0
  222. package/engine/object-data/entry/ability-type/talents.d.ts +12 -0
  223. package/engine/object-data/entry/ability-type/talents.lua +27 -0
  224. package/engine/object-data/entry/ability-type/unyielding-guard.d.ts +30 -0
  225. package/engine/object-data/entry/ability-type/unyielding-guard.lua +117 -0
  226. package/engine/object-data/entry/ability-type/valiant-charge.d.ts +27 -0
  227. package/engine/object-data/entry/ability-type/valiant-charge.lua +104 -0
  228. package/engine/object-data/entry/ability-type/warcry.d.ts +9 -0
  229. package/engine/object-data/entry/ability-type/warcry.lua +26 -0
  230. package/engine/object-data/entry/ability-type/withering-fire.d.ts +21 -0
  231. package/engine/object-data/entry/ability-type/withering-fire.lua +78 -0
  232. package/engine/object-data/entry/ability-type.d.ts +12 -3
  233. package/engine/object-data/entry/ability-type.lua +142 -8
  234. package/engine/object-data/entry/buff-type/applicable.lua +113 -109
  235. package/engine/object-data/entry/buff-type.d.ts +6 -2
  236. package/engine/object-data/entry/buff-type.lua +26 -0
  237. package/engine/object-data/entry/destructible-type.d.ts +32 -2
  238. package/engine/object-data/entry/destructible-type.lua +181 -0
  239. package/engine/object-data/entry/item-type.d.ts +12 -3
  240. package/engine/object-data/entry/item-type.lua +52 -0
  241. package/engine/object-data/entry/lightning-type.d.ts +2 -2
  242. package/engine/object-data/entry/sound-preset.d.ts +2 -2
  243. package/engine/object-data/entry/unit-type.d.ts +62 -4
  244. package/engine/object-data/entry/unit-type.lua +474 -38
  245. package/engine/object-data/entry/upgrade.d.ts +2 -2
  246. package/engine/object-data/entry.d.ts +4 -1
  247. package/engine/object-field/ability.d.ts +3 -3
  248. package/engine/object-field/ability.lua +9 -8
  249. package/engine/object-field/item.d.ts +22 -0
  250. package/engine/object-field/item.lua +118 -0
  251. package/engine/object-field/unit.d.ts +31 -5
  252. package/engine/object-field/unit.lua +95 -0
  253. package/engine/object-field.d.ts +18 -7
  254. package/engine/object-field.lua +294 -135
  255. package/engine/random.d.ts +10 -0
  256. package/engine/random.lua +21 -0
  257. package/engine/standard/entries/ability-type.d.ts +3102 -7
  258. package/engine/standard/entries/ability-type.lua +0 -6
  259. package/engine/standard/entries/item-type.d.ts +1299 -0
  260. package/engine/standard/entries/item-type.lua +2 -0
  261. package/engine/standard/entries/unit-type.d.ts +5 -0
  262. package/engine/standard/entries/unit-type.lua +5 -0
  263. package/engine/standard/fields/ability.d.ts +2 -2
  264. package/engine/standard/fields/ability.lua +2 -2
  265. package/engine/standard/fields/item.d.ts +4 -0
  266. package/engine/standard/fields/item.lua +6 -0
  267. package/engine/standard/fields/unit.d.ts +12 -0
  268. package/engine/standard/fields/unit.lua +20 -0
  269. package/engine/synchronization.d.ts +11 -0
  270. package/engine/synchronization.lua +77 -0
  271. package/engine/text-tag.d.ts +36 -2
  272. package/engine/text-tag.lua +250 -10
  273. package/engine/unit.d.ts +10 -1
  274. package/engine/unit.lua +10 -1
  275. package/event.d.ts +1 -1
  276. package/lualib_bundle.lua +1 -1
  277. package/math.d.ts +2 -0
  278. package/math.lua +14 -0
  279. package/net/socket.lua +1 -1
  280. package/network.lua +25 -1
  281. package/objutil/buff.lua +10 -8
  282. package/objutil/object.lua +1 -1
  283. package/operation.d.ts +8 -1
  284. package/operation.lua +38 -18
  285. package/package.json +3 -23
  286. package/patch-lua.lua +15 -0
  287. package/patch-lualib.lua +1 -1
  288. package/utility/arrays.d.ts +1 -0
  289. package/utility/arrays.lua +8 -0
  290. package/utility/callback-array.d.ts +17 -0
  291. package/utility/callback-array.lua +61 -0
  292. package/utility/functions.d.ts +7 -0
  293. package/utility/functions.lua +12 -0
  294. package/utility/linked-map.d.ts +35 -0
  295. package/utility/linked-map.lua +107 -0
  296. package/utility/linked-set.d.ts +4 -1
  297. package/utility/linked-set.lua +46 -1
  298. package/utility/lua-maps.d.ts +12 -2
  299. package/utility/lua-maps.lua +37 -2
  300. package/utility/lua-sets.d.ts +1 -0
  301. package/utility/lua-sets.lua +4 -0
  302. package/utility/random.d.ts +102 -0
  303. package/utility/random.lua +273 -0
  304. package/utility/records.lua +20 -1
  305. package/utility/types.d.ts +3 -0
  306. package/utility/unordered-map.d.ts +27 -0
  307. package/utility/unordered-map.lua +99 -0
  308. package/core/types/order.d.ts +0 -26
  309. package/core/types/order.lua +0 -65
  310. /package/engine/internal/{object-data/armor-increase.d.ts → misc/frame-coordinates.d.ts} +0 -0
  311. /package/engine/internal/object-data/{armor-increase.lua → armor-bonus.lua} +0 -0
  312. /package/engine/object-data/entry/ability-type/{attribute-increase.d.ts → attribute-bonus.d.ts} +0 -0
  313. /package/engine/object-data/entry/ability-type/{attribute-increase.lua → attribute-bonus.lua} +0 -0
@@ -0,0 +1,99 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
4
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
5
+ local __TS__New = ____lualib.__TS__New
6
+ local ____exports = {}
7
+ local ____exception = require("exception")
8
+ local UnsupportedOperationException = ____exception.UnsupportedOperationException
9
+ ____exports.UnorderedMap = __TS__Class()
10
+ local UnorderedMap = ____exports.UnorderedMap
11
+ UnorderedMap.name = "UnorderedMap"
12
+ function UnorderedMap.prototype.____constructor(self)
13
+ self.v = {}
14
+ self.s = 0
15
+ end
16
+ function UnorderedMap.prototype.get(self, key)
17
+ return self.v[key]
18
+ end
19
+ function UnorderedMap.prototype.getOrPut(self, key, defaultValue)
20
+ local value = self.v[key]
21
+ if value ~= nil then
22
+ return value
23
+ end
24
+ value = defaultValue()
25
+ if value ~= nil then
26
+ self.v[key] = value
27
+ self.s = self.s + 1
28
+ end
29
+ return value
30
+ end
31
+ function UnorderedMap.prototype.put(self, key, value)
32
+ local has = self.v[key] ~= nil
33
+ self.v[key] = value
34
+ if value ~= nil and not has then
35
+ self.s = self.s + 1
36
+ elseif value == nil and has then
37
+ self.s = self.s - 1
38
+ end
39
+ end
40
+ function UnorderedMap.prototype.remove(self, key)
41
+ if self.v[key] ~= nil then
42
+ self.v[key] = nil
43
+ self.s = self.s - 1
44
+ return true
45
+ end
46
+ return false
47
+ end
48
+ function UnorderedMap.prototype.contains(self, key)
49
+ return self.v[key] ~= nil
50
+ end
51
+ function UnorderedMap.prototype.__len(self)
52
+ return self.s
53
+ end
54
+ function UnorderedMap.prototype.__pairs(self)
55
+ return pairs(self.v)
56
+ end
57
+ __TS__SetDescriptor(
58
+ UnorderedMap.prototype,
59
+ "size",
60
+ {get = function(self)
61
+ return self.s
62
+ end},
63
+ true
64
+ )
65
+ local EmptyUnorderedMap = __TS__Class()
66
+ EmptyUnorderedMap.name = "EmptyUnorderedMap"
67
+ __TS__ClassExtends(EmptyUnorderedMap, ____exports.UnorderedMap)
68
+ function EmptyUnorderedMap.prototype.getOrPut(self)
69
+ error(
70
+ __TS__New(UnsupportedOperationException),
71
+ 0
72
+ )
73
+ end
74
+ function EmptyUnorderedMap.prototype.put(self)
75
+ error(
76
+ __TS__New(UnsupportedOperationException),
77
+ 0
78
+ )
79
+ end
80
+ function EmptyUnorderedMap.prototype.remove(self)
81
+ error(
82
+ __TS__New(UnsupportedOperationException),
83
+ 0
84
+ )
85
+ end
86
+ function EmptyUnorderedMap.prototype.__len(self)
87
+ return 0
88
+ end
89
+ function EmptyUnorderedMap.prototype.__pairs(self)
90
+ return pairs(self.v)
91
+ end
92
+ local EMPTY_UNORDERED_MAP = __TS__New(EmptyUnorderedMap)
93
+ ____exports.emptyUnorderedMap = function()
94
+ return EMPTY_UNORDERED_MAP
95
+ end
96
+ ____exports.mutableUnorderedMap = function()
97
+ return __TS__New(____exports.UnorderedMap)
98
+ end
99
+ return ____exports
@@ -1,26 +0,0 @@
1
- /** @noSelfInFile */
2
- import { Unit } from "./unit";
3
- import { Item } from "./item";
4
- import { Destructable } from "./destructable";
5
- export type Order = {
6
- id: number;
7
- startX: number;
8
- startY: number;
9
- issueTime: number;
10
- } & ({
11
- type: "immediate";
12
- } | {
13
- type: "point";
14
- targetX: number;
15
- targetY: number;
16
- } | {
17
- type: "target";
18
- target: Unit | Item | Destructable;
19
- });
20
- declare module "../../engine/internal/unit" {
21
- interface Unit {
22
- readonly currentOrder: Order;
23
- readonly lastOrder: Order;
24
- issueOrder(order: Order): void;
25
- }
26
- }
@@ -1,65 +0,0 @@
1
- local ____lualib = require("lualib_bundle")
2
- local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
3
- local ____exports = {}
4
- local ____unit = require("core.types.unit")
5
- local Unit = ____unit.Unit
6
- local ____game = require("core.game")
7
- local elapsedTime = ____game.elapsedTime
8
- local getUnitCurrentOrder = GetUnitCurrentOrder
9
- local orders = setmetatable({}, {__mode = "k"})
10
- Unit.onImmediateOrder:addListener(function(unit, orderId)
11
- orders[unit] = {
12
- id = orderId,
13
- startX = unit.x,
14
- startY = unit.y,
15
- issueTime = elapsedTime(),
16
- type = "immediate"
17
- }
18
- end)
19
- Unit.onPointOrder:addListener(function(unit, orderId, x, y)
20
- orders[unit] = {
21
- id = orderId,
22
- startX = unit.x,
23
- startY = unit.y,
24
- issueTime = elapsedTime(),
25
- type = "point",
26
- targetX = x,
27
- targetY = y
28
- }
29
- end)
30
- Unit.onTargetOrder:addListener(function(unit, orderId, target)
31
- orders[unit] = {
32
- id = orderId,
33
- startX = unit.x,
34
- startY = unit.y,
35
- issueTime = elapsedTime(),
36
- type = "target",
37
- target = target
38
- }
39
- end)
40
- __TS__ObjectDefineProperty(
41
- Unit.prototype,
42
- "currentOrder",
43
- {get = function(self)
44
- local currentOrderId = getUnitCurrentOrder(self.handle)
45
- local lastOrder = orders[self]
46
- return lastOrder and (lastOrder.id == currentOrderId or currentOrderId == orderId("patrolAI") and lastOrder.id == orderId("patrol")) and lastOrder or ({id = 0, type = "immediate"})
47
- end}
48
- )
49
- __TS__ObjectDefineProperty(
50
- Unit.prototype,
51
- "lastOrder",
52
- {get = function(self)
53
- return orders[self] or ({id = 0, type = "immediate"})
54
- end}
55
- )
56
- Unit.prototype.issueOrder = function(self, order)
57
- if order.type == "immediate" then
58
- IssueImmediateOrderById(self.handle, order.id)
59
- elseif order.type == "point" then
60
- IssuePointOrderById(self.handle, order.id, order.targetX, order.targetY)
61
- else
62
- IssueTargetOrderById(self.handle, order.id, order.target.handle)
63
- end
64
- end
65
- return ____exports