I'm about to create the Player and AI Players (AIBasicPlayer,AINormalPlayer and AIHardPlayer) class for my card game (gin rummy). What would be the best OOP or Design Pattern approach for creating the said classes? I checked some of the open source card game and compare their approaches, following are the approaches I have gathered:
***Classes**
1. player class only
public class player{
}
public class AIPlayer{
}
2. base class player
public abstract class player{
}
public class HumanPlayer extends player{
}
public class APlayer extends player{
}
3. interface player
public interface IPlayer{
}
public class Player implements IPlayer{}
public class AIPlayer implements IPlayer{}
*** Methods**
takeTurn()
doDiscard()
doDraw() //pick from discard pile or deck
doKnock()
I understand the use of the above codes, but I couldn't decide which one to apply or implement.I'm new to OOP or Design Pattern and your advise and code sample would be a very big help.