Add various changes on Pair toString, Firearm getter

This commit is contained in:
Katchan 2021-10-28 23:19:53 +02:00
parent 19e5f19b19
commit 2322462ab3
3 changed files with 14 additions and 9 deletions

View File

@ -13,7 +13,7 @@ public enum ClassPlayer {
private final int mineCost;
private final int bombCost;
private final int moveCost;
private final int gainEnergyCost;
private final int gainEnergy;
private final int penaltyShoot;
private final int penaltyBomb;
private final int penaltyMine;
@ -21,14 +21,14 @@ public enum ClassPlayer {
ClassPlayer(int energy, int shieldCost, int shootCost, int mineCost, int bombCost, int moveCost,
int gainEnergyCost, int penaltyShoot, int penaltyBomb, int penaltyMine, Weapon weapon){
int gainEnergy, int penaltyShoot, int penaltyBomb, int penaltyMine, Weapon weapon){
this.energy = energy;
this.shieldCost = shieldCost;
this.shootCost = shootCost;
this.mineCost = mineCost;
this.bombCost = bombCost;
this.moveCost = moveCost;
this.gainEnergyCost = gainEnergyCost;
this.gainEnergy = gainEnergy;
this.penaltyShoot = penaltyShoot;
this.penaltyBomb = penaltyBomb;
this.penaltyMine = penaltyMine;
@ -59,8 +59,8 @@ public enum ClassPlayer {
return moveCost;
}
public int getGainEnergyCost() {
return gainEnergyCost;
public int getGainEnergy() {
return gainEnergy;
}
public int getPenaltyShoot() {

View File

@ -8,23 +8,23 @@ public class Firearm implements Weapon{
public Firearm(){
this.bullet = 10;
this.horizontalDistance = 2;
this.horizontalDistance = 3;
this.verticalDistance = 3;
}
@Override
public int getBullet() {
return 0;
return this.bullet;
}
@Override
public int getHorizontalDistance() {
return 0;
return this.horizontalDistance;
}
@Override
public int getVerticalDistance() {
return 0;
return this.verticalDistance;
}
}

View File

@ -41,4 +41,9 @@ public class Pair<A,B> {
public int hashCode() {
return Objects.hash(a, b);
}
@Override
public String toString() {
return "Pair[" + a + "," + b + ']';
}
}