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

import eu.jonahbauer.wizard.core.machine.states.GameData;
import eu.jonahbauer.wizard.core.machine.Game;
import eu.jonahbauer.wizard.core.machine.states.GameState;
import eu.jonahbauer.wizard.common.messages.observer.ScoreMessage;

import static eu.jonahbauer.wizard.core.machine.states.GameData.*;

public final class Finishing extends GameState {

    public Finishing(GameData data) {
        super(data.require(SCORE));
    }

    @Override
    public void onEnter(Game game) {
        game.notify(new ScoreMessage(get(SCORE)));
        game.finish();
    }
}
