Class Player
java.lang.Object
|
+--PrintSuperClass
|
+--PlayerSkills
|
+--VitalStatistics
|
+--Player
- Direct Known Subclasses:
- PlayerDJB, PlayerGM, PlayerGM1, PlayerTMD0, PlayerTMD1, PlayerTMD2, PlayerTMD3, PlayerTMD4
- public abstract class Player
- extends VitalStatistics
parent class of all players, requires user to implement makeMove
abstract protected boolean fileStat( Message )
Programmer must implement disk file to save stats - version 2
deprecated
abstract protected void placeShips( ) - make this a private method
Programmer must place ships, and return board with ships
abstract public Move makeMove( Message msg, Board brd )
Programmer must read msg, is passed board with players current guesses
Note we have implemented a message passing system with authenication
Advantages: only one public method inside children of player
however, another alternative object oriented approach is to force children of
Player to implement all functions that will be called. This method will require
each method to do verification checks. this method would also have to inform
player child to make methods final,
| Methods inherited from class PlayerSkills |
getAverageMoves, getBadMoves, getBestMoves, getCoverage, getLoss, getMoves, getPerformance, getSkill, getTimeLog, getTotalMoves, getWin, getWorstMoves, probability, setSkill |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Player
public Player()
makeMove
public abstract Coordinates makeMove(Message msg,
Board brd)
- Abstract methods must be declared in all sub-class children