Fix: TCP Reconnection system -> model too
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user