klaus.chess.party
Class Party

java.lang.Object
  extended by klaus.chess.party.Party

public class Party
extends Object

This represents a party.

Version:
2 - using a tree instead of a list
Author:
Stephan Hillebrand

Field Summary
private  ArrayList<String> additionalMetaData
           
private  String blackPlayer
          Name of the white/black player
private  String date
           
private  String ECO
           
private  boolean engineNeedsToResync
           
private  PartyNode lastNode
          A reference to the last node of PV
private  int plyCount
          The number of plys in the pv
private  String result
           
private  PartyNode root
          The party root node
private  String round
           
private  String site
           
private  String startingComment
           
private  String tournament
           
private  PartyNode varNode
          The node before lastNode, that is the node where variations are added
private  String whitePlayer
          Name of the white/black player
 
Constructor Summary
Party()
           
 
Method Summary
 void addComment(String comment)
          Adds a comment after the last move
 void addMove(Move m)
          add a new move at the end of the PV
 void addVariation(PartyNode variation)
          Adds a variation after the previous pv move
 String generatePGN()
          This will generate a PGN from this party
 String getBlackPlayer()
           
 String getDate()
           
 String getECO()
           
 String getHTMLNotation()
           
 Move getLastMove()
          Gets the last move of the PV
 int getPlyCount()
           
 Position getPosition()
          Get the position at the end of the game, variants will be ignored!
 Position getPosition(int endPly)
          Get a position in the game, with endPly being the last ply before the position that should be created.
 String getResult()
           
 String getRound()
           
 String getSite()
           
 String getTournament()
           
 String getWhitePlayer()
           
 boolean needResync()
           
 void parsePGN(String pgnnotation)
          Parse a PGN notation
 void setBlackPlayer(String blackPlayer)
           
 void setDate(String date)
           
 void setECO(String eco)
           
 void setResult(String result)
           
 void setRound(String round)
           
 void setSite(String site)
           
 void setTournament(String tournament)
           
 void setWhitePlayer(String whitePlayer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

private String result

date

private String date

site

private String site

tournament

private String tournament

ECO

private String ECO

round

private String round

whitePlayer

private String whitePlayer
Name of the white/black player


blackPlayer

private String blackPlayer
Name of the white/black player


startingComment

private String startingComment

additionalMetaData

private ArrayList<String> additionalMetaData

root

private PartyNode root
The party root node


varNode

private PartyNode varNode
The node before lastNode, that is the node where variations are added


lastNode

private PartyNode lastNode
A reference to the last node of PV


plyCount

private int plyCount
The number of plys in the pv


engineNeedsToResync

private boolean engineNeedsToResync
Constructor Detail

Party

public Party()
Method Detail

addMove

public void addMove(Move m)
add a new move at the end of the PV

Parameters:
m - the move to add

addVariation

public void addVariation(PartyNode variation)
Adds a variation after the previous pv move

Parameters:
variation - the variation to add

getPosition

public Position getPosition()
Get the position at the end of the game, variants will be ignored!

Returns:
the position

getPosition

public Position getPosition(int endPly)
Get a position in the game, with endPly being the last ply before the position that should be created.

Parameters:
endPly - the last ply
Returns:
the position

getHTMLNotation

public String getHTMLNotation()

addComment

public void addComment(String comment)
Adds a comment after the last move

Parameters:
comment - the comment to add

parsePGN

public void parsePGN(String pgnnotation)
Parse a PGN notation

Parameters:
pgnnotation -

generatePGN

public String generatePGN()
This will generate a PGN from this party

Returns:
a PGN string that can be saved into a PGN file

getBlackPlayer

public String getBlackPlayer()

getWhitePlayer

public String getWhitePlayer()

setBlackPlayer

public void setBlackPlayer(String blackPlayer)

setWhitePlayer

public void setWhitePlayer(String whitePlayer)

getLastMove

public Move getLastMove()
Gets the last move of the PV

Returns:

needResync

public boolean needResync()

getResult

public String getResult()

setResult

public void setResult(String result)

getDate

public String getDate()

getSite

public String getSite()

getTournament

public String getTournament()

setDate

public void setDate(String date)

setSite

public void setSite(String site)

setTournament

public void setTournament(String tournament)

getRound

public String getRound()

setRound

public void setRound(String round)

getECO

public String getECO()

setECO

public void setECO(String eco)

getPlyCount

public int getPlyCount()