/**
*
*/
package de.axxeed.animosy.ai;
import org.apache.log4j.Logger;
import de.axxeed.animosy.model.Manager;
import de.axxeed.animosy.model.Node;
/**
* MrXAbstract.java
* Created: 15.08.2008 16:36:56
* @author Markus J. Luzius
*
*/
public abstract class MrXAbstract implements MrXInterface {
private static Logger log = Logger.getLogger(MrXAbstract.class);
/**Checks if the move to node n is legal or not
*@param n the node n to be tested
*@return true if the move is legal otherwise it returns false
*/
protected boolean isLegalMove(Node to)
{
boolean canMove=true;
for(int i=0;i<Manager.getGame().getBoard().getDetectives().length;i++) {
Node n=Manager.getGame().getBoard().getDetectives()[i].getPosition();
if(n.getPosition()==to.getPosition()) {
canMove=false;
}
}
return canMove;
}
}