added java docs
This commit is contained in:
@@ -8,10 +8,19 @@ public class InterruptState extends ClientState {
|
||||
|
||||
private ClientState previousState;
|
||||
|
||||
/**
|
||||
* Creates a new InterruptState
|
||||
*
|
||||
* @param parent the parent state
|
||||
* @param logic the game logic
|
||||
*/
|
||||
public InterruptState(ClientState parent, ClientGameLogic logic) {
|
||||
super(parent, logic);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enters the new state machine
|
||||
*/
|
||||
@Override
|
||||
public void enter() {
|
||||
previousState = null;
|
||||
|
||||
@@ -7,26 +7,44 @@
|
||||
|
||||
public class SettingsState extends ClientState {
|
||||
|
||||
/**
|
||||
* The current state of the settings
|
||||
*/
|
||||
private SettingStates currentState;
|
||||
|
||||
private final MainSettingsState mainSettingsState = new MainSettingsState(this, logic);
|
||||
private final AudioSettingsState audioSettingsState = new AudioSettingsState(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) {
|
||||
super(parent, logic);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enters the current state
|
||||
*/
|
||||
@Override
|
||||
public void enter() {
|
||||
currentState = mainSettingsState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exits the current state
|
||||
*/
|
||||
@Override
|
||||
public void exit() {
|
||||
currentState.exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the current state
|
||||
*/
|
||||
public SettingStates getState(){
|
||||
return currentState;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public void exit() {
|
||||
@Override
|
||||
public void selectLeave() {
|
||||
parent.setState(parent.getStartDialog());
|
||||
logic.send(new LeaveGameMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
import pp.mdga.notification.WaitMoveNotification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class NoPieceState extends ChoosePieceStates {
|
||||
@@ -49,7 +51,13 @@ public void received(WaitPieceMessage msg){
|
||||
@Override
|
||||
public void received(StartPieceMessage msg){
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user