import java.util.*;
import java.awt.*;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
 *  Clase BishopWhite
 *  <p>
 *  BishopWhite es una pieza especifica del juego
 */
public class BishopWhite extends Piece{

/**
     *  Constructor de BichopWhite 
     *
     *  @param position posicion en la ventana
     *  @param positioninboard posicion en el tablero
     */
    public BishopWhite(Vector2D position, Vector2D positioninboard){
		super(position,positioninboard);
      moves = 3;
      range = 2;
      atk = -1;
      hpmax = 12;
      hp = 12;
      type = 0;
      team = 0;
      blockmoves = false;
      blockattacks = false;
	}
  /**
     *  Retorna una lista de casillas en las que la pieza se puede mover
     *
     *  @return Lista de posibles movimientos
     */

	public ArrayList<Board> Moves(){
    	ArrayList<Board> boards = MyWorld.getBoards();
      ArrayList<Board> moves_dir = new ArrayList<Board>();
      //ArrayList<Board> in_case = new ArrayList<Board>();
    	int Col = this.getCol();
    	int Row = this.getRow();
      
		for (Board b:boards){
				if ((b.getRow() == Row+moves && b.getCol()==Col+moves) || (b.getRow() == Row-moves && b.getCol()==Col-moves) || (b.getRow() == Row+moves && b.getCol()==Col-moves) || (b.getRow() == Row-moves && b.getCol()==Col+moves)){ 
  					moves_dir.add(b);
    				}
    	}
    	
  return moves_dir;
  }
  /**
     *  Retorna una lista de casillas en las que la pieza puede atacar
     *
     *  @return Lista de posibles ataques
     */
  public ArrayList<Board> Attacks(){
    	ArrayList<Board> boards = MyWorld.getBoards();
      ArrayList<Board> attacks_dir = new ArrayList<Board>();
      //ArrayList<Board> in_case = new ArrayList<Board>();
    	int Col = this.getCol();
    	int Row = this.getRow();
      
		for (Board b:boards){
         for(int i=0; i<=range; i++){
				if (b.getCol() == Col+range && b.getRow() == Row || b.getCol() == Col && b.getRow() == Row+range || b.getCol() == Col-range && b.getRow() == Row || b.getCol() == Col && b.getRow() == Row-range){ 
  					attacks_dir.add(b);
    				}
    	}}
    	
  return attacks_dir;
  }
  
  
  
}