Class World
- java.lang.Object
-
- org.rspeer.game.adapter.Adapter<RSWorld>
-
- org.rspeer.game.adapter.component.World
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
World.Flag
static class
World.Location
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumSet<World.Flag>
getFlags()
Retrieves the set of flags associated with the world.int
getId()
World.Location
getLocation()
Retrieves the location of the world.int
getMask()
int
getPing()
Retrieves the ping of the current world.int
getPopulation()
Returns the population of the world.static boolean
isMembers()
Checks whether the current world is a members only world.static boolean
isPVP()
-
Methods inherited from class org.rspeer.game.adapter.Adapter
getProvider, validate
-
-
-
-
Constructor Detail
-
World
public World(RSWorld provider)
-
-
Method Detail
-
isMembers
public static boolean isMembers()
Checks whether the current world is a members only world.- Returns:
true
if the current world is a members only world,false
otherwise.
-
isPVP
public static boolean isPVP()
-
getPing
public int getPing()
Retrieves the ping of the current world. A cache is used to prevent excessive ping requests.- Returns:
- The ping of the current world, else -1 if the provider is null or an exception occurs.
-
getMask
public int getMask()
-
getId
public int getId()
-
getPopulation
public int getPopulation()
Returns the population of the world.- Returns:
- the population of the world, or -1 if the provider is null
-
getFlags
public EnumSet<World.Flag> getFlags()
Retrieves the set of flags associated with the world.- Returns:
- An EnumSet containing the flags associated with the world.
-
getLocation
public World.Location getLocation()
Retrieves the location of the world.- Returns:
- The location of the world. Returns
World.Location.US
if the provider is null. - Throws:
IllegalStateException
- if the location is unknown. Please report it.
-
-