public void addBlankStep(Step s) { if (theSteps.size() > 0) { Step lastStep = theSteps.get(theSteps.size() - 1); s.setStartLocation(lastStep.getEndLocation()); theSteps.add(s); } else { theSteps.add(s); startingLocation = s.getStartLocation(); // first step endingLocation = s.getEndLocation(); } }
public void addStep(Step s) { if (theSteps.size() > 0) { // Step lastStep = theSteps.get(theSteps.size()-1); // TODO has caused problems if (lastStep.getEndLocation() == s.getStartLocation()){ theSteps.add(s); endingLocation = s.getEndLocation(); // } // else {System.err.println("Move::addStep: failure to add step");} } else { // the first step theSteps.add(s); startingLocation = s.getStartLocation(); // first step endingLocation = s.getEndLocation(); } /* switch(whoseTurn){ //cannot promote during step, could extend immediately after coronation case BLACK: if(endingLocation >31){becomeKing = true; rankAtEnd=Piece.Rank.KING;} break; case WHITE: if(endingLocation <5){becomeKing = true; rankAtEnd=Piece.Rank.KING;} break; }*/ }