merge Development into test #27
@@ -8,10 +8,19 @@ public class InterruptState extends ClientState {
|
|||||||
|
|
||||||
private ClientState previousState;
|
private ClientState previousState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new InterruptState
|
||||||
|
*
|
||||||
|
* @param parent the parent state
|
||||||
|
* @param logic the game logic
|
||||||
|
*/
|
||||||
public InterruptState(ClientState parent, ClientGameLogic logic) {
|
public InterruptState(ClientState parent, ClientGameLogic logic) {
|
||||||
super(parent, logic);
|
super(parent, logic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enters the new state machine
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
previousState = null;
|
previousState = null;
|
||||||
|
|||||||
@@ -7,26 +7,44 @@
|
|||||||
|
|
||||||
public class SettingsState extends ClientState {
|
public class SettingsState extends ClientState {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current state of the settings
|
||||||
|
*/
|
||||||
private SettingStates currentState;
|
private SettingStates currentState;
|
||||||
|
|
||||||
private final MainSettingsState mainSettingsState = new MainSettingsState(this, logic);
|
private final MainSettingsState mainSettingsState = new MainSettingsState(this, logic);
|
||||||
private final AudioSettingsState audioSettingsState = new AudioSettingsState(this, logic);
|
private final AudioSettingsState audioSettingsState = new AudioSettingsState(this, logic);
|
||||||
private final VideoSettingsState videoSettingsState = new VideoSettingsState(this, logic);
|
private final VideoSettingsState videoSettingsState = new VideoSettingsState(this, logic);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new SettingsState
|
||||||
|
*
|
||||||
|
* @param parent the parent state
|
||||||
|
* @param logic the game logic
|
||||||
|
*/
|
||||||
public SettingsState(ClientState parent, ClientGameLogic logic) {
|
public SettingsState(ClientState parent, ClientGameLogic logic) {
|
||||||
super(parent, logic);
|
super(parent, logic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enters the current state
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void enter() {
|
public void enter() {
|
||||||
currentState = mainSettingsState;
|
currentState = mainSettingsState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exits the current state
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void exit() {
|
public void exit() {
|
||||||
currentState.exit();
|
currentState.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the current state
|
||||||
|
*/
|
||||||
public SettingStates getState(){
|
public SettingStates getState(){
|
||||||
return currentState;
|
return currentState;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public void exit() {
|
|||||||
@Override
|
@Override
|
||||||
public void selectLeave() {
|
public void selectLeave() {
|
||||||
parent.setState(parent.getStartDialog());
|
parent.setState(parent.getStartDialog());
|
||||||
|
logic.send(new LeaveGameMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
import pp.mdga.notification.WaitMoveNotification;
|
import pp.mdga.notification.WaitMoveNotification;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class NoPieceState extends ChoosePieceStates {
|
public class NoPieceState extends ChoosePieceStates {
|
||||||
@@ -49,7 +51,13 @@ public void received(WaitPieceMessage msg){
|
|||||||
@Override
|
@Override
|
||||||
public void received(StartPieceMessage msg){
|
public void received(StartPieceMessage msg){
|
||||||
Piece piece = logic.getGame().getPieceThroughUUID(msg.getPieceIdentifier());
|
Piece piece = logic.getGame().getPieceThroughUUID(msg.getPieceIdentifier());
|
||||||
//TODO: logic.addNotification(null);
|
List<UUID> listPiece = new ArrayList<>();
|
||||||
|
List<Integer> listIndex = new ArrayList<>();
|
||||||
|
List<Boolean> homeMove = new ArrayList<>();
|
||||||
|
listPiece.add(piece.getUuid());
|
||||||
|
listIndex.add(msg.getTargetIndex());
|
||||||
|
homeMove.add(false);
|
||||||
|
logic.addNotification(new SelectableMoveNotification(listPiece, listIndex, homeMove));
|
||||||
parent.setState(parent.getStartPiece());
|
parent.setState(parent.getStartPiece());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user