public interface IToon extends IStructView, java.lang.Comparable<IToon>
Although this interface extends IStructView
, an actual instance of IToon
might not be constructed from a key-value structure (map).
Generally it is true that if an IToon
instance is constructed from a key-value structure, the methods of IStructView
can be used, and in this
case the player name will not be present (getPlayerName()
will return null
). Before using the methods of IStructView
, one
should always test if IStructView.getStruct()
returns a non-null value. The player name will be present if an IToon
instance is not
constructed from a key-value structure.
IFactory.newToon(String)
,
IFactory.newToon(String, boolean)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
F_ID
Id field name.
|
static java.lang.String |
F_PROGRAM_ID
Program id field name.
|
static java.lang.String |
F_REALM
Realm field name.
|
static java.lang.String |
F_REGION
Region field name.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IToon t)
Provides an order based on:
region
realm
player id
The player name is not used in comparison.
|
java.lang.Integer |
getId()
Returns the player Id.
|
java.lang.String |
getPlayerName()
Returns the optional player name if present.
|
java.net.URL |
getProfileUrl(hu.scelight.sc2.rep.model.initdata.gamedesc.BnetLang lang,
java.lang.String playerName)
Returns the profile
URL associated with this toon with the specified preferred battle.net language. |
java.net.URL |
getProfileUrl(java.lang.String playerName)
Returns the profile
URL associated with this toon with preferably the user's preferred battle.net language. |
java.lang.String |
getProgramId()
Returns the program id.
|
IRealm |
getRealm()
Returns the realm pointed/specified by this toon (more specifically pointed by the region and realm ids).
|
java.lang.Integer |
getRealmId()
Returns the realm id.
|
IRegion |
getRegion()
Returns the region pointed by this toon (more specifically pointed by the region id).
|
java.lang.Integer |
getRegionId()
Returns the region id.
|
boolean |
isZero()
Tells if this toon is a zero-toon.
|
java.lang.String |
toString()
Produces a string representation in a form of:
If player name is present: regionId-programId-realmId-id-playerName
else:
regionId-programId-realmId-id |
get, get, getStruct
static final java.lang.String F_ID
static final java.lang.String F_PROGRAM_ID
static final java.lang.String F_REALM
static final java.lang.String F_REGION
boolean isZero()
A toon is a zero-toon if all parts are zeros. A toon might be a zero-toon if the controller is Computer or the game was played offline (not on the Battle.net).
java.lang.Integer getRegionId()
java.lang.String getProgramId()
"S2"
(StarCraft II).java.lang.Integer getRealmId()
java.lang.Integer getId()
IRegion getRegion()
java.lang.String getPlayerName()
null
otherwiseIRealm getRealm()
java.net.URL getProfileUrl(java.lang.String playerName)
URL
associated with this toon with preferably the user's preferred battle.net language.playerName
- player name to be included in the URLURL
associated with this toonjava.net.URL getProfileUrl(hu.scelight.sc2.rep.model.initdata.gamedesc.BnetLang lang, java.lang.String playerName)
URL
associated with this toon with the specified preferred battle.net language.
If the specified language is not supported on the region specified by this toon, the region's default language will be used.
lang
- language of the profile page to returnplayerName
- player name to be included in the URLURL
associated with this toonjava.lang.String toString()
regionId-programId-realmId-id-playerName
else:
regionId-programId-realmId-id
Example: "2-S2-1-206154-DakotaFannin"
The produced toon string is exactly in a form that is required by the factory method IFactory.newToon(String)
.
toString
in class java.lang.Object
This API documentation is public and is intended for / allowed to be used by anyone.
Scelight home page: https://sites.google.com/site/scelight/
Scelight is a trademark of András Belicza. Copyright © András Belicza, 2013-2015. All rights reserved.