Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding PieceValueTracker with default values from Wikipedia.
- Loading branch information
1 parent
c989f12
commit 51f8094
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
src/main/java/net/skytreader/kode/chesstemplar/core/PieceValueTracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package net.skytreader.kode.chesstemplar.core; | ||
|
||
/** | ||
Use this class to keep track of the values of each piece. The allows for changes | ||
in the value of a piece as the game progresses. | ||
@author Chad Estioco | ||
*/ | ||
public class PieceValueTracker{ | ||
/* | ||
These are default values. See http://en.wikipedia.org/wiki/Chess_piece_relative_value | ||
*/ | ||
private float pawnVal = 1F; | ||
private float knightVal = 3F; | ||
private float bishopVal = 3F; | ||
private float rookVal = 5F; | ||
private float queenVal = 9F; | ||
private float kingVal = Float.POSITIVE_INFINITY; | ||
|
||
public float getPawnVal(){ | ||
return pawnVal; | ||
} | ||
|
||
public void setPawnVal(float v){ | ||
pawnVal = v; | ||
} | ||
|
||
public float getKnightVal(){ | ||
return knightVal; | ||
} | ||
|
||
public void setKnightVal(float v){ | ||
knightVal = v; | ||
} | ||
|
||
public float getBishopVal(){ | ||
return bishopVal; | ||
} | ||
|
||
public void setBishopVal(float v){ | ||
bishopVal = v; | ||
} | ||
|
||
public float getRookVal(){ | ||
return rookVal; | ||
} | ||
|
||
public void setRookVal(float v){ | ||
rookVal = v; | ||
} | ||
|
||
public float getQueenVal(){ | ||
return queenVal; | ||
} | ||
|
||
public void setQueenVal(float v){ | ||
queenVal = v; | ||
} | ||
|
||
public float getKingVal(){ | ||
return kingVal; | ||
} | ||
} |