public abstract class AbstractField
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
height
Width and height of the playing field
|
protected int |
turnCounter
Number of turns played
|
int |
width
Width and height of the playing field
|
| Constructor and Description |
|---|
AbstractField(int w,
int h) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkDraw()
Returns true if the board is full (and nobody won)
|
abstract boolean |
checkWin(int player)
Check if player (0 or 1) has won
|
abstract double |
evaluatePlayerZero()
Heuristic to evaluate the quality of the position for player 0
|
abstract int |
getField(int x,
int y)
What is on field x,y?
|
int |
getPlayer()
Returns the player who plays next
|
int |
getTurnCounter()
Returns the number of turns already played
|
abstract boolean |
isOpen(int column)
Checks if there can a coin be dropped into
|
abstract void |
makeMove(int column)
Drop a coin in column
|
java.lang.String |
toString()
Build a string representing the current board
|
abstract void |
undoMove()
Undo last move
|
public final int width
public final int height
protected int turnCounter
public abstract void makeMove(int column)
column - public abstract void undoMove()
public abstract boolean checkWin(int player)
player - public abstract double evaluatePlayerZero()
public abstract int getField(int x,
int y)
x - y - public abstract boolean isOpen(int column)
column - public boolean checkDraw()
public int getTurnCounter()
public int getPlayer()
public java.lang.String toString()
toString in class java.lang.Object