Class Room
java.lang.Object
it.polimi.ingsw.communication.sugar_framework.Room
Represents a room in the Sugar communication protocol
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMakes the peer join into this roomvoidaddPeers(Collection<Peer> peers) Adds all peers to the roombooleangetPeers()inthashCode()voidIf the peer is in this room, makes the peer leave the room, otherwise it has no effect
-
Field Details
-
roomId
-
peers
-
-
Constructor Details
-
Room
public Room() -
Room
-
-
Method Details
-
addPeer
Makes the peer join into this room- Parameters:
peer- any peer connected to the server
-
addPeers
Adds all peers to the room- Parameters:
peers- a collection of Peer(s)
-
getRoomId
-
getPeers
-
remove
If the peer is in this room, makes the peer leave the room, otherwise it has no effect- Parameters:
peer- any peer
-
equals
-
hashCode
public int hashCode()
-