added two lists in PossiblePiece in order to differentiate between own and enemy pieces
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import com.jme3.network.serializing.Serializable;
|
import com.jme3.network.serializing.Serializable;
|
||||||
|
|
||||||
|
import java.sql.PseudoColumnUsage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -29,6 +30,32 @@ public PossiblePiece() {
|
|||||||
possibleEnemyPieces = new ArrayList<>();
|
possibleEnemyPieces = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Swap the possible pieces
|
||||||
|
*
|
||||||
|
* @param possibleOwnPieces the list of possible own pieces
|
||||||
|
* @param possibleEnemyPieces the list of possible enemy pieces
|
||||||
|
* @return the swapped possible pieces
|
||||||
|
*/
|
||||||
|
public static PossiblePiece swapPossiblePieces(ArrayList<String> possibleOwnPieces, ArrayList<String> possibleEnemyPieces) {
|
||||||
|
PossiblePiece possiblePiece = new PossiblePiece();
|
||||||
|
possiblePiece.possibleOwnPieces.addAll(possibleOwnPieces);
|
||||||
|
possiblePiece.possibleEnemyPieces.addAll(possibleEnemyPieces);
|
||||||
|
return possiblePiece;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the possible pieces for the shield
|
||||||
|
*
|
||||||
|
* @param possibleOwnPieces the list of possible own pieces
|
||||||
|
* @return the possible pieces for the shield
|
||||||
|
*/
|
||||||
|
public static PossiblePiece shieldPossiblePieces(ArrayList<String> possibleOwnPieces){
|
||||||
|
PossiblePiece possiblePiece = new PossiblePiece();
|
||||||
|
possiblePiece.possibleOwnPieces.addAll(possibleOwnPieces);
|
||||||
|
return possiblePiece;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a piece to the list of possible pieces
|
* Add a piece to the list of possible pieces
|
||||||
*
|
*
|
||||||
@@ -50,10 +77,17 @@ public void addEnemyPossiblePiece(String piece) {
|
|||||||
/** Getter for the list of possible pieces
|
/** Getter for the list of possible pieces
|
||||||
* @return the list of possible pieces
|
* @return the list of possible pieces
|
||||||
*/
|
*/
|
||||||
public List<String> getPossiblePieces() {
|
public List<String> getOwnPossiblePieces() {
|
||||||
return possibleOwnPieces;
|
return possibleOwnPieces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Getter for the list of possible enemy pieces
|
||||||
|
* @return the list of possible enemy pieces
|
||||||
|
*/
|
||||||
|
public List<String> getEnemyPossiblePieces() {
|
||||||
|
return possibleEnemyPieces;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accepts a visitor to process this message.
|
* Accepts a visitor to process this message.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user