diff --git a/src/main/java/it/polimi/ingsw/gc14/Network/NetworkEvents/DisconnectedPlayer.java b/src/main/java/it/polimi/ingsw/gc14/Network/NetworkEvents/DisconnectedPlayer.java new file mode 100644 index 0000000..e1400cd --- /dev/null +++ b/src/main/java/it/polimi/ingsw/gc14/Network/NetworkEvents/DisconnectedPlayer.java @@ -0,0 +1,33 @@ +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 java.io.Serializable; + +/** + * NetworkEvent to avoid drawing a card from the lower card list + */ +public class DisconnectedPlayer extends NetworkEvent implements Serializable{ + + /** + * Class constructor. + * Initializes all the attributes. + * @param username the name of the player requesting the event + */ + public DisconnectedPlayer(String username){ + super(username, EventType.SKIP_PLAYER_DISCONNECTED, false); + } + + /** + * @param gameController the Game Controller on which to apply the event + * @return true if the player could skipTheTurn, false otherwise + */ + @Override + public boolean apply(GameController gameController){ + return gameController.DisconnectedPlayer(username); + } + +} +