The agent parameter is used (and sometimes required) in a few common ways behind the scenes, though at times it might not be obvious enough just from the name of the functions or comments.
- If the device has per-player state then the agent version is letting you control just the state for that player
- If the device has per-team or per-class control then the agent parameter is being used to figure out which team/class the function is working against.
- In some cases the device keeps the agent being passed in so that it can pass it along during an event later, such as alerting which player turned on a timer.