Package com.tenio.core.entity.implement
Class RoomImpl
java.lang.Object
com.tenio.core.entity.implement.RoomImpl
- All Implemented Interfaces:
Room
An implemented room class is for using in the server.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addProperty
(String key, Object value) boolean
containsPlayerName
(String playerName) boolean
containsProperty
(String key) boolean
int
long
getId()
int
int
getName()
getOwner()
getPlayerByName
(String playerName) getPlayerBySession
(Session session) int
getProperty
(String key) int
getState()
int
hashCode()
boolean
boolean
isEmpty()
boolean
isFull()
boolean
isPublic()
static Room
void
removePlayer
(Player player) void
removeProperty
(String key) void
setActivated
(boolean activated) void
setCapacity
(int maxPlayers, int maxSpectators) void
setMaxPlayers
(int maxPlayers) void
setMaxSpectators
(int maxSpectators) void
void
void
setPassword
(String password) void
setPlayerManager
(PlayerManager playerManager) void
setPlayerSlotGeneratedStrategy
(RoomPlayerSlotGeneratedStrategy roomPlayerSlotGeneratedStrategy) void
setRoomCredentialValidatedStrategy
(RoomCredentialValidatedStrategy roomCredentialValidatedStrategy) void
setRoomRemoveMode
(RoomRemoveMode roomRemoveMode) void
void
switchPlayerToSpectator
(Player player) void
switchSpectatorToPlayer
(Player player, int targetSlot) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tenio.core.entity.Room
addPlayer, addPlayer, clear, switchSpectatorToPlayer
-
Field Details
-
NIL_SLOT
public static final int NIL_SLOT- See Also:
-
DEFAULT_SLOT
public static final int DEFAULT_SLOT- See Also:
-
-
Method Details
-
newInstance
-
getId
public long getId() -
getName
-
setName
-
getPassword
- Specified by:
getPassword
in interfaceRoom
-
setPassword
- Specified by:
setPassword
in interfaceRoom
-
getState
-
setState
-
isPublic
public boolean isPublic() -
getMaxPlayers
public int getMaxPlayers()- Specified by:
getMaxPlayers
in interfaceRoom
-
setMaxPlayers
public void setMaxPlayers(int maxPlayers) - Specified by:
setMaxPlayers
in interfaceRoom
-
getMaxSpectators
public int getMaxSpectators()- Specified by:
getMaxSpectators
in interfaceRoom
-
setMaxSpectators
public void setMaxSpectators(int maxSpectators) - Specified by:
setMaxSpectators
in interfaceRoom
-
getOwner
-
setOwner
-
getPlayerManager
- Specified by:
getPlayerManager
in interfaceRoom
-
setPlayerManager
- Specified by:
setPlayerManager
in interfaceRoom
-
isActivated
public boolean isActivated()- Specified by:
isActivated
in interfaceRoom
-
setActivated
public void setActivated(boolean activated) - Specified by:
setActivated
in interfaceRoom
-
getRoomRemoveMode
- Specified by:
getRoomRemoveMode
in interfaceRoom
-
setRoomRemoveMode
- Specified by:
setRoomRemoveMode
in interfaceRoom
-
getProperty
- Specified by:
getProperty
in interfaceRoom
-
containsProperty
- Specified by:
containsProperty
in interfaceRoom
-
addProperty
- Specified by:
addProperty
in interfaceRoom
-
removeProperty
- Specified by:
removeProperty
in interfaceRoom
-
getCapacity
public int getCapacity()- Specified by:
getCapacity
in interfaceRoom
-
setCapacity
public void setCapacity(int maxPlayers, int maxSpectators) - Specified by:
setCapacity
in interfaceRoom
-
getPlayersList
- Specified by:
getPlayersList
in interfaceRoom
-
getSpectatorsList
- Specified by:
getSpectatorsList
in interfaceRoom
-
getPlayerCount
public int getPlayerCount()- Specified by:
getPlayerCount
in interfaceRoom
-
getSpectatorCount
public int getSpectatorCount()- Specified by:
getSpectatorCount
in interfaceRoom
-
containsPlayerName
- Specified by:
containsPlayerName
in interfaceRoom
-
getPlayerByName
- Specified by:
getPlayerByName
in interfaceRoom
-
getPlayerBySession
- Specified by:
getPlayerBySession
in interfaceRoom
-
getAllPlayersList
- Specified by:
getAllPlayersList
in interfaceRoom
-
getAllSessionList
- Specified by:
getAllSessionList
in interfaceRoom
-
addPlayer
-
removePlayer
- Specified by:
removePlayer
in interfaceRoom
-
switchPlayerToSpectator
- Specified by:
switchPlayerToSpectator
in interfaceRoom
-
switchSpectatorToPlayer
- Specified by:
switchSpectatorToPlayer
in interfaceRoom
-
isEmpty
public boolean isEmpty() -
isFull
public boolean isFull() -
equals
-
hashCode
public int hashCode() -
toString
-
getPlayerSlotGeneratedStrategy
- Specified by:
getPlayerSlotGeneratedStrategy
in interfaceRoom
-
setPlayerSlotGeneratedStrategy
public void setPlayerSlotGeneratedStrategy(RoomPlayerSlotGeneratedStrategy roomPlayerSlotGeneratedStrategy) - Specified by:
setPlayerSlotGeneratedStrategy
in interfaceRoom
-
getRoomCredentialValidatedStrategy
- Specified by:
getRoomCredentialValidatedStrategy
in interfaceRoom
-
setRoomCredentialValidatedStrategy
public void setRoomCredentialValidatedStrategy(RoomCredentialValidatedStrategy roomCredentialValidatedStrategy) - Specified by:
setRoomCredentialValidatedStrategy
in interfaceRoom
-