public final class Trader extends Identity
Modifier and Type | Method and Description |
---|---|
int |
alignment()
Gets the trader's alignment.
|
java.lang.Object |
clone() |
int |
corp()
Deprecated.
Use the
corporation() method instead. |
Corporation |
corporation()
Gets the trader's corporation.
|
int |
credits()
Gets the amount of credits that the trader has.
|
void |
display()
Displays this trader in the terminal window.
|
void |
dump()
Dumps the trader info in the terminal window.
|
boolean |
equals(java.lang.Object obj)
Compares this trader to another one.
|
int |
experience()
Gets the trader's experience points.
|
int |
id()
Gets the internal trader identification number in SWATH.
|
boolean |
isDockedAtPort()
Indicates if the trader is docked at the port or not.
|
boolean |
isOnline()
Indicates if the trader is online or not.
|
boolean |
isRealPlayer()
Indicates if this is a real player or a computer controlled trader.
|
boolean |
isYou()
Indicates if this is you or not.
|
java.util.Date |
lastUpdate()
Gets the timestamp when the trader information was last updated.
|
java.lang.String |
name()
Gets the name of the trader.
|
Planet |
onPlanet()
If the trader has landed on a planet, this method will return it.
|
int |
rank()
Gets the current rank of the trader.
|
int |
relation()
Gets the current relation between you and this trader.
|
int |
sector()
Gets the sector number where the trader is currently located.
|
Ship |
ship()
Gets the trader's current ship.
|
java.lang.String |
toString() |
int |
turns()
Gets the number of turns that the trader has left.
|
getCorporation, getTrader, isCorporation, isTrader, isUnknown, isYourCorporation
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class Identity
obj
- The other trader.true
if they are equal, otherwise false
.isYou()
,
isRealPlayer()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public int id()
Swath.ID_YOU
,
Swath.ID_NOBODY
,
Swath.ID_UNKNOWN
,
Swath.ID_FEDERAL
,
Swath.ID_FERRENGI
,
Swath.ID_ALIEN
public boolean isYou()
isYou
in class Identity
true
if this is you, otherwise false
.isRealPlayer()
,
equals(Object)
public boolean isRealPlayer()
isRealPlayer
in class Identity
true
if this is a real player, otherwise false
.isYou()
,
equals(Object)
public java.lang.String name() throws java.lang.Exception
java.lang.Exception
public int sector() throws java.lang.Exception
java.lang.Exception
public java.util.Date lastUpdate() throws java.lang.Exception
null
if never updated.java.lang.Exception
public int corp() throws java.lang.Exception
corporation()
method instead.java.lang.Exception
corporation()
public Corporation corporation() throws java.lang.Exception
null
if the trader
is not in a corporation.java.lang.Exception
public int experience() throws java.lang.Exception
java.lang.Exception
public int alignment() throws java.lang.Exception
java.lang.Exception
public int credits() throws java.lang.Exception
java.lang.Exception
public int turns() throws java.lang.Exception
java.lang.Exception
public int rank() throws java.lang.Exception
java.lang.Exception
public int relation() throws java.lang.Exception
java.lang.Exception
Swath.WITH_YOU
,
Swath.ALLIED
,
Swath.NEUTRAL
,
Swath.ENEMY
public Ship ship() throws java.lang.Exception
null
if not known.java.lang.Exception
Ship
public boolean isOnline() throws java.lang.Exception
true
if the trader is online,
otherwise false
.java.lang.Exception
public boolean isDockedAtPort() throws java.lang.Exception
true
if the trader is docked,
otherwise false
.java.lang.Exception
public Planet onPlanet() throws java.lang.Exception
null
if not landed or unknown.java.lang.Exception
public void display() throws java.lang.Exception
java.lang.Exception
dump()
public void dump() throws java.lang.Exception
java.lang.Exception
display()