Pick winners and end game in verse?

When a certain condition in my verse code is met I want to be able to pick all players who are still alive and pick those as the winners of the game. But I am not sure how to do that or which API I can use. The end_game_device looks like it can only be activated by a player but not in verse code.

Players := GetPlayspace().GetPlayers()
for(Player : Players):
    if:
         Player.IsActive()
    then:
         #Do This

Thanks for your reply, but how would I implement the „# do this“ part? How would I end the game programmatically and pick the winners?

@editable RoundEndDevice : round_settings_device = round_settings_device{}

if(Winner := Players[GetRandomInt(0, Players.Length - 1):
    #Do with winner
    RoundEndGame.EndRound(Winner) #check in api