Player state
This commit is contained in:
@ -70,10 +70,11 @@
|
||||
|
||||
function renderPlayerList(players) {
|
||||
const html = players.filter(player => player.active).map((player) => {
|
||||
const onDestination = player.state == "ON_DESTINATION";
|
||||
return `
|
||||
<li class="${player.reached_destination ? "text-success" : ""}">
|
||||
<li class="${onDestination ? "text-success" : ""}">
|
||||
${player.name} (${player.move_count})
|
||||
${player.reached_destination ? "✅" : ""}
|
||||
${onDestination ? "✅" : ""}
|
||||
</li>
|
||||
`;
|
||||
}).join("");
|
||||
@ -83,7 +84,8 @@
|
||||
function renderPlayers(players) {
|
||||
players.filter(player => player.active).forEach(player => {
|
||||
const cell = findCell(player.position);
|
||||
const playerIcon = player.reached_destination ? BOARD_ICONS.PLAYER_ON_DESTINATION : BOARD_ICONS.PLAYER;
|
||||
const onDestination = player.state == "ON_DESTINATION";
|
||||
const playerIcon = onDestination ? BOARD_ICONS.PLAYER_ON_DESTINATION : BOARD_ICONS.PLAYER;
|
||||
if (cell) {
|
||||
const html = `
|
||||
<div class="player-tooltip">${player.name}</div>
|
||||
|
||||
Reference in New Issue
Block a user