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

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

import java.util.Optional;

import static eu.jonahbauer.wizard.core.machine.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()));
    }
}
