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, isYourCorporationpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class Identityobj - 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_ALIENpublic boolean isYou()
isYou in class Identitytrue if this is you, otherwise false.isRealPlayer(),
equals(Object)public boolean isRealPlayer()
isRealPlayer in class Identitytrue if this is a real player, otherwise false.isYou(),
equals(Object)public java.lang.String name()
throws java.lang.Exception
java.lang.Exceptionpublic int sector()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Date lastUpdate()
throws java.lang.Exception
null if never updated.java.lang.Exceptionpublic int corp()
throws java.lang.Exception
corporation() method instead.java.lang.Exceptioncorporation()public Corporation corporation() throws java.lang.Exception
null if the trader
is not in a corporation.java.lang.Exceptionpublic int experience()
throws java.lang.Exception
java.lang.Exceptionpublic int alignment()
throws java.lang.Exception
java.lang.Exceptionpublic int credits()
throws java.lang.Exception
java.lang.Exceptionpublic int turns()
throws java.lang.Exception
java.lang.Exceptionpublic int rank()
throws java.lang.Exception
java.lang.Exceptionpublic int relation()
throws java.lang.Exception
java.lang.ExceptionSwath.WITH_YOU,
Swath.ALLIED,
Swath.NEUTRAL,
Swath.ENEMYpublic Ship ship() throws java.lang.Exception
null if not known.java.lang.ExceptionShippublic boolean isOnline()
throws java.lang.Exception
true if the trader is online,
otherwise false.java.lang.Exceptionpublic boolean isDockedAtPort()
throws java.lang.Exception
true if the trader is docked,
otherwise false.java.lang.Exceptionpublic Planet onPlanet() throws java.lang.Exception
null if not landed or unknown.java.lang.Exceptionpublic void display()
throws java.lang.Exception
java.lang.Exceptiondump()public void dump()
throws java.lang.Exception
java.lang.Exceptiondisplay()