sc2ai 0.0.0.pre → 0.0.3
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 -0
- data/data/data_readable.json +22946 -0
- data/data/sc2ai/protocol/common.proto +59 -0
- data/data/sc2ai/protocol/data.proto +120 -0
- data/data/sc2ai/protocol/debug.proto +127 -0
- data/data/sc2ai/protocol/error.proto +221 -0
- data/data/sc2ai/protocol/query.proto +55 -0
- data/data/sc2ai/protocol/raw.proto +202 -0
- data/data/sc2ai/protocol/sc2api.proto +718 -0
- data/data/sc2ai/protocol/score.proto +108 -0
- data/data/sc2ai/protocol/spatial.proto +115 -0
- data/data/sc2ai/protocol/ui.proto +145 -0
- data/data/setup/setup.SC2Map +0 -0
- data/data/setup/setup.SC2Replay +0 -0
- data/data/stableid.json +37900 -0
- data/data/versions.json +554 -0
- data/exe/sc2ai +35 -0
- data/lib/docker_build/Dockerfile.ruby +74 -0
- data/lib/docker_build/docker-compose-base-image.yml +10 -0
- data/lib/docker_build/docker-compose-ladderzip.yml +9 -0
- data/lib/sc2ai/api/ability_id.rb +1951 -0
- data/lib/sc2ai/api/buff_id.rb +316 -0
- data/lib/sc2ai/api/data.rb +101 -0
- data/lib/sc2ai/api/effect_id.rb +20 -0
- data/lib/sc2ai/api/tech_tree.rb +82 -0
- data/lib/sc2ai/api/tech_tree_data.rb +2342 -0
- data/lib/sc2ai/api/unit_type_id.rb +2074 -0
- data/lib/sc2ai/api/upgrade_id.rb +312 -0
- data/lib/sc2ai/cli/cli.rb +177 -0
- data/lib/sc2ai/cli/ladderzip.rb +173 -0
- data/lib/sc2ai/cli/new.rb +88 -0
- data/lib/sc2ai/configuration.rb +145 -0
- data/lib/sc2ai/connection/connection_listener.rb +30 -0
- data/lib/sc2ai/connection/requests.rb +417 -0
- data/lib/sc2ai/connection/status_listener.rb +15 -0
- data/lib/sc2ai/connection.rb +146 -0
- data/lib/sc2ai/local_play/client/configurable_options.rb +115 -0
- data/lib/sc2ai/local_play/client.rb +159 -0
- data/lib/sc2ai/local_play/client_manager.rb +70 -0
- data/lib/sc2ai/local_play/map_file.rb +48 -0
- data/lib/sc2ai/local_play/match.rb +184 -0
- data/lib/sc2ai/overrides/array.rb +14 -0
- data/lib/sc2ai/overrides/async/process/child.rb +31 -0
- data/lib/sc2ai/overrides/kernel.rb +33 -0
- data/lib/sc2ai/paths.rb +294 -0
- data/lib/sc2ai/player/actions.rb +386 -0
- data/lib/sc2ai/player/debug.rb +224 -0
- data/lib/sc2ai/player/game_state.rb +131 -0
- data/lib/sc2ai/player/geometry.rb +766 -0
- data/lib/sc2ai/player/previous_state.rb +49 -0
- data/lib/sc2ai/player/units.rb +337 -0
- data/lib/sc2ai/player.rb +661 -0
- data/lib/sc2ai/ports.rb +152 -0
- data/lib/sc2ai/protocol/_meta_documentation.rb +39 -0
- data/lib/sc2ai/protocol/common_pb.rb +43 -0
- data/lib/sc2ai/protocol/data_pb.rb +47 -0
- data/lib/sc2ai/protocol/debug_pb.rb +56 -0
- data/lib/sc2ai/protocol/error_pb.rb +36 -0
- data/lib/sc2ai/protocol/extensions/color.rb +20 -0
- data/lib/sc2ai/protocol/extensions/point.rb +23 -0
- data/lib/sc2ai/protocol/extensions/point_2_d.rb +26 -0
- data/lib/sc2ai/protocol/extensions/position.rb +202 -0
- data/lib/sc2ai/protocol/extensions/power_source.rb +19 -0
- data/lib/sc2ai/protocol/extensions/unit.rb +489 -0
- data/lib/sc2ai/protocol/query_pb.rb +47 -0
- data/lib/sc2ai/protocol/raw_pb.rb +57 -0
- data/lib/sc2ai/protocol/sc2api_pb.rb +130 -0
- data/lib/sc2ai/protocol/score_pb.rb +40 -0
- data/lib/sc2ai/protocol/spatial_pb.rb +48 -0
- data/lib/sc2ai/protocol/ui_pb.rb +56 -0
- data/lib/sc2ai/unit_group/action_ext.rb +74 -0
- data/lib/sc2ai/unit_group/filter_ext.rb +379 -0
- data/lib/sc2ai/unit_group.rb +277 -0
- data/lib/sc2ai/version.rb +2 -1
- data/lib/sc2ai.rb +93 -2
- data/lib/templates/ladderzip/bin/ladder.tt +23 -0
- data/lib/templates/new/.ladderignore +20 -0
- data/lib/templates/new/Gemfile.tt +7 -0
- data/lib/templates/new/api/common.proto +59 -0
- data/lib/templates/new/api/data.proto +120 -0
- data/lib/templates/new/api/debug.proto +127 -0
- data/lib/templates/new/api/error.proto +221 -0
- data/lib/templates/new/api/query.proto +55 -0
- data/lib/templates/new/api/raw.proto +202 -0
- data/lib/templates/new/api/sc2api.proto +718 -0
- data/lib/templates/new/api/score.proto +108 -0
- data/lib/templates/new/api/spatial.proto +115 -0
- data/lib/templates/new/api/ui.proto +145 -0
- data/lib/templates/new/boot.rb.tt +6 -0
- data/lib/templates/new/my_bot.rb.tt +23 -0
- data/lib/templates/new/run_example_match.rb.tt +14 -0
- metadata +353 -9
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: sc2ai/protocol/query.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'sc2ai/protocol/common_pb'
|
8
|
+
require 'sc2ai/protocol/error_pb'
|
9
|
+
|
10
|
+
|
11
|
+
descriptor_data = "\n\x1asc2ai/protocol/query.proto\x12\x03\x41pi\x1a\x1bsc2ai/protocol/common.proto\x1a\x1asc2ai/protocol/error.proto\"\xcf\x01\n\x0cRequestQuery\x12)\n\x07pathing\x18\x01 \x03(\x0b\x32\x18.Api.RequestQueryPathing\x12\x36\n\tabilities\x18\x02 \x03(\x0b\x32#.Api.RequestQueryAvailableAbilities\x12\x36\n\nplacements\x18\x03 \x03(\x0b\x32\".Api.RequestQueryBuildingPlacement\x12$\n\x1cignore_resource_requirements\x18\x04 \x01(\x08\"\xad\x01\n\rResponseQuery\x12*\n\x07pathing\x18\x01 \x03(\x0b\x32\x19.Api.ResponseQueryPathing\x12\x37\n\tabilities\x18\x02 \x03(\x0b\x32$.Api.ResponseQueryAvailableAbilities\x12\x37\n\nplacements\x18\x03 \x03(\x0b\x32#.Api.ResponseQueryBuildingPlacement\"t\n\x13RequestQueryPathing\x12!\n\tstart_pos\x18\x01 \x01(\x0b\x32\x0c.Api.Point2DH\x00\x12\x12\n\x08unit_tag\x18\x02 \x01(\x04H\x00\x12\x1d\n\x07\x65nd_pos\x18\x03 \x01(\x0b\x32\x0c.Api.Point2DB\x07\n\x05start\"(\n\x14ResponseQueryPathing\x12\x10\n\x08\x64istance\x18\x01 \x01(\x02\"2\n\x1eRequestQueryAvailableAbilities\x12\x10\n\x08unit_tag\x18\x01 \x01(\x04\"s\n\x1fResponseQueryAvailableAbilities\x12(\n\tabilities\x18\x01 \x03(\x0b\x32\x15.Api.AvailableAbility\x12\x10\n\x08unit_tag\x18\x02 \x01(\x04\x12\x14\n\x0cunit_type_id\x18\x03 \x01(\r\"o\n\x1dRequestQueryBuildingPlacement\x12\x12\n\nability_id\x18\x01 \x01(\x05\x12 \n\ntarget_pos\x18\x02 \x01(\x0b\x32\x0c.Api.Point2D\x12\x18\n\x10placing_unit_tag\x18\x03 \x01(\x04\"C\n\x1eResponseQueryBuildingPlacement\x12!\n\x06result\x18\x01 \x01(\x0e\x32\x11.Api.ActionResult"
|
12
|
+
|
13
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
|
+
|
15
|
+
begin
|
16
|
+
pool.add_serialized_file(descriptor_data)
|
17
|
+
rescue TypeError
|
18
|
+
# Compatibility code: will be removed in the next major version.
|
19
|
+
require 'google/protobuf/descriptor_pb'
|
20
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
21
|
+
parsed.clear_dependency
|
22
|
+
serialized = parsed.class.encode(parsed)
|
23
|
+
file = pool.add_serialized_file(serialized)
|
24
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
25
|
+
imports = [
|
26
|
+
["Api.Point2D", "sc2ai/protocol/common.proto"],
|
27
|
+
]
|
28
|
+
imports.each do |type_name, expected_filename|
|
29
|
+
import_file = pool.lookup(type_name).file_descriptor
|
30
|
+
if import_file.name != expected_filename
|
31
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
35
|
+
warn "This will become an error in the next major version."
|
36
|
+
end
|
37
|
+
|
38
|
+
module Api
|
39
|
+
RequestQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQuery").msgclass
|
40
|
+
ResponseQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQuery").msgclass
|
41
|
+
RequestQueryPathing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQueryPathing").msgclass
|
42
|
+
ResponseQueryPathing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQueryPathing").msgclass
|
43
|
+
RequestQueryAvailableAbilities = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQueryAvailableAbilities").msgclass
|
44
|
+
ResponseQueryAvailableAbilities = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQueryAvailableAbilities").msgclass
|
45
|
+
RequestQueryBuildingPlacement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQueryBuildingPlacement").msgclass
|
46
|
+
ResponseQueryBuildingPlacement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQueryBuildingPlacement").msgclass
|
47
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: sc2ai/protocol/raw.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'sc2ai/protocol/common_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n\x18sc2ai/protocol/raw.proto\x12\x03\x41pi\x1a\x1bsc2ai/protocol/common.proto\"\xef\x01\n\x08StartRaw\x12\x1e\n\x08map_size\x18\x01 \x01(\x0b\x32\x0c.Api.Size2DI\x12$\n\x0cpathing_grid\x18\x02 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\x0eterrain_height\x18\x03 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\x0eplacement_grid\x18\x04 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\rplayable_area\x18\x05 \x01(\x0b\x32\x0f.Api.RectangleI\x12%\n\x0fstart_locations\x18\x06 \x03(\x0b\x32\x0c.Api.Point2D\"\xc4\x01\n\x0eObservationRaw\x12\x1e\n\x06player\x18\x01 \x01(\x0b\x32\x0e.Api.PlayerRaw\x12\x18\n\x05units\x18\x02 \x03(\x0b\x32\t.Api.Unit\x12 \n\tmap_state\x18\x03 \x01(\x0b\x32\r.Api.MapState\x12\x19\n\x05\x65vent\x18\x04 \x01(\x0b\x32\n.Api.Event\x12\x1c\n\x07\x65\x66\x66\x65\x63ts\x18\x05 \x03(\x0b\x32\x0b.Api.Effect\x12\x1d\n\x05radar\x18\x06 \x03(\x0b\x32\x0e.Api.RadarRing\"4\n\tRadarRing\x12\x17\n\x03pos\x18\x01 \x01(\x0b\x32\n.Api.Point\x12\x0e\n\x06radius\x18\x02 \x01(\x02\"C\n\x0bPowerSource\x12\x17\n\x03pos\x18\x01 \x01(\x0b\x32\n.Api.Point\x12\x0e\n\x06radius\x18\x02 \x01(\x02\x12\x0b\n\x03tag\x18\x03 \x01(\x04\"e\n\tPlayerRaw\x12\'\n\rpower_sources\x18\x01 \x03(\x0b\x32\x10.Api.PowerSource\x12\x1a\n\x06\x63\x61mera\x18\x02 \x01(\x0b\x32\n.Api.Point\x12\x13\n\x0bupgrade_ids\x18\x03 \x03(\r\"\x84\x01\n\tUnitOrder\x12\x12\n\nability_id\x18\x01 \x01(\r\x12,\n\x16target_world_space_pos\x18\x02 \x01(\x0b\x32\n.Api.PointH\x00\x12\x19\n\x0ftarget_unit_tag\x18\x03 \x01(\x04H\x00\x12\x10\n\x08progress\x18\x04 \x01(\x02\x42\x08\n\x06target\"\x9b\x01\n\rPassengerUnit\x12\x0b\n\x03tag\x18\x01 \x01(\x04\x12\x0e\n\x06health\x18\x02 \x01(\x02\x12\x12\n\nhealth_max\x18\x03 \x01(\x02\x12\x0e\n\x06shield\x18\x04 \x01(\x02\x12\x12\n\nshield_max\x18\x07 \x01(\x02\x12\x0e\n\x06\x65nergy\x18\x05 \x01(\x02\x12\x12\n\nenergy_max\x18\x08 \x01(\x02\x12\x11\n\tunit_type\x18\x06 \x01(\r\"5\n\x0bRallyTarget\x12\x19\n\x05point\x18\x01 \x01(\x0b\x32\n.Api.Point\x12\x0b\n\x03tag\x18\x02 \x01(\x04\"\xa8\x08\n\x04Unit\x12&\n\x0c\x64isplay_type\x18\x01 \x01(\x0e\x32\x10.Api.DisplayType\x12\x1f\n\x08\x61lliance\x18\x02 \x01(\x0e\x32\r.Api.Alliance\x12\x0b\n\x03tag\x18\x03 \x01(\x04\x12\x11\n\tunit_type\x18\x04 \x01(\r\x12\r\n\x05owner\x18\x05 \x01(\x05\x12\x17\n\x03pos\x18\x06 \x01(\x0b\x32\n.Api.Point\x12\x0e\n\x06\x66\x61\x63ing\x18\x07 \x01(\x02\x12\x0e\n\x06radius\x18\x08 \x01(\x02\x12\x16\n\x0e\x62uild_progress\x18\t \x01(\x02\x12\x1e\n\x05\x63loak\x18\n \x01(\x0e\x32\x0f.Api.CloakState\x12\x10\n\x08\x62uff_ids\x18\x1b \x03(\r\x12\x14\n\x0c\x64\x65tect_range\x18\x1f \x01(\x02\x12\x13\n\x0bradar_range\x18 \x01(\x02\x12\x13\n\x0bis_selected\x18\x0b \x01(\x08\x12\x14\n\x0cis_on_screen\x18\x0c \x01(\x08\x12\x0f\n\x07is_blip\x18\r \x01(\x08\x12\x12\n\nis_powered\x18# \x01(\x08\x12\x11\n\tis_active\x18\' \x01(\x08\x12\x1c\n\x14\x61ttack_upgrade_level\x18( \x01(\x05\x12\x1b\n\x13\x61rmor_upgrade_level\x18) \x01(\x05\x12\x1c\n\x14shield_upgrade_level\x18* \x01(\x05\x12\x0e\n\x06health\x18\x0e \x01(\x02\x12\x12\n\nhealth_max\x18\x0f \x01(\x02\x12\x0e\n\x06shield\x18\x10 \x01(\x02\x12\x12\n\nshield_max\x18$ \x01(\x02\x12\x0e\n\x06\x65nergy\x18\x11 \x01(\x02\x12\x12\n\nenergy_max\x18% \x01(\x02\x12\x18\n\x10mineral_contents\x18\x12 \x01(\x05\x12\x18\n\x10vespene_contents\x18\x13 \x01(\x05\x12\x11\n\tis_flying\x18\x14 \x01(\x08\x12\x13\n\x0bis_burrowed\x18\x15 \x01(\x08\x12\x18\n\x10is_hallucination\x18& \x01(\x08\x12\x1e\n\x06orders\x18\x16 \x03(\x0b\x32\x0e.Api.UnitOrder\x12\x12\n\nadd_on_tag\x18\x17 \x01(\x04\x12&\n\npassengers\x18\x18 \x03(\x0b\x32\x12.Api.PassengerUnit\x12\x19\n\x11\x63\x61rgo_space_taken\x18\x19 \x01(\x05\x12\x17\n\x0f\x63\x61rgo_space_max\x18\x1a \x01(\x05\x12\x1b\n\x13\x61ssigned_harvesters\x18\x1c \x01(\x05\x12\x18\n\x10ideal_harvesters\x18\x1d \x01(\x05\x12\x17\n\x0fweapon_cooldown\x18\x1e \x01(\x02\x12\x1a\n\x12\x65ngaged_target_tag\x18\" \x01(\x04\x12\x1c\n\x14\x62uff_duration_remain\x18+ \x01(\x05\x12\x19\n\x11\x62uff_duration_max\x18, \x01(\x05\x12\'\n\rrally_targets\x18- \x03(\x0b\x32\x10.Api.RallyTarget\"M\n\x08MapState\x12\"\n\nvisibility\x18\x01 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1d\n\x05\x63reep\x18\x02 \x01(\x0b\x32\x0e.Api.ImageData\"\x1b\n\x05\x45vent\x12\x12\n\ndead_units\x18\x01 \x03(\x04\"v\n\x06\x45\x66\x66\x65\x63t\x12\x11\n\teffect_id\x18\x01 \x01(\r\x12\x19\n\x03pos\x18\x02 \x03(\x0b\x32\x0c.Api.Point2D\x12\x1f\n\x08\x61lliance\x18\x03 \x01(\x0e\x32\r.Api.Alliance\x12\r\n\x05owner\x18\x04 \x01(\x05\x12\x0e\n\x06radius\x18\x05 \x01(\x02\"\xb2\x01\n\tActionRaw\x12\x31\n\x0cunit_command\x18\x01 \x01(\x0b\x32\x19.Api.ActionRawUnitCommandH\x00\x12/\n\x0b\x63\x61mera_move\x18\x02 \x01(\x0b\x32\x18.Api.ActionRawCameraMoveH\x00\x12\x37\n\x0ftoggle_autocast\x18\x03 \x01(\x0b\x32\x1c.Api.ActionRawToggleAutocastH\x00\x42\x08\n\x06\x61\x63tion\"\xa9\x01\n\x14\x41\x63tionRawUnitCommand\x12\x12\n\nability_id\x18\x01 \x01(\x05\x12.\n\x16target_world_space_pos\x18\x02 \x01(\x0b\x32\x0c.Api.Point2DH\x00\x12\x19\n\x0ftarget_unit_tag\x18\x03 \x01(\x04H\x00\x12\x11\n\tunit_tags\x18\x04 \x03(\x04\x12\x15\n\rqueue_command\x18\x05 \x01(\x08\x42\x08\n\x06target\"=\n\x13\x41\x63tionRawCameraMove\x12&\n\x12\x63\x65nter_world_space\x18\x01 \x01(\x0b\x32\n.Api.Point\"@\n\x17\x41\x63tionRawToggleAutocast\x12\x12\n\nability_id\x18\x01 \x01(\x05\x12\x11\n\tunit_tags\x18\x02 \x03(\x04*E\n\x0b\x44isplayType\x12\x0b\n\x07Visible\x10\x01\x12\x0c\n\x08Snapshot\x10\x02\x12\n\n\x06Hidden\x10\x03\x12\x0f\n\x0bPlaceholder\x10\x04*6\n\x08\x41lliance\x12\x08\n\x04Self\x10\x01\x12\x08\n\x04\x41lly\x10\x02\x12\x0b\n\x07Neutral\x10\x03\x12\t\n\x05\x45nemy\x10\x04*e\n\nCloakState\x12\x12\n\x0e\x43loakedUnknown\x10\x00\x12\x0b\n\x07\x43loaked\x10\x01\x12\x13\n\x0f\x43loakedDetected\x10\x02\x12\x0e\n\nNotCloaked\x10\x03\x12\x11\n\rCloakedAllied\x10\x04"
|
11
|
+
|
12
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
|
14
|
+
begin
|
15
|
+
pool.add_serialized_file(descriptor_data)
|
16
|
+
rescue TypeError
|
17
|
+
# Compatibility code: will be removed in the next major version.
|
18
|
+
require 'google/protobuf/descriptor_pb'
|
19
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
20
|
+
parsed.clear_dependency
|
21
|
+
serialized = parsed.class.encode(parsed)
|
22
|
+
file = pool.add_serialized_file(serialized)
|
23
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
24
|
+
imports = [
|
25
|
+
["Api.Size2DI", "sc2ai/protocol/common.proto"],
|
26
|
+
]
|
27
|
+
imports.each do |type_name, expected_filename|
|
28
|
+
import_file = pool.lookup(type_name).file_descriptor
|
29
|
+
if import_file.name != expected_filename
|
30
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
34
|
+
warn "This will become an error in the next major version."
|
35
|
+
end
|
36
|
+
|
37
|
+
module Api
|
38
|
+
StartRaw = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.StartRaw").msgclass
|
39
|
+
ObservationRaw = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ObservationRaw").msgclass
|
40
|
+
RadarRing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RadarRing").msgclass
|
41
|
+
PowerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PowerSource").msgclass
|
42
|
+
PlayerRaw = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerRaw").msgclass
|
43
|
+
UnitOrder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.UnitOrder").msgclass
|
44
|
+
PassengerUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PassengerUnit").msgclass
|
45
|
+
RallyTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RallyTarget").msgclass
|
46
|
+
Unit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Unit").msgclass
|
47
|
+
MapState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.MapState").msgclass
|
48
|
+
Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Event").msgclass
|
49
|
+
Effect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Effect").msgclass
|
50
|
+
ActionRaw = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionRaw").msgclass
|
51
|
+
ActionRawUnitCommand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionRawUnitCommand").msgclass
|
52
|
+
ActionRawCameraMove = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionRawCameraMove").msgclass
|
53
|
+
ActionRawToggleAutocast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionRawToggleAutocast").msgclass
|
54
|
+
DisplayType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.DisplayType").enummodule
|
55
|
+
Alliance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Alliance").enummodule
|
56
|
+
CloakState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.CloakState").enummodule
|
57
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: sc2ai/protocol/sc2api.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'sc2ai/protocol/common_pb'
|
8
|
+
require 'sc2ai/protocol/data_pb'
|
9
|
+
require 'sc2ai/protocol/debug_pb'
|
10
|
+
require 'sc2ai/protocol/error_pb'
|
11
|
+
require 'sc2ai/protocol/query_pb'
|
12
|
+
require 'sc2ai/protocol/raw_pb'
|
13
|
+
require 'sc2ai/protocol/score_pb'
|
14
|
+
require 'sc2ai/protocol/spatial_pb'
|
15
|
+
require 'sc2ai/protocol/ui_pb'
|
16
|
+
|
17
|
+
|
18
|
+
descriptor_data = "\n\x1bsc2ai/protocol/sc2api.proto\x12\x03\x41pi\x1a\x1bsc2ai/protocol/common.proto\x1a\x19sc2ai/protocol/data.proto\x1a\x1asc2ai/protocol/debug.proto\x1a\x1asc2ai/protocol/error.proto\x1a\x1asc2ai/protocol/query.proto\x1a\x18sc2ai/protocol/raw.proto\x1a\x1asc2ai/protocol/score.proto\x1a\x1csc2ai/protocol/spatial.proto\x1a\x17sc2ai/protocol/ui.proto\"\xd1\x07\n\x07Request\x12-\n\x0b\x63reate_game\x18\x01 \x01(\x0b\x32\x16.Api.RequestCreateGameH\x00\x12)\n\tjoin_game\x18\x02 \x01(\x0b\x32\x14.Api.RequestJoinGameH\x00\x12/\n\x0crestart_game\x18\x03 \x01(\x0b\x32\x17.Api.RequestRestartGameH\x00\x12/\n\x0cstart_replay\x18\x04 \x01(\x0b\x32\x17.Api.RequestStartReplayH\x00\x12+\n\nleave_game\x18\x05 \x01(\x0b\x32\x15.Api.RequestLeaveGameH\x00\x12+\n\nquick_save\x18\x06 \x01(\x0b\x32\x15.Api.RequestQuickSaveH\x00\x12+\n\nquick_load\x18\x07 \x01(\x0b\x32\x15.Api.RequestQuickLoadH\x00\x12 \n\x04quit\x18\x08 \x01(\x0b\x32\x10.Api.RequestQuitH\x00\x12)\n\tgame_info\x18\t \x01(\x0b\x32\x14.Api.RequestGameInfoH\x00\x12.\n\x0bobservation\x18\n \x01(\x0b\x32\x17.Api.RequestObservationH\x00\x12$\n\x06\x61\x63tion\x18\x0b \x01(\x0b\x32\x12.Api.RequestActionH\x00\x12\x30\n\nobs_action\x18\x15 \x01(\x0b\x32\x1a.Api.RequestObserverActionH\x00\x12 \n\x04step\x18\x0c \x01(\x0b\x32\x10.Api.RequestStepH\x00\x12 \n\x04\x64\x61ta\x18\r \x01(\x0b\x32\x10.Api.RequestDataH\x00\x12\"\n\x05query\x18\x0e \x01(\x0b\x32\x11.Api.RequestQueryH\x00\x12-\n\x0bsave_replay\x18\x0f \x01(\x0b\x32\x16.Api.RequestSaveReplayH\x00\x12-\n\x0bmap_command\x18\x16 \x01(\x0b\x32\x16.Api.RequestMapCommandH\x00\x12-\n\x0breplay_info\x18\x10 \x01(\x0b\x32\x16.Api.RequestReplayInfoH\x00\x12\x33\n\x0e\x61vailable_maps\x18\x11 \x01(\x0b\x32\x19.Api.RequestAvailableMapsH\x00\x12\'\n\x08save_map\x18\x12 \x01(\x0b\x32\x13.Api.RequestSaveMapH\x00\x12 \n\x04ping\x18\x13 \x01(\x0b\x32\x10.Api.RequestPingH\x00\x12\"\n\x05\x64\x65\x62ug\x18\x14 \x01(\x0b\x32\x11.Api.RequestDebugH\x00\x12\n\n\x02id\x18\x61 \x01(\rB\t\n\x07request\"\x95\x08\n\x08Response\x12.\n\x0b\x63reate_game\x18\x01 \x01(\x0b\x32\x17.Api.ResponseCreateGameH\x00\x12*\n\tjoin_game\x18\x02 \x01(\x0b\x32\x15.Api.ResponseJoinGameH\x00\x12\x30\n\x0crestart_game\x18\x03 \x01(\x0b\x32\x18.Api.ResponseRestartGameH\x00\x12\x30\n\x0cstart_replay\x18\x04 \x01(\x0b\x32\x18.Api.ResponseStartReplayH\x00\x12,\n\nleave_game\x18\x05 \x01(\x0b\x32\x16.Api.ResponseLeaveGameH\x00\x12,\n\nquick_save\x18\x06 \x01(\x0b\x32\x16.Api.ResponseQuickSaveH\x00\x12,\n\nquick_load\x18\x07 \x01(\x0b\x32\x16.Api.ResponseQuickLoadH\x00\x12!\n\x04quit\x18\x08 \x01(\x0b\x32\x11.Api.ResponseQuitH\x00\x12*\n\tgame_info\x18\t \x01(\x0b\x32\x15.Api.ResponseGameInfoH\x00\x12/\n\x0bobservation\x18\n \x01(\x0b\x32\x18.Api.ResponseObservationH\x00\x12%\n\x06\x61\x63tion\x18\x0b \x01(\x0b\x32\x13.Api.ResponseActionH\x00\x12\x31\n\nobs_action\x18\x15 \x01(\x0b\x32\x1b.Api.ResponseObserverActionH\x00\x12!\n\x04step\x18\x0c \x01(\x0b\x32\x11.Api.ResponseStepH\x00\x12!\n\x04\x64\x61ta\x18\r \x01(\x0b\x32\x11.Api.ResponseDataH\x00\x12#\n\x05query\x18\x0e \x01(\x0b\x32\x12.Api.ResponseQueryH\x00\x12.\n\x0bsave_replay\x18\x0f \x01(\x0b\x32\x17.Api.ResponseSaveReplayH\x00\x12.\n\x0breplay_info\x18\x10 \x01(\x0b\x32\x17.Api.ResponseReplayInfoH\x00\x12\x34\n\x0e\x61vailable_maps\x18\x11 \x01(\x0b\x32\x1a.Api.ResponseAvailableMapsH\x00\x12(\n\x08save_map\x18\x12 \x01(\x0b\x32\x14.Api.ResponseSaveMapH\x00\x12.\n\x0bmap_command\x18\x16 \x01(\x0b\x32\x17.Api.ResponseMapCommandH\x00\x12!\n\x04ping\x18\x13 \x01(\x0b\x32\x11.Api.ResponsePingH\x00\x12#\n\x05\x64\x65\x62ug\x18\x14 \x01(\x0b\x32\x12.Api.ResponseDebugH\x00\x12\n\n\x02id\x18\x61 \x01(\r\x12\r\n\x05\x65rror\x18\x62 \x03(\t\x12\x1b\n\x06status\x18\x63 \x01(\x0e\x32\x0b.Api.StatusB\n\n\x08response\"\xc0\x01\n\x11RequestCreateGame\x12\"\n\tlocal_map\x18\x01 \x01(\x0b\x32\r.Api.LocalMapH\x00\x12\x1c\n\x12\x62\x61ttlenet_map_name\x18\x02 \x01(\tH\x00\x12&\n\x0cplayer_setup\x18\x03 \x03(\x0b\x32\x10.Api.PlayerSetup\x12\x13\n\x0b\x64isable_fog\x18\x04 \x01(\x08\x12\x13\n\x0brandom_seed\x18\x05 \x01(\r\x12\x10\n\x08realtime\x18\x06 \x01(\x08\x42\x05\n\x03Map\".\n\x08LocalMap\x12\x10\n\x08map_path\x18\x01 \x01(\t\x12\x10\n\x08map_data\x18\x07 \x01(\x0c\"\x91\x02\n\x12ResponseCreateGame\x12,\n\x05\x65rror\x18\x01 \x01(\x0e\x32\x1d.Api.ResponseCreateGame.Error\x12\x15\n\rerror_details\x18\x02 \x01(\t\"\xb5\x01\n\x05\x45rror\x12\x0e\n\nMissingMap\x10\x01\x12\x12\n\x0eInvalidMapPath\x10\x02\x12\x12\n\x0eInvalidMapData\x10\x03\x12\x12\n\x0eInvalidMapName\x10\x04\x12\x14\n\x10InvalidMapHandle\x10\x05\x12\x16\n\x12MissingPlayerSetup\x10\x06\x12\x16\n\x12InvalidPlayerSetup\x10\x07\x12\x1a\n\x16MultiplayerUnsupported\x10\x08\"\x86\x02\n\x0fRequestJoinGame\x12\x19\n\x04race\x18\x01 \x01(\x0e\x32\t.Api.RaceH\x00\x12\x1c\n\x12observed_player_id\x18\x02 \x01(\rH\x00\x12&\n\x07options\x18\x03 \x01(\x0b\x32\x15.Api.InterfaceOptions\x12\"\n\x0cserver_ports\x18\x04 \x01(\x0b\x32\x0c.Api.PortSet\x12\"\n\x0c\x63lient_ports\x18\x05 \x03(\x0b\x32\x0c.Api.PortSet\x12\x13\n\x0bshared_port\x18\x06 \x01(\x05\x12\x13\n\x0bplayer_name\x18\x07 \x01(\t\x12\x0f\n\x07host_ip\x18\x08 \x01(\tB\x0f\n\rparticipation\"/\n\x07PortSet\x12\x11\n\tgame_port\x18\x01 \x01(\x05\x12\x11\n\tbase_port\x18\x02 \x01(\x05\"\xf7\x02\n\x10ResponseJoinGame\x12\x11\n\tplayer_id\x18\x01 \x01(\r\x12*\n\x05\x65rror\x18\x02 \x01(\x0e\x32\x1b.Api.ResponseJoinGame.Error\x12\x15\n\rerror_details\x18\x03 \x01(\t\"\x8c\x02\n\x05\x45rror\x12\x18\n\x14MissingParticipation\x10\x01\x12\x1b\n\x17InvalidObservedPlayerId\x10\x02\x12\x12\n\x0eMissingOptions\x10\x03\x12\x10\n\x0cMissingPorts\x10\x04\x12\x0c\n\x08GameFull\x10\x05\x12\x0f\n\x0bLaunchError\x10\x06\x12\x16\n\x12\x46\x65\x61tureUnsupported\x10\x07\x12\x12\n\x0eNoSpaceForUser\x10\x08\x12\x13\n\x0fMapDoesNotExist\x10\t\x12\x11\n\rCannotOpenMap\x10\n\x12\x11\n\rChecksumError\x10\x0b\x12\x10\n\x0cNetworkError\x10\x0c\x12\x0e\n\nOtherError\x10\r\"\x14\n\x12RequestRestartGame\"\x8e\x01\n\x13ResponseRestartGame\x12-\n\x05\x65rror\x18\x01 \x01(\x0e\x32\x1e.Api.ResponseRestartGame.Error\x12\x15\n\rerror_details\x18\x02 \x01(\t\x12\x17\n\x0fneed_hard_reset\x18\x03 \x01(\x08\"\x18\n\x05\x45rror\x12\x0f\n\x0bLaunchError\x10\x01\"\xe0\x01\n\x12RequestStartReplay\x12\x15\n\x0breplay_path\x18\x01 \x01(\tH\x00\x12\x15\n\x0breplay_data\x18\x05 \x01(\x0cH\x00\x12\x10\n\x08map_data\x18\x06 \x01(\x0c\x12\x1a\n\x12observed_player_id\x18\x02 \x01(\x05\x12&\n\x07options\x18\x03 \x01(\x0b\x32\x15.Api.InterfaceOptions\x12\x13\n\x0b\x64isable_fog\x18\x04 \x01(\x08\x12\x10\n\x08realtime\x18\x07 \x01(\x08\x12\x15\n\rrecord_replay\x18\x08 \x01(\x08\x42\x08\n\x06replay\"\xfc\x01\n\x13ResponseStartReplay\x12-\n\x05\x65rror\x18\x01 \x01(\x0e\x32\x1e.Api.ResponseStartReplay.Error\x12\x15\n\rerror_details\x18\x02 \x01(\t\"\x9e\x01\n\x05\x45rror\x12\x11\n\rMissingReplay\x10\x01\x12\x15\n\x11InvalidReplayPath\x10\x02\x12\x15\n\x11InvalidReplayData\x10\x03\x12\x12\n\x0eInvalidMapData\x10\x04\x12\x1b\n\x17InvalidObservedPlayerId\x10\x05\x12\x12\n\x0eMissingOptions\x10\x06\x12\x0f\n\x0bLaunchError\x10\x07\"(\n\x11RequestMapCommand\x12\x13\n\x0btrigger_cmd\x18\x01 \x01(\t\"v\n\x12ResponseMapCommand\x12,\n\x05\x65rror\x18\x01 \x01(\x0e\x32\x1d.Api.ResponseMapCommand.Error\x12\x15\n\rerror_details\x18\x02 \x01(\t\"\x1b\n\x05\x45rror\x12\x12\n\x0eNoTriggerError\x10\x01\"\x12\n\x10RequestLeaveGame\"\x13\n\x11ResponseLeaveGame\"\x12\n\x10RequestQuickSave\"\x13\n\x11ResponseQuickSave\"\x12\n\x10RequestQuickLoad\"\x13\n\x11ResponseQuickLoad\"\r\n\x0bRequestQuit\"\x0e\n\x0cResponseQuit\"\x11\n\x0fRequestGameInfo\"\xbf\x01\n\x10ResponseGameInfo\x12\x10\n\x08map_name\x18\x01 \x01(\t\x12\x11\n\tmod_names\x18\x06 \x03(\t\x12\x16\n\x0elocal_map_path\x18\x02 \x01(\t\x12$\n\x0bplayer_info\x18\x03 \x03(\x0b\x32\x0f.Api.PlayerInfo\x12 \n\tstart_raw\x18\x04 \x01(\x0b\x32\r.Api.StartRaw\x12&\n\x07options\x18\x05 \x01(\x0b\x32\x15.Api.InterfaceOptions\"<\n\x12RequestObservation\x12\x13\n\x0b\x64isable_fog\x18\x01 \x01(\x08\x12\x11\n\tgame_loop\x18\x02 \x01(\r\"\xce\x01\n\x13ResponseObservation\x12\x1c\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x0b.Api.Action\x12\'\n\raction_errors\x18\x02 \x03(\x0b\x32\x10.Api.ActionError\x12%\n\x0bobservation\x18\x03 \x01(\x0b\x32\x10.Api.Observation\x12(\n\rplayer_result\x18\x04 \x03(\x0b\x32\x11.Api.PlayerResult\x12\x1f\n\x04\x63hat\x18\x05 \x03(\x0b\x32\x11.Api.ChatReceived\"2\n\x0c\x43hatReceived\x12\x11\n\tplayer_id\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\"-\n\rRequestAction\x12\x1c\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x0b.Api.Action\"3\n\x0eResponseAction\x12!\n\x06result\x18\x01 \x03(\x0e\x32\x11.Api.ActionResult\"=\n\x15RequestObserverAction\x12$\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x13.Api.ObserverAction\"\x18\n\x16ResponseObserverAction\"\x1c\n\x0bRequestStep\x12\r\n\x05\x63ount\x18\x01 \x01(\r\"\'\n\x0cResponseStep\x12\x17\n\x0fsimulation_loop\x18\x01 \x01(\r\"o\n\x0bRequestData\x12\x12\n\nability_id\x18\x01 \x01(\x08\x12\x14\n\x0cunit_type_id\x18\x02 \x01(\x08\x12\x12\n\nupgrade_id\x18\x03 \x01(\x08\x12\x0f\n\x07\x62uff_id\x18\x04 \x01(\x08\x12\x11\n\teffect_id\x18\x05 \x01(\x08\"\xb9\x01\n\x0cResponseData\x12#\n\tabilities\x18\x01 \x03(\x0b\x32\x10.Api.AbilityData\x12 \n\x05units\x18\x02 \x03(\x0b\x32\x11.Api.UnitTypeData\x12\"\n\x08upgrades\x18\x03 \x03(\x0b\x32\x10.Api.UpgradeData\x12\x1c\n\x05\x62uffs\x18\x04 \x03(\x0b\x32\r.Api.BuffData\x12 \n\x07\x65\x66\x66\x65\x63ts\x18\x05 \x03(\x0b\x32\x0f.Api.EffectData\"\x13\n\x11RequestSaveReplay\"\"\n\x12ResponseSaveReplay\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"b\n\x11RequestReplayInfo\x12\x15\n\x0breplay_path\x18\x01 \x01(\tH\x00\x12\x15\n\x0breplay_data\x18\x02 \x01(\x0cH\x00\x12\x15\n\rdownload_data\x18\x03 \x01(\x08\x42\x08\n\x06replay\"\x89\x01\n\x0fPlayerInfoExtra\x12$\n\x0bplayer_info\x18\x01 \x01(\x0b\x32\x0f.Api.PlayerInfo\x12(\n\rplayer_result\x18\x02 \x01(\x0b\x32\x11.Api.PlayerResult\x12\x12\n\nplayer_mmr\x18\x03 \x01(\x05\x12\x12\n\nplayer_apm\x18\x04 \x01(\x05\"\xad\x03\n\x12ResponseReplayInfo\x12\x10\n\x08map_name\x18\x01 \x01(\t\x12\x16\n\x0elocal_map_path\x18\x02 \x01(\t\x12)\n\x0bplayer_info\x18\x03 \x03(\x0b\x32\x14.Api.PlayerInfoExtra\x12\x1b\n\x13game_duration_loops\x18\x04 \x01(\r\x12\x1d\n\x15game_duration_seconds\x18\x05 \x01(\x02\x12\x14\n\x0cgame_version\x18\x06 \x01(\t\x12\x14\n\x0c\x64\x61ta_version\x18\x0b \x01(\t\x12\x12\n\ndata_build\x18\x07 \x01(\r\x12\x12\n\nbase_build\x18\x08 \x01(\r\x12,\n\x05\x65rror\x18\t \x01(\x0e\x32\x1d.Api.ResponseReplayInfo.Error\x12\x15\n\rerror_details\x18\n \x01(\t\"m\n\x05\x45rror\x12\x11\n\rMissingReplay\x10\x01\x12\x15\n\x11InvalidReplayPath\x10\x02\x12\x15\n\x11InvalidReplayData\x10\x03\x12\x10\n\x0cParsingError\x10\x04\x12\x11\n\rDownloadError\x10\x05\"\x16\n\x14RequestAvailableMaps\"M\n\x15ResponseAvailableMaps\x12\x17\n\x0flocal_map_paths\x18\x01 \x03(\t\x12\x1b\n\x13\x62\x61ttlenet_map_names\x18\x02 \x03(\t\"4\n\x0eRequestSaveMap\x12\x10\n\x08map_path\x18\x01 \x01(\t\x12\x10\n\x08map_data\x18\x02 \x01(\x0c\"Y\n\x0fResponseSaveMap\x12)\n\x05\x65rror\x18\x01 \x01(\x0e\x32\x1a.Api.ResponseSaveMap.Error\"\x1b\n\x05\x45rror\x12\x12\n\x0eInvalidMapData\x10\x01\"\r\n\x0bRequestPing\"b\n\x0cResponsePing\x12\x14\n\x0cgame_version\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x61ta_version\x18\x02 \x01(\t\x12\x12\n\ndata_build\x18\x03 \x01(\r\x12\x12\n\nbase_build\x18\x04 \x01(\r\"0\n\x0cRequestDebug\x12 \n\x05\x64\x65\x62ug\x18\x01 \x03(\x0b\x32\x11.Api.DebugCommand\"\x0f\n\rResponseDebug\"\x9f\x01\n\x0bPlayerSetup\x12\x1d\n\x04type\x18\x01 \x01(\x0e\x32\x0f.Api.PlayerType\x12\x17\n\x04race\x18\x02 \x01(\x0e\x32\t.Api.Race\x12#\n\ndifficulty\x18\x03 \x01(\x0e\x32\x0f.Api.Difficulty\x12\x13\n\x0bplayer_name\x18\x04 \x01(\t\x12\x1e\n\x08\x61i_build\x18\x05 \x01(\x0e\x32\x0c.Api.AIBuild\"\xad\x01\n\x12SpatialCameraSetup\x12 \n\nresolution\x18\x02 \x01(\x0b\x32\x0c.Api.Size2DI\x12(\n\x12minimap_resolution\x18\x03 \x01(\x0b\x32\x0c.Api.Size2DI\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x1d\n\x15\x63rop_to_playable_area\x18\x04 \x01(\x08\x12\x1d\n\x15\x61llow_cheating_layers\x18\x05 \x01(\x08\"\x99\x02\n\x10InterfaceOptions\x12\x0b\n\x03raw\x18\x01 \x01(\x08\x12\r\n\x05score\x18\x02 \x01(\x08\x12.\n\rfeature_layer\x18\x03 \x01(\x0b\x32\x17.Api.SpatialCameraSetup\x12\'\n\x06render\x18\x04 \x01(\x0b\x32\x17.Api.SpatialCameraSetup\x12\x14\n\x0cshow_cloaked\x18\x05 \x01(\x08\x12\x1d\n\x15show_burrowed_shadows\x18\t \x01(\x08\x12\x19\n\x11show_placeholders\x18\x08 \x01(\x08\x12\x1d\n\x15raw_affects_selection\x18\x06 \x01(\x08\x12!\n\x19raw_crop_to_playable_area\x18\x07 \x01(\x08\"\xdb\x01\n\nPlayerInfo\x12\x11\n\tplayer_id\x18\x01 \x01(\r\x12\x1d\n\x04type\x18\x02 \x01(\x0e\x32\x0f.Api.PlayerType\x12!\n\x0erace_requested\x18\x03 \x01(\x0e\x32\t.Api.Race\x12\x1e\n\x0brace_actual\x18\x04 \x01(\x0e\x32\t.Api.Race\x12#\n\ndifficulty\x18\x05 \x01(\x0e\x32\x0f.Api.Difficulty\x12\x1e\n\x08\x61i_build\x18\x07 \x01(\x0e\x32\x0c.Api.AIBuild\x12\x13\n\x0bplayer_name\x18\x06 \x01(\t\"\xef\x01\n\x0cPlayerCommon\x12\x11\n\tplayer_id\x18\x01 \x01(\r\x12\x10\n\x08minerals\x18\x02 \x01(\r\x12\x0f\n\x07vespene\x18\x03 \x01(\r\x12\x10\n\x08\x66ood_cap\x18\x04 \x01(\r\x12\x11\n\tfood_used\x18\x05 \x01(\r\x12\x11\n\tfood_army\x18\x06 \x01(\r\x12\x14\n\x0c\x66ood_workers\x18\x07 \x01(\r\x12\x19\n\x11idle_worker_count\x18\x08 \x01(\r\x12\x12\n\narmy_count\x18\t \x01(\r\x12\x17\n\x0fwarp_gate_count\x18\n \x01(\r\x12\x13\n\x0blarva_count\x18\x0b \x01(\r\"\xde\x02\n\x0bObservation\x12\x11\n\tgame_loop\x18\t \x01(\r\x12(\n\rplayer_common\x18\x01 \x01(\x0b\x32\x11.Api.PlayerCommon\x12\x1a\n\x06\x61lerts\x18\n \x03(\x0e\x32\n.Api.Alert\x12(\n\tabilities\x18\x03 \x03(\x0b\x32\x15.Api.AvailableAbility\x12\x19\n\x05score\x18\x04 \x01(\x0b\x32\n.Api.Score\x12%\n\x08raw_data\x18\x05 \x01(\x0b\x32\x13.Api.ObservationRaw\x12\x38\n\x12\x66\x65\x61ture_layer_data\x18\x06 \x01(\x0b\x32\x1c.Api.ObservationFeatureLayer\x12+\n\x0brender_data\x18\x07 \x01(\x0b\x32\x16.Api.ObservationRender\x12#\n\x07ui_data\x18\x08 \x01(\x0b\x32\x12.Api.ObservationUI\"\xe4\x01\n\x06\x41\x63tion\x12\"\n\naction_raw\x18\x01 \x01(\x0b\x32\x0e.Api.ActionRaw\x12\x30\n\x14\x61\x63tion_feature_layer\x18\x02 \x01(\x0b\x32\x12.Api.ActionSpatial\x12)\n\raction_render\x18\x03 \x01(\x0b\x32\x12.Api.ActionSpatial\x12 \n\taction_ui\x18\x04 \x01(\x0b\x32\r.Api.ActionUI\x12$\n\x0b\x61\x63tion_chat\x18\x06 \x01(\x0b\x32\x0f.Api.ActionChat\x12\x11\n\tgame_loop\x18\x07 \x01(\r\"k\n\nActionChat\x12(\n\x07\x63hannel\x18\x01 \x01(\x0e\x32\x17.Api.ActionChat.Channel\x12\x0f\n\x07message\x18\x02 \x01(\t\"\"\n\x07\x43hannel\x12\r\n\tBroadcast\x10\x01\x12\x08\n\x04Team\x10\x02\"V\n\x0b\x41\x63tionError\x12\x10\n\x08unit_tag\x18\x01 \x01(\x04\x12\x12\n\nability_id\x18\x02 \x01(\x04\x12!\n\x06result\x18\x03 \x01(\x0e\x32\x11.Api.ActionResult\"\xa0\x02\n\x0eObserverAction\x12\x42\n\x12player_perspective\x18\x01 \x01(\x0b\x32$.Api.ActionObserverPlayerPerspectiveH\x00\x12\x34\n\x0b\x63\x61mera_move\x18\x02 \x01(\x0b\x32\x1d.Api.ActionObserverCameraMoveH\x00\x12\x45\n\x14\x63\x61mera_follow_player\x18\x03 \x01(\x0b\x32%.Api.ActionObserverCameraFollowPlayerH\x00\x12\x43\n\x13\x63\x61mera_follow_units\x18\x04 \x01(\x0b\x32$.Api.ActionObserverCameraFollowUnitsH\x00\x42\x08\n\x06\x61\x63tion\"4\n\x1f\x41\x63tionObserverPlayerPerspective\x12\x11\n\tplayer_id\x18\x01 \x01(\r\"M\n\x18\x41\x63tionObserverCameraMove\x12\x1f\n\tworld_pos\x18\x01 \x01(\x0b\x32\x0c.Api.Point2D\x12\x10\n\x08\x64istance\x18\x02 \x01(\x02\"5\n ActionObserverCameraFollowPlayer\x12\x11\n\tplayer_id\x18\x01 \x01(\r\"4\n\x1f\x41\x63tionObserverCameraFollowUnits\x12\x11\n\tunit_tags\x18\x01 \x03(\x04\">\n\x0cPlayerResult\x12\x11\n\tplayer_id\x18\x01 \x01(\r\x12\x1b\n\x06result\x18\x02 \x01(\x0e\x32\x0b.Api.Result*c\n\x06Status\x12\x0c\n\x08launched\x10\x01\x12\r\n\tinit_game\x10\x02\x12\x0b\n\x07in_game\x10\x03\x12\r\n\tin_replay\x10\x04\x12\t\n\x05\x65nded\x10\x05\x12\x08\n\x04quit\x10\x06\x12\x0b\n\x07unknown\x10\x63*\x96\x01\n\nDifficulty\x12\x0c\n\x08VeryEasy\x10\x01\x12\x08\n\x04\x45\x61sy\x10\x02\x12\n\n\x06Medium\x10\x03\x12\x0e\n\nMediumHard\x10\x04\x12\x08\n\x04Hard\x10\x05\x12\n\n\x06Harder\x10\x06\x12\x0c\n\x08VeryHard\x10\x07\x12\x0f\n\x0b\x43heatVision\x10\x08\x12\x0e\n\nCheatMoney\x10\t\x12\x0f\n\x0b\x43heatInsane\x10\n*9\n\nPlayerType\x12\x0f\n\x0bParticipant\x10\x01\x12\x0c\n\x08\x43omputer\x10\x02\x12\x0c\n\x08Observer\x10\x03*O\n\x07\x41IBuild\x12\x0f\n\x0bRandomBuild\x10\x01\x12\x08\n\x04Rush\x10\x02\x12\n\n\x06Timing\x10\x03\x12\t\n\x05Power\x10\x04\x12\t\n\x05Macro\x10\x05\x12\x07\n\x03\x41ir\x10\x06*\xdb\x03\n\x05\x41lert\x12\x0e\n\nAlertError\x10\x03\x12\x11\n\rAddOnComplete\x10\x04\x12\x14\n\x10\x42uildingComplete\x10\x05\x12\x17\n\x13\x42uildingUnderAttack\x10\x06\x12\x10\n\x0cLarvaHatched\x10\x07\x12\x11\n\rMergeComplete\x10\x08\x12\x15\n\x11MineralsExhausted\x10\t\x12\x11\n\rMorphComplete\x10\n\x12\x16\n\x12MothershipComplete\x10\x0b\x12\x0f\n\x0bMULEExpired\x10\x0c\x12\x19\n\x15NuclearLaunchDetected\x10\x01\x12\x10\n\x0cNukeComplete\x10\r\x12\x15\n\x11NydusWormDetected\x10\x02\x12\x14\n\x10ResearchComplete\x10\x0e\x12\x0e\n\nTrainError\x10\x0f\x12\x15\n\x11TrainUnitComplete\x10\x10\x12\x17\n\x13TrainWorkerComplete\x10\x11\x12\x1a\n\x16TransformationComplete\x10\x12\x12\x13\n\x0fUnitUnderAttack\x10\x13\x12\x13\n\x0fUpgradeComplete\x10\x14\x12\x14\n\x10VespeneExhausted\x10\x15\x12\x12\n\x0eWarpInComplete\x10\x16*9\n\x06Result\x12\x0b\n\x07Victory\x10\x01\x12\n\n\x06\x44\x65\x66\x65\x61t\x10\x02\x12\x07\n\x03Tie\x10\x03\x12\r\n\tUndecided\x10\x04"
|
19
|
+
|
20
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
21
|
+
|
22
|
+
begin
|
23
|
+
pool.add_serialized_file(descriptor_data)
|
24
|
+
rescue TypeError
|
25
|
+
# Compatibility code: will be removed in the next major version.
|
26
|
+
require 'google/protobuf/descriptor_pb'
|
27
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
28
|
+
parsed.clear_dependency
|
29
|
+
serialized = parsed.class.encode(parsed)
|
30
|
+
file = pool.add_serialized_file(serialized)
|
31
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
32
|
+
imports = [
|
33
|
+
["Api.RequestQuery", "sc2ai/protocol/query.proto"],
|
34
|
+
["Api.StartRaw", "sc2ai/protocol/raw.proto"],
|
35
|
+
["Api.AbilityData", "sc2ai/protocol/data.proto"],
|
36
|
+
["Api.DebugCommand", "sc2ai/protocol/debug.proto"],
|
37
|
+
["Api.Size2DI", "sc2ai/protocol/common.proto"],
|
38
|
+
["Api.Score", "sc2ai/protocol/score.proto"],
|
39
|
+
["Api.ObservationFeatureLayer", "sc2ai/protocol/spatial.proto"],
|
40
|
+
["Api.ObservationUI", "sc2ai/protocol/ui.proto"],
|
41
|
+
]
|
42
|
+
imports.each do |type_name, expected_filename|
|
43
|
+
import_file = pool.lookup(type_name).file_descriptor
|
44
|
+
if import_file.name != expected_filename
|
45
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
49
|
+
warn "This will become an error in the next major version."
|
50
|
+
end
|
51
|
+
|
52
|
+
module Api
|
53
|
+
Request = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Request").msgclass
|
54
|
+
Response = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Response").msgclass
|
55
|
+
RequestCreateGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestCreateGame").msgclass
|
56
|
+
LocalMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.LocalMap").msgclass
|
57
|
+
ResponseCreateGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseCreateGame").msgclass
|
58
|
+
ResponseCreateGame::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseCreateGame.Error").enummodule
|
59
|
+
RequestJoinGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestJoinGame").msgclass
|
60
|
+
PortSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PortSet").msgclass
|
61
|
+
ResponseJoinGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseJoinGame").msgclass
|
62
|
+
ResponseJoinGame::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseJoinGame.Error").enummodule
|
63
|
+
RequestRestartGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestRestartGame").msgclass
|
64
|
+
ResponseRestartGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseRestartGame").msgclass
|
65
|
+
ResponseRestartGame::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseRestartGame.Error").enummodule
|
66
|
+
RequestStartReplay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestStartReplay").msgclass
|
67
|
+
ResponseStartReplay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseStartReplay").msgclass
|
68
|
+
ResponseStartReplay::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseStartReplay.Error").enummodule
|
69
|
+
RequestMapCommand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestMapCommand").msgclass
|
70
|
+
ResponseMapCommand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseMapCommand").msgclass
|
71
|
+
ResponseMapCommand::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseMapCommand.Error").enummodule
|
72
|
+
RequestLeaveGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestLeaveGame").msgclass
|
73
|
+
ResponseLeaveGame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseLeaveGame").msgclass
|
74
|
+
RequestQuickSave = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQuickSave").msgclass
|
75
|
+
ResponseQuickSave = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQuickSave").msgclass
|
76
|
+
RequestQuickLoad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQuickLoad").msgclass
|
77
|
+
ResponseQuickLoad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQuickLoad").msgclass
|
78
|
+
RequestQuit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestQuit").msgclass
|
79
|
+
ResponseQuit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseQuit").msgclass
|
80
|
+
RequestGameInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestGameInfo").msgclass
|
81
|
+
ResponseGameInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseGameInfo").msgclass
|
82
|
+
RequestObservation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestObservation").msgclass
|
83
|
+
ResponseObservation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseObservation").msgclass
|
84
|
+
ChatReceived = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ChatReceived").msgclass
|
85
|
+
RequestAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestAction").msgclass
|
86
|
+
ResponseAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseAction").msgclass
|
87
|
+
RequestObserverAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestObserverAction").msgclass
|
88
|
+
ResponseObserverAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseObserverAction").msgclass
|
89
|
+
RequestStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestStep").msgclass
|
90
|
+
ResponseStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseStep").msgclass
|
91
|
+
RequestData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestData").msgclass
|
92
|
+
ResponseData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseData").msgclass
|
93
|
+
RequestSaveReplay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestSaveReplay").msgclass
|
94
|
+
ResponseSaveReplay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseSaveReplay").msgclass
|
95
|
+
RequestReplayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestReplayInfo").msgclass
|
96
|
+
PlayerInfoExtra = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerInfoExtra").msgclass
|
97
|
+
ResponseReplayInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseReplayInfo").msgclass
|
98
|
+
ResponseReplayInfo::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseReplayInfo.Error").enummodule
|
99
|
+
RequestAvailableMaps = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestAvailableMaps").msgclass
|
100
|
+
ResponseAvailableMaps = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseAvailableMaps").msgclass
|
101
|
+
RequestSaveMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestSaveMap").msgclass
|
102
|
+
ResponseSaveMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseSaveMap").msgclass
|
103
|
+
ResponseSaveMap::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseSaveMap.Error").enummodule
|
104
|
+
RequestPing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestPing").msgclass
|
105
|
+
ResponsePing = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponsePing").msgclass
|
106
|
+
RequestDebug = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.RequestDebug").msgclass
|
107
|
+
ResponseDebug = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ResponseDebug").msgclass
|
108
|
+
PlayerSetup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerSetup").msgclass
|
109
|
+
SpatialCameraSetup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.SpatialCameraSetup").msgclass
|
110
|
+
InterfaceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.InterfaceOptions").msgclass
|
111
|
+
PlayerInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerInfo").msgclass
|
112
|
+
PlayerCommon = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerCommon").msgclass
|
113
|
+
Observation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Observation").msgclass
|
114
|
+
Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Action").msgclass
|
115
|
+
ActionChat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionChat").msgclass
|
116
|
+
ActionChat::Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionChat.Channel").enummodule
|
117
|
+
ActionError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionError").msgclass
|
118
|
+
ObserverAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ObserverAction").msgclass
|
119
|
+
ActionObserverPlayerPerspective = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionObserverPlayerPerspective").msgclass
|
120
|
+
ActionObserverCameraMove = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionObserverCameraMove").msgclass
|
121
|
+
ActionObserverCameraFollowPlayer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionObserverCameraFollowPlayer").msgclass
|
122
|
+
ActionObserverCameraFollowUnits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionObserverCameraFollowUnits").msgclass
|
123
|
+
PlayerResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerResult").msgclass
|
124
|
+
Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Status").enummodule
|
125
|
+
Difficulty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Difficulty").enummodule
|
126
|
+
PlayerType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.PlayerType").enummodule
|
127
|
+
AIBuild = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.AIBuild").enummodule
|
128
|
+
Alert = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Alert").enummodule
|
129
|
+
Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Result").enummodule
|
130
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: sc2ai/protocol/score.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
|
8
|
+
descriptor_data = "\n\x1asc2ai/protocol/score.proto\x12\x03\x41pi\"\x92\x01\n\x05Score\x12(\n\nscore_type\x18\x06 \x01(\x0e\x32\x14.Api.Score.ScoreType\x12\r\n\x05score\x18\x07 \x01(\x05\x12(\n\rscore_details\x18\x08 \x01(\x0b\x32\x11.Api.ScoreDetails\"&\n\tScoreType\x12\x0e\n\nCurriculum\x10\x01\x12\t\n\x05Melee\x10\x02\"h\n\x14\x43\x61tegoryScoreDetails\x12\x0c\n\x04none\x18\x01 \x01(\x02\x12\x0c\n\x04\x61rmy\x18\x02 \x01(\x02\x12\x0f\n\x07\x65\x63onomy\x18\x03 \x01(\x02\x12\x12\n\ntechnology\x18\x04 \x01(\x02\x12\x0f\n\x07upgrade\x18\x05 \x01(\x02\"B\n\x11VitalScoreDetails\x12\x0c\n\x04life\x18\x01 \x01(\x02\x12\x0f\n\x07shields\x18\x02 \x01(\x02\x12\x0e\n\x06\x65nergy\x18\x03 \x01(\x02\"\xf0\x08\n\x0cScoreDetails\x12\x1c\n\x14idle_production_time\x18\x01 \x01(\x02\x12\x18\n\x10idle_worker_time\x18\x02 \x01(\x02\x12\x19\n\x11total_value_units\x18\x03 \x01(\x02\x12\x1e\n\x16total_value_structures\x18\x04 \x01(\x02\x12\x1a\n\x12killed_value_units\x18\x05 \x01(\x02\x12\x1f\n\x17killed_value_structures\x18\x06 \x01(\x02\x12\x1a\n\x12\x63ollected_minerals\x18\x07 \x01(\x02\x12\x19\n\x11\x63ollected_vespene\x18\x08 \x01(\x02\x12 \n\x18\x63ollection_rate_minerals\x18\t \x01(\x02\x12\x1f\n\x17\x63ollection_rate_vespene\x18\n \x01(\x02\x12\x16\n\x0espent_minerals\x18\x0b \x01(\x02\x12\x15\n\rspent_vespene\x18\x0c \x01(\x02\x12,\n\tfood_used\x18\r \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x32\n\x0fkilled_minerals\x18\x0e \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x31\n\x0ekilled_vespene\x18\x0f \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x30\n\rlost_minerals\x18\x10 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12/\n\x0clost_vespene\x18\x11 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x39\n\x16\x66riendly_fire_minerals\x18\x12 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x38\n\x15\x66riendly_fire_vespene\x18\x13 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x30\n\rused_minerals\x18\x14 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12/\n\x0cused_vespene\x18\x15 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x36\n\x13total_used_minerals\x18\x16 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x35\n\x12total_used_vespene\x18\x17 \x01(\x0b\x32\x19.Api.CategoryScoreDetails\x12\x32\n\x12total_damage_dealt\x18\x18 \x01(\x0b\x32\x16.Api.VitalScoreDetails\x12\x32\n\x12total_damage_taken\x18\x19 \x01(\x0b\x32\x16.Api.VitalScoreDetails\x12,\n\x0ctotal_healed\x18\x1a \x01(\x0b\x32\x16.Api.VitalScoreDetails\x12\x13\n\x0b\x63urrent_apm\x18\x1b \x01(\x02\x12\x1d\n\x15\x63urrent_effective_apm\x18\x1c \x01(\x02"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
32
|
+
end
|
33
|
+
|
34
|
+
module Api
|
35
|
+
Score = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Score").msgclass
|
36
|
+
Score::ScoreType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.Score.ScoreType").enummodule
|
37
|
+
CategoryScoreDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.CategoryScoreDetails").msgclass
|
38
|
+
VitalScoreDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.VitalScoreDetails").msgclass
|
39
|
+
ScoreDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ScoreDetails").msgclass
|
40
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: sc2ai/protocol/spatial.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'sc2ai/protocol/common_pb'
|
8
|
+
|
9
|
+
|
10
|
+
descriptor_data = "\n\x1csc2ai/protocol/spatial.proto\x12\x03\x41pi\x1a\x1bsc2ai/protocol/common.proto\"r\n\x17ObservationFeatureLayer\x12#\n\x07renders\x18\x01 \x01(\x0b\x32\x12.Api.FeatureLayers\x12\x32\n\x0fminimap_renders\x18\x02 \x01(\x0b\x32\x19.Api.FeatureLayersMinimap\"\xf3\x07\n\rFeatureLayers\x12\"\n\nheight_map\x18\x01 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\x0evisibility_map\x18\x02 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1d\n\x05\x63reep\x18\x03 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1d\n\x05power\x18\x04 \x01(\x0b\x32\x0e.Api.ImageData\x12!\n\tplayer_id\x18\x05 \x01(\x0b\x32\x0e.Api.ImageData\x12!\n\tunit_type\x18\x06 \x01(\x0b\x32\x0e.Api.ImageData\x12 \n\x08selected\x18\x07 \x01(\x0b\x32\x0e.Api.ImageData\x12\'\n\x0funit_hit_points\x18\x08 \x01(\x0b\x32\x0e.Api.ImageData\x12-\n\x15unit_hit_points_ratio\x18\x11 \x01(\x0b\x32\x0e.Api.ImageData\x12#\n\x0bunit_energy\x18\t \x01(\x0b\x32\x0e.Api.ImageData\x12)\n\x11unit_energy_ratio\x18\x12 \x01(\x0b\x32\x0e.Api.ImageData\x12$\n\x0cunit_shields\x18\n \x01(\x0b\x32\x0e.Api.ImageData\x12*\n\x12unit_shields_ratio\x18\x13 \x01(\x0b\x32\x0e.Api.ImageData\x12\'\n\x0fplayer_relative\x18\x0b \x01(\x0b\x32\x0e.Api.ImageData\x12\'\n\x0funit_density_aa\x18\x0e \x01(\x0b\x32\x0e.Api.ImageData\x12$\n\x0cunit_density\x18\x0f \x01(\x0b\x32\x0e.Api.ImageData\x12\x1f\n\x07\x65\x66\x66\x65\x63ts\x18\x14 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\x0ehallucinations\x18\x15 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1f\n\x07\x63loaked\x18\x16 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1c\n\x04\x62lip\x18\x17 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1d\n\x05\x62uffs\x18\x18 \x01(\x0b\x32\x0e.Api.ImageData\x12%\n\rbuff_duration\x18\x1a \x01(\x0b\x32\x0e.Api.ImageData\x12\x1e\n\x06\x61\x63tive\x18\x19 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\x0e\x62uild_progress\x18\x1b \x01(\x0b\x32\x0e.Api.ImageData\x12!\n\tbuildable\x18\x1c \x01(\x0b\x32\x0e.Api.ImageData\x12 \n\x08pathable\x18\x1d \x01(\x0b\x32\x0e.Api.ImageData\x12#\n\x0bplaceholder\x18\x1e \x01(\x0b\x32\x0e.Api.ImageData\"\x97\x03\n\x14\x46\x65\x61tureLayersMinimap\x12\"\n\nheight_map\x18\x01 \x01(\x0b\x32\x0e.Api.ImageData\x12&\n\x0evisibility_map\x18\x02 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1d\n\x05\x63reep\x18\x03 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1e\n\x06\x63\x61mera\x18\x04 \x01(\x0b\x32\x0e.Api.ImageData\x12!\n\tplayer_id\x18\x05 \x01(\x0b\x32\x0e.Api.ImageData\x12\'\n\x0fplayer_relative\x18\x06 \x01(\x0b\x32\x0e.Api.ImageData\x12 \n\x08selected\x18\x07 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1e\n\x06\x61lerts\x18\t \x01(\x0b\x32\x0e.Api.ImageData\x12!\n\tbuildable\x18\n \x01(\x0b\x32\x0e.Api.ImageData\x12 \n\x08pathable\x18\x0b \x01(\x0b\x32\x0e.Api.ImageData\x12!\n\tunit_type\x18\x08 \x01(\x0b\x32\x0e.Api.ImageData\"Q\n\x11ObservationRender\x12\x1b\n\x03map\x18\x01 \x01(\x0b\x32\x0e.Api.ImageData\x12\x1f\n\x07minimap\x18\x02 \x01(\x0b\x32\x0e.Api.ImageData\"\x8f\x02\n\rActionSpatial\x12\x35\n\x0cunit_command\x18\x01 \x01(\x0b\x32\x1d.Api.ActionSpatialUnitCommandH\x00\x12\x33\n\x0b\x63\x61mera_move\x18\x02 \x01(\x0b\x32\x1c.Api.ActionSpatialCameraMoveH\x00\x12\x44\n\x14unit_selection_point\x18\x03 \x01(\x0b\x32$.Api.ActionSpatialUnitSelectionPointH\x00\x12\x42\n\x13unit_selection_rect\x18\x04 \x01(\x0b\x32#.Api.ActionSpatialUnitSelectionRectH\x00\x42\x08\n\x06\x61\x63tion\"\xa8\x01\n\x18\x41\x63tionSpatialUnitCommand\x12\x12\n\nability_id\x18\x01 \x01(\x05\x12*\n\x13target_screen_coord\x18\x02 \x01(\x0b\x32\x0b.Api.PointIH\x00\x12+\n\x14target_minimap_coord\x18\x03 \x01(\x0b\x32\x0b.Api.PointIH\x00\x12\x15\n\rqueue_command\x18\x04 \x01(\x08\x42\x08\n\x06target\">\n\x17\x41\x63tionSpatialCameraMove\x12#\n\x0e\x63\x65nter_minimap\x18\x01 \x01(\x0b\x32\x0b.Api.PointI\"\xc4\x01\n\x1f\x41\x63tionSpatialUnitSelectionPoint\x12+\n\x16selection_screen_coord\x18\x01 \x01(\x0b\x32\x0b.Api.PointI\x12\x37\n\x04type\x18\x02 \x01(\x0e\x32).Api.ActionSpatialUnitSelectionPoint.Type\";\n\x04Type\x12\n\n\x06Select\x10\x01\x12\n\n\x06Toggle\x10\x02\x12\x0b\n\x07\x41llType\x10\x03\x12\x0e\n\nAddAllType\x10\x04\"h\n\x1e\x41\x63tionSpatialUnitSelectionRect\x12/\n\x16selection_screen_coord\x18\x01 \x03(\x0b\x32\x0f.Api.RectangleI\x12\x15\n\rselection_add\x18\x02 \x01(\x08"
|
11
|
+
|
12
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
13
|
+
|
14
|
+
begin
|
15
|
+
pool.add_serialized_file(descriptor_data)
|
16
|
+
rescue TypeError
|
17
|
+
# Compatibility code: will be removed in the next major version.
|
18
|
+
require 'google/protobuf/descriptor_pb'
|
19
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
20
|
+
parsed.clear_dependency
|
21
|
+
serialized = parsed.class.encode(parsed)
|
22
|
+
file = pool.add_serialized_file(serialized)
|
23
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
24
|
+
imports = [
|
25
|
+
["Api.ImageData", "sc2ai/protocol/common.proto"],
|
26
|
+
]
|
27
|
+
imports.each do |type_name, expected_filename|
|
28
|
+
import_file = pool.lookup(type_name).file_descriptor
|
29
|
+
if import_file.name != expected_filename
|
30
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
34
|
+
warn "This will become an error in the next major version."
|
35
|
+
end
|
36
|
+
|
37
|
+
module Api
|
38
|
+
ObservationFeatureLayer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ObservationFeatureLayer").msgclass
|
39
|
+
FeatureLayers = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.FeatureLayers").msgclass
|
40
|
+
FeatureLayersMinimap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.FeatureLayersMinimap").msgclass
|
41
|
+
ObservationRender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ObservationRender").msgclass
|
42
|
+
ActionSpatial = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSpatial").msgclass
|
43
|
+
ActionSpatialUnitCommand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSpatialUnitCommand").msgclass
|
44
|
+
ActionSpatialCameraMove = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSpatialCameraMove").msgclass
|
45
|
+
ActionSpatialUnitSelectionPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSpatialUnitSelectionPoint").msgclass
|
46
|
+
ActionSpatialUnitSelectionPoint::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSpatialUnitSelectionPoint.Type").enummodule
|
47
|
+
ActionSpatialUnitSelectionRect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSpatialUnitSelectionRect").msgclass
|
48
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: sc2ai/protocol/ui.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
|
8
|
+
descriptor_data = "\n\x17sc2ai/protocol/ui.proto\x12\x03\x41pi\"\xcf\x01\n\rObservationUI\x12!\n\x06groups\x18\x01 \x03(\x0b\x32\x11.Api.ControlGroup\x12\"\n\x06single\x18\x02 \x01(\x0b\x32\x10.Api.SinglePanelH\x00\x12 \n\x05multi\x18\x03 \x01(\x0b\x32\x0f.Api.MultiPanelH\x00\x12 \n\x05\x63\x61rgo\x18\x04 \x01(\x0b\x32\x0f.Api.CargoPanelH\x00\x12*\n\nproduction\x18\x05 \x01(\x0b\x32\x14.Api.ProductionPanelH\x00\x42\x07\n\x05panel\"T\n\x0c\x43ontrolGroup\x12\x1b\n\x13\x63ontrol_group_index\x18\x01 \x01(\r\x12\x18\n\x10leader_unit_type\x18\x02 \x01(\r\x12\r\n\x05\x63ount\x18\x03 \x01(\r\"\xfa\x01\n\x08UnitInfo\x12\x11\n\tunit_type\x18\x01 \x01(\r\x12\x17\n\x0fplayer_relative\x18\x02 \x01(\r\x12\x0e\n\x06health\x18\x03 \x01(\x05\x12\x0f\n\x07shields\x18\x04 \x01(\x05\x12\x0e\n\x06\x65nergy\x18\x05 \x01(\x05\x12\x1d\n\x15transport_slots_taken\x18\x06 \x01(\x05\x12\x16\n\x0e\x62uild_progress\x18\x07 \x01(\x02\x12\x1d\n\x06\x61\x64\x64_on\x18\x08 \x01(\x0b\x32\r.Api.UnitInfo\x12\x12\n\nmax_health\x18\t \x01(\x05\x12\x13\n\x0bmax_shields\x18\n \x01(\x05\x12\x12\n\nmax_energy\x18\x0b \x01(\x05\"\x92\x01\n\x0bSinglePanel\x12\x1b\n\x04unit\x18\x01 \x01(\x0b\x32\r.Api.UnitInfo\x12\x1c\n\x14\x61ttack_upgrade_level\x18\x02 \x01(\x05\x12\x1b\n\x13\x61rmor_upgrade_level\x18\x03 \x01(\x05\x12\x1c\n\x14shield_upgrade_level\x18\x04 \x01(\x05\x12\r\n\x05\x62uffs\x18\x05 \x03(\x05\"*\n\nMultiPanel\x12\x1c\n\x05units\x18\x01 \x03(\x0b\x32\r.Api.UnitInfo\"e\n\nCargoPanel\x12\x1b\n\x04unit\x18\x01 \x01(\x0b\x32\r.Api.UnitInfo\x12!\n\npassengers\x18\x02 \x03(\x0b\x32\r.Api.UnitInfo\x12\x17\n\x0fslots_available\x18\x03 \x01(\x05\"7\n\tBuildItem\x12\x12\n\nability_id\x18\x01 \x01(\r\x12\x16\n\x0e\x62uild_progress\x18\x02 \x01(\x02\"|\n\x0fProductionPanel\x12\x1b\n\x04unit\x18\x01 \x01(\x0b\x32\r.Api.UnitInfo\x12\"\n\x0b\x62uild_queue\x18\x02 \x03(\x0b\x32\r.Api.UnitInfo\x12(\n\x10production_queue\x18\x03 \x03(\x0b\x32\x0e.Api.BuildItem\"\xf7\x03\n\x08\x41\x63tionUI\x12\x30\n\rcontrol_group\x18\x01 \x01(\x0b\x32\x17.Api.ActionControlGroupH\x00\x12,\n\x0bselect_army\x18\x02 \x01(\x0b\x32\x15.Api.ActionSelectArmyH\x00\x12\x37\n\x11select_warp_gates\x18\x03 \x01(\x0b\x32\x1a.Api.ActionSelectWarpGatesH\x00\x12.\n\x0cselect_larva\x18\x04 \x01(\x0b\x32\x16.Api.ActionSelectLarvaH\x00\x12\x39\n\x12select_idle_worker\x18\x05 \x01(\x0b\x32\x1b.Api.ActionSelectIdleWorkerH\x00\x12,\n\x0bmulti_panel\x18\x06 \x01(\x0b\x32\x15.Api.ActionMultiPanelH\x00\x12\x32\n\x0b\x63\x61rgo_panel\x18\x07 \x01(\x0b\x32\x1b.Api.ActionCargoPanelUnloadH\x00\x12\x45\n\x10production_panel\x18\x08 \x01(\x0b\x32).Api.ActionProductionPanelRemoveFromQueueH\x00\x12\x34\n\x0ftoggle_autocast\x18\t \x01(\x0b\x32\x19.Api.ActionToggleAutocastH\x00\x42\x08\n\x06\x61\x63tion\"\xc9\x01\n\x12\x41\x63tionControlGroup\x12:\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32*.Api.ActionControlGroup.ControlGroupAction\x12\x1b\n\x13\x63ontrol_group_index\x18\x02 \x01(\r\"Z\n\x12\x43ontrolGroupAction\x12\n\n\x06Recall\x10\x01\x12\x07\n\x03Set\x10\x02\x12\n\n\x06\x41ppend\x10\x03\x12\x0f\n\x0bSetAndSteal\x10\x04\x12\x12\n\x0e\x41ppendAndSteal\x10\x05\")\n\x10\x41\x63tionSelectArmy\x12\x15\n\rselection_add\x18\x01 \x01(\x08\".\n\x15\x41\x63tionSelectWarpGates\x12\x15\n\rselection_add\x18\x01 \x01(\x08\"\x13\n\x11\x41\x63tionSelectLarva\"w\n\x16\x41\x63tionSelectIdleWorker\x12.\n\x04type\x18\x01 \x01(\x0e\x32 .Api.ActionSelectIdleWorker.Type\"-\n\x04Type\x12\x07\n\x03Set\x10\x01\x12\x07\n\x03\x41\x64\x64\x10\x02\x12\x07\n\x03\x41ll\x10\x03\x12\n\n\x06\x41\x64\x64\x41ll\x10\x04\"\xa8\x01\n\x10\x41\x63tionMultiPanel\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.Api.ActionMultiPanel.Type\x12\x12\n\nunit_index\x18\x02 \x01(\x05\"V\n\x04Type\x12\x10\n\x0cSingleSelect\x10\x01\x12\x10\n\x0c\x44\x65selectUnit\x10\x02\x12\x13\n\x0fSelectAllOfType\x10\x03\x12\x15\n\x11\x44\x65selectAllOfType\x10\x04\",\n\x16\x41\x63tionCargoPanelUnload\x12\x12\n\nunit_index\x18\x01 \x01(\x05\":\n$ActionProductionPanelRemoveFromQueue\x12\x12\n\nunit_index\x18\x01 \x01(\x05\"*\n\x14\x41\x63tionToggleAutocast\x12\x12\n\nability_id\x18\x01 \x01(\x05"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
32
|
+
end
|
33
|
+
|
34
|
+
module Api
|
35
|
+
ObservationUI = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ObservationUI").msgclass
|
36
|
+
ControlGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ControlGroup").msgclass
|
37
|
+
UnitInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.UnitInfo").msgclass
|
38
|
+
SinglePanel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.SinglePanel").msgclass
|
39
|
+
MultiPanel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.MultiPanel").msgclass
|
40
|
+
CargoPanel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.CargoPanel").msgclass
|
41
|
+
BuildItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.BuildItem").msgclass
|
42
|
+
ProductionPanel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ProductionPanel").msgclass
|
43
|
+
ActionUI = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionUI").msgclass
|
44
|
+
ActionControlGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionControlGroup").msgclass
|
45
|
+
ActionControlGroup::ControlGroupAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionControlGroup.ControlGroupAction").enummodule
|
46
|
+
ActionSelectArmy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSelectArmy").msgclass
|
47
|
+
ActionSelectWarpGates = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSelectWarpGates").msgclass
|
48
|
+
ActionSelectLarva = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSelectLarva").msgclass
|
49
|
+
ActionSelectIdleWorker = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSelectIdleWorker").msgclass
|
50
|
+
ActionSelectIdleWorker::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionSelectIdleWorker.Type").enummodule
|
51
|
+
ActionMultiPanel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionMultiPanel").msgclass
|
52
|
+
ActionMultiPanel::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionMultiPanel.Type").enummodule
|
53
|
+
ActionCargoPanelUnload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionCargoPanelUnload").msgclass
|
54
|
+
ActionProductionPanelRemoveFromQueue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionProductionPanelRemoveFromQueue").msgclass
|
55
|
+
ActionToggleAutocast = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("Api.ActionToggleAutocast").msgclass
|
56
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sc2ai/unit_group"
|
4
|
+
|
5
|
+
module Sc2
|
6
|
+
# A set of action related tasks for unit groups
|
7
|
+
class UnitGroup
|
8
|
+
# Our first unit's bot object.
|
9
|
+
# Returns nil if units are empty, so use safetly operator bot&.method(...)
|
10
|
+
# @return [Sc2::Player, nil] player with active connection
|
11
|
+
def bot
|
12
|
+
first&.bot
|
13
|
+
end
|
14
|
+
|
15
|
+
# Performs action on all units in this group
|
16
|
+
# @param ability_id [Integer]
|
17
|
+
# @param target [Api::Unit, Integer, Api::Point2D] is a unit, unit tag or a Api::Point2D
|
18
|
+
# @param queue_command [Boolean] shift+command
|
19
|
+
# @return [void]
|
20
|
+
def action(ability_id:, target: nil, queue_command: false)
|
21
|
+
return if size.zero?
|
22
|
+
|
23
|
+
# We're simply not letting unit groups be bot aware if units already are.
|
24
|
+
# Grab the first unit's bot to perform actions, if necessary
|
25
|
+
bot&.action(units: self, ability_id:, target:, queue_command:)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds target unit type, i.e. issuing a build command to worker.build(...Api::UnitTypeId::BARRACKS)
|
29
|
+
# @param unit_type_id [Integer] Api::UnitTypeId the unit type which will do the creation
|
30
|
+
# @param target [Api::Point2D, Integer, nil] is a unit tag or a Api::Point2D. Nil for addons/orbital
|
31
|
+
# @param queue_command [Boolean] shift+command
|
32
|
+
def build(unit_type_id:, target: nil, queue_command: false)
|
33
|
+
return if size.zero?
|
34
|
+
|
35
|
+
bot&.build(units: self, unit_type_id:, target:, queue_command:)
|
36
|
+
end
|
37
|
+
|
38
|
+
# This structure creates a unit, i.e. this Barracks trains a Marine
|
39
|
+
# @see #build
|
40
|
+
alias_method :train, :build
|
41
|
+
|
42
|
+
# Warps in unit type at target (location or pylon)
|
43
|
+
# Will only have affect is this group consists of warp gates, i.e. bot.structures.warpgates
|
44
|
+
# @param unit_type_id [Integer] Api::UnitTypeId the unit type which will do the creation
|
45
|
+
# @param target [Api::Point2D] a point, which should be inside an energy source
|
46
|
+
# @param queue_command [Boolean] shift+command
|
47
|
+
def warp(unit_type_id:, target: nil, queue_command: false)
|
48
|
+
return if size.zero?
|
49
|
+
bot&.warp(units: self, unit_type_id:, target: target, queue_command:)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Shorthand for performing action SMART (right-click)
|
53
|
+
# @param target [Api::Unit, Integer, Api::Point2D] is a unit, unit tag or a Api::Point2D
|
54
|
+
# @param queue_command [Boolean] shift+command
|
55
|
+
def smart(target: nil, queue_command: false)
|
56
|
+
action(ability_id: Api::AbilityId::SMART, target:, queue_command:)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Shorthand for performing action ATTACK
|
60
|
+
# @param target [Api::Unit, Integer, Api::Point2D] is a unit, unit tag or a Api::Point2D
|
61
|
+
# @param queue_command [Boolean] shift+command
|
62
|
+
def attack(target:, queue_command: false)
|
63
|
+
action(ability_id: Api::AbilityId::ATTACK, target: target, queue_command: queue_command)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Issues repair command on target
|
67
|
+
# @param target [Api::Unit, Integer] is a unit or unit tag
|
68
|
+
def repair(target:, queue_command: false)
|
69
|
+
action(ability_id: Api::AbilityId::EFFECT_REPAIR, target:, queue_command:)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Geometric/Map/Micro ---
|
73
|
+
end
|
74
|
+
end
|