It has been successful! It is what I want to do!!
var FoundValue : int = 0
var FoundPlayer : ?player = false
for (Key->Value: PlayerMap):
if (Value >= FoundValue):
set FoundValue = Value
set FoundPlayer = option{Key}
if (Player := FoundPlayer?):
EndDevice.Activate(Player)
But, I have a question. If I want to use the function as follow:
CheckEndGame() : void=
if (Player := GetLowestValuedPlayer()?):
I have the following error:
This invocation calls a function that has the ‘no_rollback’ effect, which is not allowed by its context.