it.prazzoli.tictactoe
Class game
java.lang.Object
it.prazzoli.tictactoe.game
public class game
- extends java.lang.Object
Questa classe rappresenta la partita, funziona da classe contenitore.
Serve per astrarre una partita del gioco, creando tutti gli oggetti necessari.
- Author:
- Maurizio Prazzoli, maurizio@prazzoli.it
Constructor Summary |
game()
Class constructor. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
game
public game()
- Class constructor.
newGame
public void newGame()
throws java.lang.Exception
- La funzione si occupa di inizializzare una nuova partita
- Throws:
java.lang.Exception
LastAIStats
public java.lang.String LastAIStats()
isValidMove
public boolean isValidMove(int bPos)
isGameOver
public boolean isGameOver()
isGameBeenWon
public boolean isGameBeenWon()
isGameBeenDraft
public boolean isGameBeenDraft()
getCurrentPlayerCompleteName
public java.lang.String getCurrentPlayerCompleteName()
getPlayerCompleteName
public java.lang.String getPlayerCompleteName(int player)
getPlayerCompleteNameAndScore
public java.lang.String getPlayerCompleteNameAndScore(int player)
isPlayerConfigured
public boolean isPlayerConfigured(int index)
resetPlayer
public void resetPlayer(int index)
setPlayerSign
public void setPlayerSign(char cSign,
int currentPlayer)
throws java.lang.Exception
- Throws:
java.lang.Exception
setPlayer
public void setPlayer(int index,
player p)
isCurrentVirtualPlayer
public boolean isCurrentVirtualPlayer()
returnBoardAsInteger
public int returnBoardAsInteger()
boardToMatrix
public java.lang.Object boardToMatrix(boolean removeE)
AIDoMove
public int AIDoMove()
playerSwitch
public void playerSwitch()
insertNewPlayerIntoDB
public boolean insertNewPlayerIntoDB(java.lang.String sUSERID,
java.lang.String sPASSWORD,
java.lang.String sNAME,
java.lang.String sSURNAME,
int iPos)
throws java.lang.Exception
- Throws:
java.lang.Exception
loadPlayerFromDB
public boolean loadPlayerFromDB(java.lang.String sUSERID,
java.lang.String sPASSWORD,
int iPos)
throws java.lang.Exception
- Throws:
java.lang.Exception
AddScoreToCurrentPlayer
public boolean AddScoreToCurrentPlayer(int scoreToAdd)