package pdp.scrabble.game.impl;
import org.jdom.Element;
import pdp.scrabble.Game;
import pdp.scrabble.game.AI;
import pdp.scrabble.game.AILevel;
import pdp.scrabble.game.GameEnvironment;
import pdp.scrabble.game.Player;
import pdp.scrabble.game.Rack;
import pdp.scrabble.game.SearchLevel;
import pdp.scrabble.game.SearchPriority;
import pdp.scrabble.game.SearchStrategy;
import pdp.scrabble.game.VocLevel;
public class SimpleAI implements AI {
private Rack rack;
private String name;
private int id;
private int score;
private VocLevel voc;
private AILevel lvl;
private PlayerImpl deleg;
private GameEnvironment env;
public SimpleAI(String name, int id, GameEnvironment env) {
this.name = name;
this.id = id;
this.env = env;
Game game = new GameImpl("blob", null); // TODO create game adapter to GameEnvironement & GameEngine
this.deleg = new PlayerImpl(game, "name", id, true, new AIConfigImpl(SearchLevel.EASY, SearchStrategy.AUTOMATIC, SearchPriority.HIGHER_SCORE));
}
public SimpleAI() {
}
@Override
public void playTurn() {
// TODO Make AI delegate turn to PlayerImpl
}
@Override
public Rack getRack() {
return rack;
}
@Override
public String getName() {
return name;
}
@Override
public int getID() {
return id;
}
@Override
public void addScore(int score) {
this.score += score;
}
@Override
public int getScore() {
return score;
}
@Override
public void setLevel(AILevel lvl) {
this.lvl = lvl;
}
@Override
public void setVocabulary(VocLevel lvl) {
this.voc = lvl;
}
@Override
public void save(Element root) {
// TODO Auto-generated method stub
}
@Override
public void load(Element root) {
// TODO Auto-generated method stub
}
@Override
public Player clone() {
// TODO return clone
return null;
}
}