/**
 * Queen.js - Queen piece implementation
 * Combines rook and bishop movement patterns
 */

import { Piece } from './Piece.js';

export class Queen extends Piece {
    constructor(color, position) {
        super(color, position);
        this.type = 'queen';
        this.value = 9;
    }

    /**
     * Get valid moves for queen
     * Queen moves like rook + bishop (any direction, any distance)
     * @param {Board} board - Game board
     * @returns {Position[]} Array of valid positions
     */
    getValidMoves(board) {
        // All 8 directions (horizontal, vertical, and diagonal)
        const directions = [
            [-1, 0],  // Up
            [1, 0],   // Down
            [0, -1],  // Left
            [0, 1],   // Right
            [-1, -1], // Up-left
            [-1, 1],  // Up-right
            [1, -1],  // Down-left
            [1, 1]    // Down-right
        ];

        return this.getSlidingMoves(board, directions);
    }
}
