Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created January 12, 2014 15:49
Show Gist options
  • Save tarynsauer/8386268 to your computer and use it in GitHub Desktop.
Save tarynsauer/8386268 to your computer and use it in GitHub Desktop.
abstract class AbstractPlayer implements Player {
private String marker;
private Player opponent;
public String getMarker() {
return marker;
}
public Player getOpponent() {
return opponent;
}
public void setOpponent(Player player) {
this.opponent = player;
}
public AbstractPlayer(String marker) {
this.marker = marker;
}
public void addMarker(Board board, int move) {
int cellIndex = move - 1;
board.cells[cellIndex] = this.marker;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment