/**
 * agent-defs.js — Single source of truth for all agent definitions.
 *
 * To add a new agent, append one entry to AGENT_DEFS below and pick an
 * unused (x, z) position. No other file needs to be edited.
 *
 * Fields:
 *   id        — unique string key used in WebSocket messages and state maps
 *   label     — display name shown in the 3D HUD and chat panel
 *   color     — hex integer (0xRRGGBB) used for Three.js materials and lights
 *   role      — human-readable role string shown under the label sprite
 *   direction — cardinal facing direction (for future mesh orientation use)
 *   x, z      — world-space position on the horizontal plane (y is always 0)
 */
export const AGENT_DEFS = [
  { id: 'alpha', label: 'ALPHA', color: 0x00ff88, role: 'orchestrator', direction: 'north', x:  0, z: -6 },
  { id: 'beta',  label: 'BETA',  color: 0x00aaff, role: 'worker',       direction: 'east',  x:  6, z:  0 },
  { id: 'gamma', label: 'GAMMA', color: 0xff6600, role: 'validator',    direction: 'south', x:  0, z:  6 },
  { id: 'delta', label: 'DELTA', color: 0xaa00ff, role: 'monitor',      direction: 'west',  x: -6, z:  0 },
];

/**
 * Convert an integer color (e.g. 0x00ff88) to a CSS hex string ('#00ff88').
 * Useful for DOM styling and canvas rendering.
 */
export function colorToCss(intColor) {
  return '#' + intColor.toString(16).padStart(6, '0');
}
