Add an API method to know when a replay is being watched
Is your feature request related to a problem? Please describe.
When writing code for the robot state, you have to manually change between simulation and replay (as far as I'm aware). You can easily automate switching between a simulated and real bot using Robot.isReal(), however no proper solution exists for AdvantageKit.
Describe the solution you'd like An API method that can detect when a replay is being ran, that way an end user can easily automate state changes.
Describe alternatives you've considered
- Java System Property (e.g.
-Dakit.mode=REPLAYor similar) - Environment Variable (e.g.
AKIT_REPLAY=trueor similar)- ~
AKIT_LOG_PATHwould work sometimes, however there are multiple ways to start a replay.~ it is always set in the subprocess
- ~
These both work fine, and would also be good solutions, however the API method is the most versatile in my opinion.
Additional context Update any documentation when it's added for other teams.
I could implement this myself in a PR if needed.
I believe this is already implemented with Logger#hasReplaySource(). Is there a difference between what that method does and what you are proposing?