Package io.sockit.gameserver
Class Location
java.lang.Object
io.sockit.gameserver.Location
public class Location extends Object
A container for Game rooms. A set of rooms can be grouped into a location
-
Field Summary
-
Method Summary
Modifier and Type Method Description boolean
addRoom(Room room)
adds a room to this locationRoom
getFirstRoom(RoomType type)
returns the first room of the given type in this locationCollection<Room>
getRooms(RoomType roomType)
returns all the rooms of the given type in this location.boolean
isDestroyed()
returns whether room is destroyed or notint
noOfPlayers()
returns the total number of players in the locationint
noOfPlayers(RoomType roomtype)
returns the total number of players of the given room type in the locationint
noOfRooms()
returns the total number of rooms in this locationint
noOfRooms(RoomType roomType)
returns the total number of rooms of the given type in this locationint
noOfSpectators()
returns the total number of spectators in the locationint
noOfSpectators(RoomType roomtype)
returns the total number of spectators of the given room type in the locationint
noOfSpectatorsAndPlayers()
returns the total number of spectators and players in the locationint
noOfSpectatorsAndPlayers(RoomType roomtype)
returns the total number of spectators and players of the given room type in the location
-
Field Details
-
Method Details
-
getFirstRoom
returns the first room of the given type in this location- Parameters:
type
- - the type of the room- Returns:
- Room - the first room of the given type in this location
-
addRoom
adds a room to this location- Parameters:
room
- - the room to add- Returns:
- boolean - true if room added successfully else false
-
getRooms
returns all the rooms of the given type in this location. Override the compareTo method of the Room class to set the order of the rooms- Parameters:
roomType
- - the room type- Returns:
- Collection<Room> - all the rooms of the given type in this location
-
noOfRooms
public final int noOfRooms()returns the total number of rooms in this location- Returns:
- int - the total number of rooms in this location
-
noOfRooms
returns the total number of rooms of the given type in this location- Parameters:
roomType
- - the room type- Returns:
- int - the total number of rooms of the given type in this location
-
noOfSpectatorsAndPlayers
public final int noOfSpectatorsAndPlayers()returns the total number of spectators and players in the location- Returns:
- int - the total number of spectators and players in the location
-
noOfPlayers
public final int noOfPlayers()returns the total number of players in the location- Returns:
- int - the total number of players in the location
-
noOfSpectators
public final int noOfSpectators()returns the total number of spectators in the location- Returns:
- int - the total number of spectators in the location
-
noOfSpectatorsAndPlayers
returns the total number of spectators and players of the given room type in the location- Parameters:
roomtype
- - the room type- Returns:
- int - the total number of spectators and players of the given room type in the location
-
noOfPlayers
returns the total number of players of the given room type in the location- Parameters:
roomtype
- - the room type- Returns:
- int - the total number of players of the given room type in the location
-
noOfSpectators
returns the total number of spectators of the given room type in the location- Parameters:
roomtype
- - the room type- Returns:
- int - the total number of spectators of the given room type in the location
-
isDestroyed
public boolean isDestroyed()returns whether room is destroyed or not- Returns:
- boolean - true if room is destroyed else false
-