Package de.axxeed.animosy.ai

Source Code of de.axxeed.animosy.ai.MrXAbstract

/**
*
*/
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;
    }

}
TOP

Related Classes of de.axxeed.animosy.ai.MrXAbstract

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.