sc2ai 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/data/sc2ai/protocol/common.proto +5 -5
  3. data/data/sc2ai/protocol/data.proto +22 -22
  4. data/data/sc2ai/protocol/debug.proto +24 -24
  5. data/data/sc2ai/protocol/error.proto +216 -215
  6. data/data/sc2ai/protocol/raw.proto +20 -20
  7. data/data/sc2ai/protocol/sc2api.proto +111 -111
  8. data/data/sc2ai/protocol/score.proto +3 -3
  9. data/data/sc2ai/protocol/spatial.proto +5 -5
  10. data/data/sc2ai/protocol/ui.proto +16 -16
  11. data/exe/sc2ai +0 -3
  12. data/lib/docker_build/Dockerfile.ruby +2 -2
  13. data/lib/sc2ai/api/data.rb +3 -3
  14. data/lib/sc2ai/connection/connection_listener.rb +3 -3
  15. data/lib/sc2ai/connection/requests.rb +31 -35
  16. data/lib/sc2ai/connection/status_listener.rb +1 -1
  17. data/lib/sc2ai/connection.rb +2 -3
  18. data/lib/sc2ai/local_play/client/configurable_options.rb +6 -7
  19. data/lib/sc2ai/local_play/client.rb +3 -3
  20. data/lib/sc2ai/local_play/match.rb +7 -2
  21. data/lib/sc2ai/paths.rb +12 -2
  22. data/lib/sc2ai/player/actions.rb +54 -35
  23. data/lib/sc2ai/player/debug.rb +21 -21
  24. data/lib/sc2ai/player/game_state.rb +11 -18
  25. data/lib/sc2ai/player/geo.rb +54 -64
  26. data/lib/sc2ai/player/units.rb +16 -16
  27. data/lib/sc2ai/player.rb +103 -41
  28. data/lib/sc2ai/ports.rb +1 -1
  29. data/lib/sc2ai/protocol/_meta_documentation.rb +265 -265
  30. data/lib/sc2ai/protocol/common_pb.rb +3865 -15
  31. data/lib/sc2ai/protocol/data_pb.rb +9109 -18
  32. data/lib/sc2ai/protocol/debug_pb.rb +10437 -26
  33. data/lib/sc2ai/protocol/error_pb.rb +1086 -10
  34. data/lib/sc2ai/protocol/extensions/ability_remapable.rb +9 -9
  35. data/lib/sc2ai/protocol/extensions/action.rb +60 -0
  36. data/lib/sc2ai/protocol/extensions/point_2_d.rb +5 -0
  37. data/lib/sc2ai/protocol/extensions/position.rb +10 -35
  38. data/lib/sc2ai/protocol/extensions/power_source.rb +3 -0
  39. data/lib/sc2ai/protocol/extensions/unit.rb +19 -35
  40. data/lib/sc2ai/protocol/query_pb.rb +5025 -17
  41. data/lib/sc2ai/protocol/raw_pb.rb +18350 -27
  42. data/lib/sc2ai/protocol/sc2api_pb.rb +48420 -93
  43. data/lib/sc2ai/protocol/score_pb.rb +5968 -12
  44. data/lib/sc2ai/protocol/spatial_pb.rb +11944 -18
  45. data/lib/sc2ai/protocol/ui_pb.rb +12927 -28
  46. data/lib/sc2ai/unit_group/action_ext.rb +0 -2
  47. data/lib/sc2ai/unit_group/filter_ext.rb +10 -9
  48. data/lib/sc2ai/unit_group/geo_ext.rb +0 -2
  49. data/lib/sc2ai/unit_group.rb +1 -1
  50. data/lib/sc2ai/version.rb +2 -3
  51. data/lib/sc2ai.rb +10 -11
  52. data/lib/templates/ladderzip/bin/ladder.tt +0 -3
  53. data/lib/templates/new/api/common.proto +6 -6
  54. data/lib/templates/new/api/data.proto +23 -20
  55. data/lib/templates/new/api/debug.proto +25 -21
  56. data/lib/templates/new/api/error.proto +217 -215
  57. data/lib/templates/new/api/query.proto +1 -1
  58. data/lib/templates/new/api/raw.proto +16 -14
  59. data/lib/templates/new/api/sc2api.proto +108 -94
  60. data/lib/templates/new/api/score.proto +4 -3
  61. data/lib/templates/new/api/spatial.proto +6 -5
  62. data/lib/templates/new/api/ui.proto +17 -14
  63. data/lib/templates/new/boot.rb.tt +1 -1
  64. data/lib/templates/new/my_bot.rb.tt +1 -1
  65. data/lib/templates/new/run_example_match.rb.tt +2 -2
  66. data/sig/sc2ai.rbs +11008 -1929
  67. metadata +25 -36
  68. data/lib/sc2ai/overrides/kernel.rb +0 -33
  69. data/sig/minaswan.rbs +0 -10323
@@ -10,12 +10,12 @@ import "sc2ai/protocol/common.proto";
10
10
  //
11
11
 
12
12
  message StartRaw {
13
- optional Size2DI map_size = 1 [unverified_lazy=true]; // Width and height of the map.
13
+ optional Size2DI map_size = 1; // Width and height of the map.
14
14
  optional ImageData pathing_grid = 2; // 1 bit bitmap of the pathing grid.
15
- optional ImageData terrain_height = 3 [unverified_lazy=true]; // 1 byte bitmap of the terrain height.
16
- optional ImageData placement_grid = 4 [unverified_lazy=true]; // 1 bit bitmap of the building placement grid.
17
- optional RectangleI playable_area = 5 [unverified_lazy=true]; // The playable cells.
18
- repeated Point2D start_locations = 6 [unverified_lazy=true]; // Possible start locations for players.
15
+ optional ImageData terrain_height = 3; // 1 byte bitmap of the terrain height.
16
+ optional ImageData placement_grid = 4; // 1 bit bitmap of the building placement grid.
17
+ optional RectangleI playable_area = 5; // The playable cells.
18
+ repeated Point2D start_locations = 6; // Possible start locations for players.
19
19
  }
20
20
 
21
21
 
@@ -59,27 +59,27 @@ message UnitOrder {
59
59
  }
60
60
 
61
61
  enum DisplayType {
62
- EnumDisplayTypeUnset = 0; // Proto3 compat
63
- Visible = 1; // Fully visible
64
- Snapshot = 2; // Dimmed version of unit left behind after entering fog of war
65
- Hidden = 3; // Fully hidden
66
- Placeholder = 4; // Building that hasn't started construction.
62
+ ENUM_DISPLAY_TYPE_UNSET = 0; // PROTO3 COMPAT
63
+ VISIBLE = 1; // FULLY VISIBLE
64
+ SNAPSHOT = 2; // DIMMED VERSION OF UNIT LEFT BEHIND AFTER ENTERING FOG OF WAR
65
+ HIDDEN = 3; // FULLY HIDDEN
66
+ PLACEHOLDER = 4; // BUILDING THAT HASN'T STARTED CONSTRUCTION.
67
67
  }
68
68
 
69
69
  enum Alliance {
70
- EnumAllianceUnset = 0; // Proto3 compat
71
- Self = 1;
72
- Ally = 2;
73
- Neutral = 3;
74
- Enemy = 4;
70
+ ENUM_ALLIANCE_UNSET = 0; // PROTO3 COMPAT
71
+ SELF = 1;
72
+ ALLY = 2;
73
+ NEUTRAL = 3;
74
+ ENEMY = 4;
75
75
  }
76
76
 
77
77
  enum CloakState {
78
- CloakedUnknown = 0; // Under the fog, so unknown whether it's cloaked or not.
79
- Cloaked = 1;
80
- CloakedDetected = 2;
81
- NotCloaked = 3;
82
- CloakedAllied = 4;
78
+ CLOAKED_UNKNOWN = 0; // UNDER THE FOG, SO UNKNOWN WHETHER IT'S CLOAKED OR NOT.
79
+ CLOAKED = 1;
80
+ CLOAKED_DETECTED = 2;
81
+ NOT_CLOAKED = 3;
82
+ CLOAKED_ALLIED = 4;
83
83
  }
84
84
 
85
85
  message PassengerUnit {
@@ -155,14 +155,14 @@ message Response {
155
155
  }
156
156
 
157
157
  enum Status {
158
- EnumStatusUnset = 0; // Proto3 compat
159
- launched = 1; // Game has been launch and is not yet doing anything.
160
- init_game = 2; // Create game has been called, and the host is awaiting players.
161
- in_game = 3; // In a single or multiplayer game.
162
- in_replay = 4; // In a replay.
163
- ended = 5; // Game has ended, can still request game info, but ready for a new game.
164
- quit = 6; // Application is shutting down.
165
- unknown = 99; // Should not happen, but indicates an error if it occurs.
158
+ ENUM_STATUS_UNSET = 0; // PROTO3 COMPAT
159
+ LAUNCHED = 1; // GAME HAS BEEN LAUNCH AND IS NOT YET DOING ANYTHING.
160
+ INIT_GAME = 2; // CREATE GAME HAS BEEN CALLED, AND THE HOST IS AWAITING PLAYERS.
161
+ IN_GAME = 3; // IN A SINGLE OR MULTIPLAYER GAME.
162
+ IN_REPLAY = 4; // IN A REPLAY.
163
+ ENDED = 5; // GAME HAS ENDED, CAN STILL REQUEST GAME INFO, BUT READY FOR A NEW GAME.
164
+ QUIT = 6; // APPLICATION IS SHUTTING DOWN.
165
+ UNKNOWN = 99; // SHOULD NOT HAPPEN, BUT INDICATES AN ERROR IF IT OCCURS.
166
166
  }
167
167
 
168
168
  //-----------------------------------------------------------------------------
@@ -192,15 +192,15 @@ message LocalMap {
192
192
 
193
193
  message ResponseCreateGame {
194
194
  enum Error {
195
- EnumResponseCreateGameErrorUnset = 0; // Proto3 compat
196
- MissingMap = 1;
197
- InvalidMapPath = 2;
198
- InvalidMapData = 3;
199
- InvalidMapName = 4;
200
- InvalidMapHandle = 5;
201
- MissingPlayerSetup = 6;
202
- InvalidPlayerSetup = 7;
203
- MultiplayerUnsupported = 8; // Multiplayer is not supported in the current build.
195
+ ENUM_RESPONSE_CREATE_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
196
+ MISSING_MAP = 1;
197
+ INVALID_MAP_PATH = 2;
198
+ INVALID_MAP_DATA = 3;
199
+ INVALID_MAP_NAME = 4;
200
+ INVALID_MAP_HANDLE = 5;
201
+ MISSING_PLAYER_SETUP = 6;
202
+ INVALID_PLAYER_SETUP = 7;
203
+ MULTIPLAYER_UNSUPPORTED = 8; // MULTIPLAYER IS NOT SUPPORTED IN THE CURRENT BUILD.
204
204
  }
205
205
  optional Error error = 1;
206
206
  optional string error_details = 2;
@@ -233,22 +233,22 @@ message ResponseJoinGame {
233
233
  optional uint32 player_id = 1;
234
234
 
235
235
  enum Error {
236
- EnumResponseJoinGameErrorUnset = 0; // Proto3 compat
237
- MissingParticipation = 1;
238
- InvalidObservedPlayerId = 2;
239
- MissingOptions = 3;
240
- MissingPorts = 4;
241
- GameFull = 5;
242
- LaunchError = 6;
243
-
244
- // Multiplayer specific.
245
- FeatureUnsupported = 7; // Multiplayer is not supported in the current build for the requested features.
246
- NoSpaceForUser = 8;
247
- MapDoesNotExist = 9;
248
- CannotOpenMap = 10;
249
- ChecksumError = 11;
250
- NetworkError = 12;
251
- OtherError = 13;
236
+ ENUM_RESPONSE_JOIN_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
237
+ MISSING_PARTICIPATION = 1;
238
+ INVALID_OBSERVED_PLAYER_ID = 2;
239
+ MISSING_OPTIONS = 3;
240
+ MISSING_PORTS = 4;
241
+ GAME_FULL = 5;
242
+ LAUNCH_ERROR = 6;
243
+
244
+ // MULTIPLAYER SPECIFIC.
245
+ FEATURE_UNSUPPORTED = 7; // MULTIPLAYER IS NOT SUPPORTED IN THE CURRENT BUILD FOR THE REQUESTED FEATURES.
246
+ NO_SPACE_FOR_USER = 8;
247
+ MAP_DOES_NOT_EXIST = 9;
248
+ CANNOT_OPEN_MAP = 10;
249
+ CHECKSUM_ERROR = 11;
250
+ NETWORK_ERROR = 12;
251
+ OTHER_ERROR = 13;
252
252
  }
253
253
  optional Error error = 2;
254
254
  optional string error_details = 3;
@@ -261,8 +261,8 @@ message RequestRestartGame {
261
261
  // The defaultRestartGameLoops is specified to be (1<<18) by default
262
262
  message ResponseRestartGame {
263
263
  enum Error {
264
- EnumResponseRestartGameErrorUnset = 0; // Proto3 compat
265
- LaunchError = 1;
264
+ ENUM_RESPONSE_RESTART_GAME_ERROR_UNSET = 0; // PROTO3 COMPAT
265
+ LAUNCH_ERROR = 1;
266
266
  }
267
267
  optional Error error = 1;
268
268
  optional string error_details = 2;
@@ -286,14 +286,14 @@ message RequestStartReplay {
286
286
 
287
287
  message ResponseStartReplay {
288
288
  enum Error {
289
- EnumResponseStartReplayErrorUnset = 0; // Proto3 compat
290
- MissingReplay = 1;
291
- InvalidReplayPath = 2;
292
- InvalidReplayData = 3;
293
- InvalidMapData = 4;
294
- InvalidObservedPlayerId = 5;
295
- MissingOptions = 6;
296
- LaunchError = 7;
289
+ ENUM_RESPONSE_START_REPLAY_ERROR_UNSET = 0; // PROTO3 COMPAT
290
+ MISSING_REPLAY = 1;
291
+ INVALID_REPLAY_PATH = 2;
292
+ INVALID_REPLAY_DATA = 3;
293
+ INVALID_MAP_DATA = 4;
294
+ INVALID_OBSERVED_PLAYER_ID = 5;
295
+ MISSING_OPTIONS = 6;
296
+ LAUNCH_ERROR = 7;
297
297
  }
298
298
  optional Error error = 1;
299
299
  optional string error_details = 2;
@@ -306,8 +306,8 @@ message RequestMapCommand {
306
306
 
307
307
  message ResponseMapCommand {
308
308
  enum Error {
309
- EnumResponseMapCommandErrorUnset = 0; // Proto3 compat
310
- NoTriggerError = 1;
309
+ ENUM_RESPONSE_MAP_COMMAND_ERROR_UNSET = 0; // PROTO3 COMPAT
310
+ NO_TRIGGER_ERROR = 1;
311
311
  }
312
312
  optional Error error = 1;
313
313
  optional string error_details = 2;
@@ -350,9 +350,9 @@ message RequestGameInfo {
350
350
  message ResponseGameInfo {
351
351
  optional string map_name = 1;
352
352
  optional string local_map_path = 2;
353
- repeated PlayerInfo player_info = 3 [unverified_lazy=true];
353
+ repeated PlayerInfo player_info = 3;
354
354
  optional StartRaw start_raw = 4; // Populated if Raw interface is enabled.
355
- optional InterfaceOptions options = 5 [unverified_lazy=true];
355
+ optional InterfaceOptions options = 5;
356
356
  repeated string mod_names = 6;
357
357
  }
358
358
 
@@ -366,7 +366,7 @@ message ResponseObservation {
366
366
  repeated Action actions = 1; // Actions this player did since the last Observation.
367
367
  repeated ActionError action_errors = 2; // Equivalent of UI "red text" errors.
368
368
  optional Observation observation = 3;
369
- repeated PlayerResult player_result = 4 [unverified_lazy=true]; // Only populated if the game ended during this step.
369
+ repeated PlayerResult player_result = 4; // Only populated if the game ended during this step.
370
370
  repeated ChatReceived chat = 5;
371
371
  }
372
372
 
@@ -459,12 +459,12 @@ message ResponseReplayInfo {
459
459
  optional uint32 base_build = 8;
460
460
 
461
461
  enum Error {
462
- EnumResponseReplayInfoErrorUnset = 0; // Proto3 compat
463
- MissingReplay = 1;
464
- InvalidReplayPath = 2;
465
- InvalidReplayData = 3;
466
- ParsingError = 4;
467
- DownloadError = 5;
462
+ ENUM_RESPONSE_REPLAY_INFO_ERROR_UNSET = 0; // PROTO3 COMPAT
463
+ MISSING_REPLAY = 1;
464
+ INVALID_REPLAY_PATH = 2;
465
+ INVALID_REPLAY_DATA = 3;
466
+ PARSING_ERROR = 4;
467
+ DOWNLOAD_ERROR = 5;
468
468
  }
469
469
  optional Error error = 9;
470
470
  optional string error_details = 10;
@@ -491,8 +491,8 @@ message RequestSaveMap {
491
491
 
492
492
  message ResponseSaveMap {
493
493
  enum Error {
494
- EnumResponseSaveMapErrorUnset = 0; // Proto3 compat
495
- InvalidMapData = 1;
494
+ ENUM_RESPONSE_SAVE_MAP_ERROR_UNSET = 0; // PROTO3 COMPAT
495
+ INVALID_MAP_DATA = 1;
496
496
  }
497
497
  optional Error error = 1;
498
498
  }
@@ -522,34 +522,34 @@ message ResponseDebug {
522
522
  //
523
523
 
524
524
  enum Difficulty {
525
- EnumDifficultyUnset = 0; // Proto3 compat
526
- VeryEasy = 1;
527
- Easy = 2;
528
- Medium = 3;
529
- MediumHard = 4;
530
- Hard = 5;
531
- Harder = 6;
532
- VeryHard = 7;
533
- CheatVision = 8;
534
- CheatMoney = 9;
535
- CheatInsane = 10;
525
+ ENUM_DIFFICULTY_UNSET = 0; // PROTO3 COMPAT
526
+ VERY_EASY = 1;
527
+ EASY = 2;
528
+ MEDIUM = 3;
529
+ MEDIUM_HARD = 4;
530
+ HARD = 5;
531
+ HARDER = 6;
532
+ VERY_HARD = 7;
533
+ CHEAT_VISION = 8;
534
+ CHEAT_MONEY = 9;
535
+ CHEAT_INSANE = 10;
536
536
  }
537
537
 
538
538
  enum PlayerType {
539
- EnumPlayerTypeUnset = 0; // Proto3 compat
540
- Participant = 1;
541
- Computer = 2;
542
- Observer = 3;
539
+ ENUM_PLAYER_TYPE_UNSET = 0; // PROTO3 COMPAT
540
+ PARTICIPANT = 1;
541
+ COMPUTER = 2;
542
+ OBSERVER = 3;
543
543
  }
544
544
 
545
545
  enum AIBuild {
546
- EnumAIBuildUnset = 0; // Proto3 compat
547
- RandomBuild = 1;
548
- Rush = 2;
549
- Timing = 3;
550
- Power = 4;
551
- Macro = 5;
552
- Air = 6;
546
+ ENUM_AI_BUILD_UNSET = 0; // PROTO3 COMPAT
547
+ RANDOM_BUILD = 1;
548
+ RUSH = 2;
549
+ TIMING = 3;
550
+ POWER = 4;
551
+ MACRO = 5;
552
+ AIR = 6;
553
553
  }
554
554
 
555
555
  message PlayerSetup {
@@ -630,11 +630,11 @@ message Observation {
630
630
  optional PlayerCommon player_common = 1;
631
631
  repeated Alert alerts = 10;
632
632
  repeated AvailableAbility abilities = 3; // Abilities available in the selection. Enabled if in this list, disabled otherwise.
633
- optional Score score = 4 [unverified_lazy=true];
633
+ optional Score score = 4;
634
634
 
635
635
  optional ObservationRaw raw_data = 5; // Populated if Raw interface is enabled.
636
636
  optional ObservationFeatureLayer feature_layer_data = 6; // Populated if Feature Layer interface is enabled.
637
- optional ObservationRender render_data = 7 [unverified_lazy=true]; // Populated if Render interface is enabled.
637
+ optional ObservationRender render_data = 7; // Populated if Render interface is enabled.
638
638
  optional ObservationUI ui_data = 8; // Populated if Feature Layer or Render interface is enabled.
639
639
  }
640
640
 
@@ -649,9 +649,9 @@ message Action {
649
649
 
650
650
  message ActionChat {
651
651
  enum Channel {
652
- EnumChannelUnset = 0; // Proto3 compat
653
- Broadcast = 1;
654
- Team = 2;
652
+ ENUM_CHANNEL_UNSET = 0; // PROTO3 COMPAT
653
+ BROADCAST = 1;
654
+ TEAM = 2;
655
655
  }
656
656
  optional Channel channel = 1;
657
657
  optional string message = 2;
@@ -693,37 +693,37 @@ message ActionObserverCameraFollowUnits {
693
693
  }
694
694
 
695
695
  enum Alert {
696
- EnumAlertUnset = 0; // Proto3 compat
697
- AlertError = 3;
698
- AddOnComplete = 4;
699
- BuildingComplete = 5;
700
- BuildingUnderAttack = 6;
701
- LarvaHatched = 7;
702
- MergeComplete = 8;
703
- MineralsExhausted = 9;
704
- MorphComplete = 10;
705
- MothershipComplete = 11;
706
- MULEExpired = 12;
707
- NuclearLaunchDetected = 1;
708
- NukeComplete = 13;
709
- NydusWormDetected = 2;
710
- ResearchComplete = 14;
711
- TrainError = 15;
712
- TrainUnitComplete = 16;
713
- TrainWorkerComplete = 17;
714
- TransformationComplete = 18;
715
- UnitUnderAttack = 19;
716
- UpgradeComplete = 20;
717
- VespeneExhausted = 21;
718
- WarpInComplete = 22;
696
+ ENUM_ALERT_UNSET = 0; // PROTO3 COMPAT
697
+ ALERT_ERROR = 3;
698
+ ADD_ON_COMPLETE = 4;
699
+ BUILDING_COMPLETE = 5;
700
+ BUILDING_UNDER_ATTACK = 6;
701
+ LARVA_HATCHED = 7;
702
+ MERGE_COMPLETE = 8;
703
+ MINERALS_EXHAUSTED = 9;
704
+ MORPH_COMPLETE = 10;
705
+ MOTHERSHIP_COMPLETE = 11;
706
+ MULE_EXPIRED = 12;
707
+ NUCLEAR_LAUNCH_DETECTED = 1;
708
+ NUKE_COMPLETE = 13;
709
+ NYDUS_WORM_DETECTED = 2;
710
+ RESEARCH_COMPLETE = 14;
711
+ TRAIN_ERROR = 15;
712
+ TRAIN_UNIT_COMPLETE = 16;
713
+ TRAIN_WORKER_COMPLETE = 17;
714
+ TRANSFORMATION_COMPLETE = 18;
715
+ UNIT_UNDER_ATTACK = 19;
716
+ UPGRADE_COMPLETE = 20;
717
+ VESPENE_EXHAUSTED = 21;
718
+ WARP_IN_COMPLETE = 22;
719
719
  }
720
720
 
721
721
  enum Result {
722
- EnumResultUnset = 0; // Proto3 compat
723
- Victory = 1;
724
- Defeat = 2;
725
- Tie = 3;
726
- Undecided = 4;
722
+ ENUM_RESULT_UNSET = 0; // PROTO3 COMPAT
723
+ VICTORY = 1;
724
+ DEFEAT = 2;
725
+ TIE = 3;
726
+ UNDECIDED = 4;
727
727
  }
728
728
 
729
729
  message PlayerResult {
@@ -5,9 +5,9 @@ package Api;
5
5
 
6
6
  message Score {
7
7
  enum ScoreType {
8
- EnumScoreTypeUnset = 0; // Proto3 compat
9
- Curriculum = 1; // map generated score (from curriculum maps with special scoring)
10
- Melee = 2; // summation of in-progress and current units/buildings value + minerals + vespene
8
+ ENUM_SCORE_TYPE_UNSET = 0; // PROTO3 COMPAT
9
+ CURRICULUM = 1; // MAP GENERATED SCORE (FROM CURRICULUM MAPS WITH SPECIAL SCORING)
10
+ MELEE = 2; // SUMMATION OF IN_PROGRESS AND CURRENT UNITS/BUILDINGS VALUE + MINERALS + VESPENE
11
11
  }
12
12
 
13
13
  optional ScoreType score_type = 6;
@@ -101,11 +101,11 @@ message ActionSpatialCameraMove {
101
101
  message ActionSpatialUnitSelectionPoint {
102
102
  optional PointI selection_screen_coord = 1;
103
103
  enum Type {
104
- EnumActionSpatialUnitSelectionPointTypeUnset = 0; // Proto3 compat
105
- Select = 1; // Equivalent to normal click. Changes selection to unit.
106
- Toggle = 2; // Equivalent to shift+click. Toggle selection of unit.
107
- AllType = 3; // Equivalent to control+click. Selects all units of a given type.
108
- AddAllType = 4; // Equivalent to shift+control+click. Selects all units of a given type.
104
+ ENUM_ACTION_SPATIAL_UNIT_SELECTION_POINT_TYPE_UNSET = 0; // PROTO3 COMPAT
105
+ SELECT = 1; // EQUIVALENT TO NORMAL CLICK. CHANGES SELECTION TO UNIT.
106
+ TOGGLE = 2; // EQUIVALENT TO SHIFT+CLICK. TOGGLE SELECTION OF UNIT.
107
+ ALL_TYPE = 3; // EQUIVALENT TO CONTROL+CLICK. SELECTS ALL UNITS OF A GIVEN TYPE.
108
+ ADD_ALL_TYPE = 4; // EQUIVALENT TO SHIFT+CONTROL+CLICK. SELECTS ALL UNITS OF A GIVEN TYPE.
109
109
  }
110
110
  optional Type type = 2;
111
111
  }
@@ -90,12 +90,12 @@ message ActionUI {
90
90
 
91
91
  message ActionControlGroup {
92
92
  enum ControlGroupAction {
93
- EnumControlGroupActionUnset = 0; // Proto3 compat
94
- Recall = 1; // Equivalent to number hotkey. Replaces current selection with control group.
95
- Set = 2; // Equivalent to Control + number hotkey. Sets control group to current selection.
96
- Append = 3; // Equivalent to Shift + number hotkey. Adds current selection into control group.
97
- SetAndSteal = 4; // Equivalent to Control + Alt + number hotkey. Sets control group to current selection. Units are removed from other control groups.
98
- AppendAndSteal = 5; // Equivalent to Shift + Alt + number hotkey. Adds current selection into control group. Units are removed from other control groups.
93
+ ENUM_CONTROL_GROUP_ACTION_UNSET = 0; // PROTO3 COMPAT
94
+ RECALL = 1; // EQUIVALENT TO NUMBER HOTKEY. REPLACES CURRENT SELECTION WITH CONTROL GROUP.
95
+ SET = 2; // EQUIVALENT TO CONTROL + NUMBER HOTKEY. SETS CONTROL GROUP TO CURRENT SELECTION.
96
+ APPEND = 3; // EQUIVALENT TO SHIFT + NUMBER HOTKEY. ADDS CURRENT SELECTION INTO CONTROL GROUP.
97
+ SET_AND_STEAL = 4; // EQUIVALENT TO CONTROL + ALT + NUMBER HOTKEY. SETS CONTROL GROUP TO CURRENT SELECTION. UNITS ARE REMOVED FROM OTHER CONTROL GROUPS.
98
+ APPEND_AND_STEAL = 5; // EQUIVALENT TO SHIFT + ALT + NUMBER HOTKEY. ADDS CURRENT SELECTION INTO CONTROL GROUP. UNITS ARE REMOVED FROM OTHER CONTROL GROUPS.
99
99
  }
100
100
  optional ControlGroupAction action = 1;
101
101
  optional uint32 control_group_index = 2;
@@ -114,22 +114,22 @@ message ActionSelectLarva {
114
114
 
115
115
  message ActionSelectIdleWorker {
116
116
  enum Type {
117
- EnumActionSelectIdleWorkerTypeUnset = 0; // Proto3 compat
118
- Set = 1; // Equivalent to click with no modifiers. Replaces selection with single idle worker.
119
- Add = 2; // Equivalent to shift+click. Adds single idle worker to current selection.
120
- All = 3; // Equivalent to control+click. Selects all idle workers.
121
- AddAll = 4; // Equivalent to shift+control+click. Adds all idle workers to current selection.
117
+ ENUM_ACTION_SELECT_IDLE_WORKER_TYPE_UNSET = 0; // PROTO3 COMPAT
118
+ SET = 1; // EQUIVALENT TO CLICK WITH NO MODIFIERS. REPLACES SELECTION WITH SINGLE IDLE WORKER.
119
+ ADD = 2; // EQUIVALENT TO SHIFT+CLICK. ADDS SINGLE IDLE WORKER TO CURRENT SELECTION.
120
+ ALL = 3; // EQUIVALENT TO CONTROL+CLICK. SELECTS ALL IDLE WORKERS.
121
+ ADD_ALL = 4; // EQUIVALENT TO SHIFT+CONTROL+CLICK. ADDS ALL IDLE WORKERS TO CURRENT SELECTION.
122
122
  }
123
123
  optional Type type = 1;
124
124
  }
125
125
 
126
126
  message ActionMultiPanel {
127
127
  enum Type {
128
- EnumActionMultiPanelTypeUnset = 0; // Proto3 compat
129
- SingleSelect = 1; // Click on icon
130
- DeselectUnit = 2; // Shift Click on icon
131
- SelectAllOfType = 3; // Control Click on icon.
132
- DeselectAllOfType = 4; // Control+Shift Click on icon.
128
+ ENUM_ACTION_MULTI_PANEL_TYPE_UNSET = 0; // PROTO3 COMPAT
129
+ SINGLE_SELECT = 1; // CLICK ON ICON
130
+ DESELECT_UNIT = 2; // SHIFT CLICK ON ICON
131
+ SELECT_ALL_OF_TYPE = 3; // CONTROL CLICK ON ICON.
132
+ DESELECT_ALL_OF_TYPE = 4; // CONTROL+SHIFT CLICK ON ICON.
133
133
  }
134
134
  optional Type type = 1;
135
135
  optional int32 unit_index = 2;
data/exe/sc2ai CHANGED
@@ -1,9 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- # require "pathname"
5
- # $LOAD_PATH.unshift(Pathname(File.dirname(__FILE__)).parent.join("lib").expand_path.to_s)
6
-
7
4
  require "sc2ai/cli/cli"
8
5
 
9
6
  # This got old quickly.
@@ -4,7 +4,7 @@ LABEL service="bot-ruby-local"
4
4
  USER root
5
5
  WORKDIR /root/ruby-builder
6
6
 
7
- ARG RUBY_VERSION=3.3.5
7
+ ARG RUBY_VERSION=3.4.1
8
8
  ARG DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=true
9
9
 
10
10
  # Deps - Ruby build
@@ -17,7 +17,7 @@ RUN tar -zxf yaml-0.2.5.tar.gz
17
17
 
18
18
  # Ruby
19
19
  RUN mkdir -p /root/ruby-builder/.ruby
20
- RUN curl https://cache.ruby-lang.org/pub/ruby/3.3/ruby-$RUBY_VERSION.tar.gz -o ruby-$RUBY_VERSION.tar.gz
20
+ RUN curl https://cache.ruby-lang.org/pub/ruby/3.4/ruby-$RUBY_VERSION.tar.gz -o ruby-$RUBY_VERSION.tar.gz
21
21
  RUN tar -zxf ruby-$RUBY_VERSION.tar.gz
22
22
  RUN mkdir ruby-$RUBY_VERSION/build
23
23
  WORKDIR /root/ruby-builder/ruby-$RUBY_VERSION/build
@@ -46,7 +46,7 @@ module Sc2
46
46
 
47
47
  # Indexes ability data by ability id
48
48
  # @param abilities [Array<Api::AbilityData>]
49
- # @return [Hash<Integer, Api::AbilityData] indexed data
49
+ # @return [Hash<Integer, Api::AbilityData>] indexed data
50
50
  def abilities_from_proto(abilities)
51
51
  result = {}
52
52
 
@@ -75,7 +75,7 @@ module Sc2
75
75
 
76
76
  # Indexes upgrades data by id
77
77
  # @param upgrades [Array<Api::UpgradeData>]
78
- # @return [Hash<Integer, Api::UpgradeData] indexed data
78
+ # @return [Hash<Integer, Api::UpgradeData>] indexed data
79
79
  def upgrades_from_proto(upgrades)
80
80
  result = {}
81
81
  upgrades.each do |u|
@@ -247,7 +247,7 @@ module Sc2
247
247
  unit_data.mineral_cost_sum += units[Api::UnitTypeId::GATEWAY].mineral_cost
248
248
  unit_data.vespene_cost_sum += units[Api::UnitTypeId::GATEWAY].vespene_cost
249
249
  else
250
- if unit_data.race == Api::Race::Zerg && unit_data.attributes.include?(:Structure)
250
+ if unit_data.race == Api::Race::ZERG && unit_data.attributes.include?(Api::Attribute::STRUCTURE)
251
251
  unit_data.mineral_cost_sum += units[Api::UnitTypeId::DRONE].mineral_cost
252
252
  end
253
253
  end
@@ -6,21 +6,21 @@ module Sc2
6
6
  # noinspection RubyUnusedLocalVariable
7
7
  module ConnectionListener
8
8
  # Called when connection established to application
9
- # @param connection [Sc2Ai::Connection]
9
+ # @param connection [Sc2::Connection]
10
10
  # noinspection
11
11
  def on_connected(connection)
12
12
  Sc2.logger.debug { "#{self.class}.#{__method__} #{connection}" }
13
13
  end
14
14
 
15
15
  # Called while waiting on connection to application
16
- # @param connection [Sc2Ai::Connection]
16
+ # @param connection [Sc2::Connection]
17
17
  # noinspection Lint/UnusedMethodArgument
18
18
  def on_connection_waiting(connection)
19
19
  Sc2.logger.debug { "#{self.class}.#{__method__} #{connection}" }
20
20
  end
21
21
 
22
22
  # Called when disconnected from application
23
- # @param connection [Sc2Ai::Connection]
23
+ # @param connection [Sc2::Connection]
24
24
  # noinspection Lint/UnusedMethodArgument
25
25
  def on_disconnect(connection)
26
26
  Sc2.logger.debug { "#{self.class}.#{__method__} #{connection}" }