/**
 *
 * @author Ryan J. Marcotte
 */

package game;

import java.util.ArrayList;

public abstract class ChessPiece
{
    private Square location;
    private ArrayList<Square> possibleMoves;
    private Team team;

    protected void addMovesInDirection(ArrayList<Square> moveList, int direction, int limit)
    {
        Square neighbor = location.getNeighbor(direction);
        int squaresTraveled = 0;

        while (neighbor != null && squaresTraveled < limit) {
            if (neighbor.isOccupied()) {
                ChessPiece occupant = neighbor.getOccupant();
                Team theirTeam = occupant.getTeam();

                if (theirTeam != team)
                    moveList.add(neighbor);

                break;
            }

            moveList.add(neighbor);
            neighbor = neighbor.getNeighbor(direction);
            squaresTraveled++;
        }
    }

    protected Square getLocation()
    {
        return location;
    }

    protected Team getTeam()
    {
        return team;
    }
    
    protected void setLocation(Square location)
    {
        this.location = location;
        location.setOccupant(this);
    }

    protected void setPossibleMoves(ArrayList<Square> possibleMoves)
    {
        this.possibleMoves = possibleMoves;
    }

    protected void setTeamFromInitialLocation(Square initialLocation)
    {
        final int NUM_SQUARES = 64;

        if (initialLocation.getIntLocation() < NUM_SQUARES / 2)
            team = Team.BLACK;
        else
            team = Team.WHITE;
    }
}

@@ -208,16 +208,723 @@
 am team;
+%0A    private int id;%0A    private boolean active;%0A%0A    public ChessPiece(Square location)%0A    %7B%0A        setLocation(location);%0A        possibleMoves = new ArrayList%3C%3E();%0A        setTeamFromInitialLocation(location);%0A        active = true;%0A    %7D%0A%0A    public ChessPiece(Square location, int id)%0A    %7B%0A        setLocation(location);%0A        this.id = id;%0A        possibleMoves = new ArrayList%3C%3E();%0A        setTeamFromInitialLocation(location);%0A        active = true;%0A    %7D%0A%0A    public ChessPiece(Square location, int id, Team team, boolean active)%0A    %7B%0A        setLocation(location);%0A        this.id = id;%0A        possibleMoves = new ArrayList%3C%3E();%0A        this.team = team;%0A        this.active = active;%0A    %7D
 %0A%0A    pr

add some overloaded constructors