com.swath
Class Planet

java.lang.Object
  extended bycom.swath.Info
      extended bycom.swath.Planet

public final class Planet
extends Info

This class represents a planet in TW.

Since:
SWATH 1.3

Method Summary
 java.lang.String className()
          Gets the planet class name.
 java.lang.Object clone()
           
 int[] colonists()
          Gets the number of colonists at each product type on the planet (Fuel Ore, Organics and Equipment).
 Trader creator()
          Gets the creator of the planet.
 void display()
          Displays this planet in the terminal window.
 void dump()
          Dumps the planet info in the terminal window.
 boolean equals(java.lang.Object obj)
           
 int fighters()
          Gets the number of fighters on the planet.
 boolean hasInterdictor()
          Indicates if the planet has an Interdictor generator or not.
 int id()
          Gets the planet identification number.
 boolean isCorpPlanet()
          Indicates if the planet is corporate or personal.
 boolean isInterdictorActive()
          Indicates if the planet's Interdictor generator is active or not.
 java.util.Date lastUpdate()
          Gets the timestamp when the planet information was last updated.
 int level()
          Gets the current planet level: 0 = No citadel 1 = Citadel 2 = Combat computer 3 = Quasar Cannon 4 = TransWarp drive 5 = Shield generator 6 = Interdictor control
 int militaryLevel()
          Gets the current military reaction level (0-100%).
 java.lang.String name()
          Gets the name of the planet.
 Identity owner()
          Gets the current planet owner.
 PlanetClass planetClass()
          Gets the planet class.
 int[] productAmounts()
          Gets the amount of product for each product type on the planet (Fuel Ore, Organics and Equipment).
 int qcAtmosLevel()
          Gets the Quasar cannon atmospheric level (0-100%).
 int qcSectorLevel()
          Gets the Quasar cannon sector level (0-100%).
 int sector()
          Gets the sector number where the planet is currently located.
 int shields()
          Gets the number of planetary shields. 1 planetary shield equals 10 normal shields.
 java.lang.String toString()
           
 int transportRange()
          Gets the current planet transporter range.
 int treasury()
          Gets the amount of credits in the planet treasury.
 java.lang.String type()
          Gets the planet class type.
 int[] upgradeAmountsNeeded()
          Gets the upgrade amount for each product type and the number of colonists needed for upgrading the planet to the next level.
 int upgradeStatus()
          Gets the current upgrade status of the planet.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object obj)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

id

public int id()
Gets the planet identification number.

Returns:
The planet id.
Since:
SWATH 1.3

lastUpdate

public java.util.Date lastUpdate()
                          throws java.lang.Exception
Gets the timestamp when the planet information was last updated.

Returns:
The last update or null if never updated.
Throws:
java.lang.Exception
Since:
SWATH 1.3

name

public java.lang.String name()
                      throws java.lang.Exception
Gets the name of the planet.

Returns:
The planet name.
Throws:
java.lang.Exception
Since:
SWATH 1.3

type

public java.lang.String type()
                      throws java.lang.Exception
Gets the planet class type.

Returns:
The planet class type.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
planetClass()

className

public java.lang.String className()
                           throws java.lang.Exception
Gets the planet class name.

Returns:
The planet class name.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
planetClass()

planetClass

public PlanetClass planetClass()
                        throws java.lang.Exception
Gets the planet class.

Returns:
The planet class or null if not known.
Throws:
java.lang.Exception
Since:
SWATH 1.6

sector

public int sector()
           throws java.lang.Exception
Gets the sector number where the planet is currently located.

Returns:
The current location or 0 if unknown.
Throws:
java.lang.Exception
Since:
SWATH 1.3

creator

public Trader creator()
               throws java.lang.Exception
Gets the creator of the planet.

Returns:
The planet creator.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
owner(), Trader

owner

public Identity owner()
               throws java.lang.Exception
Gets the current planet owner.

Returns:
The planet owner.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
creator(), isCorpPlanet(), Identity, Trader, Corporation

isCorpPlanet

public boolean isCorpPlanet()
                     throws java.lang.Exception
Indicates if the planet is corporate or personal. If the owner() method returns an unknown identity, the return value of this method is not valid.

Returns:
true if the planet is corporate, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
owner()

colonists

public int[] colonists()
                throws java.lang.Exception
Gets the number of colonists at each product type on the planet (Fuel Ore, Organics and Equipment).

Returns:
An array with the three colonist numbers.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
Swath.FUEL_ORE, Swath.ORGANICS, Swath.EQUIPMENT

productAmounts

public int[] productAmounts()
                     throws java.lang.Exception
Gets the amount of product for each product type on the planet (Fuel Ore, Organics and Equipment).

Returns:
An array with the three product amounts.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
Swath.FUEL_ORE, Swath.ORGANICS, Swath.EQUIPMENT

fighters

public int fighters()
             throws java.lang.Exception
Gets the number of fighters on the planet.

Returns:
The number of fighters.
Throws:
java.lang.Exception
Since:
SWATH 1.3

shields

public int shields()
            throws java.lang.Exception
Gets the number of planetary shields. 1 planetary shield equals 10 normal shields. The return value is only valid if the planet level is 5 or higher.

Returns:
The number of planetary shields.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
level()

treasury

public int treasury()
             throws java.lang.Exception
Gets the amount of credits in the planet treasury. The return value is only valid if the planet level is 1 or higher.

Returns:
The amount of credits.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
level()

level

public int level()
          throws java.lang.Exception
Gets the current planet level:

Returns:
The planet level.
Throws:
java.lang.Exception
Since:
SWATH 1.3

militaryLevel

public int militaryLevel()
                  throws java.lang.Exception
Gets the current military reaction level (0-100%). The return value is only valid if the planet level is 2 or higher.

Returns:
The military reaction level.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
level()

qcAtmosLevel

public int qcAtmosLevel()
                 throws java.lang.Exception
Gets the Quasar cannon atmospheric level (0-100%). The return value is only valid if the planet level is 3 or higher.

Returns:
The QCannon atmospheric level.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
level()

qcSectorLevel

public int qcSectorLevel()
                  throws java.lang.Exception
Gets the Quasar cannon sector level (0-100%). The return value is only valid if the planet level is 3 or higher.

Returns:
The QCannon sector level.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
level()

transportRange

public int transportRange()
                   throws java.lang.Exception
Gets the current planet transporter range.

Returns:
The planet transporter range, or 0 if none.
Throws:
java.lang.Exception
Since:
SWATH 1.3

hasInterdictor

public boolean hasInterdictor()
                       throws java.lang.Exception
Indicates if the planet has an Interdictor generator or not.

Returns:
true if the planet has an Interdictor generator, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
isInterdictorActive()

isInterdictorActive

public boolean isInterdictorActive()
                            throws java.lang.Exception
Indicates if the planet's Interdictor generator is active or not. Only valid if the planet has an Interdictor generator.

Returns:
true if the Interdictor generator is active, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
hasInterdictor()

upgradeStatus

public int upgradeStatus()
                  throws java.lang.Exception
Gets the current upgrade status of the planet.

Returns:
The number of days left of the current planet upgrade, or 0 if the planet is not upgrading.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
upgradeAmountsNeeded(), UpgradePlanet

upgradeAmountsNeeded

public int[] upgradeAmountsNeeded()
                           throws java.lang.Exception
Gets the upgrade amount for each product type and the number of colonists needed for upgrading the planet to the next level. Only valid if the planet is not upgrading and an upgrade attempt using UpgradePlanet has failed.

Returns:
An array with the product amounts and colonists needed for upgrade.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
Swath.FUEL_ORE, Swath.ORGANICS, Swath.EQUIPMENT, Swath.COLONISTS, upgradeStatus(), UpgradePlanet

display

public void display()
             throws java.lang.Exception
Displays this planet in the terminal window.

Throws:
java.lang.Exception
Since:
SWATH 1.4
See Also:
dump()

dump

public void dump()
          throws java.lang.Exception
Dumps the planet info in the terminal window.

Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
display()