diff --git a/include/sc2api/sc2_coordinator.h b/include/sc2api/sc2_coordinator.h index 55902831..0ad11abc 100644 --- a/include/sc2api/sc2_coordinator.h +++ b/include/sc2api/sc2_coordinator.h @@ -90,6 +90,9 @@ class Coordinator { //! ability ids are generalized to BUILD_TECHLAB ability id in the observation. void SetUseGeneralizedAbilityId(bool value); + //! Sets the replay perspective. 0 to observe "Everyone" + void SetReplayPerspective(int perspective=1); + //! Appends a command line argument to be fed to StarCraft II when starting. // \param option The string to be appended to the executable invoke. void AddCommandLine(const std::string& option); diff --git a/src/sc2api/sc2_coordinator.cc b/src/sc2api/sc2_coordinator.cc index cbe970e4..ac5442e7 100644 --- a/src/sc2api/sc2_coordinator.cc +++ b/src/sc2api/sc2_coordinator.cc @@ -922,9 +922,12 @@ void Coordinator::SetUseGeneralizedAbilityId(bool value) { imp_->use_generalized_ability_id = value; } +void Coordinator::SetReplayPerspective(int perspective) { + imp_->replay_settings_.player_id = perspective; +} + bool Coordinator::SetReplayPath(const std::string& path) { imp_->replay_settings_.replay_file.clear(); - if (HasExtension(path, ".SC2Replay")) { imp_->replay_settings_.replay_file.push_back(path); }