Class ClientStatus
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
it.polimi.ingsw.Client.ClientModel.ClientStatus
- All Implemented Interfaces:
ClientStatusInterface
,Serializable
,Remote
Status (Client)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate BoardInterface
Game's boardprivate List<CommonGoalCardInterface>
Game's Common Goal Card (1-2)private final RMIClientInterface
Client's implementationprivate String
Current player in the game, used for View purposesprivate String
Game's identifierprivate Map<ScoreCardInterface,
CommonGoalCardInterface> Game's last turn scoresprivate MoveIntermediateInterface
Move Intermediate for the clientprivate String
Player's nicknameprivate PersonalGoalCardInterface
Personal Goal Card for the Playerprivate Stack<ScoreCardInterface>
private ScoreBoardInterface
Game's final Scoreboardprivate ShelfInterface
Player's shelfprivate Status
Client status related to the gameFields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBoard()
Getter method for Game's boardGetter method for Game's Common Goal CardsGetter method for the current playerGetter method for Game's identifierGetter for Player's Move IntermediateGetter method for Player's nicknameGetter method for Player's Personal Goal Cardgetter method for Game's ScoreboardgetShelf()
Getter method for Player's shelfGetter method for Client Statusvoid
lifeline()
Naive KeepAlive implementation, used for disconnections managementvoid
setCards
(PersonalGoalCardInterface pgCard, List<CommonGoalCardInterface> cgCard) Aggregate setter for Game's and Player's cardsvoid
setCurrentPlayer
(String currentPlayer) Setter method for the current playervoid
setGameParameters
(BoardInterface board, ShelfInterface shelf, MoveIntermediateInterface mi) Aggregate setter for Game initial parametersvoid
setIdentifier
(String identifier) Setter method for Game's identifiervoid
void
setNickname
(String nickname) Setter method for Player's nicknamevoid
setter method for Game's Scoreboardvoid
boolean
Setter method for Client Status It makes the client evolveMethods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Field Details
-
client
Client's implementation -
status
Client status related to the game -
identifier
Game's identifier -
nickname
Player's nickname -
board
Game's board -
shelf
Player's shelf -
pgCard
Personal Goal Card for the Player -
cgCard
Game's Common Goal Card (1-2) -
mi
Move Intermediate for the client -
currentPlayer
Current player in the game, used for View purposes -
sci
Game's final Scoreboard -
lts
Game's last turn scores -
sc
-
-
Constructor Details
-
ClientStatus
Client Status constructor- Parameters:
client
- RMI Client implementation- Throws:
RemoteException
- related to RMI
-
-
Method Details
-
getStatus
Getter method for Client Status- Specified by:
getStatus
in interfaceClientStatusInterface
- Returns:
- Client's status
-
setStatus
Setter method for Client Status It makes the client evolve- Specified by:
setStatus
in interfaceClientStatusInterface
- Parameters:
status
- Client's status- Returns:
- client-side validation
-
getIdentifier
Getter method for Game's identifier- Specified by:
getIdentifier
in interfaceClientStatusInterface
- Returns:
- Game's identifier
-
setIdentifier
Setter method for Game's identifier- Specified by:
setIdentifier
in interfaceClientStatusInterface
- Parameters:
identifier
- Game's identifier
-
getNickname
Getter method for Player's nickname- Specified by:
getNickname
in interfaceClientStatusInterface
- Returns:
- Player's nickname
-
setNickname
Setter method for Player's nickname- Specified by:
setNickname
in interfaceClientStatusInterface
- Parameters:
nickname
- Player's nickname
-
setGameParameters
public void setGameParameters(BoardInterface board, ShelfInterface shelf, MoveIntermediateInterface mi) Aggregate setter for Game initial parameters- Specified by:
setGameParameters
in interfaceClientStatusInterface
- Parameters:
board
- Game's boardshelf
- Player's shelfmi
- Move Intermediate for the client
-
getBoard
Getter method for Game's board- Specified by:
getBoard
in interfaceClientStatusInterface
- Returns:
- Game's board
-
getShelf
Getter method for Player's shelf- Specified by:
getShelf
in interfaceClientStatusInterface
- Returns:
- Player's shelf
-
getPersonalGoalCard
Getter method for Player's Personal Goal Card- Specified by:
getPersonalGoalCard
in interfaceClientStatusInterface
- Returns:
- Player's Personal Goal Card
-
getCommonGoalCard
Getter method for Game's Common Goal Cards- Specified by:
getCommonGoalCard
in interfaceClientStatusInterface
- Returns:
- List of Game's Common Goal Cards
-
setCards
Aggregate setter for Game's and Player's cards- Specified by:
setCards
in interfaceClientStatusInterface
- Parameters:
pgCard
- Player's Personal Goal CardcgCard
- Game's Common Goal Card
-
getMoveIntermediate
Getter for Player's Move Intermediate- Specified by:
getMoveIntermediate
in interfaceClientStatusInterface
- Returns:
- Player's Move Intermediate
-
getCurrentPlayer
Getter method for the current player- Specified by:
getCurrentPlayer
in interfaceClientStatusInterface
- Returns:
- used for View purposes
-
setCurrentPlayer
Setter method for the current player- Specified by:
setCurrentPlayer
in interfaceClientStatusInterface
- Parameters:
currentPlayer
- set by the Server for View purposes
-
getScoreBoard
getter method for Game's Scoreboard- Specified by:
getScoreBoard
in interfaceClientStatusInterface
- Returns:
- used for View purposes
-
setScoreBoard
setter method for Game's Scoreboard- Specified by:
setScoreBoard
in interfaceClientStatusInterface
- Parameters:
sci
- Score Board Interface
-
getLastTurnScores
- Specified by:
getLastTurnScores
in interfaceClientStatusInterface
- Returns:
- Common Goal Cards achievement made in the last turn
-
setLastTurnScores
- Specified by:
setLastTurnScores
in interfaceClientStatusInterface
- Parameters:
lts
- Common Goal Cards achievement made in the last turn
-
getScoreCards
- Specified by:
getScoreCards
in interfaceClientStatusInterface
- Returns:
- Player's ScoreCards
-
setScoreCards
- Specified by:
setScoreCards
in interfaceClientStatusInterface
- Parameters:
sc
- Player's ScoreCards
-
lifeline
Naive KeepAlive implementation, used for disconnections management- Specified by:
lifeline
in interfaceClientStatusInterface
- Throws:
InterruptedException
- related to RMI Connection
-