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 booleanaddRoom(Room room)adds a room to this locationRoomgetFirstRoom(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.booleanisDestroyed()returns whether room is destroyed or notintnoOfPlayers()returns the total number of players in the locationintnoOfPlayers(RoomType roomtype)returns the total number of players of the given room type in the locationintnoOfRooms()returns the total number of rooms in this locationintnoOfRooms(RoomType roomType)returns the total number of rooms of the given type in this locationintnoOfSpectators()returns the total number of spectators in the locationintnoOfSpectators(RoomType roomtype)returns the total number of spectators of the given room type in the locationintnoOfSpectatorsAndPlayers()returns the total number of spectators and players in the locationintnoOfSpectatorsAndPlayers(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
-