export const CONTROL_MODE = { SINGLE: 'single', GROUP: 'group', JOYSTICK: 'joystick' }; export let activeUnit = null; export let selectedUnits = []; export function setActiveUnit(unit) { activeUnit = unit; selectedUnits = unit ? [unit] : []; } export function addToSelection(unit) { if (!selectedUnits.includes(unit)) { selectedUnits.push(unit); } } export function clearSelection() { activeUnit = null; selectedUnits = []; }