cc50e64e21
Add Hostile/Neutral/Friendly ring types with session-only inactive overrides on control, plus launch-with-players flow and live player tokens on the map. Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
520 B
TypeScript
16 lines
520 B
TypeScript
import type { AppPlayer } from '../types';
|
|
|
|
/** Игроки + члены выбранных команд, без дублей. */
|
|
export function resolveLaunchPlayerIds(
|
|
players: readonly AppPlayer[],
|
|
selectedPlayerIds: ReadonlySet<string>,
|
|
selectedTeamIds: ReadonlySet<string>,
|
|
): string[] {
|
|
const out = new Set<string>();
|
|
for (const id of selectedPlayerIds) out.add(id);
|
|
for (const p of players) {
|
|
if (p.teamId && selectedTeamIds.has(String(p.teamId))) out.add(String(p.id));
|
|
}
|
|
return [...out];
|
|
}
|