sc2ai 0.0.5 → 0.0.7

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/data/stableid.json +424 -2562
  3. data/data/versions.json +8 -0
  4. data/lib/docker_build/Dockerfile.ruby +1 -1
  5. data/lib/sc2ai/api/ability_id.rb +12 -314
  6. data/lib/sc2ai/api/buff_id.rb +9 -16
  7. data/lib/sc2ai/api/data.rb +1 -4
  8. data/lib/sc2ai/api/tech_tree.rb +35 -0
  9. data/lib/sc2ai/api/tech_tree_data.rb +14 -9
  10. data/lib/sc2ai/api/unit_type_id.rb +6 -58
  11. data/lib/sc2ai/api/upgrade_id.rb +9 -9
  12. data/lib/sc2ai/connection/requests.rb +34 -16
  13. data/lib/sc2ai/data.rb +101 -0
  14. data/lib/sc2ai/local_play/match.rb +1 -3
  15. data/lib/sc2ai/player/actions.rb +8 -4
  16. data/lib/sc2ai/player/debug.rb +2 -3
  17. data/lib/sc2ai/player/game_state.rb +36 -5
  18. data/lib/sc2ai/player/geometry.rb +138 -55
  19. data/lib/sc2ai/player/previous_state.rb +2 -1
  20. data/lib/sc2ai/player/units.rb +66 -3
  21. data/lib/sc2ai/player.rb +5 -3
  22. data/lib/sc2ai/protocol/_meta_documentation.rb +18 -0
  23. data/lib/sc2ai/protocol/extensions/ability_remapable.rb +22 -0
  24. data/lib/sc2ai/protocol/extensions/point.rb +3 -1
  25. data/lib/sc2ai/protocol/extensions/point_2_d.rb +1 -1
  26. data/lib/sc2ai/protocol/extensions/point_distance.rb +11 -0
  27. data/lib/sc2ai/protocol/extensions/position.rb +48 -13
  28. data/lib/sc2ai/protocol/extensions/unit.rb +54 -3
  29. data/lib/sc2ai/protocol/extensions/unit_type.rb +9 -0
  30. data/lib/sc2ai/unit_group/action_ext.rb +3 -3
  31. data/lib/sc2ai/unit_group/filter_ext.rb +33 -7
  32. data/lib/sc2ai/unit_group/geo_ext.rb +28 -0
  33. data/lib/sc2ai/unit_group.rb +3 -0
  34. data/lib/sc2ai/version.rb +1 -1
  35. data/lib/templates/new/run_example_match.rb.tt +1 -1
  36. data/sig/sc2ai.rbs +653 -567
  37. metadata +22 -31
data/sig/sc2ai.rbs CHANGED
@@ -23,6 +23,82 @@ module Sc2
23
23
  class Error < StandardError
24
24
  end
25
25
 
26
+ # Holds game data from tech tree and Api::ResponseData
27
+ # Called once on game start
28
+ class Data
29
+ # sord warn - Api::ResponseData wasn't able to be resolved to a constant in this project
30
+ # _@param_ `data`
31
+ def initialize: (Api::ResponseData data) -> void
32
+
33
+ # sord warn - Api::AbilityData wasn't able to be resolved to a constant in this project
34
+ # sord warn - "Hash<Integer, Api::AbilityData] indexed data" does not appear to be a type
35
+ # Indexes ability data by ability id
36
+ #
37
+ # _@param_ `abilities`
38
+ #
39
+ # _@return_ — Hash<Integer, Api::AbilityData] indexed data
40
+ def abilities_from_proto: (::Array[Api::AbilityData] abilities) -> SORD_ERROR_HashIntegerApiAbilityDataindexeddata
41
+
42
+ # Indexes unit data by id
43
+ #
44
+ # _@param_ `units`
45
+ #
46
+ # _@return_ — indexed data
47
+ def units_from_proto: (::Array[Api::UnitTypeData] units) -> ::Hash[Integer, Api::UnitTypeData]
48
+
49
+ # sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
50
+ # sord warn - "Hash<Integer, Api::UpgradeData] indexed data" does not appear to be a type
51
+ # Indexes upgrades data by id
52
+ #
53
+ # _@param_ `upgrades`
54
+ #
55
+ # _@return_ — Hash<Integer, Api::UpgradeData] indexed data
56
+ def upgrades_from_proto: (::Array[Api::UpgradeData] upgrades) -> SORD_ERROR_HashIntegerApiUpgradeDataindexeddata
57
+
58
+ # sord omit - no YARD type given for "effects", using untyped
59
+ # sord omit - no YARD return type given, using untyped
60
+ def effects_from_proto: (untyped effects) -> untyped
61
+
62
+ # sord omit - no YARD type given for "buffs", using untyped
63
+ # sord omit - no YARD return type given, using untyped
64
+ def buffs_from_proto: (untyped buffs) -> untyped
65
+
66
+ # sord omit - no YARD return type given, using untyped
67
+ # Overrides unit data from api to implement fixes or change context
68
+ # i.e. Api::UnitTypeId::ORBITALCOMMAND cost is cost-to-upgrade instead of CC + Orbital combined cost.
69
+ # Run once. Depends on all data already being set.
70
+ def override_unit_data: () -> untyped
71
+
72
+ # sord omit - no YARD return type given, using untyped
73
+ # Fixes mineral_cost, vespene_cost and food_required values
74
+ def correct_unit_type_costs: () -> untyped
75
+
76
+ # sord omit - no YARD return type given, using untyped
77
+ # Fixes mineral_cost_sum, vespene_cost_sum
78
+ def correct_unit_type_sum: () -> untyped
79
+
80
+ # sord warn - Api::AbilityData wasn't able to be resolved to a constant in this project
81
+ # _@return_ — AbilityId => AbilityData
82
+ attr_accessor abilities: (::Hash[Integer, Api::AbilityData] | untyped)
83
+
84
+ # _@return_ — UnitId => UnitTypeData
85
+ attr_accessor units: (::Hash[Integer, Api::UnitTypeData] | untyped)
86
+
87
+ # sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
88
+ # _@return_ — UpgradeId => UpgradeData
89
+ attr_accessor upgrades: (::Hash[Integer, Api::UpgradeData] | untyped)
90
+
91
+ # sord omit - no YARD type given for :buffs, using untyped
92
+ # Not particularly useful data. Just use BuffId directly
93
+ # @return [Hash<Integer, Api::BuffData>] BuffId => BuffData
94
+ attr_accessor buffs: untyped
95
+
96
+ # sord omit - no YARD type given for :effects, using untyped
97
+ # Not particularly useful data. Just use EffectId directly
98
+ # @return [Hash<Integer, Api::EffectData>] EffectId => EffectData
99
+ attr_accessor effects: untyped
100
+ end
101
+
26
102
  # Helps determine common paths to sc2 install dir, executable and maps.
27
103
  # It maintains some semblance of compatibility with python-sc2 config
28
104
  #
@@ -338,10 +414,16 @@ module Sc2
338
414
  def on_status_change: (Symbol status) -> untyped
339
415
 
340
416
  # Determines if your game_info will be refreshed at this moment
341
- # Has a hard-capped refresh of only ever 2 steps
417
+ # Has a hard-capped refresh of only ever 4 steps
342
418
  # In general game_info is only refreshed Player::Bot reads from pathing_grid or placement_grid
343
419
  def game_info_stale?: () -> bool
344
420
 
421
+ # A Hash by unit tag, holding an array of available ability ids
422
+ # Synchronously calls RequestQueryAvailableAbilities and caches for this game loop.
423
+ #
424
+ # _@return_ — { unit_tag => [ability_id, ...], ... }
425
+ def available_abilities: () -> ::Hash[Integer, ::Array[Integer]]
426
+
345
427
  # sord warn - Api::PlayerCommon wasn't able to be resolved to a constant in this project
346
428
  # An alias for observation.player_common to allow easier access to i.e. common.minerals
347
429
  #
@@ -494,7 +576,6 @@ module Sc2
494
576
  # _@param_ `race` — Api::Race::* excl *::Random
495
577
  def on_random_race_detected: (Integer race) -> untyped
496
578
 
497
- # sord warn - Api::ActionError wasn't able to be resolved to a constant in this project
498
579
  # sord omit - no YARD return type given, using untyped
499
580
  # Called on step if errors are present. Equivalent of UI red text errors.
500
581
  # Override to read action errors.
@@ -682,16 +763,15 @@ module Sc2
682
763
  #
683
764
  # _@param_ `radius` — default one tile wide, 1.0
684
765
  #
685
- # _@param_ `color` — default white. min(r,b) is used for both r&b
766
+ # _@param_ `color` — default white
686
767
  def debug_draw_sphere: (point: Api::Point, ?radius: Float, ?color: Api::Color?) -> void
687
768
 
688
- # Toggles cheat commands on/off (send only once to enable)
689
769
  # Possible values:
690
770
  # Api::DebugGameState::Show_map
691
771
  # Api::DebugGameState::Control_enemy
692
772
  # Api::DebugGameState::Food
693
773
  # Api::DebugGameState::Free
694
- # Api::DebugGameState::all_resources
774
+ # Api::DebugGameState::All_resources
695
775
  # Api::DebugGameState::God
696
776
  # Api::DebugGameState::Minerals
697
777
  # Api::DebugGameState::Gas
@@ -807,7 +887,7 @@ module Sc2
807
887
  #
808
888
  # _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
809
889
  #
810
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
890
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
811
891
  #
812
892
  # _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
813
893
  #
@@ -819,21 +899,22 @@ module Sc2
819
899
  ?queue_command: bool
820
900
  ) -> untyped
821
901
 
822
- # sord omit - no YARD type given for "units:", using untyped
823
902
  # sord omit - no YARD return type given, using untyped
824
903
  # Warps in unit type at target (location or pylon) with optional source units (warp gates)
825
904
  # When not specifying the specific warp gate(s), all warpgates will be used
826
905
  #
827
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
906
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
828
907
  #
829
908
  # _@param_ `queue_command` — shift+command
830
909
  #
831
910
  # _@param_ `target` — is a unit tag or a Api::Point2D
911
+ #
912
+ # _@param_ `units`
832
913
  def warp: (
833
914
  unit_type_id: Integer,
834
915
  target: (Api::Point2D | Integer),
835
916
  queue_command: bool,
836
- ?units: untyped
917
+ ?units: (::Array[Integer] | Integer | Api::Unit)?
837
918
  ) -> untyped
838
919
 
839
920
  # sord omit - no YARD return type given, using untyped
@@ -985,6 +1066,10 @@ module Sc2
985
1066
  # Returns the upgrade ids which are researching or queued
986
1067
  def upgrade_in_progress?: (untyped upgrade_id) -> bool
987
1068
 
1069
+ # sord omit - no YARD type given for "unit_type_id", using untyped
1070
+ # For this unit type, tells you how many are in progress by checking orders for all it's sources.
1071
+ def units_in_progress: (untyped unit_type_id) -> Integer
1072
+
988
1073
  # Returns static [Api::UnitTypeData] for a unit
989
1074
  #
990
1075
  # _@param_ `unit` — Api::UnitTypeId or Api::Unit
@@ -1036,6 +1121,14 @@ module Sc2
1036
1121
  # Checks whether you have the resources to
1037
1122
  def can_afford_upgrade?: (untyped upgrade_id) -> bool
1038
1123
 
1124
+ # Returns whether Query Available Ability is true for unit and tag
1125
+ # Queries API if necessary. Uses batching in the background.
1126
+ #
1127
+ # _@param_ `unit_tag`
1128
+ #
1129
+ # _@param_ `ability_id`
1130
+ def unit_ability_available?: (unit_tag: Integer, ability_id: Integer) -> bool
1131
+
1039
1132
  # sord warn - Api::Observation wasn't able to be resolved to a constant in this project
1040
1133
  # sord omit - no YARD return type given, using untyped
1041
1134
  # Divides raw data units into various attributes on every step
@@ -1102,6 +1195,10 @@ module Sc2
1102
1195
  # Returns the upgrade ids which are researching or queued
1103
1196
  def upgrade_in_progress?: (untyped upgrade_id) -> bool
1104
1197
 
1198
+ # sord omit - no YARD type given for "unit_type_id", using untyped
1199
+ # For this unit type, tells you how many are in progress by checking orders for all it's sources.
1200
+ def units_in_progress: (untyped unit_type_id) -> Integer
1201
+
1105
1202
  # Returns static [Api::UnitTypeData] for a unit
1106
1203
  #
1107
1204
  # _@param_ `unit` — Api::UnitTypeId or Api::Unit
@@ -1153,6 +1250,14 @@ module Sc2
1153
1250
  # Checks whether you have the resources to
1154
1251
  def can_afford_upgrade?: (untyped upgrade_id) -> bool
1155
1252
 
1253
+ # Returns whether Query Available Ability is true for unit and tag
1254
+ # Queries API if necessary. Uses batching in the background.
1255
+ #
1256
+ # _@param_ `unit_tag`
1257
+ #
1258
+ # _@param_ `ability_id`
1259
+ def unit_ability_available?: (unit_tag: Integer, ability_id: Integer) -> bool
1260
+
1156
1261
  # sord warn - Api::Observation wasn't able to be resolved to a constant in this project
1157
1262
  # sord omit - no YARD return type given, using untyped
1158
1263
  # Divides raw data units into various attributes on every step
@@ -1320,16 +1425,15 @@ module Sc2
1320
1425
  #
1321
1426
  # _@param_ `radius` — default one tile wide, 1.0
1322
1427
  #
1323
- # _@param_ `color` — default white. min(r,b) is used for both r&b
1428
+ # _@param_ `color` — default white
1324
1429
  def debug_draw_sphere: (point: Api::Point, ?radius: Float, ?color: Api::Color?) -> void
1325
1430
 
1326
- # Toggles cheat commands on/off (send only once to enable)
1327
1431
  # Possible values:
1328
1432
  # Api::DebugGameState::Show_map
1329
1433
  # Api::DebugGameState::Control_enemy
1330
1434
  # Api::DebugGameState::Food
1331
1435
  # Api::DebugGameState::Free
1332
- # Api::DebugGameState::all_resources
1436
+ # Api::DebugGameState::All_resources
1333
1437
  # Api::DebugGameState::God
1334
1438
  # Api::DebugGameState::Minerals
1335
1439
  # Api::DebugGameState::Gas
@@ -1415,6 +1519,10 @@ module Sc2
1415
1519
  # Returns the upgrade ids which are researching or queued
1416
1520
  def upgrade_in_progress?: (untyped upgrade_id) -> bool
1417
1521
 
1522
+ # sord omit - no YARD type given for "unit_type_id", using untyped
1523
+ # For this unit type, tells you how many are in progress by checking orders for all it's sources.
1524
+ def units_in_progress: (untyped unit_type_id) -> Integer
1525
+
1418
1526
  # Returns static [Api::UnitTypeData] for a unit
1419
1527
  #
1420
1528
  # _@param_ `unit` — Api::UnitTypeId or Api::Unit
@@ -1466,6 +1574,14 @@ module Sc2
1466
1574
  # Checks whether you have the resources to
1467
1575
  def can_afford_upgrade?: (untyped upgrade_id) -> bool
1468
1576
 
1577
+ # Returns whether Query Available Ability is true for unit and tag
1578
+ # Queries API if necessary. Uses batching in the background.
1579
+ #
1580
+ # _@param_ `unit_tag`
1581
+ #
1582
+ # _@param_ `ability_id`
1583
+ def unit_ability_available?: (unit_tag: Integer, ability_id: Integer) -> bool
1584
+
1469
1585
  # sord warn - Api::Observation wasn't able to be resolved to a constant in this project
1470
1586
  # sord omit - no YARD return type given, using untyped
1471
1587
  # Divides raw data units into various attributes on every step
@@ -1497,13 +1613,17 @@ module Sc2
1497
1613
 
1498
1614
  attr_accessor all_units: (Sc2::UnitGroup | untyped)
1499
1615
 
1500
- # _@return_ — a group of units
1616
+ # _@return_ — a group of placeholder structures
1501
1617
  attr_accessor units: Sc2::UnitGroup
1502
1618
 
1503
1619
  # sord omit - no YARD type given for :structures, using untyped
1504
1620
  # A full list of all your structures (non-units)
1505
1621
  attr_accessor structures: untyped
1506
1622
 
1623
+ # sord omit - no YARD type given for :placeholders, using untyped
1624
+ # A list of structures which haven't started
1625
+ attr_accessor placeholders: untyped
1626
+
1507
1627
  # _@return_ — a group of neutral units
1508
1628
  attr_accessor neutral: Sc2::UnitGroup
1509
1629
 
@@ -1517,7 +1637,7 @@ module Sc2
1517
1637
 
1518
1638
  # sord warn - Api::RadarRing wasn't able to be resolved to a constant in this project
1519
1639
  # sord warn - Api::RadarRing wasn't able to be resolved to a constant in this project
1520
- # _@return_ — an array of power sources
1640
+ # _@return_ — an array of radar rings sources
1521
1641
  attr_accessor power_sources: ::Array[Api::RadarRing]
1522
1642
 
1523
1643
  # sord omit - no YARD type given for :radar_rings, using untyped
@@ -1612,7 +1732,7 @@ module Sc2
1612
1732
  #
1613
1733
  # _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
1614
1734
  #
1615
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
1735
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
1616
1736
  #
1617
1737
  # _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
1618
1738
  #
@@ -1624,21 +1744,22 @@ module Sc2
1624
1744
  ?queue_command: bool
1625
1745
  ) -> untyped
1626
1746
 
1627
- # sord omit - no YARD type given for "units:", using untyped
1628
1747
  # sord omit - no YARD return type given, using untyped
1629
1748
  # Warps in unit type at target (location or pylon) with optional source units (warp gates)
1630
1749
  # When not specifying the specific warp gate(s), all warpgates will be used
1631
1750
  #
1632
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
1751
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
1633
1752
  #
1634
1753
  # _@param_ `queue_command` — shift+command
1635
1754
  #
1636
1755
  # _@param_ `target` — is a unit tag or a Api::Point2D
1756
+ #
1757
+ # _@param_ `units`
1637
1758
  def warp: (
1638
1759
  unit_type_id: Integer,
1639
1760
  target: (Api::Point2D | Integer),
1640
1761
  queue_command: bool,
1641
- ?units: untyped
1762
+ ?units: (::Array[Integer] | Integer | Api::Unit)?
1642
1763
  ) -> untyped
1643
1764
 
1644
1765
  # sord omit - no YARD return type given, using untyped
@@ -1799,6 +1920,9 @@ module Sc2
1799
1920
  # Effected by crop_to_playable_area
1800
1921
  def map_height: () -> Integer
1801
1922
 
1923
+ # Center of the map
1924
+ def map_center: () -> Api::Point2D
1925
+
1802
1926
  # Returns zero to map_width as range
1803
1927
  #
1804
1928
  # _@return_ — 0 to map_width
@@ -1835,6 +1959,16 @@ module Sc2
1835
1959
  # One pixel covers one whole block. Rounds fractionated positions down.
1836
1960
  def parsed_placement_grid: () -> Numo::Bit
1837
1961
 
1962
+ # Whether this tile is where an expansion is supposed to be placed.
1963
+ # To see if a unit/structure is blocking an expansion, pass their coordinates to this method.
1964
+ #
1965
+ # _@param_ `x`
1966
+ #
1967
+ # _@param_ `y`
1968
+ #
1969
+ # _@return_ — true if location has creep on it
1970
+ def expo_placement?: (x: (Float | Integer), y: (Float | Integer)) -> bool
1971
+
1838
1972
  # sord warn - Numo::Bit wasn't able to be resolved to a constant in this project
1839
1973
  # Returns a grid where ony the expo locations are marked
1840
1974
  def expo_placement_grid: () -> Numo::Bit
@@ -1891,11 +2025,12 @@ module Sc2
1891
2025
  # _@return_ — z axis position between -16 and 16
1892
2026
  def terrain_height: (x: (Float | Integer), y: (Float | Integer)) -> Float
1893
2027
 
1894
- # sord omit - no YARD type given for "position", using untyped
1895
2028
  # Returns the terrain height (z) at position x and y for a point
1896
2029
  #
2030
+ # _@param_ `position`
2031
+ #
1897
2032
  # _@return_ — z axis position between -16 and 16
1898
- def terrain_height_for_pos: (untyped position) -> Float
2033
+ def terrain_height_for_pos: (Sc2::Position position) -> Float
1899
2034
 
1900
2035
  # sord warn - Numo::SFloat wasn't able to be resolved to a constant in this project
1901
2036
  # Returns a parsed terrain_height from bot.game_info.start_raw.
@@ -1961,6 +2096,7 @@ module Sc2
1961
2096
 
1962
2097
  # sord warn - Numo::Bit wasn't able to be resolved to a constant in this project
1963
2098
  # Provides parsed minimap representation of creep spread
2099
+ # Caches for 4 frames
1964
2100
  #
1965
2101
  # _@return_ — Numo array
1966
2102
  def parsed_creep: () -> Numo::Bit
@@ -2035,6 +2171,13 @@ module Sc2
2035
2171
  # _@return_ — UnitGroup of geysers for the base
2036
2172
  def geysers_for_base: ((Api::Unit | Sc2::Position) base) -> Sc2::UnitGroup
2037
2173
 
2174
+ # Gets geysers which have not been taken for a base or base position
2175
+ #
2176
+ # _@param_ `base` — base Unit or Position
2177
+ #
2178
+ # _@return_ — UnitGroup of geysers for the base
2179
+ def geysers_open_for_base: ((Api::Unit | Sc2::Position) base) -> Sc2::UnitGroup
2180
+
2038
2181
  # _@param_ `base` — base Unit or Position
2039
2182
  #
2040
2183
  # _@return_ — UnitGroup of resources (minerals+geysers)
@@ -2070,8 +2213,15 @@ module Sc2
2070
2213
  #
2071
2214
  # _@param_ `random` — number of nearest points to randomly choose from. 1 for nearest point.
2072
2215
  #
2216
+ # _@param_ `in_power` — whether this must be on a power field
2217
+ #
2073
2218
  # _@return_ — buildable location, nil if no buildable location found
2074
- def build_placement_near: (length: Integer, target: (Api::Unit | Sc2::Position), ?random: Integer) -> Api::Point2D?
2219
+ def build_placement_near: (
2220
+ length: Integer,
2221
+ target: (Api::Unit | Sc2::Position),
2222
+ ?random: Integer,
2223
+ ?in_power: bool
2224
+ ) -> Api::Point2D?
2075
2225
 
2076
2226
  # Draws a grid within a unit (pylon/prisms) radius, then selects points which are placeable
2077
2227
  #
@@ -2104,7 +2254,6 @@ module Sc2
2104
2254
  ?count: Integer
2105
2255
  ) -> ::Array[Api::Point2D]
2106
2256
 
2107
- # sord warn - Sc2::Location wasn't able to be resolved to a constant in this project
2108
2257
  # Gets a random point near a location with a positive/negative offset applied to both x and y
2109
2258
  #
2110
2259
  # _@param_ `pos`
@@ -2115,13 +2264,12 @@ module Sc2
2115
2264
  # Randomly randomly adjust both x and y by a range of -3.5 or +3.5
2116
2265
  # geo.point_random_near(point: structures.hq.first, offset: 3.5)
2117
2266
  # ```
2118
- def point_random_near: (pos: Sc2::Location, ?offset: Float) -> Api::Point2D
2267
+ def point_random_near: (pos: Sc2::Position, ?offset: Float) -> Api::Point2D
2119
2268
 
2120
- # sord warn - Sc2::Location wasn't able to be resolved to a constant in this project
2121
2269
  # _@param_ `pos`
2122
2270
  #
2123
2271
  # _@param_ `radius`
2124
- def point_random_on_circle: (pos: Sc2::Location, ?radius: Float) -> Api::Point2D
2272
+ def point_random_on_circle: (pos: Sc2::Position, ?radius: Float) -> Api::Point2D
2125
2273
 
2126
2274
  # _@return_ — player with active connection
2127
2275
  attr_accessor bot: (Sc2::Player | untyped)
@@ -2137,10 +2285,16 @@ module Sc2
2137
2285
  def on_status_change: (Symbol status) -> untyped
2138
2286
 
2139
2287
  # Determines if your game_info will be refreshed at this moment
2140
- # Has a hard-capped refresh of only ever 2 steps
2288
+ # Has a hard-capped refresh of only ever 4 steps
2141
2289
  # In general game_info is only refreshed Player::Bot reads from pathing_grid or placement_grid
2142
2290
  def game_info_stale?: () -> bool
2143
2291
 
2292
+ # A Hash by unit tag, holding an array of available ability ids
2293
+ # Synchronously calls RequestQueryAvailableAbilities and caches for this game loop.
2294
+ #
2295
+ # _@return_ — { unit_tag => [ability_id, ...], ... }
2296
+ def available_abilities: () -> ::Hash[Integer, ::Array[Integer]]
2297
+
2144
2298
  # sord warn - Api::PlayerCommon wasn't able to be resolved to a constant in this project
2145
2299
  # An alias for observation.player_common to allow easier access to i.e. common.minerals
2146
2300
  #
@@ -2151,7 +2305,7 @@ module Sc2
2151
2305
  attr_accessor status: (Symbol | untyped)
2152
2306
 
2153
2307
  # _@return_ — current game loop
2154
- attr_accessor game_loop: Integer
2308
+ attr_accessor game_loop: (Integer | untyped)
2155
2309
 
2156
2310
  # sord warn - Api::ResponseGameInfo wasn't able to be resolved to a constant in this project
2157
2311
  # sord warn - Api::ResponseGameInfo wasn't able to be resolved to a constant in this project
@@ -2192,6 +2346,10 @@ module Sc2
2192
2346
  #
2193
2347
  # _@see_ `Unit#build` — and #morph
2194
2348
  attr_accessor spent_supply: (Integer | untyped)
2349
+
2350
+ # This is the last loop at which available_abilities was queried.
2351
+ # Used to determine staleness.
2352
+ attr_accessor available_abilities_loop: Integer
2195
2353
  end
2196
2354
 
2197
2355
  # Container for the previous game state, based on current bot state
@@ -2227,6 +2385,10 @@ module Sc2
2227
2385
  # Returns the upgrade ids which are researching or queued
2228
2386
  def upgrade_in_progress?: (untyped upgrade_id) -> bool
2229
2387
 
2388
+ # sord omit - no YARD type given for "unit_type_id", using untyped
2389
+ # For this unit type, tells you how many are in progress by checking orders for all it's sources.
2390
+ def units_in_progress: (untyped unit_type_id) -> Integer
2391
+
2230
2392
  # Returns static [Api::UnitTypeData] for a unit
2231
2393
  #
2232
2394
  # _@param_ `unit` — Api::UnitTypeId or Api::Unit
@@ -2278,6 +2440,14 @@ module Sc2
2278
2440
  # Checks whether you have the resources to
2279
2441
  def can_afford_upgrade?: (untyped upgrade_id) -> bool
2280
2442
 
2443
+ # Returns whether Query Available Ability is true for unit and tag
2444
+ # Queries API if necessary. Uses batching in the background.
2445
+ #
2446
+ # _@param_ `unit_tag`
2447
+ #
2448
+ # _@param_ `ability_id`
2449
+ def unit_ability_available?: (unit_tag: Integer, ability_id: Integer) -> bool
2450
+
2281
2451
  # sord warn - Api::Observation wasn't able to be resolved to a constant in this project
2282
2452
  # sord omit - no YARD return type given, using untyped
2283
2453
  # Divides raw data units into various attributes on every step
@@ -2312,10 +2482,16 @@ module Sc2
2312
2482
  def on_status_change: (Symbol status) -> untyped
2313
2483
 
2314
2484
  # Determines if your game_info will be refreshed at this moment
2315
- # Has a hard-capped refresh of only ever 2 steps
2485
+ # Has a hard-capped refresh of only ever 4 steps
2316
2486
  # In general game_info is only refreshed Player::Bot reads from pathing_grid or placement_grid
2317
2487
  def game_info_stale?: () -> bool
2318
2488
 
2489
+ # A Hash by unit tag, holding an array of available ability ids
2490
+ # Synchronously calls RequestQueryAvailableAbilities and caches for this game loop.
2491
+ #
2492
+ # _@return_ — { unit_tag => [ability_id, ...], ... }
2493
+ def available_abilities: () -> ::Hash[Integer, ::Array[Integer]]
2494
+
2319
2495
  # sord warn - Api::PlayerCommon wasn't able to be resolved to a constant in this project
2320
2496
  # An alias for observation.player_common to allow easier access to i.e. common.minerals
2321
2497
  #
@@ -2437,83 +2613,6 @@ module Sc2
2437
2613
  end
2438
2614
  end
2439
2615
 
2440
- # Holds game data from tech tree and Api::ResponseData
2441
- # Called once on game start
2442
- class Data
2443
- # sord warn - Api::ResponseData wasn't able to be resolved to a constant in this project
2444
- # _@param_ `data`
2445
- def initialize: (Api::ResponseData data) -> void
2446
-
2447
- # sord warn - Api::AbilityData wasn't able to be resolved to a constant in this project
2448
- # sord warn - "Hash<Integer, Api::AbilityData] indexed data" does not appear to be a type
2449
- # Indexes ability data by ability id
2450
- #
2451
- # _@param_ `abilities`
2452
- #
2453
- # _@return_ — Hash<Integer, Api::AbilityData] indexed data
2454
- def abilities_from_proto: (::Array[Api::AbilityData] abilities) -> SORD_ERROR_HashIntegerApiAbilityDataindexeddata
2455
-
2456
- # sord warn - "Hash<Integer, Api::UnitTypeData] indexed data" does not appear to be a type
2457
- # Indexes unit data by id
2458
- #
2459
- # _@param_ `units`
2460
- #
2461
- # _@return_ — Hash<Integer, Api::UnitTypeData] indexed data
2462
- def units_from_proto: (::Array[Api::UnitTypeData] units) -> SORD_ERROR_HashIntegerApiUnitTypeDataindexeddata
2463
-
2464
- # sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
2465
- # sord warn - "Hash<Integer, Api::UpgradeData] indexed data" does not appear to be a type
2466
- # Indexes upgrades data by id
2467
- #
2468
- # _@param_ `upgrades`
2469
- #
2470
- # _@return_ — Hash<Integer, Api::UpgradeData] indexed data
2471
- def upgrades_from_proto: (::Array[Api::UpgradeData] upgrades) -> SORD_ERROR_HashIntegerApiUpgradeDataindexeddata
2472
-
2473
- # sord omit - no YARD type given for "effects", using untyped
2474
- # sord omit - no YARD return type given, using untyped
2475
- def effects_from_proto: (untyped effects) -> untyped
2476
-
2477
- # sord omit - no YARD type given for "buffs", using untyped
2478
- # sord omit - no YARD return type given, using untyped
2479
- def buffs_from_proto: (untyped buffs) -> untyped
2480
-
2481
- # sord omit - no YARD return type given, using untyped
2482
- # Overrides unit data from api to implement fixes or change context
2483
- # i.e. Api::UnitTypeId::ORBITALCOMMAND cost is cost-to-upgrade instead of CC + Orbital combined cost.
2484
- # Run once. Depends on all data already being set.
2485
- def override_unit_data: () -> untyped
2486
-
2487
- # sord omit - no YARD return type given, using untyped
2488
- # Fixes mineral_cost, vespene_cost and food_required values
2489
- def correct_unit_type_costs: () -> untyped
2490
-
2491
- # sord omit - no YARD return type given, using untyped
2492
- # Fixes mineral_cost_sum, vespene_cost_sum
2493
- def correct_unit_type_sum: () -> untyped
2494
-
2495
- # sord warn - Api::AbilityData wasn't able to be resolved to a constant in this project
2496
- # _@return_ — AbilityId => AbilityData
2497
- attr_accessor abilities: (::Hash[Integer, Api::AbilityData] | untyped)
2498
-
2499
- # _@return_ — UnitId => UnitTypeData
2500
- attr_accessor units: (::Hash[Integer, Api::UnitTypeData] | untyped)
2501
-
2502
- # sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
2503
- # _@return_ — UpgradeId => UpgradeData
2504
- attr_accessor upgrades: (::Hash[Integer, Api::UpgradeData] | untyped)
2505
-
2506
- # sord omit - no YARD type given for :buffs, using untyped
2507
- # Not particularly useful data. Just use BuffId directly
2508
- # @return [Hash<Integer, Api::BuffData>] BuffId => BuffData
2509
- attr_accessor buffs: untyped
2510
-
2511
- # sord omit - no YARD type given for :effects, using untyped
2512
- # Not particularly useful data. Just use EffectId directly
2513
- # @return [Hash<Integer, Api::EffectData>] EffectId => EffectData
2514
- attr_accessor effects: untyped
2515
- end
2516
-
2517
2616
  # Manages client connection to the Api
2518
2617
  class Connection
2519
2618
  include Sc2::Connection::Requests
@@ -2751,20 +2850,16 @@ module Sc2
2751
2850
  ) -> Api::ResponseQuery
2752
2851
 
2753
2852
  # sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
2754
- # sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
2755
- # sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
2756
2853
  # sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
2757
2854
  # Queries one or more pathing queries
2758
2855
  #
2759
2856
  # _@param_ `queries` — one or more pathing queries
2760
2857
  #
2761
2858
  # _@return_ — one or more results depending on input size
2762
- def query_pathings: ((::Array[Api::RequestQueryPathing] | Api::RequestQueryPathing) queries) -> (::Array[Api::ResponseQueryPathing] | Api::ResponseQueryPathing)
2859
+ def query_pathings: (::Array[Api::RequestQueryPathing] queries) -> ::Array[Api::ResponseQueryPathing]
2763
2860
 
2764
- # sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
2765
2861
  # sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
2766
2862
  # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
2767
- # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
2768
2863
  # Queries one or more ability-available checks
2769
2864
  #
2770
2865
  # _@param_ `queries` — one or more pathing queries
@@ -2772,9 +2867,8 @@ module Sc2
2772
2867
  # _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
2773
2868
  #
2774
2869
  # _@return_ — one or more results depending on input size
2775
- def query_abilities: ((::Array[Api::RequestQueryAvailableAbilities] | Api::RequestQueryAvailableAbilities) queries, ?ignore_resource_requirements: bool) -> (::Array[Api::ResponseQueryAvailableAbilities] | Api::ResponseQueryAvailableAbilities)
2870
+ def query_abilities: (::Array[Api::RequestQueryAvailableAbilities] queries, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
2776
2871
 
2777
- # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
2778
2872
  # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
2779
2873
  # Queries available abilities for units
2780
2874
  #
@@ -2783,18 +2877,27 @@ module Sc2
2783
2877
  # _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
2784
2878
  #
2785
2879
  # _@return_ — one or more results depending on input size
2786
- def query_abilities_for_unit_tags: ((::Array[Integer] | Integer) unit_tags, ?ignore_resource_requirements: bool) -> (::Array[Api::ResponseQueryAvailableAbilities] | Api::ResponseQueryAvailableAbilities)
2880
+ def query_abilities_for_unit_tags: (::Array[Integer] unit_tags, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
2881
+
2882
+ # sord omit - no YARD type given for "ignore_resource_requirements:", using untyped
2883
+ # Queries available ability ids for one unit
2884
+ # Shortened response over #query_abilities_for_unit_tags, since we know the tag already
2885
+ # and can just return an array of ability ids.
2886
+ # Note: Querying single units are expensive and should be batched with #query_abilities_for_unit_tags
2887
+ #
2888
+ # _@param_ `unit` — a unit or a tag.
2889
+ #
2890
+ # _@return_ — array of ability ids
2891
+ def query_ability_ids_for_unit: ((Api::Unit | Integer) unit, ?ignore_resource_requirements: untyped) -> ::Array[Integer]
2787
2892
 
2788
2893
  # sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
2789
- # sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
2790
- # sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
2791
2894
  # sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
2792
2895
  # Queries one or more pathing queries
2793
2896
  #
2794
2897
  # _@param_ `queries` — one or more placement queries
2795
2898
  #
2796
2899
  # _@return_ — one or more results depending on input size
2797
- def query_placements: ((::Array[Api::RequestQueryBuildingPlacement] | Api::RequestQueryBuildingPlacement) queries) -> (::Array[Api::ResponseQueryBuildingPlacement] | Api::ResponseQueryBuildingPlacement)
2900
+ def query_placements: (::Array[Api::RequestQueryBuildingPlacement] queries) -> ::Array[Api::ResponseQueryBuildingPlacement]
2798
2901
 
2799
2902
  # sord omit - no YARD return type given, using untyped
2800
2903
  # Generates a replay.
@@ -3051,19 +3154,15 @@ module Sc2
3051
3154
  ) -> Api::ResponseQuery
3052
3155
 
3053
3156
  # sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
3054
- # sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
3055
- # sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
3056
3157
  # sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
3057
3158
  # Queries one or more pathing queries
3058
3159
  #
3059
3160
  # _@param_ `queries` — one or more pathing queries
3060
3161
  #
3061
3162
  # _@return_ — one or more results depending on input size
3062
- def query_pathings: ((::Array[Api::RequestQueryPathing] | Api::RequestQueryPathing) queries) -> (::Array[Api::ResponseQueryPathing] | Api::ResponseQueryPathing)
3163
+ def query_pathings: (::Array[Api::RequestQueryPathing] queries) -> ::Array[Api::ResponseQueryPathing]
3063
3164
 
3064
3165
  # sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
3065
- # sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
3066
- # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
3067
3166
  # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
3068
3167
  # Queries one or more ability-available checks
3069
3168
  #
@@ -3072,9 +3171,8 @@ module Sc2
3072
3171
  # _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
3073
3172
  #
3074
3173
  # _@return_ — one or more results depending on input size
3075
- def query_abilities: ((::Array[Api::RequestQueryAvailableAbilities] | Api::RequestQueryAvailableAbilities) queries, ?ignore_resource_requirements: bool) -> (::Array[Api::ResponseQueryAvailableAbilities] | Api::ResponseQueryAvailableAbilities)
3174
+ def query_abilities: (::Array[Api::RequestQueryAvailableAbilities] queries, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
3076
3175
 
3077
- # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
3078
3176
  # sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
3079
3177
  # Queries available abilities for units
3080
3178
  #
@@ -3083,18 +3181,27 @@ module Sc2
3083
3181
  # _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
3084
3182
  #
3085
3183
  # _@return_ — one or more results depending on input size
3086
- def query_abilities_for_unit_tags: ((::Array[Integer] | Integer) unit_tags, ?ignore_resource_requirements: bool) -> (::Array[Api::ResponseQueryAvailableAbilities] | Api::ResponseQueryAvailableAbilities)
3184
+ def query_abilities_for_unit_tags: (::Array[Integer] unit_tags, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
3185
+
3186
+ # sord omit - no YARD type given for "ignore_resource_requirements:", using untyped
3187
+ # Queries available ability ids for one unit
3188
+ # Shortened response over #query_abilities_for_unit_tags, since we know the tag already
3189
+ # and can just return an array of ability ids.
3190
+ # Note: Querying single units are expensive and should be batched with #query_abilities_for_unit_tags
3191
+ #
3192
+ # _@param_ `unit` — a unit or a tag.
3193
+ #
3194
+ # _@return_ — array of ability ids
3195
+ def query_ability_ids_for_unit: ((Api::Unit | Integer) unit, ?ignore_resource_requirements: untyped) -> ::Array[Integer]
3087
3196
 
3088
3197
  # sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
3089
- # sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
3090
- # sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
3091
3198
  # sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
3092
3199
  # Queries one or more pathing queries
3093
3200
  #
3094
3201
  # _@param_ `queries` — one or more placement queries
3095
3202
  #
3096
3203
  # _@return_ — one or more results depending on input size
3097
- def query_placements: ((::Array[Api::RequestQueryBuildingPlacement] | Api::RequestQueryBuildingPlacement) queries) -> (::Array[Api::ResponseQueryBuildingPlacement] | Api::ResponseQueryBuildingPlacement)
3204
+ def query_placements: (::Array[Api::RequestQueryBuildingPlacement] queries) -> ::Array[Api::ResponseQueryBuildingPlacement]
3098
3205
 
3099
3206
  # sord omit - no YARD return type given, using untyped
3100
3207
  # Generates a replay.
@@ -3440,6 +3547,10 @@ module Sc2
3440
3547
  # Allows, i.e. Player#units.workers to fire only the first time it's called per frame
3441
3548
  def cached: (untyped key) -> untyped
3442
3549
 
3550
+ # Returns the center (average) position of all units or nil if the group is empty.
3551
+ # Outliers effect this point
3552
+ def pos_centroid: () -> Api::Point2D?
3553
+
3443
3554
  # Our first unit's bot object.
3444
3555
  # Returns nil if units are empty, so use safetly operator bot&.method(...)
3445
3556
  #
@@ -3458,7 +3569,7 @@ module Sc2
3458
3569
  # sord omit - no YARD return type given, using untyped
3459
3570
  # Builds target unit type, i.e. issuing a build command to worker.build(...Api::UnitTypeId::BARRACKS)
3460
3571
  #
3461
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
3572
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
3462
3573
  #
3463
3574
  # _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
3464
3575
  #
@@ -3469,12 +3580,12 @@ module Sc2
3469
3580
  # Warps in unit type at target (location or pylon)
3470
3581
  # Will only have affect is this group consists of warp gates, i.e. bot.structures.warpgates
3471
3582
  #
3472
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
3583
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
3473
3584
  #
3474
3585
  # _@param_ `target` — a point, which should be inside an energy source
3475
3586
  #
3476
3587
  # _@param_ `queue_command` — shift+command
3477
- def warp: (unit_type_id: Integer, ?target: Api::Point2D?, ?queue_command: bool) -> untyped
3588
+ def warp: (unit_type_id: Integer, target: Api::Point2D, ?queue_command: bool) -> untyped
3478
3589
 
3479
3590
  # sord omit - no YARD return type given, using untyped
3480
3591
  # Research a specific upgrade at one of these structures
@@ -3640,9 +3751,26 @@ module Sc2
3640
3751
 
3641
3752
  # Selects only units which have finished constructing, i.o.w. build_progress == 1.0
3642
3753
  #
3643
- # _@return_ — gas structures
3754
+ # _@return_ — complete unit group
3644
3755
  def completed: () -> UnitGroup
3645
3756
 
3757
+ # Selects only units which have finished constructing, i.o.w. build_progress != 1.0
3758
+ #
3759
+ # _@return_ — incomplete unit group
3760
+ def incomplete: () -> UnitGroup
3761
+
3762
+ # sord omit - no YARD return type given, using untyped
3763
+ # Selects only units which do not have orders
3764
+ def idle: () -> untyped
3765
+
3766
+ # Selects units which have this ability available\
3767
+ # Queries API if necessary
3768
+ #
3769
+ # _@param_ `ability_id`
3770
+ #
3771
+ # _@return_ — units which have the ability available
3772
+ def ability_available?: (Integer ability_id) -> UnitGroup
3773
+
3646
3774
  # Selects mineral fields
3647
3775
  #
3648
3776
  # _@return_ — mineral fields
@@ -3697,6 +3825,9 @@ module Sc2
3697
3825
  # Selects overlords
3698
3826
  def overlords: () -> Sc2::UnitGroup
3699
3827
 
3828
+ # Selects overseers
3829
+ def overseers: () -> Sc2::UnitGroup
3830
+
3700
3831
  # Selects creep tumors (all)
3701
3832
  # CREEPTUMORQUEEN is still building & burrowing
3702
3833
  # while CREEPTUMOR was spread from another tumor still building & burrowing
@@ -3784,10 +3915,10 @@ module Sc2
3784
3915
  def initialize: ((Api::Unit | ::Hash[Integer, Api::Unit] | ::Array[Api::Unit] | Sc2::UnitGroup)? unit_group) -> void
3785
3916
 
3786
3917
  # Does the opposite of selector and returns those values for parent
3787
- def select_type: () -> UnitGroup
3918
+ def select: () -> Sc2::UnitGroup
3788
3919
 
3789
3920
  # Does the opposite of selector and returns those values for parent
3790
- def reject_type: () -> UnitGroup
3921
+ def reject: () -> Sc2::UnitGroup
3791
3922
 
3792
3923
  # Returns the value of attribute parent.
3793
3924
  attr_accessor parent: untyped
@@ -4131,10 +4262,17 @@ module Sc2
4131
4262
  end
4132
4263
 
4133
4264
  # A unified construct that tames Api::* messages which contain location data
4134
- # Items which are of type Sc2::Location will have #x and #y property at the least.
4265
+ # Items which are of type Sc2::Position will have #x and #y property at the least.
4135
4266
  module Position
4136
4267
  TOLERANCE: untyped
4137
4268
 
4269
+ # sord omit - no YARD type given for "other", using untyped
4270
+ # sord omit - no YARD return type given, using untyped
4271
+ # Loose equality matches on floats x and y.
4272
+ # We never check z-axis, because the map is single-level.
4273
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
4274
+ def ==: (untyped other) -> untyped
4275
+
4138
4276
  # A new point representing the sum of this point and the other point.
4139
4277
  #
4140
4278
  # _@param_ `other` — The other point/number to add.
@@ -4155,15 +4293,26 @@ module Sc2
4155
4293
  # _@return_ — A new point representing this point divided by the scalar.
4156
4294
  def divide: (Float scalar) -> Api::Point2D
4157
4295
 
4158
- # sord omit - no YARD return type given, using untyped
4159
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
4160
- # We send method missing ourselves when y to fix this chain.
4161
- def y: () -> untyped
4296
+ # Returns x coordinate
4297
+ def x: () -> Float
4298
+
4299
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
4300
+ # Sets x coordinate
4301
+ def x=: (Float x) -> Float
4302
+
4303
+ # Returns y coordinate
4304
+ def y: () -> Float
4305
+
4306
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
4307
+ # Sets y coordinate
4308
+ def y=: (Float y) -> Float
4162
4309
 
4163
4310
  # Randomly adjusts both x and y by a range of: -offset..offset
4164
4311
  #
4165
4312
  # _@param_ `offset`
4166
- def random_offset: (Float offset) -> Api::Point2D
4313
+ #
4314
+ # _@return_ — new Position
4315
+ def random_offset: (Float offset) -> Sc2::Position
4167
4316
 
4168
4317
  # sord omit - no YARD type given for "offset", using untyped
4169
4318
  # Changes this point's x and y by the supplied offset
@@ -4175,15 +4324,15 @@ module Sc2
4175
4324
  # sord omit - no YARD type given for "y", using untyped
4176
4325
  # Creates a new point with x and y which is offset
4177
4326
  #
4178
- # _@return_ — self
4179
- def offset: (untyped x, untyped y) -> Api::Point2D
4327
+ # _@return_ — new Position
4328
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
4180
4329
 
4181
4330
  # sord omit - no YARD type given for "x", using untyped
4182
4331
  # sord omit - no YARD type given for "y", using untyped
4183
4332
  # Changes this point's x and y by the supplied offset
4184
4333
  #
4185
4334
  # _@return_ — self
4186
- def offset!: (untyped x, untyped y) -> Sc2::Position
4335
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
4187
4336
 
4188
4337
  # For vector returns the magnitude, synonymous with Math.hypot
4189
4338
  def magnitude: () -> Float
@@ -4253,7 +4402,7 @@ module Sc2
4253
4402
  end
4254
4403
  end
4255
4404
 
4256
- # Generated from stableid.json, do not edit.
4405
+ # This class was partially generated with the help of AI.
4257
4406
  module Api
4258
4407
  # Constant reference of Buff ids
4259
4408
  module BuffId
@@ -4547,23 +4696,16 @@ module Api
4547
4696
  ACCELERATIONZONETEMPORALFIELD: untyped
4548
4697
  ACCELERATIONZONEFLYINGTEMPORALFIELD: untyped
4549
4698
  INHIBITORZONEFLYINGTEMPORALFIELD: untyped
4550
- DUMMYBUFF000: untyped
4699
+ LOADOUTSPRAYTRACKER: untyped
4551
4700
  INHIBITORZONETEMPORALFIELD: untyped
4701
+ CLOAKFIELD: untyped
4552
4702
  RESONATINGGLAIVESPHASESHIFT: untyped
4553
4703
  NEURALPARASITECHILDREN: untyped
4554
4704
  AMORPHOUSARMORCLOUD: untyped
4555
4705
  RAVENSHREDDERMISSILEARMORREDUCTIONUISUBTRUCT: untyped
4556
- BATTERYOVERCHARGE: untyped
4557
- DUMMYBUFF001: untyped
4558
- DUMMYBUFF002: untyped
4559
- DUMMYBUFF003: untyped
4560
- DUMMYBUFF004: untyped
4561
- DUMMYBUFF005: untyped
4562
- ONCREEPQUEEN: untyped
4563
- LOADOUTSPRAYTRACKER: untyped
4564
- CLOAKFIELD: untyped
4565
4706
  TAKENDAMAGE: untyped
4566
4707
  RAVENSCRAMBLERMISSILECARRIER: untyped
4708
+ BATTERYOVERCHARGE: untyped
4567
4709
 
4568
4710
  # sord omit - no YARD return type given, using untyped
4569
4711
  def self._250MMSTRIKECANNONS: () -> untyped
@@ -4684,6 +4826,21 @@ module Api
4684
4826
  # _@return_ — ability_id
4685
4827
  def self.upgrade_ability_data: (Integer source_unit_type_id) -> ::Hash[Integer, ::Hash[untyped, untyped]]
4686
4828
 
4829
+ # sord omit - no YARD type given for "unit_type_id", using untyped
4830
+ # Returns known abilities fo unit type
4831
+ #
4832
+ # _@return_ — array of ability_ids
4833
+ def self.unit_abilities: (untyped unit_type_id) -> ::Array[Integer]
4834
+
4835
+ # sord omit - no YARD return type given, using untyped
4836
+ def standard_abilities: () -> untyped
4837
+
4838
+ # sord omit - no YARD type given for "unit_type_id", using untyped
4839
+ # Returns special abilities, excluding basic start/stop/attack commands
4840
+ #
4841
+ # _@return_ — array of ability_ids
4842
+ def self.unit_special_abilities: (untyped unit_type_id) -> ::Array[Integer]
4843
+
4687
4844
  # sord omit - no YARD return type given, using untyped
4688
4845
  def self.unit_type_creation_abilities_data: () -> untyped
4689
4846
 
@@ -5974,7 +6131,6 @@ module Api
5974
6131
  NEXUSSHIELDRECHARGEONPYLON_NEXUSSHIELDRECHARGEONPYLON: untyped
5975
6132
  INFESTORENSNARE_INFESTORENSNARE: untyped
5976
6133
  EFFECT_RESTORE: untyped
5977
- SHIELDBATTERYRECHARGECHANNELED_STOP: untyped
5978
6134
  NEXUSSHIELDOVERCHARGE_NEXUSSHIELDOVERCHARGE: untyped
5979
6135
  NEXUSSHIELDOVERCHARGEOFF_NEXUSSHIELDOVERCHARGEOFF: untyped
5980
6136
  ATTACK_BATTLECRUISER: untyped
@@ -6010,317 +6166,14 @@ module Api
6010
6166
  LOADOUTSPRAY_LOADOUTSPRAY12: untyped
6011
6167
  LOADOUTSPRAY_LOADOUTSPRAY13: untyped
6012
6168
  LOADOUTSPRAY_LOADOUTSPRAY14: untyped
6013
- DUMMYABIL0_DUMMYABIL0: untyped
6014
- DUMMYABIL1_DUMMYABIL1: untyped
6015
- DUMMYABIL2_DUMMYABIL2: untyped
6016
- DUMMYABIL3_DUMMYABIL3: untyped
6017
- DUMMYABIL4_DUMMYABIL4: untyped
6018
- DUMMYABIL5_DUMMYABIL5: untyped
6019
- DUMMYABIL6_DUMMYABIL6: untyped
6020
- DUMMYABIL7_DUMMYABIL7: untyped
6021
- DUMMYABIL8_DUMMYABIL8: untyped
6022
- DUMMYABIL9_DUMMYABIL9: untyped
6023
- DUMMYABIL10_DUMMYABIL10: untyped
6024
- DUMMYABIL11_DUMMYABIL11: untyped
6025
- DUMMYABIL12_DUMMYABIL12: untyped
6026
- DUMMYABIL13_DUMMYABIL13: untyped
6027
- DUMMYABIL14_DUMMYABIL14: untyped
6028
- DUMMYABIL15_DUMMYABIL15: untyped
6029
- DUMMYABIL16_DUMMYABIL16: untyped
6030
- DUMMYABIL17_DUMMYABIL17: untyped
6031
- DUMMYABIL18_DUMMYABIL18: untyped
6032
- DUMMYABIL19_DUMMYABIL19: untyped
6033
- DUMMYABIL20_DUMMYABIL20: untyped
6034
- DUMMYABIL21_DUMMYABIL21: untyped
6035
- DUMMYABIL22_DUMMYABIL22: untyped
6036
- DUMMYABIL23_DUMMYABIL23: untyped
6037
- DUMMYABIL24_DUMMYABIL24: untyped
6038
- DUMMYABIL25_DUMMYABIL25: untyped
6039
- DUMMYABIL26_DUMMYABIL26: untyped
6040
- DUMMYABIL27_DUMMYABIL27: untyped
6041
- DUMMYABIL28_DUMMYABIL28: untyped
6042
- DUMMYABIL29_DUMMYABIL29: untyped
6043
- DUMMYABIL30_DUMMYABIL30: untyped
6044
- DUMMYABIL31_DUMMYABIL31: untyped
6045
- DUMMYABIL32_DUMMYABIL32: untyped
6046
- DUMMYABIL33_DUMMYABIL33: untyped
6047
- DUMMYABIL34_DUMMYABIL34: untyped
6048
- DUMMYABIL35_DUMMYABIL35: untyped
6049
- DUMMYABIL36_DUMMYABIL36: untyped
6050
- DUMMYABIL37_DUMMYABIL37: untyped
6051
- DUMMYABIL38_DUMMYABIL38: untyped
6052
- DUMMYABIL39_DUMMYABIL39: untyped
6053
- DUMMYABIL40_DUMMYABIL40: untyped
6054
- DUMMYABIL41_DUMMYABIL41: untyped
6055
- DUMMYABIL42_DUMMYABIL42: untyped
6056
- DUMMYABIL43_DUMMYABIL43: untyped
6057
- DUMMYABIL44_DUMMYABIL44: untyped
6058
- DUMMYABIL45_DUMMYABIL45: untyped
6059
- DUMMYABIL46_DUMMYABIL46: untyped
6060
- DUMMYABIL47_DUMMYABIL47: untyped
6061
- DUMMYABIL48_DUMMYABIL48: untyped
6062
- DUMMYABIL49_DUMMYABIL49: untyped
6063
- DUMMYABIL50_DUMMYABIL50: untyped
6064
- DUMMYABIL51_DUMMYABIL51: untyped
6065
- DUMMYABIL52_DUMMYABIL52: untyped
6066
- DUMMYABIL53_DUMMYABIL53: untyped
6067
- DUMMYABIL54_DUMMYABIL54: untyped
6068
- DUMMYABIL55_DUMMYABIL55: untyped
6069
- DUMMYABIL56_DUMMYABIL56: untyped
6070
- DUMMYABIL57_DUMMYABIL57: untyped
6071
- DUMMYABIL58_DUMMYABIL58: untyped
6072
- DUMMYABIL59_DUMMYABIL59: untyped
6073
- DUMMYABIL60_DUMMYABIL60: untyped
6074
- DUMMYABIL61_DUMMYABIL61: untyped
6075
- DUMMYABIL62_DUMMYABIL62: untyped
6076
- DUMMYABIL63_DUMMYABIL63: untyped
6077
- DUMMYABIL64_DUMMYABIL64: untyped
6078
- DUMMYABIL65_DUMMYABIL65: untyped
6079
- DUMMYABIL66_DUMMYABIL66: untyped
6080
- DUMMYABIL67_DUMMYABIL67: untyped
6081
- DUMMYABIL68_DUMMYABIL68: untyped
6082
- DUMMYABIL69_DUMMYABIL69: untyped
6083
- DUMMYABIL70_DUMMYABIL70: untyped
6084
- DUMMYABIL71_DUMMYABIL71: untyped
6085
- DUMMYABIL72_DUMMYABIL72: untyped
6086
- DUMMYABIL73_DUMMYABIL73: untyped
6087
- DUMMYABIL74_DUMMYABIL74: untyped
6088
- DUMMYABIL75_DUMMYABIL75: untyped
6089
- DUMMYABIL76_DUMMYABIL76: untyped
6090
- DUMMYABIL77_DUMMYABIL77: untyped
6091
- DUMMYABIL78_DUMMYABIL78: untyped
6092
- DUMMYABIL79_DUMMYABIL79: untyped
6093
- DUMMYABIL80_DUMMYABIL80: untyped
6094
- DUMMYABIL81_DUMMYABIL81: untyped
6095
- DUMMYABIL82_DUMMYABIL82: untyped
6096
- DUMMYABIL83_DUMMYABIL83: untyped
6097
- DUMMYABIL84_DUMMYABIL84: untyped
6098
- DUMMYABIL85_DUMMYABIL85: untyped
6099
- DUMMYABIL86_DUMMYABIL86: untyped
6100
- DUMMYABIL87_DUMMYABIL87: untyped
6101
- DUMMYABIL88_DUMMYABIL88: untyped
6102
- DUMMYABIL89_DUMMYABIL89: untyped
6103
- DUMMYABIL90_DUMMYABIL90: untyped
6104
- DUMMYABIL91_DUMMYABIL91: untyped
6105
- DUMMYABIL92_DUMMYABIL92: untyped
6106
- DUMMYABIL93_DUMMYABIL93: untyped
6107
- DUMMYABIL94_DUMMYABIL94: untyped
6108
- DUMMYABIL95_DUMMYABIL95: untyped
6109
- DUMMYABIL96_DUMMYABIL96: untyped
6110
- DUMMYABIL97_DUMMYABIL97: untyped
6111
- DUMMYABIL98_DUMMYABIL98: untyped
6112
- DUMMYABIL99_DUMMYABIL99: untyped
6113
- DUMMYABIL100_DUMMYABIL100: untyped
6114
- DUMMYABIL101_DUMMYABIL101: untyped
6115
- DUMMYABIL102_DUMMYABIL102: untyped
6116
- DUMMYABIL103_DUMMYABIL103: untyped
6117
- DUMMYABIL104_DUMMYABIL104: untyped
6118
- DUMMYABIL105_DUMMYABIL105: untyped
6119
- DUMMYABIL106_DUMMYABIL106: untyped
6120
- DUMMYABIL107_DUMMYABIL107: untyped
6121
- DUMMYABIL108_DUMMYABIL108: untyped
6122
- DUMMYABIL109_DUMMYABIL109: untyped
6123
- DUMMYABIL110_DUMMYABIL110: untyped
6124
- DUMMYABIL111_DUMMYABIL111: untyped
6125
- DUMMYABIL112_DUMMYABIL112: untyped
6126
- DUMMYABIL113_DUMMYABIL113: untyped
6127
- DUMMYABIL114_DUMMYABIL114: untyped
6128
- DUMMYABIL115_DUMMYABIL115: untyped
6129
- DUMMYABIL116_DUMMYABIL116: untyped
6130
- DUMMYABIL117_DUMMYABIL117: untyped
6131
- DUMMYABIL118_DUMMYABIL118: untyped
6132
- DUMMYABIL119_DUMMYABIL119: untyped
6133
- DUMMYABIL120_DUMMYABIL120: untyped
6134
- DUMMYABIL121_DUMMYABIL121: untyped
6135
- DUMMYABIL122_DUMMYABIL122: untyped
6136
- DUMMYABIL123_DUMMYABIL123: untyped
6137
- DUMMYABIL124_DUMMYABIL124: untyped
6138
- DUMMYABIL125_DUMMYABIL125: untyped
6139
- DUMMYABIL126_DUMMYABIL126: untyped
6140
- DUMMYABIL127_DUMMYABIL127: untyped
6141
- DUMMYABIL128_DUMMYABIL128: untyped
6142
- DUMMYABIL129_DUMMYABIL129: untyped
6143
- DUMMYABIL130_DUMMYABIL130: untyped
6144
- DUMMYABIL131_DUMMYABIL131: untyped
6145
- DUMMYABIL132_DUMMYABIL132: untyped
6146
- DUMMYABIL133_DUMMYABIL133: untyped
6147
- DUMMYABIL134_DUMMYABIL134: untyped
6148
- DUMMYABIL135_DUMMYABIL135: untyped
6149
- DUMMYABIL136_DUMMYABIL136: untyped
6150
- DUMMYABIL137_DUMMYABIL137: untyped
6151
- DUMMYABIL138_DUMMYABIL138: untyped
6152
- DUMMYABIL139_DUMMYABIL139: untyped
6153
- DUMMYABIL140_DUMMYABIL140: untyped
6154
- DUMMYABIL141_DUMMYABIL141: untyped
6155
- DUMMYABIL142_DUMMYABIL142: untyped
6156
- DUMMYABIL143_DUMMYABIL143: untyped
6157
- DUMMYABIL144_DUMMYABIL144: untyped
6158
- DUMMYABIL145_DUMMYABIL145: untyped
6159
- DUMMYABIL146_DUMMYABIL146: untyped
6160
- DUMMYABIL147_DUMMYABIL147: untyped
6161
- DUMMYABIL148_DUMMYABIL148: untyped
6162
- DUMMYABIL149_DUMMYABIL149: untyped
6163
- DUMMYABIL150_DUMMYABIL150: untyped
6164
- DUMMYABIL151_DUMMYABIL151: untyped
6165
- DUMMYABIL152_DUMMYABIL152: untyped
6166
- DUMMYABIL153_DUMMYABIL153: untyped
6167
- DUMMYABIL154_DUMMYABIL154: untyped
6168
- DUMMYABIL155_DUMMYABIL155: untyped
6169
- DUMMYABIL156_DUMMYABIL156: untyped
6170
- DUMMYABIL157_DUMMYABIL157: untyped
6171
- DUMMYABIL158_DUMMYABIL158: untyped
6172
- DUMMYABIL159_DUMMYABIL159: untyped
6173
- DUMMYABIL160_DUMMYABIL160: untyped
6174
- DUMMYABIL161_DUMMYABIL161: untyped
6175
- DUMMYABIL162_DUMMYABIL162: untyped
6176
- DUMMYABIL163_DUMMYABIL163: untyped
6177
- DUMMYABIL164_DUMMYABIL164: untyped
6178
- DUMMYABIL165_DUMMYABIL165: untyped
6179
- DUMMYABIL166_DUMMYABIL166: untyped
6180
- DUMMYABIL167_DUMMYABIL167: untyped
6181
- DUMMYABIL168_DUMMYABIL168: untyped
6182
- DUMMYABIL169_DUMMYABIL169: untyped
6183
- DUMMYABIL170_DUMMYABIL170: untyped
6184
- DUMMYABIL171_DUMMYABIL171: untyped
6185
- DUMMYABIL172_DUMMYABIL172: untyped
6186
- DUMMYABIL173_DUMMYABIL173: untyped
6187
- DUMMYABIL174_DUMMYABIL174: untyped
6188
- DUMMYABIL175_DUMMYABIL175: untyped
6189
- DUMMYABIL176_DUMMYABIL176: untyped
6190
- DUMMYABIL177_DUMMYABIL177: untyped
6191
- DUMMYABIL178_DUMMYABIL178: untyped
6192
- DUMMYABIL179_DUMMYABIL179: untyped
6193
- DUMMYABIL180_DUMMYABIL180: untyped
6194
- DUMMYABIL181_DUMMYABIL181: untyped
6195
- DUMMYABIL182_DUMMYABIL182: untyped
6196
- DUMMYABIL183_DUMMYABIL183: untyped
6197
- DUMMYABIL184_DUMMYABIL184: untyped
6198
- DUMMYABIL185_DUMMYABIL185: untyped
6199
- DUMMYABIL186_DUMMYABIL186: untyped
6200
- DUMMYABIL187_DUMMYABIL187: untyped
6201
- DUMMYABIL188_DUMMYABIL188: untyped
6202
- DUMMYABIL189_DUMMYABIL189: untyped
6203
- DUMMYABIL190_DUMMYABIL190: untyped
6204
- DUMMYABIL191_DUMMYABIL191: untyped
6205
- DUMMYABIL192_DUMMYABIL192: untyped
6206
- DUMMYABIL193_DUMMYABIL193: untyped
6207
- DUMMYABIL194_DUMMYABIL194: untyped
6208
- DUMMYABIL195_DUMMYABIL195: untyped
6209
- DUMMYABIL196_DUMMYABIL196: untyped
6210
- DUMMYABIL197_DUMMYABIL197: untyped
6211
- DUMMYABIL198_DUMMYABIL198: untyped
6212
- DUMMYABIL199_DUMMYABIL199: untyped
6213
- DUMMYABIL200_DUMMYABIL200: untyped
6214
- DUMMYABIL201_DUMMYABIL201: untyped
6215
- DUMMYABIL202_DUMMYABIL202: untyped
6216
- DUMMYABIL203_DUMMYABIL203: untyped
6217
- DUMMYABIL204_DUMMYABIL204: untyped
6218
- DUMMYABIL205_DUMMYABIL205: untyped
6219
- DUMMYABIL206_DUMMYABIL206: untyped
6220
- DUMMYABIL207_DUMMYABIL207: untyped
6221
- DUMMYABIL208_DUMMYABIL208: untyped
6222
- DUMMYABIL209_DUMMYABIL209: untyped
6223
- DUMMYABIL210_DUMMYABIL210: untyped
6224
- DUMMYABIL211_DUMMYABIL211: untyped
6225
- DUMMYABIL212_DUMMYABIL212: untyped
6226
- DUMMYABIL213_DUMMYABIL213: untyped
6227
- DUMMYABIL214_DUMMYABIL214: untyped
6228
- DUMMYABIL215_DUMMYABIL215: untyped
6229
- DUMMYABIL216_DUMMYABIL216: untyped
6230
- DUMMYABIL217_DUMMYABIL217: untyped
6231
- DUMMYABIL218_DUMMYABIL218: untyped
6232
- DUMMYABIL219_DUMMYABIL219: untyped
6233
- DUMMYABIL220_DUMMYABIL220: untyped
6234
- DUMMYABIL221_DUMMYABIL221: untyped
6235
- DUMMYABIL222_DUMMYABIL222: untyped
6236
- DUMMYABIL223_DUMMYABIL223: untyped
6237
- DUMMYABIL224_DUMMYABIL224: untyped
6238
- DUMMYABIL225_DUMMYABIL225: untyped
6239
- DUMMYABIL226_DUMMYABIL226: untyped
6240
- DUMMYABIL227_DUMMYABIL227: untyped
6241
- DUMMYABIL228_DUMMYABIL228: untyped
6242
- DUMMYABIL229_DUMMYABIL229: untyped
6243
- DUMMYABIL230_DUMMYABIL230: untyped
6244
- DUMMYABIL231_DUMMYABIL231: untyped
6245
- DUMMYABIL232_DUMMYABIL232: untyped
6246
- DUMMYABIL233_DUMMYABIL233: untyped
6247
- DUMMYABIL234_DUMMYABIL234: untyped
6248
- DUMMYABIL235_DUMMYABIL235: untyped
6249
- DUMMYABIL236_DUMMYABIL236: untyped
6250
- DUMMYABIL237_DUMMYABIL237: untyped
6251
- DUMMYABIL238_DUMMYABIL238: untyped
6252
- DUMMYABIL239_DUMMYABIL239: untyped
6253
- DUMMYABIL240_DUMMYABIL240: untyped
6254
- DUMMYABIL241_DUMMYABIL241: untyped
6255
- DUMMYABIL242_DUMMYABIL242: untyped
6256
- DUMMYABIL243_DUMMYABIL243: untyped
6257
- DUMMYABIL244_DUMMYABIL244: untyped
6258
- DUMMYABIL245_DUMMYABIL245: untyped
6259
- DUMMYABIL246_DUMMYABIL246: untyped
6260
- DUMMYABIL247_DUMMYABIL247: untyped
6261
- DUMMYABIL248_DUMMYABIL248: untyped
6262
- DUMMYABIL249_DUMMYABIL249: untyped
6263
- DUMMYABIL250_DUMMYABIL250: untyped
6264
- DUMMYABIL251_DUMMYABIL251: untyped
6265
- DUMMYABIL252_DUMMYABIL252: untyped
6266
- DUMMYABIL253_DUMMYABIL253: untyped
6267
- DUMMYABIL254_DUMMYABIL254: untyped
6268
- DUMMYABIL255_DUMMYABIL255: untyped
6269
- DUMMYABIL256_DUMMYABIL256: untyped
6270
- DUMMYABIL257_DUMMYABIL257: untyped
6271
- DUMMYABIL258_DUMMYABIL258: untyped
6272
- DUMMYABIL259_DUMMYABIL259: untyped
6273
- DUMMYABIL260_DUMMYABIL260: untyped
6274
- DUMMYABIL261_DUMMYABIL261: untyped
6275
- DUMMYABIL262_DUMMYABIL262: untyped
6276
- DUMMYABIL263_DUMMYABIL263: untyped
6277
- DUMMYABIL264_DUMMYABIL264: untyped
6278
- DUMMYABIL265_DUMMYABIL265: untyped
6279
- DUMMYABIL266_DUMMYABIL266: untyped
6280
- DUMMYABIL267_DUMMYABIL267: untyped
6281
- DUMMYABIL268_DUMMYABIL268: untyped
6282
- DUMMYABIL269_DUMMYABIL269: untyped
6283
- DUMMYABIL270_DUMMYABIL270: untyped
6284
- DUMMYABIL271_DUMMYABIL271: untyped
6285
- DUMMYABIL272_DUMMYABIL272: untyped
6286
- DUMMYABIL273_DUMMYABIL273: untyped
6287
- DUMMYABIL274_DUMMYABIL274: untyped
6288
- DUMMYABIL275_DUMMYABIL275: untyped
6289
- DUMMYABIL276_DUMMYABIL276: untyped
6290
- DUMMYABIL277_DUMMYABIL277: untyped
6291
- DUMMYABIL278_DUMMYABIL278: untyped
6292
- DUMMYABIL279_DUMMYABIL279: untyped
6293
- DUMMYABIL280_DUMMYABIL280: untyped
6294
- DUMMYABIL281_DUMMYABIL281: untyped
6295
- DUMMYABIL282_DUMMYABIL282: untyped
6296
- DUMMYABIL283_DUMMYABIL283: untyped
6297
- DUMMYABIL284_DUMMYABIL284: untyped
6298
- DUMMYABIL285_DUMMYABIL285: untyped
6299
- DUMMYABIL286_DUMMYABIL286: untyped
6300
- DUMMYABIL287_DUMMYABIL287: untyped
6301
- DUMMYABIL288_DUMMYABIL288: untyped
6302
- DUMMYABIL289_DUMMYABIL289: untyped
6303
- DUMMYABIL290_DUMMYABIL290: untyped
6304
- DUMMYABIL291_DUMMYABIL291: untyped
6305
- DUMMYABIL292_DUMMYABIL292: untyped
6306
- DUMMYABIL293_DUMMYABIL293: untyped
6307
- DUMMYABIL294_DUMMYABIL294: untyped
6308
- DUMMYABIL295_DUMMYABIL295: untyped
6169
+ MORPHTOCOLLAPSIBLEROCKTOWERDEBRISRAMPLEFTGREEN_CANCEL: untyped
6170
+ MORPHTOCOLLAPSIBLEROCKTOWERDEBRISRAMPRIGHTGREEN_CANCEL: untyped
6309
6171
  BATTERYOVERCHARGE_BATTERYOVERCHARGE: untyped
6310
- DUMMYABIL296_DUMMYABIL296: untyped
6311
6172
  AMORPHOUSARMORCLOUD_AMORPHOUSARMORCLOUD: untyped
6312
- DUMMYABIL297_DUMMYABIL297: untyped
6313
6173
  SHIELDBATTERYRECHARGEEX5_SHIELDBATTERYRECHARGE: untyped
6314
6174
  SHIELDBATTERYRECHARGEEX5_STOP: untyped
6315
- DUMMYABIL298_DUMMYABIL298: untyped
6316
- DUMMYABIL299_DUMMYABIL299: untyped
6317
- DUMMYABIL300_DUMMYABIL300: untyped
6318
- DUMMYABIL301_DUMMYABIL301: untyped
6319
- DUMMYABIL302_DUMMYABIL302: untyped
6320
6175
  MORPHTOBANELING_BANELING: untyped
6321
6176
  MORPHTOBANELING_CANCEL: untyped
6322
- MORPHTOCOLLAPSIBLEROCKTOWERDEBRISRAMPLEFTGREEN_CANCEL: untyped
6323
- MORPHTOCOLLAPSIBLEROCKTOWERDEBRISRAMPRIGHTGREEN_CANCEL: untyped
6324
6177
  MOTHERSHIPCLOAK_ORACLECLOAKFIELD: untyped
6325
6178
 
6326
6179
  # sord omit - no YARD return type given, using untyped
@@ -6646,15 +6499,15 @@ module Api
6646
6499
  DIGGINGCLAWS: untyped
6647
6500
  CARRIERCARRIERCAPACITY: untyped
6648
6501
  CARRIERLEASHRANGEUPGRADE: untyped
6502
+ HURRICANETHRUSTERS: untyped
6649
6503
  TEMPESTGROUNDATTACKUPGRADE: untyped
6650
6504
  MICROBIALSHROUD: untyped
6505
+ INTERFERENCEMATRIX: untyped
6651
6506
  SUNDERINGIMPACT: untyped
6652
6507
  AMPLIFIEDSHIELDING: untyped
6653
6508
  PSIONICAMPLIFIERS: untyped
6654
6509
  SECRETEDCOATING: untyped
6655
6510
  ENHANCEDSHOCKWAVES: untyped
6656
- HURRICANETHRUSTERS: untyped
6657
- INTERFERENCEMATRIX: untyped
6658
6511
 
6659
6512
  # sord omit - no YARD return type given, using untyped
6660
6513
  def self._330MMBARRAGECANNONS: () -> untyped
@@ -8650,64 +8503,12 @@ module Api
8650
8503
  MINERALFIELD450: untyped
8651
8504
  MINERALFIELDOPAQUE: untyped
8652
8505
  MINERALFIELDOPAQUE900: untyped
8653
- MECHAZERGLINGACGLUESCREENDUMMY_2: untyped
8654
- MECHABANELINGACGLUESCREENDUMMY_2: untyped
8655
- MECHAHYDRALISKACGLUESCREENDUMMY_2: untyped
8656
- MECHAINFESTORACGLUESCREENDUMMY_2: untyped
8657
- MECHACORRUPTORACGLUESCREENDUMMY_2: untyped
8658
- MECHAULTRALISKACGLUESCREENDUMMY_2: untyped
8659
- MECHAOVERSEERACGLUESCREENDUMMY_2: untyped
8660
- MECHALURKERACGLUESCREENDUMMY_2: untyped
8661
- MECHABATTLECARRIERLORDACGLUESCREENDUMMY_2: untyped
8662
- MECHASPINECRAWLERACGLUESCREENDUMMY_2: untyped
8663
- MECHASPORECRAWLERACGLUESCREENDUMMY_2: untyped
8664
- TROOPERMENGSKACGLUESCREENDUMMY_2: untyped
8665
- MEDIVACMENGSKACGLUESCREENDUMMY_2: untyped
8666
- BLIMPMENGSKACGLUESCREENDUMMY_2: untyped
8667
- MARAUDERMENGSKACGLUESCREENDUMMY_2: untyped
8668
- GHOSTMENGSKACGLUESCREENDUMMY_2: untyped
8669
- SIEGETANKMENGSKACGLUESCREENDUMMY_2: untyped
8670
- THORMENGSKACGLUESCREENDUMMY_2: untyped
8671
- VIKINGMENGSKACGLUESCREENDUMMY_2: untyped
8672
- BATTLECRUISERMENGSKACGLUESCREENDUMMY_2: untyped
8673
- BUNKERDEPOTMENGSKACGLUESCREENDUMMY_2: untyped
8674
- MISSILETURRETMENGSKACGLUESCREENDUMMY_2: untyped
8675
- ARTILLERYMENGSKACGLUESCREENDUMMY_2: untyped
8676
- LOADOUTSPRAY1_2: untyped
8677
- LOADOUTSPRAY2_2: untyped
8678
- LOADOUTSPRAY3_2: untyped
8679
- LOADOUTSPRAY4_2: untyped
8680
- LOADOUTSPRAY5_2: untyped
8681
- LOADOUTSPRAY6_2: untyped
8682
- LOADOUTSPRAY7_2: untyped
8683
- LOADOUTSPRAY8_2: untyped
8684
- LOADOUTSPRAY9_2: untyped
8685
- LOADOUTSPRAY10_2: untyped
8686
- LOADOUTSPRAY11_2: untyped
8687
- LOADOUTSPRAY12_2: untyped
8688
- LOADOUTSPRAY13_2: untyped
8689
- LOADOUTSPRAY14_2: untyped
8690
8506
  COLLAPSIBLEROCKTOWERDEBRISRAMPLEFTGREEN: untyped
8691
8507
  COLLAPSIBLEROCKTOWERDEBRISRAMPRIGHTGREEN: untyped
8692
8508
  COLLAPSIBLEROCKTOWERPUSHUNITRAMPLEFTGREEN: untyped
8693
8509
  COLLAPSIBLEROCKTOWERPUSHUNITRAMPRIGHTGREEN: untyped
8694
8510
  COLLAPSIBLEROCKTOWERRAMPLEFTGREEN: untyped
8695
8511
  COLLAPSIBLEROCKTOWERRAMPRIGHTGREEN: untyped
8696
- DUMMYUNIT000: untyped
8697
- DUMMYUNIT001: untyped
8698
- DUMMYUNIT002: untyped
8699
- DUMMYUNIT003: untyped
8700
- DUMMYUNIT004: untyped
8701
- DUMMYUNIT005: untyped
8702
- DUMMYUNIT006: untyped
8703
- DUMMYUNIT007: untyped
8704
- DUMMYUNIT008: untyped
8705
- DUMMYUNIT009: untyped
8706
- DUMMYUNIT010: untyped
8707
- DUMMYUNIT011: untyped
8708
- DUMMYUNIT012: untyped
8709
- DUMMYUNIT013: untyped
8710
- DUMMYUNIT014: untyped
8711
8512
 
8712
8513
  # sord omit - no YARD return type given, using untyped
8713
8514
  def self._4SLOTBAG: () -> untyped
@@ -8749,6 +8550,15 @@ module Api
8749
8550
  # sord omit - no YARD return type given, using untyped
8750
8551
  def hash: () -> untyped
8751
8552
 
8553
+ # Returns an integer unique identifier
8554
+ # If the unit goes out of vision and is snapshot-able, they get a random id
8555
+ # - Such a unit gets the same unit tag when it re-enters vision
8556
+ def tag: () -> Integer
8557
+
8558
+ # sord infer - inferred type of parameter "tag" as Integer using getter's return type
8559
+ # Sets unit tag
8560
+ def tag=: (Integer tag) -> Integer
8561
+
8752
8562
  # Returns static [Api::UnitTypeData] for a unit
8753
8563
  def unit_data: () -> Api::UnitTypeData
8754
8564
 
@@ -8827,6 +8637,15 @@ module Api
8827
8637
  # _@return_ — whether unit has attribute :Summoned
8828
8638
  def is_summoned?: () -> bool
8829
8639
 
8640
+ # Whether unit is effected by buff_id
8641
+ #
8642
+ # _@param_ `buff_id`
8643
+ #
8644
+ # ```ruby
8645
+ # unit.has_buff??(Api::BuffId::QUEENSPAWNLARVATIMER)
8646
+ # ```
8647
+ def has_buff?: (Integer buff_id) -> bool
8648
+
8830
8649
  # sord omit - no YARD return type given, using untyped
8831
8650
  # Performs action on this unit
8832
8651
  #
@@ -8883,7 +8702,7 @@ module Api
8883
8702
  # sord omit - no YARD return type given, using untyped
8884
8703
  # Builds target unit type, i.e. issuing a build command to worker.build(...Api::UnitTypeId::BARRACKS)
8885
8704
  #
8886
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
8705
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
8887
8706
  #
8888
8707
  # _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
8889
8708
  #
@@ -8901,7 +8720,7 @@ module Api
8901
8720
  # sord omit - no YARD return type given, using untyped
8902
8721
  # Research a specific upgrade
8903
8722
  #
8904
- # _@param_ `upgrade_id` — Api::UnitTypeId the unit type which will do the creation
8723
+ # _@param_ `upgrade_id` — Api::UnitTypeId the unit type you wish to research
8905
8724
  #
8906
8725
  # _@param_ `queue_command` — shift+command
8907
8726
  def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
@@ -8978,6 +8797,12 @@ module Api
8978
8797
  # ```
8979
8798
  def can_attack?: (unit: Api::Unit, ?weapon_index: Integer, ?ability_id: Integer?) -> bool
8980
8799
 
8800
+ # Returns whether this unit has an ability available
8801
+ # Queries API if necessary
8802
+ #
8803
+ # _@param_ `ability_id`
8804
+ def ability_available?: (Integer ability_id) -> bool
8805
+
8981
8806
  # sord warn - Api::unit wasn't able to be resolved to a constant in this project
8982
8807
  # sord warn - Api::Weapon wasn't able to be resolved to a constant in this project
8983
8808
  # Checks whether a weapon can target a unit
@@ -9052,6 +8877,22 @@ module Api
9052
8877
  # For Terran builds a tech lab add-on on the current structure
9053
8878
  def build_tech_lab: (?queue_command: untyped) -> void
9054
8879
 
8880
+ # sord omit - no YARD return type given, using untyped
8881
+ # Warps in unit type at target (location or pylon)
8882
+ # Only works if the source is a Warp Gate
8883
+ #
8884
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
8885
+ #
8886
+ # _@param_ `target` — a point, which should be inside an energy source
8887
+ #
8888
+ # _@param_ `queue_command` — shift+command
8889
+ def warp: (unit_type_id: Integer, target: Api::Point2D, ?queue_command: bool) -> untyped
8890
+
8891
+ # Returns true if unit does not have orders
8892
+ #
8893
+ # _@return_ — whether unit is idle
8894
+ def is_idle?: () -> bool
8895
+
9055
8896
  # sord omit - no YARD type given for "abilities", using untyped
9056
8897
  # sord omit - no YARD type given for "target:", using untyped
9057
8898
  # Reduces repetition in the is_*action*?(target:) methods
@@ -9151,6 +8992,7 @@ module Api
9151
8992
  # Protobuf virtual class.
9152
8993
  class Point < Google::Protobuf::AbstractMessage
9153
8994
  include Sc2::Position
8995
+ include Api::PointDistanceExtension
9154
8996
  include Api::PointExtension
9155
8997
  extend Api::PointExtension::ClassMethods
9156
8998
 
@@ -9176,6 +9018,13 @@ module Api
9176
9018
  # Creates a Point2D using x and y
9177
9019
  def to_p2d: () -> Api::Point2D
9178
9020
 
9021
+ # sord omit - no YARD type given for "other", using untyped
9022
+ # sord omit - no YARD return type given, using untyped
9023
+ # Loose equality matches on floats x and y.
9024
+ # We never check z-axis, because the map is single-level.
9025
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
9026
+ def ==: (untyped other) -> untyped
9027
+
9179
9028
  # A new point representing the sum of this point and the other point.
9180
9029
  #
9181
9030
  # _@param_ `other` — The other point/number to add.
@@ -9196,15 +9045,26 @@ module Api
9196
9045
  # _@return_ — A new point representing this point divided by the scalar.
9197
9046
  def divide: (Float scalar) -> Api::Point2D
9198
9047
 
9199
- # sord omit - no YARD return type given, using untyped
9200
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
9201
- # We send method missing ourselves when y to fix this chain.
9202
- def y: () -> untyped
9048
+ # Returns x coordinate
9049
+ def x: () -> Float
9050
+
9051
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
9052
+ # Sets x coordinate
9053
+ def x=: (Float x) -> Float
9054
+
9055
+ # Returns y coordinate
9056
+ def y: () -> Float
9057
+
9058
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
9059
+ # Sets y coordinate
9060
+ def y=: (Float y) -> Float
9203
9061
 
9204
9062
  # Randomly adjusts both x and y by a range of: -offset..offset
9205
9063
  #
9206
9064
  # _@param_ `offset`
9207
- def random_offset: (Float offset) -> Api::Point2D
9065
+ #
9066
+ # _@return_ — new Position
9067
+ def random_offset: (Float offset) -> Sc2::Position
9208
9068
 
9209
9069
  # sord omit - no YARD type given for "offset", using untyped
9210
9070
  # Changes this point's x and y by the supplied offset
@@ -9216,15 +9076,15 @@ module Api
9216
9076
  # sord omit - no YARD type given for "y", using untyped
9217
9077
  # Creates a new point with x and y which is offset
9218
9078
  #
9219
- # _@return_ — self
9220
- def offset: (untyped x, untyped y) -> Api::Point2D
9079
+ # _@return_ — new Position
9080
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
9221
9081
 
9222
9082
  # sord omit - no YARD type given for "x", using untyped
9223
9083
  # sord omit - no YARD type given for "y", using untyped
9224
9084
  # Changes this point's x and y by the supplied offset
9225
9085
  #
9226
9086
  # _@return_ — self
9227
- def offset!: (untyped x, untyped y) -> Sc2::Position
9087
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
9228
9088
 
9229
9089
  # For vector returns the magnitude, synonymous with Math.hypot
9230
9090
  def magnitude: () -> Float
@@ -9297,6 +9157,7 @@ module Api
9297
9157
  class Point2D < Google::Protobuf::AbstractMessage
9298
9158
  include Sc2::Position
9299
9159
  include Api::Point2DExtension
9160
+ include Api::PointDistanceExtension
9300
9161
  extend Api::Point2DExtension::ClassMethods
9301
9162
 
9302
9163
  # sord omit - no YARD type given for "x", using untyped
@@ -9316,7 +9177,14 @@ module Api
9316
9177
 
9317
9178
  # sord omit - no YARD type given for "z:", using untyped
9318
9179
  # Create a new 3d Point, by adding a y axis.
9319
- def to_3d: (z: untyped) -> Api::Point
9180
+ def to_3d: (?z: untyped) -> Api::Point
9181
+
9182
+ # sord omit - no YARD type given for "other", using untyped
9183
+ # sord omit - no YARD return type given, using untyped
9184
+ # Loose equality matches on floats x and y.
9185
+ # We never check z-axis, because the map is single-level.
9186
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
9187
+ def ==: (untyped other) -> untyped
9320
9188
 
9321
9189
  # A new point representing the sum of this point and the other point.
9322
9190
  #
@@ -9338,15 +9206,26 @@ module Api
9338
9206
  # _@return_ — A new point representing this point divided by the scalar.
9339
9207
  def divide: (Float scalar) -> Api::Point2D
9340
9208
 
9341
- # sord omit - no YARD return type given, using untyped
9342
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
9343
- # We send method missing ourselves when y to fix this chain.
9344
- def y: () -> untyped
9209
+ # Returns x coordinate
9210
+ def x: () -> Float
9211
+
9212
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
9213
+ # Sets x coordinate
9214
+ def x=: (Float x) -> Float
9215
+
9216
+ # Returns y coordinate
9217
+ def y: () -> Float
9218
+
9219
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
9220
+ # Sets y coordinate
9221
+ def y=: (Float y) -> Float
9345
9222
 
9346
9223
  # Randomly adjusts both x and y by a range of: -offset..offset
9347
9224
  #
9348
9225
  # _@param_ `offset`
9349
- def random_offset: (Float offset) -> Api::Point2D
9226
+ #
9227
+ # _@return_ — new Position
9228
+ def random_offset: (Float offset) -> Sc2::Position
9350
9229
 
9351
9230
  # sord omit - no YARD type given for "offset", using untyped
9352
9231
  # Changes this point's x and y by the supplied offset
@@ -9358,15 +9237,15 @@ module Api
9358
9237
  # sord omit - no YARD type given for "y", using untyped
9359
9238
  # Creates a new point with x and y which is offset
9360
9239
  #
9361
- # _@return_ — self
9362
- def offset: (untyped x, untyped y) -> Api::Point2D
9240
+ # _@return_ — new Position
9241
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
9363
9242
 
9364
9243
  # sord omit - no YARD type given for "x", using untyped
9365
9244
  # sord omit - no YARD type given for "y", using untyped
9366
9245
  # Changes this point's x and y by the supplied offset
9367
9246
  #
9368
9247
  # _@return_ — self
9369
- def offset!: (untyped x, untyped y) -> Sc2::Position
9248
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
9370
9249
 
9371
9250
  # For vector returns the magnitude, synonymous with Math.hypot
9372
9251
  def magnitude: () -> Float
@@ -9438,6 +9317,14 @@ module Api
9438
9317
  # Protobuf virtual class.
9439
9318
  class PointI < Google::Protobuf::AbstractMessage
9440
9319
  include Sc2::Position
9320
+ include Api::PointDistanceExtension
9321
+
9322
+ # sord omit - no YARD type given for "other", using untyped
9323
+ # sord omit - no YARD return type given, using untyped
9324
+ # Loose equality matches on floats x and y.
9325
+ # We never check z-axis, because the map is single-level.
9326
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
9327
+ def ==: (untyped other) -> untyped
9441
9328
 
9442
9329
  # A new point representing the sum of this point and the other point.
9443
9330
  #
@@ -9459,15 +9346,26 @@ module Api
9459
9346
  # _@return_ — A new point representing this point divided by the scalar.
9460
9347
  def divide: (Float scalar) -> Api::Point2D
9461
9348
 
9462
- # sord omit - no YARD return type given, using untyped
9463
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
9464
- # We send method missing ourselves when y to fix this chain.
9465
- def y: () -> untyped
9349
+ # Returns x coordinate
9350
+ def x: () -> Float
9351
+
9352
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
9353
+ # Sets x coordinate
9354
+ def x=: (Float x) -> Float
9355
+
9356
+ # Returns y coordinate
9357
+ def y: () -> Float
9358
+
9359
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
9360
+ # Sets y coordinate
9361
+ def y=: (Float y) -> Float
9466
9362
 
9467
9363
  # Randomly adjusts both x and y by a range of: -offset..offset
9468
9364
  #
9469
9365
  # _@param_ `offset`
9470
- def random_offset: (Float offset) -> Api::Point2D
9366
+ #
9367
+ # _@return_ — new Position
9368
+ def random_offset: (Float offset) -> Sc2::Position
9471
9369
 
9472
9370
  # sord omit - no YARD type given for "offset", using untyped
9473
9371
  # Changes this point's x and y by the supplied offset
@@ -9479,15 +9377,15 @@ module Api
9479
9377
  # sord omit - no YARD type given for "y", using untyped
9480
9378
  # Creates a new point with x and y which is offset
9481
9379
  #
9482
- # _@return_ — self
9483
- def offset: (untyped x, untyped y) -> Api::Point2D
9380
+ # _@return_ — new Position
9381
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
9484
9382
 
9485
9383
  # sord omit - no YARD type given for "x", using untyped
9486
9384
  # sord omit - no YARD type given for "y", using untyped
9487
9385
  # Changes this point's x and y by the supplied offset
9488
9386
  #
9489
9387
  # _@return_ — self
9490
- def offset!: (untyped x, untyped y) -> Sc2::Position
9388
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
9491
9389
 
9492
9390
  # For vector returns the magnitude, synonymous with Math.hypot
9493
9391
  def magnitude: () -> Float
@@ -9571,6 +9469,13 @@ module Api
9571
9469
  # ```
9572
9470
  def self.[]: (untyped x, untyped y, untyped z) -> Api::Point
9573
9471
 
9472
+ # sord omit - no YARD type given for "other", using untyped
9473
+ # sord omit - no YARD return type given, using untyped
9474
+ # Loose equality matches on floats x and y.
9475
+ # We never check z-axis, because the map is single-level.
9476
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
9477
+ def ==: (untyped other) -> untyped
9478
+
9574
9479
  # A new point representing the sum of this point and the other point.
9575
9480
  #
9576
9481
  # _@param_ `other` — The other point/number to add.
@@ -9591,15 +9496,26 @@ module Api
9591
9496
  # _@return_ — A new point representing this point divided by the scalar.
9592
9497
  def divide: (Float scalar) -> Api::Point2D
9593
9498
 
9594
- # sord omit - no YARD return type given, using untyped
9595
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
9596
- # We send method missing ourselves when y to fix this chain.
9597
- def y: () -> untyped
9499
+ # Returns x coordinate
9500
+ def x: () -> Float
9501
+
9502
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
9503
+ # Sets x coordinate
9504
+ def x=: (Float x) -> Float
9505
+
9506
+ # Returns y coordinate
9507
+ def y: () -> Float
9508
+
9509
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
9510
+ # Sets y coordinate
9511
+ def y=: (Float y) -> Float
9598
9512
 
9599
9513
  # Randomly adjusts both x and y by a range of: -offset..offset
9600
9514
  #
9601
9515
  # _@param_ `offset`
9602
- def random_offset: (Float offset) -> Api::Point2D
9516
+ #
9517
+ # _@return_ — new Position
9518
+ def random_offset: (Float offset) -> Sc2::Position
9603
9519
 
9604
9520
  # sord omit - no YARD type given for "offset", using untyped
9605
9521
  # Changes this point's x and y by the supplied offset
@@ -9611,15 +9527,15 @@ module Api
9611
9527
  # sord omit - no YARD type given for "y", using untyped
9612
9528
  # Creates a new point with x and y which is offset
9613
9529
  #
9614
- # _@return_ — self
9615
- def offset: (untyped x, untyped y) -> Api::Point2D
9530
+ # _@return_ — new Position
9531
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
9616
9532
 
9617
9533
  # sord omit - no YARD type given for "x", using untyped
9618
9534
  # sord omit - no YARD type given for "y", using untyped
9619
9535
  # Changes this point's x and y by the supplied offset
9620
9536
  #
9621
9537
  # _@return_ — self
9622
- def offset!: (untyped x, untyped y) -> Sc2::Position
9538
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
9623
9539
 
9624
9540
  # For vector returns the magnitude, synonymous with Math.hypot
9625
9541
  def magnitude: () -> Float
@@ -9691,6 +9607,14 @@ module Api
9691
9607
  # Protobuf virtual class.
9692
9608
  class Size2DI < Google::Protobuf::AbstractMessage
9693
9609
  include Sc2::Position
9610
+ include Api::PointDistanceExtension
9611
+
9612
+ # sord omit - no YARD type given for "other", using untyped
9613
+ # sord omit - no YARD return type given, using untyped
9614
+ # Loose equality matches on floats x and y.
9615
+ # We never check z-axis, because the map is single-level.
9616
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
9617
+ def ==: (untyped other) -> untyped
9694
9618
 
9695
9619
  # A new point representing the sum of this point and the other point.
9696
9620
  #
@@ -9712,15 +9636,26 @@ module Api
9712
9636
  # _@return_ — A new point representing this point divided by the scalar.
9713
9637
  def divide: (Float scalar) -> Api::Point2D
9714
9638
 
9715
- # sord omit - no YARD return type given, using untyped
9716
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
9717
- # We send method missing ourselves when y to fix this chain.
9718
- def y: () -> untyped
9639
+ # Returns x coordinate
9640
+ def x: () -> Float
9641
+
9642
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
9643
+ # Sets x coordinate
9644
+ def x=: (Float x) -> Float
9645
+
9646
+ # Returns y coordinate
9647
+ def y: () -> Float
9648
+
9649
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
9650
+ # Sets y coordinate
9651
+ def y=: (Float y) -> Float
9719
9652
 
9720
9653
  # Randomly adjusts both x and y by a range of: -offset..offset
9721
9654
  #
9722
9655
  # _@param_ `offset`
9723
- def random_offset: (Float offset) -> Api::Point2D
9656
+ #
9657
+ # _@return_ — new Position
9658
+ def random_offset: (Float offset) -> Sc2::Position
9724
9659
 
9725
9660
  # sord omit - no YARD type given for "offset", using untyped
9726
9661
  # Changes this point's x and y by the supplied offset
@@ -9732,15 +9667,15 @@ module Api
9732
9667
  # sord omit - no YARD type given for "y", using untyped
9733
9668
  # Creates a new point with x and y which is offset
9734
9669
  #
9735
- # _@return_ — self
9736
- def offset: (untyped x, untyped y) -> Api::Point2D
9670
+ # _@return_ — new Position
9671
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
9737
9672
 
9738
9673
  # sord omit - no YARD type given for "x", using untyped
9739
9674
  # sord omit - no YARD type given for "y", using untyped
9740
9675
  # Changes this point's x and y by the supplied offset
9741
9676
  #
9742
9677
  # _@return_ — self
9743
- def offset!: (untyped x, untyped y) -> Sc2::Position
9678
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
9744
9679
 
9745
9680
  # For vector returns the magnitude, synonymous with Math.hypot
9746
9681
  def magnitude: () -> Float
@@ -9816,6 +9751,15 @@ module Api
9816
9751
  # sord omit - no YARD return type given, using untyped
9817
9752
  def hash: () -> untyped
9818
9753
 
9754
+ # Returns an integer unique identifier
9755
+ # If the unit goes out of vision and is snapshot-able, they get a random id
9756
+ # - Such a unit gets the same unit tag when it re-enters vision
9757
+ def tag: () -> Integer
9758
+
9759
+ # sord infer - inferred type of parameter "tag" as Integer using getter's return type
9760
+ # Sets unit tag
9761
+ def tag=: (Integer tag) -> Integer
9762
+
9819
9763
  # Returns static [Api::UnitTypeData] for a unit
9820
9764
  def unit_data: () -> Api::UnitTypeData
9821
9765
 
@@ -9894,6 +9838,15 @@ module Api
9894
9838
  # _@return_ — whether unit has attribute :Summoned
9895
9839
  def is_summoned?: () -> bool
9896
9840
 
9841
+ # Whether unit is effected by buff_id
9842
+ #
9843
+ # _@param_ `buff_id`
9844
+ #
9845
+ # ```ruby
9846
+ # unit.has_buff??(Api::BuffId::QUEENSPAWNLARVATIMER)
9847
+ # ```
9848
+ def has_buff?: (Integer buff_id) -> bool
9849
+
9897
9850
  # sord omit - no YARD return type given, using untyped
9898
9851
  # Performs action on this unit
9899
9852
  #
@@ -9950,7 +9903,7 @@ module Api
9950
9903
  # sord omit - no YARD return type given, using untyped
9951
9904
  # Builds target unit type, i.e. issuing a build command to worker.build(...Api::UnitTypeId::BARRACKS)
9952
9905
  #
9953
- # _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
9906
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
9954
9907
  #
9955
9908
  # _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
9956
9909
  #
@@ -9968,7 +9921,7 @@ module Api
9968
9921
  # sord omit - no YARD return type given, using untyped
9969
9922
  # Research a specific upgrade
9970
9923
  #
9971
- # _@param_ `upgrade_id` — Api::UnitTypeId the unit type which will do the creation
9924
+ # _@param_ `upgrade_id` — Api::UnitTypeId the unit type you wish to research
9972
9925
  #
9973
9926
  # _@param_ `queue_command` — shift+command
9974
9927
  def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
@@ -10045,6 +9998,12 @@ module Api
10045
9998
  # ```
10046
9999
  def can_attack?: (unit: Api::Unit, ?weapon_index: Integer, ?ability_id: Integer?) -> bool
10047
10000
 
10001
+ # Returns whether this unit has an ability available
10002
+ # Queries API if necessary
10003
+ #
10004
+ # _@param_ `ability_id`
10005
+ def ability_available?: (Integer ability_id) -> bool
10006
+
10048
10007
  # sord warn - Api::unit wasn't able to be resolved to a constant in this project
10049
10008
  # sord warn - Api::Weapon wasn't able to be resolved to a constant in this project
10050
10009
  # Checks whether a weapon can target a unit
@@ -10119,6 +10078,22 @@ module Api
10119
10078
  # For Terran builds a tech lab add-on on the current structure
10120
10079
  def build_tech_lab: (?queue_command: untyped) -> void
10121
10080
 
10081
+ # sord omit - no YARD return type given, using untyped
10082
+ # Warps in unit type at target (location or pylon)
10083
+ # Only works if the source is a Warp Gate
10084
+ #
10085
+ # _@param_ `unit_type_id` — Api::UnitTypeId the unit type you wish to build
10086
+ #
10087
+ # _@param_ `target` — a point, which should be inside an energy source
10088
+ #
10089
+ # _@param_ `queue_command` — shift+command
10090
+ def warp: (unit_type_id: Integer, target: Api::Point2D, ?queue_command: bool) -> untyped
10091
+
10092
+ # Returns true if unit does not have orders
10093
+ #
10094
+ # _@return_ — whether unit is idle
10095
+ def is_idle?: () -> bool
10096
+
10122
10097
  # sord omit - no YARD type given for "abilities", using untyped
10123
10098
  # sord omit - no YARD type given for "target:", using untyped
10124
10099
  # Reduces repetition in the is_*action*?(target:) methods
@@ -10127,7 +10102,83 @@ module Api
10127
10102
 
10128
10103
  # Protobuf virtual class.
10129
10104
  class UnitTypeData < Google::Protobuf::AbstractMessage
10105
+ include Api::UnitTypeExtension
10130
10106
  include Api::UnitTypeDataExtension
10107
+
10108
+ # sord omit - no YARD return type given, using untyped
10109
+ def mood: () -> untyped
10110
+ end
10111
+
10112
+ # Protobuf virtual class.
10113
+ class AvailableAbility < Google::Protobuf::AbstractMessage
10114
+ include Api::AbilityRemapable
10115
+
10116
+ # Ability Id. The generic id or "remapid".
10117
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10118
+ def ability_id: () -> Integer
10119
+ end
10120
+
10121
+ # Protobuf virtual class.
10122
+ class UnitOrder < Google::Protobuf::AbstractMessage
10123
+ include Api::AbilityRemapable
10124
+
10125
+ # Ability Id. The generic id or "remapid".
10126
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10127
+ def ability_id: () -> Integer
10128
+ end
10129
+
10130
+ # Protobuf virtual class.
10131
+ class ActionRawUnitCommand < Google::Protobuf::AbstractMessage
10132
+ include Api::AbilityRemapable
10133
+
10134
+ # Ability Id. The generic id or "remapid".
10135
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10136
+ def ability_id: () -> Integer
10137
+ end
10138
+
10139
+ # Protobuf virtual class.
10140
+ class ActionRawToggleAutocast < Google::Protobuf::AbstractMessage
10141
+ include Api::AbilityRemapable
10142
+
10143
+ # Ability Id. The generic id or "remapid".
10144
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10145
+ def ability_id: () -> Integer
10146
+ end
10147
+
10148
+ # Protobuf virtual class.
10149
+ class ActionError < Google::Protobuf::AbstractMessage
10150
+ include Api::AbilityRemapable
10151
+
10152
+ # Ability Id. The generic id or "remapid".
10153
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10154
+ def ability_id: () -> Integer
10155
+ end
10156
+
10157
+ # Protobuf virtual class.
10158
+ class ActionSpatialUnitCommand < Google::Protobuf::AbstractMessage
10159
+ include Api::AbilityRemapable
10160
+
10161
+ # Ability Id. The generic id or "remapid".
10162
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10163
+ def ability_id: () -> Integer
10164
+ end
10165
+
10166
+ # Protobuf virtual class.
10167
+ class BuildItem < Google::Protobuf::AbstractMessage
10168
+ include Api::AbilityRemapable
10169
+
10170
+ # Ability Id. The generic id or "remapid".
10171
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10172
+ def ability_id: () -> Integer
10173
+ end
10174
+
10175
+ # Protobuf virtual class.
10176
+ class ActionToggleAutocast < Google::Protobuf::AbstractMessage
10177
+ include Api::AbilityRemapable
10178
+
10179
+ # Ability Id. The generic id or "remapid".
10180
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10181
+ def ability_id: () -> Integer
10131
10182
  end
10132
10183
 
10133
10184
  # Protobuf virtual enum.
@@ -10156,7 +10207,7 @@ module Api
10156
10207
 
10157
10208
  # sord omit - no YARD type given for "z:", using untyped
10158
10209
  # Create a new 3d Point, by adding a y axis.
10159
- def to_3d: (z: untyped) -> Api::Point
10210
+ def to_3d: (?z: untyped) -> Api::Point
10160
10211
 
10161
10212
  # Adds additional functionality to message class Api::Point2D
10162
10213
  module ClassMethods
@@ -10171,10 +10222,23 @@ module Api
10171
10222
  end
10172
10223
  end
10173
10224
 
10225
+ # Adds additional functionality to message object Api::Unit
10226
+ module UnitTypeExtension
10227
+ # sord omit - no YARD return type given, using untyped
10228
+ def mood: () -> untyped
10229
+ end
10230
+
10174
10231
  # Adds additional functionality to message object Api::PowerSource
10175
10232
  module PowerSourceExtension
10176
10233
  include Sc2::Position
10177
10234
 
10235
+ # sord omit - no YARD type given for "other", using untyped
10236
+ # sord omit - no YARD return type given, using untyped
10237
+ # Loose equality matches on floats x and y.
10238
+ # We never check z-axis, because the map is single-level.
10239
+ # TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
10240
+ def ==: (untyped other) -> untyped
10241
+
10178
10242
  # A new point representing the sum of this point and the other point.
10179
10243
  #
10180
10244
  # _@param_ `other` — The other point/number to add.
@@ -10195,15 +10259,26 @@ module Api
10195
10259
  # _@return_ — A new point representing this point divided by the scalar.
10196
10260
  def divide: (Float scalar) -> Api::Point2D
10197
10261
 
10198
- # sord omit - no YARD return type given, using untyped
10199
- # Bug: Psych implements method 'y' on Kernel, but protobuf uses method_missing to read AbstractMethod
10200
- # We send method missing ourselves when y to fix this chain.
10201
- def y: () -> untyped
10262
+ # Returns x coordinate
10263
+ def x: () -> Float
10264
+
10265
+ # sord infer - inferred type of parameter "x" as Float using getter's return type
10266
+ # Sets x coordinate
10267
+ def x=: (Float x) -> Float
10268
+
10269
+ # Returns y coordinate
10270
+ def y: () -> Float
10271
+
10272
+ # sord infer - inferred type of parameter "y" as Float using getter's return type
10273
+ # Sets y coordinate
10274
+ def y=: (Float y) -> Float
10202
10275
 
10203
10276
  # Randomly adjusts both x and y by a range of: -offset..offset
10204
10277
  #
10205
10278
  # _@param_ `offset`
10206
- def random_offset: (Float offset) -> Api::Point2D
10279
+ #
10280
+ # _@return_ — new Position
10281
+ def random_offset: (Float offset) -> Sc2::Position
10207
10282
 
10208
10283
  # sord omit - no YARD type given for "offset", using untyped
10209
10284
  # Changes this point's x and y by the supplied offset
@@ -10215,15 +10290,15 @@ module Api
10215
10290
  # sord omit - no YARD type given for "y", using untyped
10216
10291
  # Creates a new point with x and y which is offset
10217
10292
  #
10218
- # _@return_ — self
10219
- def offset: (untyped x, untyped y) -> Api::Point2D
10293
+ # _@return_ — new Position
10294
+ def offset: (?untyped x, ?untyped y) -> Sc2::Position
10220
10295
 
10221
10296
  # sord omit - no YARD type given for "x", using untyped
10222
10297
  # sord omit - no YARD type given for "y", using untyped
10223
10298
  # Changes this point's x and y by the supplied offset
10224
10299
  #
10225
10300
  # _@return_ — self
10226
- def offset!: (untyped x, untyped y) -> Sc2::Position
10301
+ def offset!: (?untyped x, ?untyped y) -> Sc2::Position
10227
10302
 
10228
10303
  # For vector returns the magnitude, synonymous with Math.hypot
10229
10304
  def magnitude: () -> Float
@@ -10305,6 +10380,10 @@ module Api
10305
10380
  end
10306
10381
  end
10307
10382
 
10383
+ # Adds additional functionality to message object Api::Unit
10384
+ module PointDistanceExtension
10385
+ end
10386
+
10308
10387
  # Adds additional functionality to message object Api::UnitTypeData
10309
10388
  module UnitTypeDataExtension
10310
10389
  # Sum of all morphs mineral cost
@@ -10320,6 +10399,13 @@ module Api
10320
10399
  # _@return_ — sum of vespene gas costs
10321
10400
  attr_accessor vespene_cost_sum: (Integer | untyped)
10322
10401
  end
10402
+
10403
+ # This module make sure that a read from method ability_id always returns the proper source id
10404
+ module AbilityRemapable
10405
+ # Ability Id. The generic id or "remapid".
10406
+ # i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
10407
+ def ability_id: () -> Integer
10408
+ end
10323
10409
  end
10324
10410
 
10325
10411
  # Array extensions