parent
c328377478
commit
ebcefda582
@ -1,34 +0,0 @@
|
||||
package eu.jonahbauer.wizard.client.libgdx.state;
|
||||
|
||||
import eu.jonahbauer.wizard.client.libgdx.Client;
|
||||
import eu.jonahbauer.wizard.client.libgdx.screens.CreateGameScreen;
|
||||
import eu.jonahbauer.wizard.common.messages.server.ServerMessage;
|
||||
import eu.jonahbauer.wizard.common.messages.server.SessionCreatedMessage;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public final class Creation extends BaseState {
|
||||
|
||||
private CreateGameScreen createScreen;
|
||||
|
||||
public Creation() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ClientState> onEnter(Client client) {
|
||||
createScreen = new CreateGameScreen(client.getGame());
|
||||
client.getGame().setScreen(createScreen);
|
||||
|
||||
return super.onEnter(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ClientState> onMessage(Client client, ServerMessage message) {
|
||||
if (message instanceof SessionCreatedMessage created) {
|
||||
|
||||
return Optional.empty();
|
||||
} else {
|
||||
return unexpectedMessage(client, message);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue