package it.polimi.ingsw.gc14.Network.NetworkEvents;

import it.polimi.ingsw.gc14.Controller.GameController;
import it.polimi.ingsw.gc14.Network.EventType;
import it.polimi.ingsw.gc14.Network.NetworkEvent;
import it.polimi.ingsw.gc14.View.IView;

import java.io.Serializable;

public class AddPlayer extends NetworkEvent implements  Serializable {
    private int proposedNPlayer;
    public int getProposedNPlayer() {
        return proposedNPlayer;
    }
    public AddPlayer(String username, int proposedNPlayer) {
        super(username, EventType.ADD_PLAYER, false);
        this.proposedNPlayer = proposedNPlayer;
    }
    @Override
    public boolean apply(GameController gameController)
    {
        return gameController.addPlayer(username);
    }
    public String apply(IView gameController)
    {
        return gameController.toString();
    }
}
