player
inherits from agent
. So you should be able to attempt to cast to player
to see if the provided agent
is in fact a player
instance.
Example:
if (Player := player[Agent]):
# Do something with Player here now that we know this is in fact a Player type