Commit a109bebd authored by Erwan Bousse's avatar Erwan Bousse

Few changes

parent f11ce525
......@@ -142,10 +142,14 @@ public class Board {
}
/**
* Picks the next pawn that is allowed to play.
* Picks the next pawn that is allowed to play, which is the next pawn in the list of pawns.
* @return The next pawn that is allowed to play.
*/
public Pawn getNextPawn() {
if (pawns.size() == 0) {
return null;
}
if (pawns.size() == 1) {
currentPawn = pawns.get(0);
return pawns.get(0);
......@@ -190,6 +194,9 @@ public class Board {
for (int y= ySize-1; y>=0; y--) {
for(int x = 0; x<xSize; x++) {
result += squareContentSprite(x,y);
if (x == xSize) {
result += '|';
}
}
result+="\n";
}
......
......@@ -124,7 +124,7 @@ public class Pawn {
* The enemy pawn should suffer 1 damage,
* but it should suffer 2 damages if the current pawn
* is on a bonus square.
* @param ennemy The attacked pawn.
* @param enemy The attacked pawn.
* @return A message that explain what happened during the assault.
*/
private String attack(Pawn enemy) {
......@@ -134,7 +134,10 @@ public class Pawn {
else
message+=enemy.suffer(1);
if (enemy.isDead()) gold++;
return message;
if (message != "")
return message;
else
return "";
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment