warscript 0.0.1-dev.1d1ce87 → 0.0.1-dev.1d4a073

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 (54) hide show
  1. package/attributes.d.ts +1 -0
  2. package/attributes.lua +9 -0
  3. package/core/types/player.d.ts +16 -0
  4. package/core/types/player.lua +57 -14
  5. package/core/types/tileCell.d.ts +2 -1
  6. package/core/types/tileCell.lua +5 -0
  7. package/destroyable.d.ts +1 -0
  8. package/destroyable.lua +9 -0
  9. package/engine/behavior.d.ts +10 -2
  10. package/engine/behavior.lua +157 -76
  11. package/engine/behaviour/ability/apply-buff.lua +4 -4
  12. package/engine/behaviour/ability/remove-buffs.d.ts +9 -0
  13. package/engine/behaviour/ability/remove-buffs.lua +21 -0
  14. package/engine/behaviour/ability.d.ts +2 -1
  15. package/engine/behaviour/ability.lua +2 -1
  16. package/engine/behaviour/unit/stun-immunity.d.ts +6 -4
  17. package/engine/behaviour/unit/stun-immunity.lua +1 -1
  18. package/engine/behaviour/unit.d.ts +7 -3
  19. package/engine/behaviour/unit.lua +89 -22
  20. package/engine/buff.d.ts +12 -2
  21. package/engine/buff.lua +80 -17
  22. package/engine/internal/unit/ability.lua +3 -3
  23. package/engine/internal/unit/fly-height.d.ts +7 -0
  24. package/engine/internal/unit/fly-height.lua +20 -0
  25. package/engine/internal/unit/main-selected.lua +12 -27
  26. package/engine/internal/unit/scale.d.ts +7 -0
  27. package/engine/internal/unit/scale.lua +20 -0
  28. package/engine/internal/unit-missile-launch.lua +41 -23
  29. package/engine/internal/unit.d.ts +13 -10
  30. package/engine/internal/unit.lua +83 -64
  31. package/engine/local-client.d.ts +2 -0
  32. package/engine/local-client.lua +30 -0
  33. package/engine/object-data/entry/destructible-type.d.ts +17 -1
  34. package/engine/object-data/entry/destructible-type.lua +90 -0
  35. package/engine/object-data/entry/unit-type.d.ts +4 -0
  36. package/engine/object-data/entry/unit-type.lua +76 -32
  37. package/engine/object-field/unit.d.ts +13 -1
  38. package/engine/object-field/unit.lua +57 -0
  39. package/engine/object-field.d.ts +7 -1
  40. package/engine/object-field.lua +232 -111
  41. package/engine/standard/fields/ability.d.ts +2 -2
  42. package/engine/standard/fields/ability.lua +2 -2
  43. package/engine/standard/fields/unit.d.ts +3 -1
  44. package/engine/standard/fields/unit.lua +4 -0
  45. package/engine/synchronization.d.ts +11 -0
  46. package/engine/synchronization.lua +77 -0
  47. package/engine/text-tag.lua +2 -1
  48. package/engine/unit.d.ts +2 -0
  49. package/engine/unit.lua +2 -0
  50. package/net/socket.lua +1 -1
  51. package/package.json +2 -2
  52. package/utility/callback-array.lua +1 -1
  53. package/utility/linked-set.d.ts +1 -0
  54. package/utility/linked-set.lua +19 -1
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.1d1ce87",
4
+ "version": "0.0.1-dev.1d4a073",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",
@@ -24,7 +24,7 @@
24
24
  "@warscript/language-extensions": "^0.0.1",
25
25
  "@warscript/tstl-plugin": "^0.0.4",
26
26
  "lua-types": "^2.13.1",
27
- "warpack": "0.0.1-dev.251db08"
27
+ "warpack": "0.0.1-dev.efd0770"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@typescript-eslint/eslint-plugin": "^8.13.0",
@@ -42,6 +42,7 @@ function ____exports.clearCallbacks(array)
42
42
  end
43
43
  function ____exports.consumeCallback(array, id)
44
44
  local callback = array[id]
45
+ array[id] = doNothing
45
46
  id = id + 1
46
47
  local argsCount = array[id]
47
48
  id = id + 1
@@ -49,7 +50,6 @@ function ____exports.consumeCallback(array, id)
49
50
  callback,
50
51
  tableUnpack(array, id, id + argsCount - 1)
51
52
  )
52
- array[id] = doNothing
53
53
  end
54
54
  function ____exports.consumeCallbacks(array)
55
55
  local length = array[1] or 2
@@ -36,6 +36,7 @@ export declare class LinkedSet<T extends AnyNotNil> implements ReadonlyLinkedSet
36
36
  copyOf(): LinkedSet<T>;
37
37
  first(): T | undefined;
38
38
  last(): T | undefined;
39
+ pop(): T | undefined;
39
40
  next(key: T): T | undefined;
40
41
  previous(key: T): T | undefined;
41
42
  add(key: T): boolean;
@@ -42,6 +42,23 @@ end
42
42
  function LinkedSet.prototype.last(self)
43
43
  return self.l
44
44
  end
45
+ function LinkedSet.prototype.pop(self)
46
+ local f = self.f
47
+ if f == nil then
48
+ return nil
49
+ end
50
+ local n = self.n
51
+ local next = n[f]
52
+ n[f] = nil
53
+ self.f = next
54
+ if next ~= nil then
55
+ self.p[next] = nil
56
+ else
57
+ self.l = nil
58
+ end
59
+ self.s = self.s - 1
60
+ return f
61
+ end
45
62
  function LinkedSet.prototype.next(self, key)
46
63
  return self.n[key]
47
64
  end
@@ -107,8 +124,9 @@ function LinkedSet.prototype.forEach(self, action, ...)
107
124
  local n = self.n
108
125
  local c = self.f
109
126
  while c ~= nil do
127
+ local next = n[c]
110
128
  action(c, ...)
111
- c = n[c]
129
+ c = next
112
130
  end
113
131
  end
114
132
  function LinkedSet.prototype.toArray(self)