package eu.jonahbauer.wizard.server.machine.states;

import eu.jonahbauer.wizard.server.machine.ClientState;
import eu.jonahbauer.wizard.server.machine.Player;
import org.springframework.web.socket.CloseStatus;

import java.util.Optional;

public class CreatedState implements ClientState {
    @Override
    public Optional<ClientState> onOpen(Player player) {
        return Optional.of(new LobbyState());
    }

    @Override
    public Optional<ClientState> onClose(Player player, CloseStatus status) {
        throw new IllegalStateException();
    }
}
