package packets;
import elements.Consts.Priorities;
import network.Game;
import network.Lobby;
/**
*
* @author Joel Garboden
*/
public class PlayerQuitReq extends Request
{
public final String playerName;
public PlayerQuitReq(String playerName)
{
this.playerName = playerName;
this.priority = Priorities.TURN_UPDATE;
}
public PlayerQuitReq(int playerID)
{
playerName = "";
this.playerID = playerID;
this.priority = Priorities.TURN_UPDATE;
}
@Override
public boolean processRequest(Game game)
{
game.playerQuitCmd(playerName);
return true;
}
@Override
public boolean lobbyRequest(Lobby lobby)
{
lobby.playerQuitCmd(playerName);
return true;
}
@Override
public String toString()
{
return "playerQuitRequest from: " + playerName;
}
}
|