[client] add result styles
This commit is contained in:
@@ -110,12 +110,17 @@ class GameState {
|
||||
}
|
||||
|
||||
public function get_humans():Array<PlayerState> {
|
||||
return controls.filter(function(control:PlayerControl):Bool {
|
||||
var humanControls = controls.filter(function(control:PlayerControl):Bool {
|
||||
return switch control.controller {
|
||||
case HUMAN(_): true;
|
||||
case _: false;
|
||||
}
|
||||
}).map(function(control:PlayerControl):PlayerState {
|
||||
});
|
||||
humanControls.sort(function(a, b) return switch [a.controller, b.controller] {
|
||||
case [HUMAN(i), HUMAN(j)]: i - j;
|
||||
case _: 0;
|
||||
});
|
||||
return humanControls.map(function(control:PlayerControl):PlayerState {
|
||||
return players.get(control.playerId);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user