12 #include "sc2api/sc2_action.h" 14 #include "sc2api/sc2_data.h" 25 enum class UNIT_TYPEID;
26 enum class ABILITY_ID;
28 class ObservationInterface;
32 enum class Visibility {
44 typedef std::function<bool(const Unit& unit)>
Filter;
53 virtual uint32_t GetPlayerID()
const = 0;
57 virtual uint32_t GetGameLoop()
const = 0;
61 virtual Units GetUnits()
const = 0;
68 virtual Units GetUnits(
Unit::Alliance alliance, Filter filter = {})
const = 0;
74 virtual Units GetUnits(Filter filter)
const = 0;
79 virtual const Unit* GetUnit(Tag tag)
const = 0;
83 virtual const RawActions& GetRawActions()
const = 0;
95 virtual const std::vector<ChatMessage>& GetChatMessages()
const = 0;
99 virtual const std::vector<PowerSource>& GetPowerSources()
const = 0;
103 virtual const std::vector<Effect>& GetEffects()
const = 0;
107 virtual const std::vector<UpgradeID>& GetUpgrades()
const = 0;
111 virtual const Score& GetScore()
const = 0;
116 virtual const Abilities& GetAbilityData(
bool force_refresh =
false)
const = 0;
121 virtual const UnitTypes& GetUnitTypeData(
bool force_refresh =
false)
const = 0;
126 virtual const Upgrades& GetUpgradeData(
bool force_refresh =
false)
const = 0;
131 virtual const Buffs& GetBuffData(
bool force_refresh =
false)
const = 0;
136 virtual const Effects& GetEffectData(
bool force_refresh =
false)
const = 0;
140 virtual const GameInfo& GetGameInfo()
const = 0;
144 virtual int32_t GetMinerals()
const = 0;
148 virtual int32_t GetVespene()
const = 0;
153 virtual int32_t GetFoodCap()
const = 0;
158 virtual int32_t GetFoodUsed()
const = 0;
163 virtual int32_t GetFoodArmy()
const = 0;
168 virtual int32_t GetFoodWorkers()
const = 0;
172 virtual int32_t GetIdleWorkerCount()
const = 0;
176 virtual int32_t GetArmyCount()
const = 0;
180 virtual int32_t GetWarpGateCount()
const = 0;
184 virtual Point2D GetCameraPos()
const = 0;
188 virtual Point3D GetStartLocation()
const = 0;
192 virtual const std::vector<PlayerResult>& GetResults()
const = 0;
197 virtual bool HasCreep(
const Point2D& point)
const = 0;
202 virtual Visibility GetVisibility(
const Point2D& point)
const = 0;
209 virtual bool IsPathable(
const Point2D& point)
const = 0;
216 virtual bool IsPlacable(
const Point2D& point)
const = 0;
221 virtual float TerrainHeight(
const Point2D& point)
const = 0;
227 virtual const SC2APIProtocol::Observation* GetRawObservation()
const = 0;
244 virtual AvailableAbilities GetAbilitiesForUnit(
const Unit* unit,
bool ignore_resource_requirements =
false) = 0;
250 virtual std::vector<AvailableAbilities> GetAbilitiesForUnits(
const Units& units,
bool ignore_resource_requirements =
false) = 0;
256 virtual float PathingDistance(
const Point2D& start,
const Point2D& end) = 0;
262 virtual float PathingDistance(
const Unit* start,
const Point2D& end) = 0;
265 Tag start_unit_tag_ = NullTag;
270 virtual std::vector<float> PathingDistance(
const std::vector<PathingQuery>& queries) = 0;
279 virtual bool Placement(
const AbilityID& ability,
const Point2D& target_pos,
const Unit* unit =
nullptr) = 0;
285 target_pos(target) {};
289 Tag placing_unit_tag = 0LL;
295 virtual std::vector<bool> Placement(
const std::vector<PlacementQuery>& queries) = 0;
313 virtual void UnitCommand(
const Unit* unit,
AbilityID ability,
bool queued_command =
false) = 0;
322 virtual void UnitCommand(
const Unit* unit,
AbilityID ability,
const Point2D& point,
bool queued_command =
false) = 0;
328 virtual void UnitCommand(
const Unit* unit,
AbilityID ability,
const Unit* target,
bool queued_command =
false) = 0;
331 virtual void UnitCommand(
const Units& units,
AbilityID ability,
bool queued_move =
false) = 0;
334 virtual void UnitCommand(
const Units& units,
AbilityID ability,
const Point2D& point,
bool queued_command =
false) = 0;
337 virtual void UnitCommand(
const Units& units,
AbilityID ability,
const Unit* target,
bool queued_command =
false) = 0;
342 virtual const std::vector<Tag>& Commands()
const = 0;
347 virtual void ToggleAutocast(Tag unit_tag,
AbilityID ability) = 0;
351 virtual void ToggleAutocast(
const std::vector<Tag>& unit_tags,
AbilityID ability) = 0;
356 virtual void SendChat(
const std::string& message, ChatChannel channel = ChatChannel::All) = 0;
362 virtual void SendActions() = 0;
373 virtual void UnitCommand(
AbilityID ability) = 0;
379 virtual void UnitCommand(
AbilityID ability,
const Point2DI& point,
bool minimap =
false) = 0;
382 virtual void CameraMove(
const Point2DI& center) = 0;
387 virtual void Select(
const Point2DI& center, PointSelectionType selection_type) = 0;
393 virtual void Select(
const Point2DI& p0,
const Point2DI& p1,
bool add_to_selection =
false) = 0;
397 virtual void SendActions() = 0;
409 virtual void CameraMove(
const Point2D& point,
float distance = 0.0f) = 0;
412 virtual void CameraFollowPlayer() = 0;
416 virtual void SendActions() = 0;
432 virtual void DebugTextOut(
const std::string& out,
Color color = Colors::White) = 0;
438 virtual void DebugTextOut(
const std::string& out,
const Point2D& pt_virtual_2D,
Color color = Colors::White, uint32_t size = 8) = 0;
444 virtual void DebugTextOut(
const std::string& out,
const Point3D& pt3D,
Color color = Colors::White, uint32_t size = 8) = 0;
449 virtual void DebugLineOut(
const Point3D& p0,
const Point3D& p1,
Color color = Colors::White) = 0;
454 virtual void DebugBoxOut(
const Point3D& p_min,
const Point3D& p_max,
Color color = Colors::White) = 0;
459 virtual void DebugSphereOut(
const Point3D& p,
float r,
Color color = Colors::White) = 0;
468 virtual void DebugCreateUnit(
UnitTypeID unit_type,
const Point2D& p, uint32_t player_id = 1, uint32_t count = 1) = 0;
472 virtual void DebugKillUnit(
const Unit* unit) = 0;
475 virtual void DebugShowMap() = 0;
477 virtual void DebugEnemyControl() = 0;
479 virtual void DebugIgnoreFood() = 0;
481 virtual void DebugIgnoreResourceCost() = 0;
483 virtual void DebugGiveAllResources() = 0;
485 virtual void DebugGodMode() = 0;
487 virtual void DebugIgnoreMineral() = 0;
489 virtual void DebugNoCooldowns() = 0;
491 virtual void DebugGiveAllTech() = 0;
493 virtual void DebugGiveAllUpgrades() = 0;
495 virtual void DebugFastBuild() = 0;
497 virtual void DebugSetScore(
float score) = 0;
500 virtual void DebugEndGame(
bool victory =
false) = 0;
504 virtual void DebugSetEnergy(
float value,
const Unit* unit) = 0;
508 virtual void DebugSetLife(
float value,
const Unit* unit) = 0;
512 virtual void DebugSetShields(
float value,
const Unit* unit) = 0;
516 virtual void DebugMoveCamera(
const Point2D& pos) = 0;
526 virtual void DebugTestApp(AppTest app_test,
int delay_ms = 0) = 0;
530 virtual void SendDebug() = 0;
Possible actions for feature layers.
Definition: sc2_action.h:113
Definition: sc2_interfaces.h:281
Common data types, including points, rectangles and colors.
A unit. Could be a structure, a worker or a military unit.
Definition: sc2_unit.h:69
Unit data in an observation.
Alliance
Relationship to this player.
Definition: sc2_unit.h:83
Definition: sc2_interfaces.h:236
2D integer point.
Definition: sc2_common.h:95
Scores.
Definition: sc2_score.h:179
Definition: sc2_common.h:14
Definition: sc2_common.h:49
Definition: sc2_action.h:9
All available abilities for a unit.
Definition: sc2_data.h:91
RGB Color.
Definition: sc2_common.h:115
Definition: sc2_interfaces.h:264
The ObservationInterface reflects the current state of the game. Guaranteed to be valid when OnGameSt...
Definition: sc2_interfaces.h:47
std::function< bool(const Unit &unit)> Filter
Definition: sc2_interfaces.h:44
The ObserverActionInterface corresponds to the actions available in the observer UI.
Definition: sc2_interfaces.h:401
Initial data for a game and map.
Definition: sc2_map_info.h:69
Definition: sc2_interfaces.h:423
Definition: sc2_interfaces.h:301
Definition: sc2_connection.h:16
Definition: sc2_interfaces.h:367