/////// TicStgGame.java /////// public class TicStgGame extends TicGame { public TicStgGame(TicBoard b) { super(b); stg = new TicStrategy(); // default strategy } public TicStgGame(TicBoard b, TicStrategy s) { super(b); stg = s; } protected TicStgGame() { } public void strategy(TicStrategy s) { stg = s; } // set new strategy // New definition using strategy public int genMove(boolean player) { int self, opponent; if ( ended() ) return NOMOVE; if (player == PLAYER_X) { self = cross; opponent = circle; } else { self = circle; opponent = cross; } return stg.move(self, opponent); } protected TicStrategy stg; // game strategy }