sc2ai 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/data.json +1 -1
- data/data/data_readable.json +31 -28
- data/lib/docker_build/Dockerfile.ruby +1 -1
- data/lib/sc2ai/api/data.rb +159 -2
- data/lib/sc2ai/api/tech_tree.rb +22 -0
- data/lib/sc2ai/api/tech_tree_data.rb +19 -8
- data/lib/sc2ai/connection/requests.rb +26 -11
- data/lib/sc2ai/connection.rb +1 -1
- data/lib/sc2ai/local_play/client_manager.rb +9 -1
- data/lib/sc2ai/player/actions.rb +17 -0
- data/lib/sc2ai/player/debug.rb +1 -0
- data/lib/sc2ai/player/game_state.rb +8 -5
- data/lib/sc2ai/player/geometry.rb +100 -16
- data/lib/sc2ai/player/previous_state.rb +3 -3
- data/lib/sc2ai/player/units.rb +116 -6
- data/lib/sc2ai/player.rb +3 -1
- data/lib/sc2ai/protocol/_meta_documentation.rb +2 -0
- data/lib/sc2ai/protocol/extensions/ability_remapable.rb +22 -0
- data/lib/sc2ai/protocol/extensions/point.rb +3 -1
- data/lib/sc2ai/protocol/extensions/point_2_d.rb +6 -0
- data/lib/sc2ai/protocol/extensions/position.rb +41 -4
- data/lib/sc2ai/protocol/extensions/unit.rb +35 -3
- data/lib/sc2ai/protocol/extensions/unit_type_data.rb +20 -0
- data/lib/sc2ai/unit_group/action_ext.rb +9 -0
- data/lib/sc2ai/unit_group/filter_ext.rb +18 -1
- data/lib/sc2ai/unit_group/geo_ext.rb +28 -0
- data/lib/sc2ai/unit_group.rb +12 -1
- data/lib/sc2ai/version.rb +1 -1
- data/lib/templates/new/run_example_match.rb.tt +1 -1
- data/sig/sc2ai.rbs +498 -87
- metadata +26 -23
data/sig/sc2ai.rbs
CHANGED
@@ -338,7 +338,7 @@ module Sc2
|
|
338
338
|
def on_status_change: (Symbol status) -> untyped
|
339
339
|
|
340
340
|
# Determines if your game_info will be refreshed at this moment
|
341
|
-
# Has a hard-capped refresh of only ever
|
341
|
+
# Has a hard-capped refresh of only ever 4 steps
|
342
342
|
# In general game_info is only refreshed Player::Bot reads from pathing_grid or placement_grid
|
343
343
|
def game_info_stale?: () -> bool
|
344
344
|
|
@@ -802,17 +802,18 @@ module Sc2
|
|
802
802
|
?queue_command: bool
|
803
803
|
) -> untyped
|
804
804
|
|
805
|
-
# sord omit - no YARD type given for "units:", using untyped
|
806
805
|
# sord omit - no YARD return type given, using untyped
|
807
806
|
# Builds target unit type using units as source at optional target
|
808
807
|
#
|
808
|
+
# _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
|
809
|
+
#
|
809
810
|
# _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
|
810
811
|
#
|
811
812
|
# _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
|
812
813
|
#
|
813
814
|
# _@param_ `queue_command` — shift+command
|
814
815
|
def build: (
|
815
|
-
units:
|
816
|
+
units: (::Array[Integer] | Integer | Api::Unit),
|
816
817
|
unit_type_id: Integer,
|
817
818
|
?target: (Api::Point2D | Integer)?,
|
818
819
|
?queue_command: bool
|
@@ -835,6 +836,16 @@ module Sc2
|
|
835
836
|
?units: untyped
|
836
837
|
) -> untyped
|
837
838
|
|
839
|
+
# sord omit - no YARD return type given, using untyped
|
840
|
+
# Research a specific upgrade
|
841
|
+
#
|
842
|
+
# _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
|
843
|
+
#
|
844
|
+
# _@param_ `upgrade_id` — Api::UpgradeId to research
|
845
|
+
#
|
846
|
+
# _@param_ `queue_command` — shift+command
|
847
|
+
def research: (units: (::Array[Integer] | Integer | Api::Unit), upgrade_id: Integer, ?queue_command: bool) -> untyped
|
848
|
+
|
838
849
|
# Toggles auto-cast ability for units
|
839
850
|
#
|
840
851
|
# _@param_ `units` — can be an Api::Unit, array of Tags or single Tag
|
@@ -966,7 +977,18 @@ module Sc2
|
|
966
977
|
# _@return_ — unit tag array
|
967
978
|
def unit_tags_from_source: ((Integer | ::Array[Integer] | Api::Unit | Sc2::UnitGroup) source) -> ::Array[Integer]
|
968
979
|
|
969
|
-
#
|
980
|
+
# Returns the upgrade ids which are researching or queued
|
981
|
+
# Not set for enemy.
|
982
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
983
|
+
|
984
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
985
|
+
# Returns the upgrade ids which are researching or queued
|
986
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
987
|
+
|
988
|
+
# sord omit - no YARD type given for "unit_type_id", using untyped
|
989
|
+
# For this unit type, tells you how many are in progress by checking orders for all it's sources.
|
990
|
+
def units_in_progress: (untyped unit_type_id) -> Integer
|
991
|
+
|
970
992
|
# Returns static [Api::UnitTypeData] for a unit
|
971
993
|
#
|
972
994
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -978,6 +1000,12 @@ module Sc2
|
|
978
1000
|
# _@param_ `ability_id` — Api::AbilityId::*
|
979
1001
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
980
1002
|
|
1003
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
1004
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
1005
|
+
#
|
1006
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
1007
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
1008
|
+
|
981
1009
|
# Checks unit data for an attribute value
|
982
1010
|
#
|
983
1011
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1008,6 +1036,10 @@ module Sc2
|
|
1008
1036
|
# Checks whether you have the resources to construct quantity of unit type
|
1009
1037
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
1010
1038
|
|
1039
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1040
|
+
# Checks whether you have the resources to
|
1041
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
1042
|
+
|
1011
1043
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
1012
1044
|
# sord omit - no YARD return type given, using untyped
|
1013
1045
|
# Divides raw data units into various attributes on every step
|
@@ -1066,7 +1098,18 @@ module Sc2
|
|
1066
1098
|
# _@return_ — Api::Race if race detected, false otherwise
|
1067
1099
|
def detect_race_from_units: () -> (bool | Integer)
|
1068
1100
|
|
1069
|
-
#
|
1101
|
+
# Returns the upgrade ids which are researching or queued
|
1102
|
+
# Not set for enemy.
|
1103
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
1104
|
+
|
1105
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1106
|
+
# Returns the upgrade ids which are researching or queued
|
1107
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
1108
|
+
|
1109
|
+
# sord omit - no YARD type given for "unit_type_id", using untyped
|
1110
|
+
# For this unit type, tells you how many are in progress by checking orders for all it's sources.
|
1111
|
+
def units_in_progress: (untyped unit_type_id) -> Integer
|
1112
|
+
|
1070
1113
|
# Returns static [Api::UnitTypeData] for a unit
|
1071
1114
|
#
|
1072
1115
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1078,6 +1121,12 @@ module Sc2
|
|
1078
1121
|
# _@param_ `ability_id` — Api::AbilityId::*
|
1079
1122
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
1080
1123
|
|
1124
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
1125
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
1126
|
+
#
|
1127
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
1128
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
1129
|
+
|
1081
1130
|
# Checks unit data for an attribute value
|
1082
1131
|
#
|
1083
1132
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1108,6 +1157,10 @@ module Sc2
|
|
1108
1157
|
# Checks whether you have the resources to construct quantity of unit type
|
1109
1158
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
1110
1159
|
|
1160
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1161
|
+
# Checks whether you have the resources to
|
1162
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
1163
|
+
|
1111
1164
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
1112
1165
|
# sord omit - no YARD return type given, using untyped
|
1113
1166
|
# Divides raw data units into various attributes on every step
|
@@ -1362,7 +1415,18 @@ module Sc2
|
|
1362
1415
|
|
1363
1416
|
# Helper methods for working with units
|
1364
1417
|
module Units
|
1365
|
-
#
|
1418
|
+
# Returns the upgrade ids which are researching or queued
|
1419
|
+
# Not set for enemy.
|
1420
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
1421
|
+
|
1422
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1423
|
+
# Returns the upgrade ids which are researching or queued
|
1424
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
1425
|
+
|
1426
|
+
# sord omit - no YARD type given for "unit_type_id", using untyped
|
1427
|
+
# For this unit type, tells you how many are in progress by checking orders for all it's sources.
|
1428
|
+
def units_in_progress: (untyped unit_type_id) -> Integer
|
1429
|
+
|
1366
1430
|
# Returns static [Api::UnitTypeData] for a unit
|
1367
1431
|
#
|
1368
1432
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1374,6 +1438,12 @@ module Sc2
|
|
1374
1438
|
# _@param_ `ability_id` — Api::AbilityId::*
|
1375
1439
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
1376
1440
|
|
1441
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
1442
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
1443
|
+
#
|
1444
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
1445
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
1446
|
+
|
1377
1447
|
# Checks unit data for an attribute value
|
1378
1448
|
#
|
1379
1449
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1404,6 +1474,10 @@ module Sc2
|
|
1404
1474
|
# Checks whether you have the resources to construct quantity of unit type
|
1405
1475
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
1406
1476
|
|
1477
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1478
|
+
# Checks whether you have the resources to
|
1479
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
1480
|
+
|
1407
1481
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
1408
1482
|
# sord omit - no YARD return type given, using untyped
|
1409
1483
|
# Divides raw data units into various attributes on every step
|
@@ -1448,6 +1522,11 @@ module Sc2
|
|
1448
1522
|
# _@return_ — a group of neutral units
|
1449
1523
|
attr_accessor effects: Sc2::UnitGroup
|
1450
1524
|
|
1525
|
+
# sord omit - no YARD type given for :upgrades_completed, using untyped
|
1526
|
+
# Returns the upgrade ids you have acquired such as weapon upgrade and armor upgrade ids.
|
1527
|
+
# Shorthand for observation.raw_data.player.upgrade_ids
|
1528
|
+
attr_reader upgrades_completed: untyped
|
1529
|
+
|
1451
1530
|
# sord warn - Api::RadarRing wasn't able to be resolved to a constant in this project
|
1452
1531
|
# sord warn - Api::RadarRing wasn't able to be resolved to a constant in this project
|
1453
1532
|
# _@return_ — an array of power sources
|
@@ -1540,17 +1619,18 @@ module Sc2
|
|
1540
1619
|
?queue_command: bool
|
1541
1620
|
) -> untyped
|
1542
1621
|
|
1543
|
-
# sord omit - no YARD type given for "units:", using untyped
|
1544
1622
|
# sord omit - no YARD return type given, using untyped
|
1545
1623
|
# Builds target unit type using units as source at optional target
|
1546
1624
|
#
|
1625
|
+
# _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
|
1626
|
+
#
|
1547
1627
|
# _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
|
1548
1628
|
#
|
1549
1629
|
# _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
|
1550
1630
|
#
|
1551
1631
|
# _@param_ `queue_command` — shift+command
|
1552
1632
|
def build: (
|
1553
|
-
units:
|
1633
|
+
units: (::Array[Integer] | Integer | Api::Unit),
|
1554
1634
|
unit_type_id: Integer,
|
1555
1635
|
?target: (Api::Point2D | Integer)?,
|
1556
1636
|
?queue_command: bool
|
@@ -1573,6 +1653,16 @@ module Sc2
|
|
1573
1653
|
?units: untyped
|
1574
1654
|
) -> untyped
|
1575
1655
|
|
1656
|
+
# sord omit - no YARD return type given, using untyped
|
1657
|
+
# Research a specific upgrade
|
1658
|
+
#
|
1659
|
+
# _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
|
1660
|
+
#
|
1661
|
+
# _@param_ `upgrade_id` — Api::UpgradeId to research
|
1662
|
+
#
|
1663
|
+
# _@param_ `queue_command` — shift+command
|
1664
|
+
def research: (units: (::Array[Integer] | Integer | Api::Unit), upgrade_id: Integer, ?queue_command: bool) -> untyped
|
1665
|
+
|
1576
1666
|
# Toggles auto-cast ability for units
|
1577
1667
|
#
|
1578
1668
|
# _@param_ `units` — can be an Api::Unit, array of Tags or single Tag
|
@@ -1757,6 +1847,16 @@ module Sc2
|
|
1757
1847
|
# One pixel covers one whole block. Rounds fractionated positions down.
|
1758
1848
|
def parsed_placement_grid: () -> Numo::Bit
|
1759
1849
|
|
1850
|
+
# Whether this tile is where an expansion is supposed to be placed.
|
1851
|
+
# To see if a unit/structure is blocking an expansion, pass their coordinates to this method.
|
1852
|
+
#
|
1853
|
+
# _@param_ `x`
|
1854
|
+
#
|
1855
|
+
# _@param_ `y`
|
1856
|
+
#
|
1857
|
+
# _@return_ — true if location has creep on it
|
1858
|
+
def expo_placement?: (x: (Float | Integer), y: (Float | Integer)) -> bool
|
1859
|
+
|
1760
1860
|
# sord warn - Numo::Bit wasn't able to be resolved to a constant in this project
|
1761
1861
|
# Returns a grid where ony the expo locations are marked
|
1762
1862
|
def expo_placement_grid: () -> Numo::Bit
|
@@ -1813,6 +1913,13 @@ module Sc2
|
|
1813
1913
|
# _@return_ — z axis position between -16 and 16
|
1814
1914
|
def terrain_height: (x: (Float | Integer), y: (Float | Integer)) -> Float
|
1815
1915
|
|
1916
|
+
# Returns the terrain height (z) at position x and y for a point
|
1917
|
+
#
|
1918
|
+
# _@param_ `position`
|
1919
|
+
#
|
1920
|
+
# _@return_ — z axis position between -16 and 16
|
1921
|
+
def terrain_height_for_pos: (Sc2::Position position) -> Float
|
1922
|
+
|
1816
1923
|
# sord warn - Numo::SFloat wasn't able to be resolved to a constant in this project
|
1817
1924
|
# Returns a parsed terrain_height from bot.game_info.start_raw.
|
1818
1925
|
# Each value in [row][column] holds a float value which is the z height
|
@@ -1877,6 +1984,7 @@ module Sc2
|
|
1877
1984
|
|
1878
1985
|
# sord warn - Numo::Bit wasn't able to be resolved to a constant in this project
|
1879
1986
|
# Provides parsed minimap representation of creep spread
|
1987
|
+
# Caches for 4 frames
|
1880
1988
|
#
|
1881
1989
|
# _@return_ — Numo array
|
1882
1990
|
def parsed_creep: () -> Numo::Bit
|
@@ -1951,6 +2059,13 @@ module Sc2
|
|
1951
2059
|
# _@return_ — UnitGroup of geysers for the base
|
1952
2060
|
def geysers_for_base: ((Api::Unit | Sc2::Position) base) -> Sc2::UnitGroup
|
1953
2061
|
|
2062
|
+
# Gets geysers which have not been taken for a base or base position
|
2063
|
+
#
|
2064
|
+
# _@param_ `base` — base Unit or Position
|
2065
|
+
#
|
2066
|
+
# _@return_ — UnitGroup of geysers for the base
|
2067
|
+
def geysers_open_for_base: ((Api::Unit | Sc2::Position) base) -> Sc2::UnitGroup
|
2068
|
+
|
1954
2069
|
# _@param_ `base` — base Unit or Position
|
1955
2070
|
#
|
1956
2071
|
# _@return_ — UnitGroup of resources (minerals+geysers)
|
@@ -1986,8 +2101,15 @@ module Sc2
|
|
1986
2101
|
#
|
1987
2102
|
# _@param_ `random` — number of nearest points to randomly choose from. 1 for nearest point.
|
1988
2103
|
#
|
2104
|
+
# _@param_ `in_power` — whether this must be on a power field
|
2105
|
+
#
|
1989
2106
|
# _@return_ — buildable location, nil if no buildable location found
|
1990
|
-
def build_placement_near: (
|
2107
|
+
def build_placement_near: (
|
2108
|
+
length: Integer,
|
2109
|
+
target: (Api::Unit | Sc2::Position),
|
2110
|
+
?random: Integer,
|
2111
|
+
?in_power: bool
|
2112
|
+
) -> Api::Point2D?
|
1991
2113
|
|
1992
2114
|
# Draws a grid within a unit (pylon/prisms) radius, then selects points which are placeable
|
1993
2115
|
#
|
@@ -2020,7 +2142,6 @@ module Sc2
|
|
2020
2142
|
?count: Integer
|
2021
2143
|
) -> ::Array[Api::Point2D]
|
2022
2144
|
|
2023
|
-
# sord warn - Sc2::Location wasn't able to be resolved to a constant in this project
|
2024
2145
|
# Gets a random point near a location with a positive/negative offset applied to both x and y
|
2025
2146
|
#
|
2026
2147
|
# _@param_ `pos`
|
@@ -2031,13 +2152,12 @@ module Sc2
|
|
2031
2152
|
# Randomly randomly adjust both x and y by a range of -3.5 or +3.5
|
2032
2153
|
# geo.point_random_near(point: structures.hq.first, offset: 3.5)
|
2033
2154
|
# ```
|
2034
|
-
def point_random_near: (pos: Sc2::
|
2155
|
+
def point_random_near: (pos: Sc2::Position, ?offset: Float) -> Api::Point2D
|
2035
2156
|
|
2036
|
-
# sord warn - Sc2::Location wasn't able to be resolved to a constant in this project
|
2037
2157
|
# _@param_ `pos`
|
2038
2158
|
#
|
2039
2159
|
# _@param_ `radius`
|
2040
|
-
def point_random_on_circle: (pos: Sc2::
|
2160
|
+
def point_random_on_circle: (pos: Sc2::Position, ?radius: Float) -> Api::Point2D
|
2041
2161
|
|
2042
2162
|
# _@return_ — player with active connection
|
2043
2163
|
attr_accessor bot: (Sc2::Player | untyped)
|
@@ -2053,7 +2173,7 @@ module Sc2
|
|
2053
2173
|
def on_status_change: (Symbol status) -> untyped
|
2054
2174
|
|
2055
2175
|
# Determines if your game_info will be refreshed at this moment
|
2056
|
-
# Has a hard-capped refresh of only ever
|
2176
|
+
# Has a hard-capped refresh of only ever 4 steps
|
2057
2177
|
# In general game_info is only refreshed Player::Bot reads from pathing_grid or placement_grid
|
2058
2178
|
def game_info_stale?: () -> bool
|
2059
2179
|
|
@@ -2067,7 +2187,7 @@ module Sc2
|
|
2067
2187
|
attr_accessor status: (Symbol | untyped)
|
2068
2188
|
|
2069
2189
|
# _@return_ — current game loop
|
2070
|
-
attr_accessor game_loop: Integer
|
2190
|
+
attr_accessor game_loop: (Integer | untyped)
|
2071
2191
|
|
2072
2192
|
# sord warn - Api::ResponseGameInfo wasn't able to be resolved to a constant in this project
|
2073
2193
|
# sord warn - Api::ResponseGameInfo wasn't able to be resolved to a constant in this project
|
@@ -2135,7 +2255,18 @@ module Sc2
|
|
2135
2255
|
# _@param_ `bot`
|
2136
2256
|
def after_reset: (Sc2::Player::Bot _bot) -> untyped
|
2137
2257
|
|
2138
|
-
#
|
2258
|
+
# Returns the upgrade ids which are researching or queued
|
2259
|
+
# Not set for enemy.
|
2260
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
2261
|
+
|
2262
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
2263
|
+
# Returns the upgrade ids which are researching or queued
|
2264
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
2265
|
+
|
2266
|
+
# sord omit - no YARD type given for "unit_type_id", using untyped
|
2267
|
+
# For this unit type, tells you how many are in progress by checking orders for all it's sources.
|
2268
|
+
def units_in_progress: (untyped unit_type_id) -> Integer
|
2269
|
+
|
2139
2270
|
# Returns static [Api::UnitTypeData] for a unit
|
2140
2271
|
#
|
2141
2272
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -2147,6 +2278,12 @@ module Sc2
|
|
2147
2278
|
# _@param_ `ability_id` — Api::AbilityId::*
|
2148
2279
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
2149
2280
|
|
2281
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
2282
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
2283
|
+
#
|
2284
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
2285
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
2286
|
+
|
2150
2287
|
# Checks unit data for an attribute value
|
2151
2288
|
#
|
2152
2289
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -2177,6 +2314,10 @@ module Sc2
|
|
2177
2314
|
# Checks whether you have the resources to construct quantity of unit type
|
2178
2315
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
2179
2316
|
|
2317
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
2318
|
+
# Checks whether you have the resources to
|
2319
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
2320
|
+
|
2180
2321
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
2181
2322
|
# sord omit - no YARD return type given, using untyped
|
2182
2323
|
# Divides raw data units into various attributes on every step
|
@@ -2211,7 +2352,7 @@ module Sc2
|
|
2211
2352
|
def on_status_change: (Symbol status) -> untyped
|
2212
2353
|
|
2213
2354
|
# Determines if your game_info will be refreshed at this moment
|
2214
|
-
# Has a hard-capped refresh of only ever
|
2355
|
+
# Has a hard-capped refresh of only ever 4 steps
|
2215
2356
|
# In general game_info is only refreshed Player::Bot reads from pathing_grid or placement_grid
|
2216
2357
|
def game_info_stale?: () -> bool
|
2217
2358
|
|
@@ -2352,7 +2493,6 @@ module Sc2
|
|
2352
2493
|
# _@return_ — Hash<Integer, Api::AbilityData] indexed data
|
2353
2494
|
def abilities_from_proto: (::Array[Api::AbilityData] abilities) -> SORD_ERROR_HashIntegerApiAbilityDataindexeddata
|
2354
2495
|
|
2355
|
-
# sord warn - Api::UnitTypeData wasn't able to be resolved to a constant in this project
|
2356
2496
|
# sord warn - "Hash<Integer, Api::UnitTypeData] indexed data" does not appear to be a type
|
2357
2497
|
# Indexes unit data by id
|
2358
2498
|
#
|
@@ -2378,17 +2518,30 @@ module Sc2
|
|
2378
2518
|
# sord omit - no YARD return type given, using untyped
|
2379
2519
|
def buffs_from_proto: (untyped buffs) -> untyped
|
2380
2520
|
|
2521
|
+
# sord omit - no YARD return type given, using untyped
|
2522
|
+
# Overrides unit data from api to implement fixes or change context
|
2523
|
+
# i.e. Api::UnitTypeId::ORBITALCOMMAND cost is cost-to-upgrade instead of CC + Orbital combined cost.
|
2524
|
+
# Run once. Depends on all data already being set.
|
2525
|
+
def override_unit_data: () -> untyped
|
2526
|
+
|
2527
|
+
# sord omit - no YARD return type given, using untyped
|
2528
|
+
# Fixes mineral_cost, vespene_cost and food_required values
|
2529
|
+
def correct_unit_type_costs: () -> untyped
|
2530
|
+
|
2531
|
+
# sord omit - no YARD return type given, using untyped
|
2532
|
+
# Fixes mineral_cost_sum, vespene_cost_sum
|
2533
|
+
def correct_unit_type_sum: () -> untyped
|
2534
|
+
|
2381
2535
|
# sord warn - Api::AbilityData wasn't able to be resolved to a constant in this project
|
2382
2536
|
# _@return_ — AbilityId => AbilityData
|
2383
2537
|
attr_accessor abilities: (::Hash[Integer, Api::AbilityData] | untyped)
|
2384
2538
|
|
2385
|
-
#
|
2386
|
-
# _@return_ — UnitId => UnitData
|
2539
|
+
# _@return_ — UnitId => UnitTypeData
|
2387
2540
|
attr_accessor units: (::Hash[Integer, Api::UnitTypeData] | untyped)
|
2388
2541
|
|
2389
|
-
# sord warn - Api::
|
2390
|
-
# _@return_ —
|
2391
|
-
attr_accessor upgrades: (::Hash[Integer, Api::
|
2542
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
2543
|
+
# _@return_ — UpgradeId => UpgradeData
|
2544
|
+
attr_accessor upgrades: (::Hash[Integer, Api::UpgradeData] | untyped)
|
2392
2545
|
|
2393
2546
|
# sord omit - no YARD type given for :buffs, using untyped
|
2394
2547
|
# Not particularly useful data. Just use BuffId directly
|
@@ -2638,19 +2791,15 @@ module Sc2
|
|
2638
2791
|
) -> Api::ResponseQuery
|
2639
2792
|
|
2640
2793
|
# sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
|
2641
|
-
# sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
|
2642
|
-
# sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
|
2643
2794
|
# sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
|
2644
2795
|
# Queries one or more pathing queries
|
2645
2796
|
#
|
2646
2797
|
# _@param_ `queries` — one or more pathing queries
|
2647
2798
|
#
|
2648
2799
|
# _@return_ — one or more results depending on input size
|
2649
|
-
def query_pathings: (
|
2800
|
+
def query_pathings: (::Array[Api::RequestQueryPathing] queries) -> ::Array[Api::ResponseQueryPathing]
|
2650
2801
|
|
2651
2802
|
# sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2652
|
-
# sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2653
|
-
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2654
2803
|
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2655
2804
|
# Queries one or more ability-available checks
|
2656
2805
|
#
|
@@ -2659,9 +2808,8 @@ module Sc2
|
|
2659
2808
|
# _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
|
2660
2809
|
#
|
2661
2810
|
# _@return_ — one or more results depending on input size
|
2662
|
-
def query_abilities: (
|
2811
|
+
def query_abilities: (::Array[Api::RequestQueryAvailableAbilities] queries, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
|
2663
2812
|
|
2664
|
-
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2665
2813
|
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2666
2814
|
# Queries available abilities for units
|
2667
2815
|
#
|
@@ -2670,18 +2818,26 @@ module Sc2
|
|
2670
2818
|
# _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
|
2671
2819
|
#
|
2672
2820
|
# _@return_ — one or more results depending on input size
|
2673
|
-
def query_abilities_for_unit_tags: (
|
2821
|
+
def query_abilities_for_unit_tags: (::Array[Integer] unit_tags, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
|
2822
|
+
|
2823
|
+
# sord omit - no YARD type given for "ignore_resource_requirements:", using untyped
|
2824
|
+
# sord omit - no YARD return type given, using untyped
|
2825
|
+
# Queries available ability ids for one unit
|
2826
|
+
# Shortened response over #query_abilities_for_unit_tags, since we know the tag already
|
2827
|
+
# and can just return an array of ability ids.
|
2828
|
+
# Note: Querying single units are expensive and should be batched with #query_abilities_for_unit_tags
|
2829
|
+
#
|
2830
|
+
# _@param_ `unit` — a unit or a tag.
|
2831
|
+
def query_ability_ids_for_unit: ((Api::Unit | Integer) unit, ?ignore_resource_requirements: untyped) -> untyped
|
2674
2832
|
|
2675
|
-
# sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2676
2833
|
# sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2677
2834
|
# sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2678
|
-
# sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2679
2835
|
# Queries one or more pathing queries
|
2680
2836
|
#
|
2681
2837
|
# _@param_ `queries` — one or more placement queries
|
2682
2838
|
#
|
2683
2839
|
# _@return_ — one or more results depending on input size
|
2684
|
-
def query_placements: (
|
2840
|
+
def query_placements: (::Array[Api::RequestQueryBuildingPlacement] queries) -> ::Array[Api::ResponseQueryBuildingPlacement]
|
2685
2841
|
|
2686
2842
|
# sord omit - no YARD return type given, using untyped
|
2687
2843
|
# Generates a replay.
|
@@ -2937,20 +3093,16 @@ module Sc2
|
|
2937
3093
|
?ignore_resource_requirements: bool
|
2938
3094
|
) -> Api::ResponseQuery
|
2939
3095
|
|
2940
|
-
# sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
|
2941
3096
|
# sord warn - Api::RequestQueryPathing wasn't able to be resolved to a constant in this project
|
2942
3097
|
# sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
|
2943
|
-
# sord warn - Api::ResponseQueryPathing wasn't able to be resolved to a constant in this project
|
2944
3098
|
# Queries one or more pathing queries
|
2945
3099
|
#
|
2946
3100
|
# _@param_ `queries` — one or more pathing queries
|
2947
3101
|
#
|
2948
3102
|
# _@return_ — one or more results depending on input size
|
2949
|
-
def query_pathings: (
|
3103
|
+
def query_pathings: (::Array[Api::RequestQueryPathing] queries) -> ::Array[Api::ResponseQueryPathing]
|
2950
3104
|
|
2951
3105
|
# sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2952
|
-
# sord warn - Api::RequestQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2953
|
-
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2954
3106
|
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2955
3107
|
# Queries one or more ability-available checks
|
2956
3108
|
#
|
@@ -2959,9 +3111,8 @@ module Sc2
|
|
2959
3111
|
# _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
|
2960
3112
|
#
|
2961
3113
|
# _@return_ — one or more results depending on input size
|
2962
|
-
def query_abilities: (
|
3114
|
+
def query_abilities: (::Array[Api::RequestQueryAvailableAbilities] queries, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
|
2963
3115
|
|
2964
|
-
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2965
3116
|
# sord warn - Api::ResponseQueryAvailableAbilities wasn't able to be resolved to a constant in this project
|
2966
3117
|
# Queries available abilities for units
|
2967
3118
|
#
|
@@ -2970,18 +3121,26 @@ module Sc2
|
|
2970
3121
|
# _@param_ `ignore_resource_requirements` — Ignores requirements like food, minerals and so on.
|
2971
3122
|
#
|
2972
3123
|
# _@return_ — one or more results depending on input size
|
2973
|
-
def query_abilities_for_unit_tags: (
|
3124
|
+
def query_abilities_for_unit_tags: (::Array[Integer] unit_tags, ?ignore_resource_requirements: bool) -> ::Array[Api::ResponseQueryAvailableAbilities]
|
3125
|
+
|
3126
|
+
# sord omit - no YARD type given for "ignore_resource_requirements:", using untyped
|
3127
|
+
# sord omit - no YARD return type given, using untyped
|
3128
|
+
# Queries available ability ids for one unit
|
3129
|
+
# Shortened response over #query_abilities_for_unit_tags, since we know the tag already
|
3130
|
+
# and can just return an array of ability ids.
|
3131
|
+
# Note: Querying single units are expensive and should be batched with #query_abilities_for_unit_tags
|
3132
|
+
#
|
3133
|
+
# _@param_ `unit` — a unit or a tag.
|
3134
|
+
def query_ability_ids_for_unit: ((Api::Unit | Integer) unit, ?ignore_resource_requirements: untyped) -> untyped
|
2974
3135
|
|
2975
3136
|
# sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2976
|
-
# sord warn - Api::RequestQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2977
|
-
# sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2978
3137
|
# sord warn - Api::ResponseQueryBuildingPlacement wasn't able to be resolved to a constant in this project
|
2979
3138
|
# Queries one or more pathing queries
|
2980
3139
|
#
|
2981
3140
|
# _@param_ `queries` — one or more placement queries
|
2982
3141
|
#
|
2983
3142
|
# _@return_ — one or more results depending on input size
|
2984
|
-
def query_placements: (
|
3143
|
+
def query_placements: (::Array[Api::RequestQueryBuildingPlacement] queries) -> ::Array[Api::ResponseQueryBuildingPlacement]
|
2985
3144
|
|
2986
3145
|
# sord omit - no YARD return type given, using untyped
|
2987
3146
|
# Generates a replay.
|
@@ -3296,11 +3455,18 @@ module Sc2
|
|
3296
3455
|
# _@return_ — new unit group
|
3297
3456
|
def except: () -> Sc2::UnitGroup
|
3298
3457
|
|
3299
|
-
# Returns a
|
3458
|
+
# Returns a new unit group containing the entries for given tag(s).
|
3300
3459
|
#
|
3301
3460
|
# _@return_ — new unit group
|
3302
3461
|
def slice: () -> Sc2::UnitGroup
|
3303
3462
|
|
3463
|
+
# Returns a new unit group containing each element found both in self and in all of the given other_arrays; duplicates are omitted; items are compared using eql? (items must also implement hash correctly):
|
3464
|
+
#
|
3465
|
+
# _@param_ `other_unit_group`
|
3466
|
+
#
|
3467
|
+
# _@return_ — new unit group
|
3468
|
+
def intersection: (UnitGroup other_unit_group) -> UnitGroup
|
3469
|
+
|
3304
3470
|
# Selects a single random Unit without a parameter or an array of Units with a param, i.e. self.random(2)
|
3305
3471
|
def sample: () -> Api::Unit
|
3306
3472
|
|
@@ -3320,6 +3486,10 @@ module Sc2
|
|
3320
3486
|
# Allows, i.e. Player#units.workers to fire only the first time it's called per frame
|
3321
3487
|
def cached: (untyped key) -> untyped
|
3322
3488
|
|
3489
|
+
# Returns the center (average) position of all units or nil if the group is empty.
|
3490
|
+
# Outliers effect this point
|
3491
|
+
def pos_centroid: () -> Api::Point2D?
|
3492
|
+
|
3323
3493
|
# Our first unit's bot object.
|
3324
3494
|
# Returns nil if units are empty, so use safetly operator bot&.method(...)
|
3325
3495
|
#
|
@@ -3356,6 +3526,14 @@ module Sc2
|
|
3356
3526
|
# _@param_ `queue_command` — shift+command
|
3357
3527
|
def warp: (unit_type_id: Integer, ?target: Api::Point2D?, ?queue_command: bool) -> untyped
|
3358
3528
|
|
3529
|
+
# sord omit - no YARD return type given, using untyped
|
3530
|
+
# Research a specific upgrade at one of these structures
|
3531
|
+
#
|
3532
|
+
# _@param_ `upgrade_id` — Api::UpgradeId to research
|
3533
|
+
#
|
3534
|
+
# _@param_ `queue_command` — shift+command
|
3535
|
+
def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
|
3536
|
+
|
3359
3537
|
# sord omit - no YARD return type given, using untyped
|
3360
3538
|
# Shorthand for performing action SMART (right-click)
|
3361
3539
|
#
|
@@ -3510,6 +3688,15 @@ module Sc2
|
|
3510
3688
|
# _@return_ — gas structures
|
3511
3689
|
def gas: () -> UnitGroup
|
3512
3690
|
|
3691
|
+
# Selects only units which have finished constructing, i.o.w. build_progress == 1.0
|
3692
|
+
#
|
3693
|
+
# _@return_ — gas structures
|
3694
|
+
def completed: () -> UnitGroup
|
3695
|
+
|
3696
|
+
# sord omit - no YARD return type given, using untyped
|
3697
|
+
# Selects only units which do not have orders
|
3698
|
+
def idle: () -> untyped
|
3699
|
+
|
3513
3700
|
# Selects mineral fields
|
3514
3701
|
#
|
3515
3702
|
# _@return_ — mineral fields
|
@@ -3564,6 +3751,9 @@ module Sc2
|
|
3564
3751
|
# Selects overlords
|
3565
3752
|
def overlords: () -> Sc2::UnitGroup
|
3566
3753
|
|
3754
|
+
# Selects overseers
|
3755
|
+
def overseers: () -> Sc2::UnitGroup
|
3756
|
+
|
3567
3757
|
# Selects creep tumors (all)
|
3568
3758
|
# CREEPTUMORQUEEN is still building & burrowing
|
3569
3759
|
# while CREEPTUMOR was spread from another tumor still building & burrowing
|
@@ -3985,6 +4175,9 @@ module Sc2
|
|
3985
4175
|
# _@param_ `player_index`
|
3986
4176
|
def stop: (Integer player_index) -> void
|
3987
4177
|
|
4178
|
+
# sord omit - no YARD return type given, using untyped
|
4179
|
+
def stop_all: () -> untyped
|
4180
|
+
|
3988
4181
|
def initialize: () -> void
|
3989
4182
|
|
3990
4183
|
# Returns the value of attribute clients.
|
@@ -3995,10 +4188,17 @@ module Sc2
|
|
3995
4188
|
end
|
3996
4189
|
|
3997
4190
|
# A unified construct that tames Api::* messages which contain location data
|
3998
|
-
# Items which are of type Sc2::
|
4191
|
+
# Items which are of type Sc2::Position will have #x and #y property at the least.
|
3999
4192
|
module Position
|
4000
4193
|
TOLERANCE: untyped
|
4001
4194
|
|
4195
|
+
# sord omit - no YARD type given for "other", using untyped
|
4196
|
+
# sord omit - no YARD return type given, using untyped
|
4197
|
+
# Loose equality matches on floats x and y.
|
4198
|
+
# We never check z-axis, because the map is single-level.
|
4199
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
4200
|
+
def ==: (untyped other) -> untyped
|
4201
|
+
|
4002
4202
|
# A new point representing the sum of this point and the other point.
|
4003
4203
|
#
|
4004
4204
|
# _@param_ `other` — The other point/number to add.
|
@@ -4019,10 +4219,19 @@ module Sc2
|
|
4019
4219
|
# _@return_ — A new point representing this point divided by the scalar.
|
4020
4220
|
def divide: (Float scalar) -> Api::Point2D
|
4021
4221
|
|
4022
|
-
#
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4222
|
+
# Returns x coordinate
|
4223
|
+
def x: () -> Float
|
4224
|
+
|
4225
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
4226
|
+
# Sets x coordinate
|
4227
|
+
def x=: (Float x) -> Float
|
4228
|
+
|
4229
|
+
# Returns y coordinate
|
4230
|
+
def y: () -> Float
|
4231
|
+
|
4232
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
4233
|
+
# Sets y coordinate
|
4234
|
+
def y=: (Float y) -> Float
|
4026
4235
|
|
4027
4236
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
4028
4237
|
#
|
@@ -4528,6 +4737,26 @@ module Api
|
|
4528
4737
|
# _@return_ — unit_type_id an array of unit type ids as per Api:UnitTypeId
|
4529
4738
|
def self.upgrade_researched_from: (upgrade_id: Integer) -> Integer
|
4530
4739
|
|
4740
|
+
# sord omit - no YARD type given for "upgrade_id:", using untyped
|
4741
|
+
# Returns the ability which researches this upgrade
|
4742
|
+
#
|
4743
|
+
# _@return_ — ability_id
|
4744
|
+
def self.upgrade_research_ability_id: (upgrade_id: untyped) -> Integer
|
4745
|
+
|
4746
|
+
# Returns a full list of structure unit id's which perform upgrades
|
4747
|
+
# This is a useful list when checking if any updates are in progress,
|
4748
|
+
# because we scan these structure types for orders
|
4749
|
+
#
|
4750
|
+
# _@return_ — unit type ids
|
4751
|
+
def self.upgrade_structure_unit_type_ids: () -> ::Array[Integer]
|
4752
|
+
|
4753
|
+
# Returns hash of upgrade info for a specific structure where the upgrade id is the key
|
4754
|
+
#
|
4755
|
+
# _@param_ `source_unit_type_id` — source structure unit type id
|
4756
|
+
#
|
4757
|
+
# _@return_ — ability_id
|
4758
|
+
def self.upgrade_ability_data: (Integer source_unit_type_id) -> ::Hash[Integer, ::Hash[untyped, untyped]]
|
4759
|
+
|
4531
4760
|
# sord omit - no YARD return type given, using untyped
|
4532
4761
|
def self.unit_type_creation_abilities_data: () -> untyped
|
4533
4762
|
|
@@ -8593,7 +8822,15 @@ module Api
|
|
8593
8822
|
# sord omit - no YARD return type given, using untyped
|
8594
8823
|
def hash: () -> untyped
|
8595
8824
|
|
8596
|
-
#
|
8825
|
+
# Returns an integer unique identifier
|
8826
|
+
# If the unit goes out of vision and is snapshot-able, they get a random id
|
8827
|
+
# - Such a unit gets the same unit tag when it re-enters vision
|
8828
|
+
def tag: () -> Integer
|
8829
|
+
|
8830
|
+
# sord infer - inferred type of parameter "tag" as Integer using getter's return type
|
8831
|
+
# Sets unit tag
|
8832
|
+
def tag=: (Integer tag) -> Integer
|
8833
|
+
|
8597
8834
|
# Returns static [Api::UnitTypeData] for a unit
|
8598
8835
|
def unit_data: () -> Api::UnitTypeData
|
8599
8836
|
|
@@ -8612,9 +8849,8 @@ module Api
|
|
8612
8849
|
# _@return_ — whether unit has attribute
|
8613
8850
|
#
|
8614
8851
|
# ```ruby
|
8615
|
-
# has_attribute?(Api::
|
8616
|
-
# has_attribute?(
|
8617
|
-
# has_attribute?(Api::UnitTypeId::SCV, :Mechanical)
|
8852
|
+
# unit.has_attribute?(Api::Attribute::Mechanical)
|
8853
|
+
# unit.has_attribute?(:Mechanical)
|
8618
8854
|
# ```
|
8619
8855
|
def has_attribute?: (untyped attribute) -> bool
|
8620
8856
|
|
@@ -8673,6 +8909,15 @@ module Api
|
|
8673
8909
|
# _@return_ — whether unit has attribute :Summoned
|
8674
8910
|
def is_summoned?: () -> bool
|
8675
8911
|
|
8912
|
+
# Whether unit is effected by buff_id
|
8913
|
+
#
|
8914
|
+
# _@param_ `buff_id`
|
8915
|
+
#
|
8916
|
+
# ```ruby
|
8917
|
+
# unit.has_buff??(Api::BuffId::QUEENSPAWNLARVATIMER)
|
8918
|
+
# ```
|
8919
|
+
def has_buff?: (Integer buff_id) -> bool
|
8920
|
+
|
8676
8921
|
# sord omit - no YARD return type given, using untyped
|
8677
8922
|
# Performs action on this unit
|
8678
8923
|
#
|
@@ -8736,12 +8981,21 @@ module Api
|
|
8736
8981
|
# _@param_ `queue_command` — shift+command
|
8737
8982
|
def build: (unit_type_id: Integer, ?target: (Api::Point2D | Integer)?, ?queue_command: bool) -> untyped
|
8738
8983
|
|
8739
|
-
# sord omit - no YARD type given for "queue_command:", using untyped
|
8740
8984
|
# sord omit - no YARD return type given, using untyped
|
8741
8985
|
# Issues repair command on target
|
8742
8986
|
#
|
8743
8987
|
# _@param_ `target` — is a unit or unit tag
|
8744
|
-
|
8988
|
+
#
|
8989
|
+
# _@param_ `queue_command` — shift+command
|
8990
|
+
def repair: (target: (Api::Unit | Integer), ?queue_command: bool) -> untyped
|
8991
|
+
|
8992
|
+
# sord omit - no YARD return type given, using untyped
|
8993
|
+
# Research a specific upgrade
|
8994
|
+
#
|
8995
|
+
# _@param_ `upgrade_id` — Api::UnitTypeId the unit type which will do the creation
|
8996
|
+
#
|
8997
|
+
# _@param_ `queue_command` — shift+command
|
8998
|
+
def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
|
8745
8999
|
|
8746
9000
|
# Draws a placement outline
|
8747
9001
|
# noinspection RubyArgCount
|
@@ -9013,6 +9267,13 @@ module Api
|
|
9013
9267
|
# Creates a Point2D using x and y
|
9014
9268
|
def to_p2d: () -> Api::Point2D
|
9015
9269
|
|
9270
|
+
# sord omit - no YARD type given for "other", using untyped
|
9271
|
+
# sord omit - no YARD return type given, using untyped
|
9272
|
+
# Loose equality matches on floats x and y.
|
9273
|
+
# We never check z-axis, because the map is single-level.
|
9274
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
9275
|
+
def ==: (untyped other) -> untyped
|
9276
|
+
|
9016
9277
|
# A new point representing the sum of this point and the other point.
|
9017
9278
|
#
|
9018
9279
|
# _@param_ `other` — The other point/number to add.
|
@@ -9033,10 +9294,19 @@ module Api
|
|
9033
9294
|
# _@return_ — A new point representing this point divided by the scalar.
|
9034
9295
|
def divide: (Float scalar) -> Api::Point2D
|
9035
9296
|
|
9036
|
-
#
|
9037
|
-
|
9038
|
-
|
9039
|
-
|
9297
|
+
# Returns x coordinate
|
9298
|
+
def x: () -> Float
|
9299
|
+
|
9300
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
9301
|
+
# Sets x coordinate
|
9302
|
+
def x=: (Float x) -> Float
|
9303
|
+
|
9304
|
+
# Returns y coordinate
|
9305
|
+
def y: () -> Float
|
9306
|
+
|
9307
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
9308
|
+
# Sets y coordinate
|
9309
|
+
def y=: (Float y) -> Float
|
9040
9310
|
|
9041
9311
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
9042
9312
|
#
|
@@ -9151,6 +9421,17 @@ module Api
|
|
9151
9421
|
# sord omit - no YARD type given for "other", using untyped
|
9152
9422
|
def eql?: (untyped other) -> bool
|
9153
9423
|
|
9424
|
+
# sord omit - no YARD type given for "z:", using untyped
|
9425
|
+
# Create a new 3d Point, by adding a y axis.
|
9426
|
+
def to_3d: (z: untyped) -> Api::Point
|
9427
|
+
|
9428
|
+
# sord omit - no YARD type given for "other", using untyped
|
9429
|
+
# sord omit - no YARD return type given, using untyped
|
9430
|
+
# Loose equality matches on floats x and y.
|
9431
|
+
# We never check z-axis, because the map is single-level.
|
9432
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
9433
|
+
def ==: (untyped other) -> untyped
|
9434
|
+
|
9154
9435
|
# A new point representing the sum of this point and the other point.
|
9155
9436
|
#
|
9156
9437
|
# _@param_ `other` — The other point/number to add.
|
@@ -9171,10 +9452,19 @@ module Api
|
|
9171
9452
|
# _@return_ — A new point representing this point divided by the scalar.
|
9172
9453
|
def divide: (Float scalar) -> Api::Point2D
|
9173
9454
|
|
9174
|
-
#
|
9175
|
-
|
9176
|
-
|
9177
|
-
|
9455
|
+
# Returns x coordinate
|
9456
|
+
def x: () -> Float
|
9457
|
+
|
9458
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
9459
|
+
# Sets x coordinate
|
9460
|
+
def x=: (Float x) -> Float
|
9461
|
+
|
9462
|
+
# Returns y coordinate
|
9463
|
+
def y: () -> Float
|
9464
|
+
|
9465
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
9466
|
+
# Sets y coordinate
|
9467
|
+
def y=: (Float y) -> Float
|
9178
9468
|
|
9179
9469
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
9180
9470
|
#
|
@@ -9272,6 +9562,13 @@ module Api
|
|
9272
9562
|
class PointI < Google::Protobuf::AbstractMessage
|
9273
9563
|
include Sc2::Position
|
9274
9564
|
|
9565
|
+
# sord omit - no YARD type given for "other", using untyped
|
9566
|
+
# sord omit - no YARD return type given, using untyped
|
9567
|
+
# Loose equality matches on floats x and y.
|
9568
|
+
# We never check z-axis, because the map is single-level.
|
9569
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
9570
|
+
def ==: (untyped other) -> untyped
|
9571
|
+
|
9275
9572
|
# A new point representing the sum of this point and the other point.
|
9276
9573
|
#
|
9277
9574
|
# _@param_ `other` — The other point/number to add.
|
@@ -9292,10 +9589,19 @@ module Api
|
|
9292
9589
|
# _@return_ — A new point representing this point divided by the scalar.
|
9293
9590
|
def divide: (Float scalar) -> Api::Point2D
|
9294
9591
|
|
9295
|
-
#
|
9296
|
-
|
9297
|
-
|
9298
|
-
|
9592
|
+
# Returns x coordinate
|
9593
|
+
def x: () -> Float
|
9594
|
+
|
9595
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
9596
|
+
# Sets x coordinate
|
9597
|
+
def x=: (Float x) -> Float
|
9598
|
+
|
9599
|
+
# Returns y coordinate
|
9600
|
+
def y: () -> Float
|
9601
|
+
|
9602
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
9603
|
+
# Sets y coordinate
|
9604
|
+
def y=: (Float y) -> Float
|
9299
9605
|
|
9300
9606
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
9301
9607
|
#
|
@@ -9404,6 +9710,13 @@ module Api
|
|
9404
9710
|
# ```
|
9405
9711
|
def self.[]: (untyped x, untyped y, untyped z) -> Api::Point
|
9406
9712
|
|
9713
|
+
# sord omit - no YARD type given for "other", using untyped
|
9714
|
+
# sord omit - no YARD return type given, using untyped
|
9715
|
+
# Loose equality matches on floats x and y.
|
9716
|
+
# We never check z-axis, because the map is single-level.
|
9717
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
9718
|
+
def ==: (untyped other) -> untyped
|
9719
|
+
|
9407
9720
|
# A new point representing the sum of this point and the other point.
|
9408
9721
|
#
|
9409
9722
|
# _@param_ `other` — The other point/number to add.
|
@@ -9424,10 +9737,19 @@ module Api
|
|
9424
9737
|
# _@return_ — A new point representing this point divided by the scalar.
|
9425
9738
|
def divide: (Float scalar) -> Api::Point2D
|
9426
9739
|
|
9427
|
-
#
|
9428
|
-
|
9429
|
-
|
9430
|
-
|
9740
|
+
# Returns x coordinate
|
9741
|
+
def x: () -> Float
|
9742
|
+
|
9743
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
9744
|
+
# Sets x coordinate
|
9745
|
+
def x=: (Float x) -> Float
|
9746
|
+
|
9747
|
+
# Returns y coordinate
|
9748
|
+
def y: () -> Float
|
9749
|
+
|
9750
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
9751
|
+
# Sets y coordinate
|
9752
|
+
def y=: (Float y) -> Float
|
9431
9753
|
|
9432
9754
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
9433
9755
|
#
|
@@ -9525,6 +9847,13 @@ module Api
|
|
9525
9847
|
class Size2DI < Google::Protobuf::AbstractMessage
|
9526
9848
|
include Sc2::Position
|
9527
9849
|
|
9850
|
+
# sord omit - no YARD type given for "other", using untyped
|
9851
|
+
# sord omit - no YARD return type given, using untyped
|
9852
|
+
# Loose equality matches on floats x and y.
|
9853
|
+
# We never check z-axis, because the map is single-level.
|
9854
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
9855
|
+
def ==: (untyped other) -> untyped
|
9856
|
+
|
9528
9857
|
# A new point representing the sum of this point and the other point.
|
9529
9858
|
#
|
9530
9859
|
# _@param_ `other` — The other point/number to add.
|
@@ -9545,10 +9874,19 @@ module Api
|
|
9545
9874
|
# _@return_ — A new point representing this point divided by the scalar.
|
9546
9875
|
def divide: (Float scalar) -> Api::Point2D
|
9547
9876
|
|
9548
|
-
#
|
9549
|
-
|
9550
|
-
|
9551
|
-
|
9877
|
+
# Returns x coordinate
|
9878
|
+
def x: () -> Float
|
9879
|
+
|
9880
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
9881
|
+
# Sets x coordinate
|
9882
|
+
def x=: (Float x) -> Float
|
9883
|
+
|
9884
|
+
# Returns y coordinate
|
9885
|
+
def y: () -> Float
|
9886
|
+
|
9887
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
9888
|
+
# Sets y coordinate
|
9889
|
+
def y=: (Float y) -> Float
|
9552
9890
|
|
9553
9891
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
9554
9892
|
#
|
@@ -9649,7 +9987,15 @@ module Api
|
|
9649
9987
|
# sord omit - no YARD return type given, using untyped
|
9650
9988
|
def hash: () -> untyped
|
9651
9989
|
|
9652
|
-
#
|
9990
|
+
# Returns an integer unique identifier
|
9991
|
+
# If the unit goes out of vision and is snapshot-able, they get a random id
|
9992
|
+
# - Such a unit gets the same unit tag when it re-enters vision
|
9993
|
+
def tag: () -> Integer
|
9994
|
+
|
9995
|
+
# sord infer - inferred type of parameter "tag" as Integer using getter's return type
|
9996
|
+
# Sets unit tag
|
9997
|
+
def tag=: (Integer tag) -> Integer
|
9998
|
+
|
9653
9999
|
# Returns static [Api::UnitTypeData] for a unit
|
9654
10000
|
def unit_data: () -> Api::UnitTypeData
|
9655
10001
|
|
@@ -9668,9 +10014,8 @@ module Api
|
|
9668
10014
|
# _@return_ — whether unit has attribute
|
9669
10015
|
#
|
9670
10016
|
# ```ruby
|
9671
|
-
# has_attribute?(Api::
|
9672
|
-
# has_attribute?(
|
9673
|
-
# has_attribute?(Api::UnitTypeId::SCV, :Mechanical)
|
10017
|
+
# unit.has_attribute?(Api::Attribute::Mechanical)
|
10018
|
+
# unit.has_attribute?(:Mechanical)
|
9674
10019
|
# ```
|
9675
10020
|
def has_attribute?: (untyped attribute) -> bool
|
9676
10021
|
|
@@ -9729,6 +10074,15 @@ module Api
|
|
9729
10074
|
# _@return_ — whether unit has attribute :Summoned
|
9730
10075
|
def is_summoned?: () -> bool
|
9731
10076
|
|
10077
|
+
# Whether unit is effected by buff_id
|
10078
|
+
#
|
10079
|
+
# _@param_ `buff_id`
|
10080
|
+
#
|
10081
|
+
# ```ruby
|
10082
|
+
# unit.has_buff??(Api::BuffId::QUEENSPAWNLARVATIMER)
|
10083
|
+
# ```
|
10084
|
+
def has_buff?: (Integer buff_id) -> bool
|
10085
|
+
|
9732
10086
|
# sord omit - no YARD return type given, using untyped
|
9733
10087
|
# Performs action on this unit
|
9734
10088
|
#
|
@@ -9792,12 +10146,21 @@ module Api
|
|
9792
10146
|
# _@param_ `queue_command` — shift+command
|
9793
10147
|
def build: (unit_type_id: Integer, ?target: (Api::Point2D | Integer)?, ?queue_command: bool) -> untyped
|
9794
10148
|
|
9795
|
-
# sord omit - no YARD type given for "queue_command:", using untyped
|
9796
10149
|
# sord omit - no YARD return type given, using untyped
|
9797
10150
|
# Issues repair command on target
|
9798
10151
|
#
|
9799
10152
|
# _@param_ `target` — is a unit or unit tag
|
9800
|
-
|
10153
|
+
#
|
10154
|
+
# _@param_ `queue_command` — shift+command
|
10155
|
+
def repair: (target: (Api::Unit | Integer), ?queue_command: bool) -> untyped
|
10156
|
+
|
10157
|
+
# sord omit - no YARD return type given, using untyped
|
10158
|
+
# Research a specific upgrade
|
10159
|
+
#
|
10160
|
+
# _@param_ `upgrade_id` — Api::UnitTypeId the unit type which will do the creation
|
10161
|
+
#
|
10162
|
+
# _@param_ `queue_command` — shift+command
|
10163
|
+
def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
|
9801
10164
|
|
9802
10165
|
# Draws a placement outline
|
9803
10166
|
# noinspection RubyArgCount
|
@@ -9951,6 +10314,11 @@ module Api
|
|
9951
10314
|
def is_performing_ability_on_target?: (untyped abilities, ?target: untyped) -> bool
|
9952
10315
|
end
|
9953
10316
|
|
10317
|
+
# Protobuf virtual class.
|
10318
|
+
class UnitTypeData < Google::Protobuf::AbstractMessage
|
10319
|
+
include Api::UnitTypeDataExtension
|
10320
|
+
end
|
10321
|
+
|
9954
10322
|
# Protobuf virtual enum.
|
9955
10323
|
class Race < Google::Protobuf::AbstractMessage
|
9956
10324
|
end
|
@@ -9975,6 +10343,10 @@ module Api
|
|
9975
10343
|
# sord omit - no YARD type given for "other", using untyped
|
9976
10344
|
def eql?: (untyped other) -> bool
|
9977
10345
|
|
10346
|
+
# sord omit - no YARD type given for "z:", using untyped
|
10347
|
+
# Create a new 3d Point, by adding a y axis.
|
10348
|
+
def to_3d: (z: untyped) -> Api::Point
|
10349
|
+
|
9978
10350
|
# Adds additional functionality to message class Api::Point2D
|
9979
10351
|
module ClassMethods
|
9980
10352
|
# sord omit - no YARD type given for "x", using untyped
|
@@ -9992,6 +10364,13 @@ module Api
|
|
9992
10364
|
module PowerSourceExtension
|
9993
10365
|
include Sc2::Position
|
9994
10366
|
|
10367
|
+
# sord omit - no YARD type given for "other", using untyped
|
10368
|
+
# sord omit - no YARD return type given, using untyped
|
10369
|
+
# Loose equality matches on floats x and y.
|
10370
|
+
# We never check z-axis, because the map is single-level.
|
10371
|
+
# TODO: We should almost certainly introduce TOLERANCE here, but verify it's cost first.
|
10372
|
+
def ==: (untyped other) -> untyped
|
10373
|
+
|
9995
10374
|
# A new point representing the sum of this point and the other point.
|
9996
10375
|
#
|
9997
10376
|
# _@param_ `other` — The other point/number to add.
|
@@ -10012,10 +10391,19 @@ module Api
|
|
10012
10391
|
# _@return_ — A new point representing this point divided by the scalar.
|
10013
10392
|
def divide: (Float scalar) -> Api::Point2D
|
10014
10393
|
|
10015
|
-
#
|
10016
|
-
|
10017
|
-
|
10018
|
-
|
10394
|
+
# Returns x coordinate
|
10395
|
+
def x: () -> Float
|
10396
|
+
|
10397
|
+
# sord infer - inferred type of parameter "x" as Float using getter's return type
|
10398
|
+
# Sets x coordinate
|
10399
|
+
def x=: (Float x) -> Float
|
10400
|
+
|
10401
|
+
# Returns y coordinate
|
10402
|
+
def y: () -> Float
|
10403
|
+
|
10404
|
+
# sord infer - inferred type of parameter "y" as Float using getter's return type
|
10405
|
+
# Sets y coordinate
|
10406
|
+
def y=: (Float y) -> Float
|
10019
10407
|
|
10020
10408
|
# Randomly adjusts both x and y by a range of: -offset..offset
|
10021
10409
|
#
|
@@ -10121,6 +10509,29 @@ module Api
|
|
10121
10509
|
def []: (untyped x, untyped y, untyped z) -> Api::Point
|
10122
10510
|
end
|
10123
10511
|
end
|
10512
|
+
|
10513
|
+
# Adds additional functionality to message object Api::UnitTypeData
|
10514
|
+
module UnitTypeDataExtension
|
10515
|
+
# Sum of all morphs mineral cost
|
10516
|
+
# i.e. 550M Orbital command = 400M CC + 150M Upgrade
|
10517
|
+
# i.e. 350M Hatchery = 50M Drone + 300M Build
|
10518
|
+
#
|
10519
|
+
# _@return_ — sum of mineral costs
|
10520
|
+
attr_accessor mineral_cost_sum: (Integer | untyped)
|
10521
|
+
|
10522
|
+
# Sum of all morphs vespene gas cost
|
10523
|
+
# i.e. 250G Broodlord = 100G Corruptor + 150G Morph
|
10524
|
+
#
|
10525
|
+
# _@return_ — sum of vespene gas costs
|
10526
|
+
attr_accessor vespene_cost_sum: (Integer | untyped)
|
10527
|
+
end
|
10528
|
+
|
10529
|
+
# This module make sure that a read from method ability_id always returns the proper source id
|
10530
|
+
module AbilityRemapable
|
10531
|
+
# Ability Id. The generic id or "remapid".
|
10532
|
+
# i.e. Api::AbilityId::ATTACK_BATTLECRUISER returns generic Api::AbilityId::ATTACK
|
10533
|
+
def ability_id: () -> Integer
|
10534
|
+
end
|
10124
10535
|
end
|
10125
10536
|
|
10126
10537
|
# Array extensions
|