public class Player { /* * Holds player information * @param color the player's color (WHITE/BLACK) */ public Player(int color) { this.color = color; } /* * Set player as the active */ public void active() { active = true; } /* * Set player as the inactive */ public void inactive() { active = false; } /* * Is the player active? * @return player active (=true) or inactive (=false) */ public boolean isActive() { return active; } /* * Returns the player's color * @return the color of the player (WHITE/BLACK) */ public int getColor() { return color; } /* * Returns the other player's color * @return the color of the other player (WHITE/BLACK) */ public int getOtherColor() { if (color == WHITE) return BLACK; else return WHITE; } private boolean active; private int color; private static final int BLACK = 0; private static final int WHITE = 1; }