Incremental updates. Work in progress to augment Board, Referee, add score for computer player, implement Monte-Carlo simulation.

Renamed Player implementations and changed Player to interface, with the goal of using abstraction to make the human and computer interactions with the game identical for ease of simulation.
This commit is contained in:
Woody Folsom
2012-04-08 17:25:10 -04:00
parent e0f42531e7
commit 9619f9a96d
13 changed files with 178 additions and 58 deletions

View File

@@ -35,7 +35,7 @@ public class BoardPanel extends JPanel {
referee = ref;
setLayout(new GridLayout(Board.NUM_ROWS, Board.NUM_COLS));
BoardPanelMouseListener bpml = new BoardPanelMouseListener(this, tsp, referee.getPlayer());
BoardPanelMouseListener bpml = new BoardPanelMouseListener(this, tsp, referee.getHumanPlayer());
ImageIcon noneIcon = new ImageIcon(NONE_ICON);
for (int r = 0; r < Board.NUM_ROWS; r++) {
for (int c = 0; c < Board.NUM_COLS; c++) {

View File

@@ -38,7 +38,7 @@ public class MainFrame extends JFrame {
private void init() {
// Create objects.
ScorePanel sp = new ScorePanel(game);
TileSelectionPanel tp = new TileSelectionPanel(game.getPlayer());
TileSelectionPanel tp = new TileSelectionPanel(game.getHumanPlayer());
BoardPanel bp = new BoardPanel(game,tp);
MessagePanel mp = new MessagePanel(game);

View File

@@ -11,9 +11,9 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import controller.PlayerController;
import controller.TSPMouseListener;
import model.HumanPlayer;
import model.Board.TileColor;
public class TileSelectionPanel extends JPanel {
@@ -26,9 +26,9 @@ public class TileSelectionPanel extends JPanel {
private final JLabel red = new JLabel(new ImageIcon(BoardPanel.RED_ICON));
private final JLabel yellow = new JLabel(new ImageIcon(
BoardPanel.YELLOW_ICON));
private final PlayerController pc;
private final HumanPlayer pc;
public TileSelectionPanel(PlayerController pc) {
public TileSelectionPanel(HumanPlayer pc) {
this.pc = pc;
initLayout();