sc2ai 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/data/data.json +1 -1
- data/data/data_readable.json +31 -28
- data/lib/sc2ai/api/data.rb +162 -2
- data/lib/sc2ai/api/tech_tree.rb +22 -0
- data/lib/sc2ai/api/tech_tree_data.rb +19 -8
- 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/geometry.rb +6 -0
- data/lib/sc2ai/player/previous_state.rb +2 -2
- data/lib/sc2ai/player/units.rb +75 -6
- data/lib/sc2ai/protocol/_meta_documentation.rb +2 -0
- data/lib/sc2ai/protocol/extensions/point_2_d.rb +6 -0
- data/lib/sc2ai/protocol/extensions/unit.rb +10 -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 +6 -0
- data/lib/sc2ai/unit_group.rb +9 -1
- data/lib/sc2ai/version.rb +1 -1
- data/lib/templates/new/run_example_match.rb.tt +1 -1
- data/sig/sc2ai.rbs +226 -27
- metadata +19 -4
data/sig/sc2ai.rbs
CHANGED
@@ -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,14 @@ 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
|
+
|
970
988
|
# Returns static [Api::UnitTypeData] for a unit
|
971
989
|
#
|
972
990
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -978,6 +996,12 @@ module Sc2
|
|
978
996
|
# _@param_ `ability_id` — Api::AbilityId::*
|
979
997
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
980
998
|
|
999
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
1000
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
1001
|
+
#
|
1002
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
1003
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
1004
|
+
|
981
1005
|
# Checks unit data for an attribute value
|
982
1006
|
#
|
983
1007
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1008,6 +1032,10 @@ module Sc2
|
|
1008
1032
|
# Checks whether you have the resources to construct quantity of unit type
|
1009
1033
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
1010
1034
|
|
1035
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1036
|
+
# Checks whether you have the resources to
|
1037
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
1038
|
+
|
1011
1039
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
1012
1040
|
# sord omit - no YARD return type given, using untyped
|
1013
1041
|
# Divides raw data units into various attributes on every step
|
@@ -1066,7 +1094,14 @@ module Sc2
|
|
1066
1094
|
# _@return_ — Api::Race if race detected, false otherwise
|
1067
1095
|
def detect_race_from_units: () -> (bool | Integer)
|
1068
1096
|
|
1069
|
-
#
|
1097
|
+
# Returns the upgrade ids which are researching or queued
|
1098
|
+
# Not set for enemy.
|
1099
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
1100
|
+
|
1101
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1102
|
+
# Returns the upgrade ids which are researching or queued
|
1103
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
1104
|
+
|
1070
1105
|
# Returns static [Api::UnitTypeData] for a unit
|
1071
1106
|
#
|
1072
1107
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1078,6 +1113,12 @@ module Sc2
|
|
1078
1113
|
# _@param_ `ability_id` — Api::AbilityId::*
|
1079
1114
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
1080
1115
|
|
1116
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
1117
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
1118
|
+
#
|
1119
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
1120
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
1121
|
+
|
1081
1122
|
# Checks unit data for an attribute value
|
1082
1123
|
#
|
1083
1124
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1108,6 +1149,10 @@ module Sc2
|
|
1108
1149
|
# Checks whether you have the resources to construct quantity of unit type
|
1109
1150
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
1110
1151
|
|
1152
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1153
|
+
# Checks whether you have the resources to
|
1154
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
1155
|
+
|
1111
1156
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
1112
1157
|
# sord omit - no YARD return type given, using untyped
|
1113
1158
|
# Divides raw data units into various attributes on every step
|
@@ -1362,7 +1407,14 @@ module Sc2
|
|
1362
1407
|
|
1363
1408
|
# Helper methods for working with units
|
1364
1409
|
module Units
|
1365
|
-
#
|
1410
|
+
# Returns the upgrade ids which are researching or queued
|
1411
|
+
# Not set for enemy.
|
1412
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
1413
|
+
|
1414
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1415
|
+
# Returns the upgrade ids which are researching or queued
|
1416
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
1417
|
+
|
1366
1418
|
# Returns static [Api::UnitTypeData] for a unit
|
1367
1419
|
#
|
1368
1420
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1374,6 +1426,12 @@ module Sc2
|
|
1374
1426
|
# _@param_ `ability_id` — Api::AbilityId::*
|
1375
1427
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
1376
1428
|
|
1429
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
1430
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
1431
|
+
#
|
1432
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
1433
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
1434
|
+
|
1377
1435
|
# Checks unit data for an attribute value
|
1378
1436
|
#
|
1379
1437
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -1404,6 +1462,10 @@ module Sc2
|
|
1404
1462
|
# Checks whether you have the resources to construct quantity of unit type
|
1405
1463
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
1406
1464
|
|
1465
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
1466
|
+
# Checks whether you have the resources to
|
1467
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
1468
|
+
|
1407
1469
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
1408
1470
|
# sord omit - no YARD return type given, using untyped
|
1409
1471
|
# Divides raw data units into various attributes on every step
|
@@ -1448,6 +1510,11 @@ module Sc2
|
|
1448
1510
|
# _@return_ — a group of neutral units
|
1449
1511
|
attr_accessor effects: Sc2::UnitGroup
|
1450
1512
|
|
1513
|
+
# sord omit - no YARD type given for :upgrades_completed, using untyped
|
1514
|
+
# Returns the upgrade ids you have acquired such as weapon upgrade and armor upgrade ids.
|
1515
|
+
# Shorthand for observation.raw_data.player.upgrade_ids
|
1516
|
+
attr_reader upgrades_completed: untyped
|
1517
|
+
|
1451
1518
|
# sord warn - Api::RadarRing wasn't able to be resolved to a constant in this project
|
1452
1519
|
# sord warn - Api::RadarRing wasn't able to be resolved to a constant in this project
|
1453
1520
|
# _@return_ — an array of power sources
|
@@ -1540,17 +1607,18 @@ module Sc2
|
|
1540
1607
|
?queue_command: bool
|
1541
1608
|
) -> untyped
|
1542
1609
|
|
1543
|
-
# sord omit - no YARD type given for "units:", using untyped
|
1544
1610
|
# sord omit - no YARD return type given, using untyped
|
1545
1611
|
# Builds target unit type using units as source at optional target
|
1546
1612
|
#
|
1613
|
+
# _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
|
1614
|
+
#
|
1547
1615
|
# _@param_ `unit_type_id` — Api::UnitTypeId the unit type which will do the creation
|
1548
1616
|
#
|
1549
1617
|
# _@param_ `target` — is a unit tag or a Api::Point2D. Nil for addons/orbital
|
1550
1618
|
#
|
1551
1619
|
# _@param_ `queue_command` — shift+command
|
1552
1620
|
def build: (
|
1553
|
-
units:
|
1621
|
+
units: (::Array[Integer] | Integer | Api::Unit),
|
1554
1622
|
unit_type_id: Integer,
|
1555
1623
|
?target: (Api::Point2D | Integer)?,
|
1556
1624
|
?queue_command: bool
|
@@ -1573,6 +1641,16 @@ module Sc2
|
|
1573
1641
|
?units: untyped
|
1574
1642
|
) -> untyped
|
1575
1643
|
|
1644
|
+
# sord omit - no YARD return type given, using untyped
|
1645
|
+
# Research a specific upgrade
|
1646
|
+
#
|
1647
|
+
# _@param_ `units` — can be an Api::Unit, array of Api::Unit#tag or single tag
|
1648
|
+
#
|
1649
|
+
# _@param_ `upgrade_id` — Api::UpgradeId to research
|
1650
|
+
#
|
1651
|
+
# _@param_ `queue_command` — shift+command
|
1652
|
+
def research: (units: (::Array[Integer] | Integer | Api::Unit), upgrade_id: Integer, ?queue_command: bool) -> untyped
|
1653
|
+
|
1576
1654
|
# Toggles auto-cast ability for units
|
1577
1655
|
#
|
1578
1656
|
# _@param_ `units` — can be an Api::Unit, array of Tags or single Tag
|
@@ -1813,6 +1891,12 @@ module Sc2
|
|
1813
1891
|
# _@return_ — z axis position between -16 and 16
|
1814
1892
|
def terrain_height: (x: (Float | Integer), y: (Float | Integer)) -> Float
|
1815
1893
|
|
1894
|
+
# sord omit - no YARD type given for "position", using untyped
|
1895
|
+
# Returns the terrain height (z) at position x and y for a point
|
1896
|
+
#
|
1897
|
+
# _@return_ — z axis position between -16 and 16
|
1898
|
+
def terrain_height_for_pos: (untyped position) -> Float
|
1899
|
+
|
1816
1900
|
# sord warn - Numo::SFloat wasn't able to be resolved to a constant in this project
|
1817
1901
|
# Returns a parsed terrain_height from bot.game_info.start_raw.
|
1818
1902
|
# Each value in [row][column] holds a float value which is the z height
|
@@ -2135,7 +2219,14 @@ module Sc2
|
|
2135
2219
|
# _@param_ `bot`
|
2136
2220
|
def after_reset: (Sc2::Player::Bot _bot) -> untyped
|
2137
2221
|
|
2138
|
-
#
|
2222
|
+
# Returns the upgrade ids which are researching or queued
|
2223
|
+
# Not set for enemy.
|
2224
|
+
def upgrades_in_progress: () -> ::Array[Integer]
|
2225
|
+
|
2226
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
2227
|
+
# Returns the upgrade ids which are researching or queued
|
2228
|
+
def upgrade_in_progress?: (untyped upgrade_id) -> bool
|
2229
|
+
|
2139
2230
|
# Returns static [Api::UnitTypeData] for a unit
|
2140
2231
|
#
|
2141
2232
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -2147,6 +2238,12 @@ module Sc2
|
|
2147
2238
|
# _@param_ `ability_id` — Api::AbilityId::*
|
2148
2239
|
def ability_data: (Integer ability_id) -> Api::AbilityData
|
2149
2240
|
|
2241
|
+
# sord warn - Api::UpgradeData wasn't able to be resolved to a constant in this project
|
2242
|
+
# Returns static [Api::UpgradeData] for an upgrade id
|
2243
|
+
#
|
2244
|
+
# _@param_ `upgrade_id` — Api::UpgradeId::*
|
2245
|
+
def upgrade_data: (Integer upgrade_id) -> Api::UpgradeData
|
2246
|
+
|
2150
2247
|
# Checks unit data for an attribute value
|
2151
2248
|
#
|
2152
2249
|
# _@param_ `unit` — Api::UnitTypeId or Api::Unit
|
@@ -2177,6 +2274,10 @@ module Sc2
|
|
2177
2274
|
# Checks whether you have the resources to construct quantity of unit type
|
2178
2275
|
def can_afford?: (unit_type_id: untyped, ?quantity: untyped) -> bool
|
2179
2276
|
|
2277
|
+
# sord omit - no YARD type given for "upgrade_id", using untyped
|
2278
|
+
# Checks whether you have the resources to
|
2279
|
+
def can_afford_upgrade?: (untyped upgrade_id) -> bool
|
2280
|
+
|
2180
2281
|
# sord warn - Api::Observation wasn't able to be resolved to a constant in this project
|
2181
2282
|
# sord omit - no YARD return type given, using untyped
|
2182
2283
|
# Divides raw data units into various attributes on every step
|
@@ -2352,7 +2453,6 @@ module Sc2
|
|
2352
2453
|
# _@return_ — Hash<Integer, Api::AbilityData] indexed data
|
2353
2454
|
def abilities_from_proto: (::Array[Api::AbilityData] abilities) -> SORD_ERROR_HashIntegerApiAbilityDataindexeddata
|
2354
2455
|
|
2355
|
-
# sord warn - Api::UnitTypeData wasn't able to be resolved to a constant in this project
|
2356
2456
|
# sord warn - "Hash<Integer, Api::UnitTypeData] indexed data" does not appear to be a type
|
2357
2457
|
# Indexes unit data by id
|
2358
2458
|
#
|
@@ -2378,17 +2478,30 @@ module Sc2
|
|
2378
2478
|
# sord omit - no YARD return type given, using untyped
|
2379
2479
|
def buffs_from_proto: (untyped buffs) -> untyped
|
2380
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
|
+
|
2381
2495
|
# sord warn - Api::AbilityData wasn't able to be resolved to a constant in this project
|
2382
2496
|
# _@return_ — AbilityId => AbilityData
|
2383
2497
|
attr_accessor abilities: (::Hash[Integer, Api::AbilityData] | untyped)
|
2384
2498
|
|
2385
|
-
#
|
2386
|
-
# _@return_ — UnitId => UnitData
|
2499
|
+
# _@return_ — UnitId => UnitTypeData
|
2387
2500
|
attr_accessor units: (::Hash[Integer, Api::UnitTypeData] | untyped)
|
2388
2501
|
|
2389
|
-
# sord warn - Api::
|
2390
|
-
# _@return_ —
|
2391
|
-
attr_accessor upgrades: (::Hash[Integer, Api::
|
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)
|
2392
2505
|
|
2393
2506
|
# sord omit - no YARD type given for :buffs, using untyped
|
2394
2507
|
# Not particularly useful data. Just use BuffId directly
|
@@ -3296,11 +3409,18 @@ module Sc2
|
|
3296
3409
|
# _@return_ — new unit group
|
3297
3410
|
def except: () -> Sc2::UnitGroup
|
3298
3411
|
|
3299
|
-
# Returns a
|
3412
|
+
# Returns a new unit group containing the entries for given tag(s).
|
3300
3413
|
#
|
3301
3414
|
# _@return_ — new unit group
|
3302
3415
|
def slice: () -> Sc2::UnitGroup
|
3303
3416
|
|
3417
|
+
# 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):
|
3418
|
+
#
|
3419
|
+
# _@param_ `other_unit_group`
|
3420
|
+
#
|
3421
|
+
# _@return_ — new unit group
|
3422
|
+
def intersection: (UnitGroup other_unit_group) -> UnitGroup
|
3423
|
+
|
3304
3424
|
# Selects a single random Unit without a parameter or an array of Units with a param, i.e. self.random(2)
|
3305
3425
|
def sample: () -> Api::Unit
|
3306
3426
|
|
@@ -3356,6 +3476,14 @@ module Sc2
|
|
3356
3476
|
# _@param_ `queue_command` — shift+command
|
3357
3477
|
def warp: (unit_type_id: Integer, ?target: Api::Point2D?, ?queue_command: bool) -> untyped
|
3358
3478
|
|
3479
|
+
# sord omit - no YARD return type given, using untyped
|
3480
|
+
# Research a specific upgrade at one of these structures
|
3481
|
+
#
|
3482
|
+
# _@param_ `upgrade_id` — Api::UpgradeId to research
|
3483
|
+
#
|
3484
|
+
# _@param_ `queue_command` — shift+command
|
3485
|
+
def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
|
3486
|
+
|
3359
3487
|
# sord omit - no YARD return type given, using untyped
|
3360
3488
|
# Shorthand for performing action SMART (right-click)
|
3361
3489
|
#
|
@@ -3510,6 +3638,11 @@ module Sc2
|
|
3510
3638
|
# _@return_ — gas structures
|
3511
3639
|
def gas: () -> UnitGroup
|
3512
3640
|
|
3641
|
+
# Selects only units which have finished constructing, i.o.w. build_progress == 1.0
|
3642
|
+
#
|
3643
|
+
# _@return_ — gas structures
|
3644
|
+
def completed: () -> UnitGroup
|
3645
|
+
|
3513
3646
|
# Selects mineral fields
|
3514
3647
|
#
|
3515
3648
|
# _@return_ — mineral fields
|
@@ -3985,6 +4118,9 @@ module Sc2
|
|
3985
4118
|
# _@param_ `player_index`
|
3986
4119
|
def stop: (Integer player_index) -> void
|
3987
4120
|
|
4121
|
+
# sord omit - no YARD return type given, using untyped
|
4122
|
+
def stop_all: () -> untyped
|
4123
|
+
|
3988
4124
|
def initialize: () -> void
|
3989
4125
|
|
3990
4126
|
# Returns the value of attribute clients.
|
@@ -4528,6 +4664,26 @@ module Api
|
|
4528
4664
|
# _@return_ — unit_type_id an array of unit type ids as per Api:UnitTypeId
|
4529
4665
|
def self.upgrade_researched_from: (upgrade_id: Integer) -> Integer
|
4530
4666
|
|
4667
|
+
# sord omit - no YARD type given for "upgrade_id:", using untyped
|
4668
|
+
# Returns the ability which researches this upgrade
|
4669
|
+
#
|
4670
|
+
# _@return_ — ability_id
|
4671
|
+
def self.upgrade_research_ability_id: (upgrade_id: untyped) -> Integer
|
4672
|
+
|
4673
|
+
# Returns a full list of structure unit id's which perform upgrades
|
4674
|
+
# This is a useful list when checking if any updates are in progress,
|
4675
|
+
# because we scan these structure types for orders
|
4676
|
+
#
|
4677
|
+
# _@return_ — unit type ids
|
4678
|
+
def self.upgrade_structure_unit_type_ids: () -> ::Array[Integer]
|
4679
|
+
|
4680
|
+
# Returns hash of upgrade info for a specific structure where the upgrade id is the key
|
4681
|
+
#
|
4682
|
+
# _@param_ `source_unit_type_id` — source structure unit type id
|
4683
|
+
#
|
4684
|
+
# _@return_ — ability_id
|
4685
|
+
def self.upgrade_ability_data: (Integer source_unit_type_id) -> ::Hash[Integer, ::Hash[untyped, untyped]]
|
4686
|
+
|
4531
4687
|
# sord omit - no YARD return type given, using untyped
|
4532
4688
|
def self.unit_type_creation_abilities_data: () -> untyped
|
4533
4689
|
|
@@ -8593,7 +8749,6 @@ module Api
|
|
8593
8749
|
# sord omit - no YARD return type given, using untyped
|
8594
8750
|
def hash: () -> untyped
|
8595
8751
|
|
8596
|
-
# sord warn - Api::UnitTypeData wasn't able to be resolved to a constant in this project
|
8597
8752
|
# Returns static [Api::UnitTypeData] for a unit
|
8598
8753
|
def unit_data: () -> Api::UnitTypeData
|
8599
8754
|
|
@@ -8612,9 +8767,8 @@ module Api
|
|
8612
8767
|
# _@return_ — whether unit has attribute
|
8613
8768
|
#
|
8614
8769
|
# ```ruby
|
8615
|
-
# has_attribute?(Api::
|
8616
|
-
# has_attribute?(
|
8617
|
-
# has_attribute?(Api::UnitTypeId::SCV, :Mechanical)
|
8770
|
+
# unit.has_attribute?(Api::Attribute::Mechanical)
|
8771
|
+
# unit.has_attribute?(:Mechanical)
|
8618
8772
|
# ```
|
8619
8773
|
def has_attribute?: (untyped attribute) -> bool
|
8620
8774
|
|
@@ -8736,12 +8890,21 @@ module Api
|
|
8736
8890
|
# _@param_ `queue_command` — shift+command
|
8737
8891
|
def build: (unit_type_id: Integer, ?target: (Api::Point2D | Integer)?, ?queue_command: bool) -> untyped
|
8738
8892
|
|
8739
|
-
# sord omit - no YARD type given for "queue_command:", using untyped
|
8740
8893
|
# sord omit - no YARD return type given, using untyped
|
8741
8894
|
# Issues repair command on target
|
8742
8895
|
#
|
8743
8896
|
# _@param_ `target` — is a unit or unit tag
|
8744
|
-
|
8897
|
+
#
|
8898
|
+
# _@param_ `queue_command` — shift+command
|
8899
|
+
def repair: (target: (Api::Unit | Integer), ?queue_command: bool) -> untyped
|
8900
|
+
|
8901
|
+
# sord omit - no YARD return type given, using untyped
|
8902
|
+
# Research a specific upgrade
|
8903
|
+
#
|
8904
|
+
# _@param_ `upgrade_id` — Api::UnitTypeId the unit type which will do the creation
|
8905
|
+
#
|
8906
|
+
# _@param_ `queue_command` — shift+command
|
8907
|
+
def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
|
8745
8908
|
|
8746
8909
|
# Draws a placement outline
|
8747
8910
|
# noinspection RubyArgCount
|
@@ -9151,6 +9314,10 @@ module Api
|
|
9151
9314
|
# sord omit - no YARD type given for "other", using untyped
|
9152
9315
|
def eql?: (untyped other) -> bool
|
9153
9316
|
|
9317
|
+
# sord omit - no YARD type given for "z:", using untyped
|
9318
|
+
# Create a new 3d Point, by adding a y axis.
|
9319
|
+
def to_3d: (z: untyped) -> Api::Point
|
9320
|
+
|
9154
9321
|
# A new point representing the sum of this point and the other point.
|
9155
9322
|
#
|
9156
9323
|
# _@param_ `other` — The other point/number to add.
|
@@ -9649,7 +9816,6 @@ module Api
|
|
9649
9816
|
# sord omit - no YARD return type given, using untyped
|
9650
9817
|
def hash: () -> untyped
|
9651
9818
|
|
9652
|
-
# sord warn - Api::UnitTypeData wasn't able to be resolved to a constant in this project
|
9653
9819
|
# Returns static [Api::UnitTypeData] for a unit
|
9654
9820
|
def unit_data: () -> Api::UnitTypeData
|
9655
9821
|
|
@@ -9668,9 +9834,8 @@ module Api
|
|
9668
9834
|
# _@return_ — whether unit has attribute
|
9669
9835
|
#
|
9670
9836
|
# ```ruby
|
9671
|
-
# has_attribute?(Api::
|
9672
|
-
# has_attribute?(
|
9673
|
-
# has_attribute?(Api::UnitTypeId::SCV, :Mechanical)
|
9837
|
+
# unit.has_attribute?(Api::Attribute::Mechanical)
|
9838
|
+
# unit.has_attribute?(:Mechanical)
|
9674
9839
|
# ```
|
9675
9840
|
def has_attribute?: (untyped attribute) -> bool
|
9676
9841
|
|
@@ -9792,12 +9957,21 @@ module Api
|
|
9792
9957
|
# _@param_ `queue_command` — shift+command
|
9793
9958
|
def build: (unit_type_id: Integer, ?target: (Api::Point2D | Integer)?, ?queue_command: bool) -> untyped
|
9794
9959
|
|
9795
|
-
# sord omit - no YARD type given for "queue_command:", using untyped
|
9796
9960
|
# sord omit - no YARD return type given, using untyped
|
9797
9961
|
# Issues repair command on target
|
9798
9962
|
#
|
9799
9963
|
# _@param_ `target` — is a unit or unit tag
|
9800
|
-
|
9964
|
+
#
|
9965
|
+
# _@param_ `queue_command` — shift+command
|
9966
|
+
def repair: (target: (Api::Unit | Integer), ?queue_command: bool) -> untyped
|
9967
|
+
|
9968
|
+
# sord omit - no YARD return type given, using untyped
|
9969
|
+
# Research a specific upgrade
|
9970
|
+
#
|
9971
|
+
# _@param_ `upgrade_id` — Api::UnitTypeId the unit type which will do the creation
|
9972
|
+
#
|
9973
|
+
# _@param_ `queue_command` — shift+command
|
9974
|
+
def research: (upgrade_id: Integer, ?queue_command: bool) -> untyped
|
9801
9975
|
|
9802
9976
|
# Draws a placement outline
|
9803
9977
|
# noinspection RubyArgCount
|
@@ -9951,6 +10125,11 @@ module Api
|
|
9951
10125
|
def is_performing_ability_on_target?: (untyped abilities, ?target: untyped) -> bool
|
9952
10126
|
end
|
9953
10127
|
|
10128
|
+
# Protobuf virtual class.
|
10129
|
+
class UnitTypeData < Google::Protobuf::AbstractMessage
|
10130
|
+
include Api::UnitTypeDataExtension
|
10131
|
+
end
|
10132
|
+
|
9954
10133
|
# Protobuf virtual enum.
|
9955
10134
|
class Race < Google::Protobuf::AbstractMessage
|
9956
10135
|
end
|
@@ -9975,6 +10154,10 @@ module Api
|
|
9975
10154
|
# sord omit - no YARD type given for "other", using untyped
|
9976
10155
|
def eql?: (untyped other) -> bool
|
9977
10156
|
|
10157
|
+
# sord omit - no YARD type given for "z:", using untyped
|
10158
|
+
# Create a new 3d Point, by adding a y axis.
|
10159
|
+
def to_3d: (z: untyped) -> Api::Point
|
10160
|
+
|
9978
10161
|
# Adds additional functionality to message class Api::Point2D
|
9979
10162
|
module ClassMethods
|
9980
10163
|
# sord omit - no YARD type given for "x", using untyped
|
@@ -10121,6 +10304,22 @@ module Api
|
|
10121
10304
|
def []: (untyped x, untyped y, untyped z) -> Api::Point
|
10122
10305
|
end
|
10123
10306
|
end
|
10307
|
+
|
10308
|
+
# Adds additional functionality to message object Api::UnitTypeData
|
10309
|
+
module UnitTypeDataExtension
|
10310
|
+
# Sum of all morphs mineral cost
|
10311
|
+
# i.e. 550M Orbital command = 400M CC + 150M Upgrade
|
10312
|
+
# i.e. 350M Hatchery = 50M Drone + 300M Build
|
10313
|
+
#
|
10314
|
+
# _@return_ — sum of mineral costs
|
10315
|
+
attr_accessor mineral_cost_sum: (Integer | untyped)
|
10316
|
+
|
10317
|
+
# Sum of all morphs vespene gas cost
|
10318
|
+
# i.e. 250G Broodlord = 100G Corruptor + 150G Morph
|
10319
|
+
#
|
10320
|
+
# _@return_ — sum of vespene gas costs
|
10321
|
+
attr_accessor vespene_cost_sum: (Integer | untyped)
|
10322
|
+
end
|
10124
10323
|
end
|
10125
10324
|
|
10126
10325
|
# Array extensions
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sc2ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dyson Returns
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|
@@ -262,8 +262,22 @@ dependencies:
|
|
262
262
|
- - "~>"
|
263
263
|
- !ruby/object:Gem::Version
|
264
264
|
version: '3.13'
|
265
|
-
|
266
|
-
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: async-rspec
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '1.17'
|
272
|
+
type: :development
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - "~>"
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '1.17'
|
279
|
+
description: This is a Ruby interface to STARCRAFT® II. Write your own AI using an
|
280
|
+
easy interface and compete against others.
|
267
281
|
email:
|
268
282
|
executables:
|
269
283
|
- sc2ai
|
@@ -335,6 +349,7 @@ files:
|
|
335
349
|
- lib/sc2ai/protocol/extensions/position.rb
|
336
350
|
- lib/sc2ai/protocol/extensions/power_source.rb
|
337
351
|
- lib/sc2ai/protocol/extensions/unit.rb
|
352
|
+
- lib/sc2ai/protocol/extensions/unit_type_data.rb
|
338
353
|
- lib/sc2ai/protocol/query_pb.rb
|
339
354
|
- lib/sc2ai/protocol/raw_pb.rb
|
340
355
|
- lib/sc2ai/protocol/sc2api_pb.rb
|