TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
tcunit.h
1 /*
2  * Copyright (c) 2017-present, Facebook, Inc.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #pragma once
9 
10 #include <BWAPI.h>
11 
12 #include <torchcraft/state.h>
13 
14 namespace tcbwapi {
15 
16 // XXX I'm not saying this is clean but it does the job for BWEM
17 class TCUnit : public BWAPI::UnitInterface {
18  public:
19  TCUnit(torchcraft::replayer::Unit u) : u_(std::move(u)) {}
20  virtual ~TCUnit() {}
21 
22  //
23  // Implemented methods
24  //
25  int getID() const override {
26  return u_.id;
27  }
28  int getResources() const override {
29  return u_.resources;
30  }
31  BWAPI::UnitType getType() const override {
32  return BWAPI::UnitType(u_.type);
33  }
34  BWAPI::Position getPosition() const override {
35  return BWAPI::Position(
36  u_.x * torchcraft::BW::XYPixelsPerWalktile,
37  u_.y * torchcraft::BW::XYPixelsPerWalktile);
38  }
39  bool isLifted() const override {
40  return (u_.flags & torchcraft::Unit::Flags::Lifted) != 0;
41  }
42 
43  // Assume we get the unit at the beginning of the game
44  int getInitialResources() const override {
45  return getResources();
46  }
47  BWAPI::TilePosition getInitialTilePosition() const override {
48  return getTilePosition();
49  }
50  BWAPI::Position getInitialPosition() const override {
51  return getPosition();
52  }
53  BWAPI::UnitType getInitialType() const override {
54  return getType();
55  }
56 
57  private:
58  void throwNotImplemented() const {
59  throw std::runtime_error("tcbwapi::TCUnit: Method not implemented");
60  }
61 
63 
64 //
65 // Stubs
66 //
67 #if defined(__clang__)
68 #pragma clang diagnostic push
69 #pragma clang diagnostic ignored "-Wreturn-type"
70 #elif defined(__GNUC__)
71 #pragma GCC diagnostic push
72 #pragma GCC diagnostic ignored "-Wreturn-type"
73 #endif
74  public:
75  bool exists() const override {
76  throwNotImplemented();
77  }
78  int getReplayID() const override {
79  throwNotImplemented();
80  }
81  BWAPI::Player getPlayer() const override {
82  throwNotImplemented();
83  }
84  double getAngle() const override {
85  throwNotImplemented();
86  }
87  double getVelocityX() const override {
88  throwNotImplemented();
89  }
90  double getVelocityY() const override {
91  throwNotImplemented();
92  }
93  int getHitPoints() const override {
94  throwNotImplemented();
95  }
96  int getShields() const override {
97  throwNotImplemented();
98  }
99  int getEnergy() const override {
100  throwNotImplemented();
101  }
102  int getResourceGroup() const override {
103  throwNotImplemented();
104  }
105  int getLastCommandFrame() const override {
106  throwNotImplemented();
107  }
108  BWAPI::UnitCommand getLastCommand() const override {
109  throwNotImplemented();
110  }
111  BWAPI::Player getLastAttackingPlayer() const override {
112  throwNotImplemented();
113  }
114  int getInitialHitPoints() const override {
115  throwNotImplemented();
116  }
117  int getKillCount() const override {
118  throwNotImplemented();
119  }
120  int getAcidSporeCount() const override {
121  throwNotImplemented();
122  }
123  int getInterceptorCount() const override {
124  throwNotImplemented();
125  }
126  int getScarabCount() const override {
127  throwNotImplemented();
128  }
129  int getSpiderMineCount() const override {
130  throwNotImplemented();
131  }
132  int getGroundWeaponCooldown() const override {
133  throwNotImplemented();
134  }
135  int getAirWeaponCooldown() const override {
136  throwNotImplemented();
137  }
138  int getSpellCooldown() const override {
139  throwNotImplemented();
140  }
141  int getDefenseMatrixPoints() const override {
142  throwNotImplemented();
143  }
144  int getDefenseMatrixTimer() const override {
145  throwNotImplemented();
146  }
147  int getEnsnareTimer() const override {
148  throwNotImplemented();
149  }
150  int getIrradiateTimer() const override {
151  throwNotImplemented();
152  }
153  int getLockdownTimer() const override {
154  throwNotImplemented();
155  }
156  int getMaelstromTimer() const override {
157  throwNotImplemented();
158  }
159  int getOrderTimer() const override {
160  throwNotImplemented();
161  }
162  int getPlagueTimer() const override {
163  throwNotImplemented();
164  }
165  int getRemoveTimer() const override {
166  throwNotImplemented();
167  }
168  int getStasisTimer() const override {
169  throwNotImplemented();
170  }
171  int getStimTimer() const override {
172  throwNotImplemented();
173  }
174  BWAPI::UnitType getBuildType() const override {
175  throwNotImplemented();
176  }
177  BWAPI::UnitType::list getTrainingQueue() const override {
178  throwNotImplemented();
179  }
180  BWAPI::TechType getTech() const override {
181  throwNotImplemented();
182  }
183  BWAPI::UpgradeType getUpgrade() const override {
184  throwNotImplemented();
185  }
186  int getRemainingBuildTime() const override {
187  throwNotImplemented();
188  }
189  int getRemainingTrainTime() const override {
190  throwNotImplemented();
191  }
192  int getRemainingResearchTime() const override {
193  throwNotImplemented();
194  }
195  int getRemainingUpgradeTime() const override {
196  throwNotImplemented();
197  }
198  BWAPI::Unit getBuildUnit() const override {
199  throwNotImplemented();
200  }
201  BWAPI::Unit getTarget() const override {
202  throwNotImplemented();
203  }
204  BWAPI::Position getTargetPosition() const override {
205  throwNotImplemented();
206  }
207  BWAPI::Order getOrder() const override {
208  throwNotImplemented();
209  }
210  BWAPI::Order getSecondaryOrder() const override {
211  throwNotImplemented();
212  }
213  BWAPI::Unit getOrderTarget() const override {
214  throwNotImplemented();
215  }
216  BWAPI::Position getOrderTargetPosition() const override {
217  throwNotImplemented();
218  }
219  BWAPI::Position getRallyPosition() const override {
220  throwNotImplemented();
221  }
222  BWAPI::Unit getRallyUnit() const override {
223  throwNotImplemented();
224  }
225  BWAPI::Unit getAddon() const override {
226  throwNotImplemented();
227  }
228  BWAPI::Unit getNydusExit() const override {
229  throwNotImplemented();
230  }
231  BWAPI::Unit getPowerUp() const override {
232  throwNotImplemented();
233  }
234  BWAPI::Unit getTransport() const override {
235  throwNotImplemented();
236  }
237  BWAPI::Unitset getLoadedUnits() const override {
238  throwNotImplemented();
239  }
240  BWAPI::Unit getCarrier() const override {
241  throwNotImplemented();
242  }
243  BWAPI::Unitset getInterceptors() const override {
244  throwNotImplemented();
245  }
246  BWAPI::Unit getHatchery() const override {
247  throwNotImplemented();
248  }
249  BWAPI::Unitset getLarva() const override {
250  throwNotImplemented();
251  }
252  bool hasNuke() const override {
253  throwNotImplemented();
254  }
255  bool isAccelerating() const override {
256  throwNotImplemented();
257  }
258  bool isAttacking() const override {
259  throwNotImplemented();
260  }
261  bool isAttackFrame() const override {
262  throwNotImplemented();
263  }
264  bool isBeingGathered() const override {
265  throwNotImplemented();
266  }
267  bool isBeingHealed() const override {
268  throwNotImplemented();
269  }
270  bool isBlind() const override {
271  throwNotImplemented();
272  }
273  bool isBraking() const override {
274  throwNotImplemented();
275  }
276  bool isBurrowed() const override {
277  throwNotImplemented();
278  }
279  bool isCarryingGas() const override {
280  throwNotImplemented();
281  }
282  bool isCarryingMinerals() const override {
283  throwNotImplemented();
284  }
285  bool isCloaked() const override {
286  throwNotImplemented();
287  }
288  bool isCompleted() const override {
289  throwNotImplemented();
290  }
291  bool isConstructing() const override {
292  throwNotImplemented();
293  }
294  bool isDetected() const override {
295  throwNotImplemented();
296  }
297  bool isGatheringGas() const override {
298  throwNotImplemented();
299  }
300  bool isGatheringMinerals() const override {
301  throwNotImplemented();
302  }
303  bool isHallucination() const override {
304  throwNotImplemented();
305  }
306  bool isIdle() const override {
307  throwNotImplemented();
308  }
309  bool isInterruptible() const override {
310  throwNotImplemented();
311  }
312  bool isInvincible() const override {
313  throwNotImplemented();
314  }
315  bool isMorphing() const override {
316  throwNotImplemented();
317  }
318  bool isMoving() const override {
319  throwNotImplemented();
320  }
321  bool isParasited() const override {
322  throwNotImplemented();
323  }
324  bool isSelected() const override {
325  throwNotImplemented();
326  }
327  bool isStartingAttack() const override {
328  throwNotImplemented();
329  }
330  bool isStuck() const override {
331  throwNotImplemented();
332  }
333  bool isTraining() const override {
334  throwNotImplemented();
335  }
336  bool isUnderAttack() const override {
337  throwNotImplemented();
338  }
339  bool isUnderDarkSwarm() const override {
340  throwNotImplemented();
341  }
342  bool isUnderDisruptionWeb() const override {
343  throwNotImplemented();
344  }
345  bool isUnderStorm() const override {
346  throwNotImplemented();
347  }
348  bool isPowered() const override {
349  throwNotImplemented();
350  }
351  bool isVisible(BWAPI::Player player = nullptr) const override {
352  throwNotImplemented();
353  }
354  bool isTargetable() const override {
355  throwNotImplemented();
356  }
357  bool issueCommand(BWAPI::UnitCommand command) override {
358  throwNotImplemented();
359  }
361  BWAPI::UnitCommand command,
362  bool checkCanUseTechPositionOnPositions = true,
363  bool checkCanUseTechUnitOnUnits = true,
364  bool checkCanBuildUnitType = true,
365  bool checkCanTargetUnit = true,
366  bool checkCanIssueCommandType = true,
367  bool checkCommandibility = true) const override {
368  throwNotImplemented();
369  }
371  BWAPI::UnitCommand command,
372  bool checkCanUseTechPositionOnPositions = true,
373  bool checkCanUseTechUnitOnUnits = true,
374  bool checkCanTargetUnit = true,
375  bool checkCanIssueCommandType = true,
376  bool checkCommandibilityGrouped = true,
377  bool checkCommandibility = true) const override {
378  throwNotImplemented();
379  }
380  bool canCommand() const override {
381  throwNotImplemented();
382  }
383  bool canCommandGrouped(bool checkCommandibility = true) const override {
384  throwNotImplemented();
385  }
387  BWAPI::UnitCommandType ct,
388  bool checkCommandibility = true) const override {
389  throwNotImplemented();
390  }
392  BWAPI::UnitCommandType ct,
393  bool checkCommandibilityGrouped = true,
394  bool checkCommandibility = true) const override {
395  throwNotImplemented();
396  }
397  bool canTargetUnit(BWAPI::Unit targetUnit, bool checkCommandibility = true)
398  const override {
399  throwNotImplemented();
400  }
401  bool canAttack(bool checkCommandibility = true) const override {
402  throwNotImplemented();
403  }
404  bool canAttack(
405  BWAPI::Position target,
406  bool checkCanTargetUnit = true,
407  bool checkCanIssueCommandType = true,
408  bool checkCommandibility = true) const override {
409  throwNotImplemented();
410  }
411  bool canAttack(
412  BWAPI::Unit target,
413  bool checkCanTargetUnit = true,
414  bool checkCanIssueCommandType = true,
415  bool checkCommandibility = true) const override {
416  throwNotImplemented();
417  }
419  bool checkCommandibilityGrouped = true,
420  bool checkCommandibility = true) const override {
421  throwNotImplemented();
422  }
424  BWAPI::Position target,
425  bool checkCanTargetUnit = true,
426  bool checkCanIssueCommandType = true,
427  bool checkCommandibilityGrouped = true,
428  bool checkCommandibility = true) const override {
429  throwNotImplemented();
430  }
432  BWAPI::Unit target,
433  bool checkCanTargetUnit = true,
434  bool checkCanIssueCommandType = true,
435  bool checkCommandibilityGrouped = true,
436  bool checkCommandibility = true) const override {
437  throwNotImplemented();
438  }
439  bool canAttackMove(bool checkCommandibility = true) const override {
440  throwNotImplemented();
441  }
443  bool checkCommandibilityGrouped = true,
444  bool checkCommandibility = true) const override {
445  throwNotImplemented();
446  }
447  bool canAttackUnit(bool checkCommandibility = true) const override {
448  throwNotImplemented();
449  }
451  BWAPI::Unit targetUnit,
452  bool checkCanTargetUnit = true,
453  bool checkCanIssueCommandType = true,
454  bool checkCommandibility = true) const override {
455  throwNotImplemented();
456  }
458  bool checkCommandibilityGrouped = true,
459  bool checkCommandibility = true) const override {
460  throwNotImplemented();
461  }
463  BWAPI::Unit targetUnit,
464  bool checkCanTargetUnit = true,
465  bool checkCanIssueCommandType = true,
466  bool checkCommandibilityGrouped = true,
467  bool checkCommandibility = true) const override {
468  throwNotImplemented();
469  }
470  bool canBuild(bool checkCommandibility = true) const override {
471  throwNotImplemented();
472  }
473  bool canBuild(
474  BWAPI::UnitType uType,
475  bool checkCanIssueCommandType = true,
476  bool checkCommandibility = true) const override {
477  throwNotImplemented();
478  }
479  bool canBuild(
480  BWAPI::UnitType uType,
481  BWAPI::TilePosition tilePos,
482  bool checkTargetUnitType = true,
483  bool checkCanIssueCommandType = true,
484  bool checkCommandibility = true) const override {
485  throwNotImplemented();
486  }
487  bool canBuildAddon(bool checkCommandibility = true) const override {
488  throwNotImplemented();
489  }
491  BWAPI::UnitType uType,
492  bool checkCanIssueCommandType = true,
493  bool checkCommandibility = true) const override {
494  throwNotImplemented();
495  }
496  bool canTrain(bool checkCommandibility = true) const override {
497  throwNotImplemented();
498  }
499  bool canTrain(
500  BWAPI::UnitType uType,
501  bool checkCanIssueCommandType = true,
502  bool checkCommandibility = true) const override {
503  throwNotImplemented();
504  }
505  bool canMorph(bool checkCommandibility = true) const override {
506  throwNotImplemented();
507  }
508  bool canMorph(
509  BWAPI::UnitType uType,
510  bool checkCanIssueCommandType = true,
511  bool checkCommandibility = true) const override {
512  throwNotImplemented();
513  }
514  bool canResearch(bool checkCommandibility = true) const override {
515  throwNotImplemented();
516  }
517  bool canResearch(BWAPI::TechType type, bool checkCanIssueCommandType = true)
518  const override {
519  throwNotImplemented();
520  }
521  bool canUpgrade(bool checkCommandibility = true) const override {
522  throwNotImplemented();
523  }
524  bool canUpgrade(BWAPI::UpgradeType type, bool checkCanIssueCommandType = true)
525  const override {
526  throwNotImplemented();
527  }
528  bool canSetRallyPoint(bool checkCommandibility = true) const override {
529  throwNotImplemented();
530  }
532  BWAPI::Position target,
533  bool checkCanTargetUnit = true,
534  bool checkCanIssueCommandType = true,
535  bool checkCommandibility = true) const override {
536  throwNotImplemented();
537  }
539  BWAPI::Unit target,
540  bool checkCanTargetUnit = true,
541  bool checkCanIssueCommandType = true,
542  bool checkCommandibility = true) const override {
543  throwNotImplemented();
544  }
545  bool canSetRallyPosition(bool checkCommandibility = true) const override {
546  throwNotImplemented();
547  }
548  bool canSetRallyUnit(bool checkCommandibility = true) const override {
549  throwNotImplemented();
550  }
552  BWAPI::Unit targetUnit,
553  bool checkCanTargetUnit = true,
554  bool checkCanIssueCommandType = true,
555  bool checkCommandibility = true) const override {
556  throwNotImplemented();
557  }
558  bool canMove(bool checkCommandibility = true) const override {
559  throwNotImplemented();
560  }
562  bool checkCommandibilityGrouped = true,
563  bool checkCommandibility = true) const override {
564  throwNotImplemented();
565  }
566  bool canPatrol(bool checkCommandibility = true) const override {
567  throwNotImplemented();
568  }
570  bool checkCommandibilityGrouped = true,
571  bool checkCommandibility = true) const override {
572  throwNotImplemented();
573  }
574  bool canFollow(bool checkCommandibility = true) const override {
575  throwNotImplemented();
576  }
577  bool canFollow(
578  BWAPI::Unit targetUnit,
579  bool checkCanTargetUnit = true,
580  bool checkCanIssueCommandType = true,
581  bool checkCommandibility = true) const override {
582  throwNotImplemented();
583  }
584  bool canGather(bool checkCommandibility = true) const override {
585  throwNotImplemented();
586  }
587  bool canGather(
588  BWAPI::Unit targetUnit,
589  bool checkCanTargetUnit = true,
590  bool checkCanIssueCommandType = true,
591  bool checkCommandibility = true) const override {
592  throwNotImplemented();
593  }
594  bool canReturnCargo(bool checkCommandibility = true) const override {
595  throwNotImplemented();
596  }
597  bool canHoldPosition(bool checkCommandibility = true) const override {
598  throwNotImplemented();
599  }
600  bool canStop(bool checkCommandibility = true) const override {
601  throwNotImplemented();
602  }
603  bool canRepair(bool checkCommandibility = true) const override {
604  throwNotImplemented();
605  }
606  bool canRepair(
607  BWAPI::Unit targetUnit,
608  bool checkCanTargetUnit = true,
609  bool checkCanIssueCommandType = true,
610  bool checkCommandibility = true) const override {
611  throwNotImplemented();
612  }
613  bool canBurrow(bool checkCommandibility = true) const override {
614  throwNotImplemented();
615  }
616  bool canUnburrow(bool checkCommandibility = true) const override {
617  throwNotImplemented();
618  }
619  bool canCloak(bool checkCommandibility = true) const override {
620  throwNotImplemented();
621  }
622  bool canDecloak(bool checkCommandibility = true) const override {
623  throwNotImplemented();
624  }
625  bool canSiege(bool checkCommandibility = true) const override {
626  throwNotImplemented();
627  }
628  bool canUnsiege(bool checkCommandibility = true) const override {
629  throwNotImplemented();
630  }
631  bool canLift(bool checkCommandibility = true) const override {
632  throwNotImplemented();
633  }
634  bool canLand(bool checkCommandibility = true) const override {
635  throwNotImplemented();
636  }
637  bool canLand(
638  BWAPI::TilePosition target,
639  bool checkCanIssueCommandType = true,
640  bool checkCommandibility = true) const override {
641  throwNotImplemented();
642  }
643  bool canLoad(bool checkCommandibility = true) const override {
644  throwNotImplemented();
645  }
646  bool canLoad(
647  BWAPI::Unit targetUnit,
648  bool checkCanTargetUnit = true,
649  bool checkCanIssueCommandType = true,
650  bool checkCommandibility = true) const override {
651  throwNotImplemented();
652  }
654  bool checkCommandibility = true) const override {
655  throwNotImplemented();
656  }
658  BWAPI::Position targDropPos,
659  bool checkCanIssueCommandType = true,
660  bool checkCommandibility = true) const override {
661  throwNotImplemented();
662  }
663  bool canUnload(bool checkCommandibility = true) const override {
664  throwNotImplemented();
665  }
666  bool canUnload(
667  BWAPI::Unit targetUnit,
668  bool checkCanTargetUnit = true,
669  bool checkPosition = true,
670  bool checkCanIssueCommandType = true,
671  bool checkCommandibility = true) const override {
672  throwNotImplemented();
673  }
674  bool canUnloadAll(bool checkCommandibility = true) const override {
675  throwNotImplemented();
676  }
677  bool canUnloadAllPosition(bool checkCommandibility = true) const override {
678  throwNotImplemented();
679  }
681  BWAPI::Position targDropPos,
682  bool checkCanIssueCommandType = true,
683  bool checkCommandibility = true) const override {
684  throwNotImplemented();
685  }
686  bool canRightClick(bool checkCommandibility = true) const override {
687  throwNotImplemented();
688  }
690  BWAPI::Position target,
691  bool checkCanTargetUnit = true,
692  bool checkCanIssueCommandType = true,
693  bool checkCommandibility = true) const override {
694  throwNotImplemented();
695  }
697  BWAPI::Unit target,
698  bool checkCanTargetUnit = true,
699  bool checkCanIssueCommandType = true,
700  bool checkCommandibility = true) const override {
701  throwNotImplemented();
702  }
704  bool checkCommandibilityGrouped = true,
705  bool checkCommandibility = true) const override {
706  throwNotImplemented();
707  }
709  BWAPI::Position target,
710  bool checkCanTargetUnit = true,
711  bool checkCanIssueCommandType = true,
712  bool checkCommandibilityGrouped = true,
713  bool checkCommandibility = true) const override {
714  throwNotImplemented();
715  }
717  BWAPI::Unit target,
718  bool checkCanTargetUnit = true,
719  bool checkCanIssueCommandType = true,
720  bool checkCommandibilityGrouped = true,
721  bool checkCommandibility = true) const override {
722  throwNotImplemented();
723  }
724  bool canRightClickPosition(bool checkCommandibility = true) const override {
725  throwNotImplemented();
726  }
728  bool checkCommandibilityGrouped = true,
729  bool checkCommandibility = true) const override {
730  throwNotImplemented();
731  }
732  bool canRightClickUnit(bool checkCommandibility = true) const override {
733  throwNotImplemented();
734  }
736  BWAPI::Unit targetUnit,
737  bool checkCanTargetUnit = true,
738  bool checkCanIssueCommandType = true,
739  bool checkCommandibility = true) const override {
740  throwNotImplemented();
741  }
743  bool checkCommandibilityGrouped = true,
744  bool checkCommandibility = true) const override {
745  throwNotImplemented();
746  }
748  BWAPI::Unit targetUnit,
749  bool checkCanTargetUnit = true,
750  bool checkCanIssueCommandType = true,
751  bool checkCommandibilityGrouped = true,
752  bool checkCommandibility = true) const override {
753  throwNotImplemented();
754  }
755  bool canHaltConstruction(bool checkCommandibility = true) const override {
756  throwNotImplemented();
757  }
758  bool canCancelConstruction(bool checkCommandibility = true) const override {
759  throwNotImplemented();
760  }
761  bool canCancelAddon(bool checkCommandibility = true) const override {
762  throwNotImplemented();
763  }
764  bool canCancelTrain(bool checkCommandibility = true) const override {
765  throwNotImplemented();
766  }
767  bool canCancelTrainSlot(bool checkCommandibility = true) const override {
768  throwNotImplemented();
769  }
771  int slot,
772  bool checkCanIssueCommandType = true,
773  bool checkCommandibility = true) const override {
774  throwNotImplemented();
775  }
776  bool canCancelMorph(bool checkCommandibility = true) const override {
777  throwNotImplemented();
778  }
779  bool canCancelResearch(bool checkCommandibility = true) const override {
780  throwNotImplemented();
781  }
782  bool canCancelUpgrade(bool checkCommandibility = true) const override {
783  throwNotImplemented();
784  }
786  bool checkCommandibility = true) const override {
787  throwNotImplemented();
788  }
790  BWAPI::TechType tech,
791  bool checkCanIssueCommandType = true,
792  bool checkCommandibility = true) const override {
793  throwNotImplemented();
794  }
796  BWAPI::TechType tech,
797  BWAPI::Position target,
798  bool checkCanTargetUnit = true,
799  bool checkTargetsType = true,
800  bool checkCanIssueCommandType = true,
801  bool checkCommandibility = true) const override {
802  throwNotImplemented();
803  }
805  BWAPI::TechType tech,
806  BWAPI::Unit target = nullptr,
807  bool checkCanTargetUnit = true,
808  bool checkTargetsType = true,
809  bool checkCanIssueCommandType = true,
810  bool checkCommandibility = true) const override {
811  throwNotImplemented();
812  }
814  BWAPI::TechType tech,
815  bool checkCanIssueCommandType = true,
816  bool checkCommandibility = true) const override {
817  throwNotImplemented();
818  }
820  BWAPI::TechType tech,
821  bool checkCanIssueCommandType = true,
822  bool checkCommandibility = true) const override {
823  throwNotImplemented();
824  }
826  BWAPI::TechType tech,
827  BWAPI::Unit targetUnit,
828  bool checkCanTargetUnit = true,
829  bool checkTargetsUnits = true,
830  bool checkCanIssueCommandType = true,
831  bool checkCommandibility = true) const override {
832  throwNotImplemented();
833  }
835  BWAPI::TechType tech,
836  bool checkCanIssueCommandType = true,
837  bool checkCommandibility = true) const override {
838  throwNotImplemented();
839  }
841  BWAPI::TechType tech,
842  BWAPI::Position target,
843  bool checkTargetsPositions = true,
844  bool checkCanIssueCommandType = true,
845  bool checkCommandibility = true) const override {
846  throwNotImplemented();
847  }
848  bool canPlaceCOP(bool checkCommandibility = true) const override {
849  throwNotImplemented();
850  }
852  BWAPI::TilePosition target,
853  bool checkCanIssueCommandType = true,
854  bool checkCommandibility = true) const override {
855  throwNotImplemented();
856  }
857 #if defined(__clang__)
858 #pragma clang diagnostic pop
859 #elif defined(__GNUC__)
860 #pragma GCC diagnostic pop
861 #endif
862 };
863 
864 } // namespace tcbwapi
bool canUnloadWithOrWithoutTarget(bool checkCommandibility=true) const override
Definition: tcunit.h:653
bool canSetRallyPoint(BWAPI::Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:531
int getHitPoints() const override
Definition: tcunit.h:93
double getAngle() const override
Definition: tcunit.h:84
bool canMove(bool checkCommandibility=true) const override
Definition: tcunit.h:558
BWAPI::UnitType getInitialType() const override
Definition: tcunit.h:53
int getStimTimer() const override
Definition: tcunit.h:171
bool canResearch(bool checkCommandibility=true) const override
Definition: tcunit.h:514
bool canBuild(bool checkCommandibility=true) const override
Definition: tcunit.h:470
int32_t x
Definition: frame.h:82
int getLastCommandFrame() const override
Definition: tcunit.h:105
bool canPlaceCOP(BWAPI::TilePosition target, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:851
int32_t y
Definition: frame.h:82
Definition: tcunit.h:17
BWAPI::Unit getBuildUnit() const override
Definition: tcunit.h:198
BWAPI::Unit getOrderTarget() const override
Definition: tcunit.h:213
double getVelocityY() const override
Definition: tcunit.h:90
bool canBuildAddon(bool checkCommandibility=true) const override
Definition: tcunit.h:487
BWAPI::Unit getTransport() const override
Definition: tcunit.h:234
int getReplayID() const override
Definition: tcunit.h:78
bool canFollow(bool checkCommandibility=true) const override
Definition: tcunit.h:574
bool canUseTechUnit(BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:819
bool isStartingAttack() const override
Definition: tcunit.h:327
bool canPatrol(bool checkCommandibility=true) const override
Definition: tcunit.h:566
bool canUnloadAllPosition(bool checkCommandibility=true) const override
Definition: tcunit.h:677
BWAPI::Position getOrderTargetPosition() const override
Definition: tcunit.h:216
bool canHoldPosition(bool checkCommandibility=true) const override
Definition: tcunit.h:597
bool canUseTechPosition(BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:834
bool canIssueCommand(BWAPI::UnitCommand command, bool checkCanUseTechPositionOnPositions=true, bool checkCanUseTechUnitOnUnits=true, bool checkCanBuildUnitType=true, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:360
int getInitialResources() const override
Definition: tcunit.h:44
bool canSetRallyUnit(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:551
bool canUseTech(BWAPI::TechType tech, BWAPI::Position target, bool checkCanTargetUnit=true, bool checkTargetsType=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:795
BWAPI::Player getLastAttackingPlayer() const override
Definition: tcunit.h:111
bool canCommand() const override
Definition: tcunit.h:380
bool canRepair(bool checkCommandibility=true) const override
Definition: tcunit.h:603
bool canRightClickUnit(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:735
bool canAttackMove(bool checkCommandibility=true) const override
Definition: tcunit.h:439
bool canCancelTrainSlot(bool checkCommandibility=true) const override
Definition: tcunit.h:767
bool canTrain(BWAPI::UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:499
bool canGather(bool checkCommandibility=true) const override
Definition: tcunit.h:584
bool isBlind() const override
Definition: tcunit.h:270
BWAPI::UnitType getBuildType() const override
Definition: tcunit.h:174
bool canRepair(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:606
bool canDecloak(bool checkCommandibility=true) const override
Definition: tcunit.h:622
BWAPI::Position getRallyPosition() const override
Definition: tcunit.h:219
bool canMorph(bool checkCommandibility=true) const override
Definition: tcunit.h:505
bool isUnderStorm() const override
Definition: tcunit.h:345
bool canUseTechWithOrWithoutTarget(BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:789
bool canResearch(BWAPI::TechType type, bool checkCanIssueCommandType=true) const override
Definition: tcunit.h:517
bool canBurrow(bool checkCommandibility=true) const override
Definition: tcunit.h:613
STL namespace.
bool canAttackGrouped(BWAPI::Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:423
bool canReturnCargo(bool checkCommandibility=true) const override
Definition: tcunit.h:594
bool canUnload(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkPosition=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:666
int getAcidSporeCount() const override
Definition: tcunit.h:120
bool canUseTechWithOrWithoutTarget(bool checkCommandibility=true) const override
Definition: tcunit.h:785
bool canIssueCommandTypeGrouped(BWAPI::UnitCommandType ct, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:391
bool isPowered() const override
Definition: tcunit.h:348
int getIrradiateTimer() const override
Definition: tcunit.h:150
bool canGather(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:587
BWAPI::Unitset getLoadedUnits() const override
Definition: tcunit.h:237
bool isInterruptible() const override
Definition: tcunit.h:309
Definition: state.h:25
bool canCommandGrouped(bool checkCommandibility=true) const override
Definition: tcunit.h:383
bool canUseTech(BWAPI::TechType tech, BWAPI::Unit target=nullptr, bool checkCanTargetUnit=true, bool checkTargetsType=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:804
bool canTrain(bool checkCommandibility=true) const override
Definition: tcunit.h:496
bool canSetRallyPoint(bool checkCommandibility=true) const override
Definition: tcunit.h:528
bool canUpgrade(BWAPI::UpgradeType type, bool checkCanIssueCommandType=true) const override
Definition: tcunit.h:524
bool isGatheringMinerals() const override
Definition: tcunit.h:300
BWAPI::Order getOrder() const override
Definition: tcunit.h:207
BWAPI::TilePosition getInitialTilePosition() const override
Definition: tcunit.h:47
int getEnsnareTimer() const override
Definition: tcunit.h:147
bool isBraking() const override
Definition: tcunit.h:273
bool canRightClickGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:703
bool canAttackGrouped(BWAPI::Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:431
bool canAttackUnitGrouped(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:462
BWAPI::Unit getRallyUnit() const override
Definition: tcunit.h:222
bool isTraining() const override
Definition: tcunit.h:333
int32_t type
Definition: frame.h:87
bool canUpgrade(bool checkCommandibility=true) const override
Definition: tcunit.h:521
int getOrderTimer() const override
Definition: tcunit.h:159
bool canIssueCommandGrouped(BWAPI::UnitCommand command, bool checkCanUseTechPositionOnPositions=true, bool checkCanUseTechUnitOnUnits=true, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:370
bool canAttackUnit(bool checkCommandibility=true) const override
Definition: tcunit.h:447
bool canSetRallyPoint(BWAPI::Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:538
bool canBuildAddon(BWAPI::UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:490
bool canRightClickGrouped(BWAPI::Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:708
bool isMorphing() const override
Definition: tcunit.h:315
bool isInvincible() const override
Definition: tcunit.h:312
Definition: frame.h:81
int getGroundWeaponCooldown() const override
Definition: tcunit.h:132
bool canAttackUnitGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:457
bool exists() const override
Definition: tcunit.h:75
int getRemainingResearchTime() const override
Definition: tcunit.h:192
bool canAttack(bool checkCommandibility=true) const override
Definition: tcunit.h:401
bool canRightClickPosition(bool checkCommandibility=true) const override
Definition: tcunit.h:724
bool canRightClickUnit(bool checkCommandibility=true) const override
Definition: tcunit.h:732
BWAPI::UnitType::list getTrainingQueue() const override
Definition: tcunit.h:177
bool isAttacking() const override
Definition: tcunit.h:258
int getSpellCooldown() const override
Definition: tcunit.h:138
int getResources() const override
Definition: tcunit.h:28
int getScarabCount() const override
Definition: tcunit.h:126
bool isAccelerating() const override
Definition: tcunit.h:255
BWAPI::Unit getPowerUp() const override
Definition: tcunit.h:231
bool canCloak(bool checkCommandibility=true) const override
Definition: tcunit.h:619
bool canTargetUnit(BWAPI::Unit targetUnit, bool checkCommandibility=true) const override
Definition: tcunit.h:397
bool canAttack(BWAPI::Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:411
bool canPatrolGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:569
bool canLift(bool checkCommandibility=true) const override
Definition: tcunit.h:631
bool canUseTechUnit(BWAPI::TechType tech, BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkTargetsUnits=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:825
int getID() const override
Definition: tcunit.h:25
int32_t resources
Definition: frame.h:100
BWAPI::UnitCommand getLastCommand() const override
Definition: tcunit.h:108
bool canRightClick(bool checkCommandibility=true) const override
Definition: tcunit.h:686
bool isTargetable() const override
Definition: tcunit.h:354
bool isVisible(BWAPI::Player player=nullptr) const override
Definition: tcunit.h:351
bool canLand(BWAPI::TilePosition target, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:637
bool canCancelTrain(bool checkCommandibility=true) const override
Definition: tcunit.h:764
bool isGatheringGas() const override
Definition: tcunit.h:297
bool canIssueCommandType(BWAPI::UnitCommandType ct, bool checkCommandibility=true) const override
Definition: tcunit.h:386
int getRemainingUpgradeTime() const override
Definition: tcunit.h:195
bool isCompleted() const override
Definition: tcunit.h:288
BWAPI::Order getSecondaryOrder() const override
Definition: tcunit.h:210
BWAPI::Unitset getLarva() const override
Definition: tcunit.h:249
bool canSetRallyPosition(bool checkCommandibility=true) const override
Definition: tcunit.h:545
int getDefenseMatrixTimer() const override
Definition: tcunit.h:144
bool canFollow(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:577
bool canLand(bool checkCommandibility=true) const override
Definition: tcunit.h:634
bool canLoad(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:646
bool canUnsiege(bool checkCommandibility=true) const override
Definition: tcunit.h:628
TCUnit(torchcraft::replayer::Unit u)
Definition: tcunit.h:19
int getInterceptorCount() const override
Definition: tcunit.h:123
BWAPI::TechType getTech() const override
Definition: tcunit.h:180
int getResourceGroup() const override
Definition: tcunit.h:102
bool isMoving() const override
Definition: tcunit.h:318
bool canAttackMoveGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:442
int getKillCount() const override
Definition: tcunit.h:117
int getRemoveTimer() const override
Definition: tcunit.h:165
int32_t id
Definition: frame.h:82
bool canUnloadAtPosition(BWAPI::Position targDropPos, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:657
bool canMorph(BWAPI::UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:508
bool isSelected() const override
Definition: tcunit.h:324
int getStasisTimer() const override
Definition: tcunit.h:168
double getVelocityX() const override
Definition: tcunit.h:87
int getAirWeaponCooldown() const override
Definition: tcunit.h:135
bool isStuck() const override
Definition: tcunit.h:330
bool canRightClickPositionGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:727
bool canSetRallyUnit(bool checkCommandibility=true) const override
Definition: tcunit.h:548
bool isCarryingGas() const override
Definition: tcunit.h:279
bool canUnloadAll(bool checkCommandibility=true) const override
Definition: tcunit.h:674
bool isUnderDisruptionWeb() const override
Definition: tcunit.h:342
bool canBuild(BWAPI::UnitType uType, BWAPI::TilePosition tilePos, bool checkTargetUnitType=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:479
int getRemainingBuildTime() const override
Definition: tcunit.h:186
bool isCloaked() const override
Definition: tcunit.h:285
bool isConstructing() const override
Definition: tcunit.h:291
bool isAttackFrame() const override
Definition: tcunit.h:261
int getInitialHitPoints() const override
Definition: tcunit.h:114
bool isCarryingMinerals() const override
Definition: tcunit.h:282
virtual ~TCUnit()
Definition: tcunit.h:20
BWAPI::Unitset getInterceptors() const override
Definition: tcunit.h:243
BWAPI::Unit getHatchery() const override
Definition: tcunit.h:246
bool isUnderDarkSwarm() const override
Definition: tcunit.h:339
bool canUnloadAllPosition(BWAPI::Position targDropPos, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:680
bool canUnload(bool checkCommandibility=true) const override
Definition: tcunit.h:663
bool canCancelUpgrade(bool checkCommandibility=true) const override
Definition: tcunit.h:782
bool isBeingGathered() const override
Definition: tcunit.h:264
int getMaelstromTimer() const override
Definition: tcunit.h:156
bool canCancelAddon(bool checkCommandibility=true) const override
Definition: tcunit.h:761
BWAPI::Position getPosition() const override
Definition: tcunit.h:34
bool isBurrowed() const override
Definition: tcunit.h:276
bool isLifted() const override
Definition: tcunit.h:39
bool canAttack(BWAPI::Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:404
bool canCancelResearch(bool checkCommandibility=true) const override
Definition: tcunit.h:779
bool isHallucination() const override
Definition: tcunit.h:303
bool canRightClickGrouped(BWAPI::Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:716
bool isBeingHealed() const override
Definition: tcunit.h:267
BWAPI::Position getInitialPosition() const override
Definition: tcunit.h:50
bool canUnburrow(bool checkCommandibility=true) const override
Definition: tcunit.h:616
int getRemainingTrainTime() const override
Definition: tcunit.h:189
bool canRightClick(BWAPI::Unit target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:696
bool canCancelConstruction(bool checkCommandibility=true) const override
Definition: tcunit.h:758
bool canRightClick(BWAPI::Position target, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:689
bool canCancelTrainSlot(int slot, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:770
BWAPI::UpgradeType getUpgrade() const override
Definition: tcunit.h:183
bool canSiege(bool checkCommandibility=true) const override
Definition: tcunit.h:625
bool canUseTechPosition(BWAPI::TechType tech, BWAPI::Position target, bool checkTargetsPositions=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:840
bool canPlaceCOP(bool checkCommandibility=true) const override
Definition: tcunit.h:848
BWAPI::Unit getCarrier() const override
Definition: tcunit.h:240
bool canBuild(BWAPI::UnitType uType, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:473
bool canLoad(bool checkCommandibility=true) const override
Definition: tcunit.h:643
bool canStop(bool checkCommandibility=true) const override
Definition: tcunit.h:600
BWAPI::Unit getNydusExit() const override
Definition: tcunit.h:228
bool canCancelMorph(bool checkCommandibility=true) const override
Definition: tcunit.h:776
bool canRightClickUnitGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:742
BWAPI::UnitType getType() const override
Definition: tcunit.h:31
bool canMoveGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:561
bool isUnderAttack() const override
Definition: tcunit.h:336
int getPlagueTimer() const override
Definition: tcunit.h:162
bool isParasited() const override
Definition: tcunit.h:321
bool isIdle() const override
Definition: tcunit.h:306
bool canAttackUnit(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:450
uint64_t flags
Definition: frame.h:85
bool canUseTechWithoutTarget(BWAPI::TechType tech, bool checkCanIssueCommandType=true, bool checkCommandibility=true) const override
Definition: tcunit.h:813
BWAPI::Unit getTarget() const override
Definition: tcunit.h:201
int getDefenseMatrixPoints() const override
Definition: tcunit.h:141
bool canHaltConstruction(bool checkCommandibility=true) const override
Definition: tcunit.h:755
int getShields() const override
Definition: tcunit.h:96
int getSpiderMineCount() const override
Definition: tcunit.h:129
BWAPI::Unit getAddon() const override
Definition: tcunit.h:225
BWAPI::Player getPlayer() const override
Definition: tcunit.h:81
int getLockdownTimer() const override
Definition: tcunit.h:153
bool canRightClickUnitGrouped(BWAPI::Unit targetUnit, bool checkCanTargetUnit=true, bool checkCanIssueCommandType=true, bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:747
BWAPI::Position getTargetPosition() const override
Definition: tcunit.h:204
bool hasNuke() const override
Definition: tcunit.h:252
int getEnergy() const override
Definition: tcunit.h:99
bool isDetected() const override
Definition: tcunit.h:294
bool canAttackGrouped(bool checkCommandibilityGrouped=true, bool checkCommandibility=true) const override
Definition: tcunit.h:418
bool issueCommand(BWAPI::UnitCommand command) override
Definition: tcunit.h:357