/* * AcceptPlayersDontAttackMe2.java * * Created on April 23, 2004, 2:09 AM */ package simulations.core.strategy.decisionSupportStrategy; import simulations.core.Player; import java.util.ArrayList; import java.util.Iterator; import simulations.core.history.Turn; import simulations.core.history.PlayerTurn; import simulations.core.strategy.PlayerIntElement; /** * This class describes a decision support strategy that accept only * if the asking player never attacked me directly and indirectly * @author tom */ public class AcceptPlayersDontAttackMeStrategy2 extends DecisionSupportStrategy { private ArrayList notAcceptList; private boolean first; /** Creates a new instance of AcceptPlayersDontAttackMe */ public AcceptPlayersDontAttackMeStrategy2() { super(); name="AcceptPlayersDontAttackMeStrategy2"; notAcceptList = new ArrayList(); memoryParam=true; abr="7"; } /** return the description of this decision support strategy * @return return the description of this decision support strategy **/ public String getDescription() { return "Decision support strategy :\n"+ "I accept if asking player have never\n"+ "attacked me directly and indirectly\n"+ "memory="+memory+"\n"; } /** This method returns true if the player p is already in notAskingList * @return true if the player p is already in notAskingList false otherwise **/ private boolean containsPlayer(Player p) { for(int i=0;i