mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Utfører små endringer i kommentarer, navngiving og kodestil
This commit is contained in:
parent
8a5bf9fda0
commit
0b40c8bb92
@ -13,14 +13,22 @@ public class GameStartInfo {
|
|||||||
private String playerName;
|
private String playerName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Empty initialization method used by kryo
|
* Empty initialization method required by kryo
|
||||||
*/
|
*/
|
||||||
public GameStartInfo() {}
|
public GameStartInfo() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player name of the current player
|
||||||
|
* @param playerName The player name of the current player
|
||||||
|
*/
|
||||||
public void setPlayerName(String playerName) {
|
public void setPlayerName(String playerName) {
|
||||||
this.playerName = playerName;
|
this.playerName = playerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player name of the current player
|
||||||
|
* @return The player name of the current player
|
||||||
|
*/
|
||||||
public String getPlayerName() {
|
public String getPlayerName() {
|
||||||
return playerName;
|
return playerName;
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,25 @@ package inf112.fiasko.roborally.networking.containers;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is used to contain power down status for all players
|
||||||
|
*/
|
||||||
public class PowerdownContainer {
|
public class PowerdownContainer {
|
||||||
private Map<String,Boolean> powerdown;
|
private final Map<String, Boolean> powerDown;
|
||||||
|
|
||||||
public PowerdownContainer(Map<String, Boolean> powerdown) {
|
/**
|
||||||
this.powerdown = powerdown;
|
* Instantiates a new power down container
|
||||||
|
* @param powerDown A map between player names and whether they should remain in power down
|
||||||
|
*/
|
||||||
|
public PowerdownContainer(Map<String, Boolean> powerDown) {
|
||||||
|
this.powerDown = powerDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Boolean> getPowerdown() {
|
/**
|
||||||
return powerdown;
|
* Gets the power down map stored in the container
|
||||||
|
* @return A map between player name and stay in power down
|
||||||
|
*/
|
||||||
|
public Map<String, Boolean> getPowerDown() {
|
||||||
|
return powerDown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* This class handles everything that should happen during a phase
|
* This class handles everything that should happen during a phase
|
||||||
*/
|
*/
|
||||||
public class Phase {
|
public class Phase {
|
||||||
private Board gameBoard;
|
private final Board gameBoard;
|
||||||
private final List<Player> playerList;
|
private final List<Player> playerList;
|
||||||
private int cycleDelay;
|
private final int cycleDelay;
|
||||||
private List<BoardElementContainer<Tile>> cogwheels;
|
private List<BoardElementContainer<Tile>> cogwheels;
|
||||||
private List<BoardElementContainer<Tile>> conveyorBelts;
|
private List<BoardElementContainer<Tile>> conveyorBelts;
|
||||||
private List<BoardElementContainer<Tile>> fastConveyorBelts;
|
private List<BoardElementContainer<Tile>> fastConveyorBelts;
|
||||||
|
@ -183,7 +183,7 @@ public class RoboRallyGame implements IRoboRallyGame {
|
|||||||
@Override
|
@Override
|
||||||
public void receiveStayInPowerDown(PowerdownContainer powerDowns) {
|
public void receiveStayInPowerDown(PowerdownContainer powerDowns) {
|
||||||
for (Player player : playerList) {
|
for (Player player : playerList) {
|
||||||
player.setPowerDownNextRound(powerDowns.getPowerdown().get(player.getName()));
|
player.setPowerDownNextRound(powerDowns.getPowerDown().get(player.getName()));
|
||||||
}
|
}
|
||||||
respawnRobots();
|
respawnRobots();
|
||||||
resetHasTouchedFlagThisTurnForAllRobots();
|
resetHasTouchedFlagThisTurnForAllRobots();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user