package eu.jonahbauer.wizard.core.states.game;

import eu.jonahbauer.wizard.core.Game;
import eu.jonahbauer.wizard.core.states.GameData;
import eu.jonahbauer.wizard.core.states.GameState;
import eu.jonahbauer.wizard.core.states.round.StartingRound;

import java.util.Optional;

import static eu.jonahbauer.wizard.core.states.GameData.PLAYERS;

public final class Starting extends GameState {

    public Starting(GameData data) {
        super(data.require(PLAYERS));
    }

    @Override
    public Optional<GameState> onEnter(Game game) {
        return transition(new StartingRound(getData()));
    }
}
