|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.universe.DBItem | +--org.gjt.universe.FleetBase
Abstract base class for representing a group of ships moving together or stationed in the same location.
Field Summary | |
private static FleetID |
currentID
|
private FleetID |
ID
|
private Location |
location
|
private java.lang.String |
name
|
private CivID |
owner
|
private VectorShipID |
ships
|
Constructor Summary | |
protected |
FleetBase()
This method creates the special undefined fleet. |
protected |
FleetBase(CivID AID,
java.lang.String in_name,
Location loc)
This method is the designated constructor for instances of this class. |
Method Summary | |
void |
addShip(ShipID HID)
This method adds the ship with the given unique ID to the fleet, removing it from any other fleet to which it might have previously belonged. |
protected void |
announceCreation()
This method announces, via a notification posted on the default notification center that the instance exists. |
boolean |
colonize(PlanetID PID)
This method causes the receiving fleet to attempt to colonize the planet with the given ID using one of the colonization ships present in the fleet. |
FleetID |
getID()
This method returns the unique ID of the fleet. |
static FleetID |
getID(java.lang.String in_name)
This method looks up a fleet by its name. |
Index |
getIndex()
This method is present for compatibility reasons. |
Location |
getLocation()
This method returns the current location of the fleet. |
java.lang.String |
getName()
Returns the name of the fleet that should be shown in the UI |
CivID |
getOwner()
|
VectorShipID |
getShips()
This method returns a vector containing the IDs all of the ships in the fleet. |
int |
getSize()
Returns the number of ships in the fleet. |
SpeedBase |
getSpeed()
This method returns the speed of the fleet. |
boolean |
isColonizable()
This method returns true if one or more of the ships in the fleet is capable of creating a colony. |
boolean |
move(Location destination)
This method moves the fleet to the specified location. |
void |
removeShip(ShipID HID)
This method removes the ship with the given ID from the fleet. |
void |
setLocation(Location newValue)
This method sets the current location of the fleet. |
void |
setName(java.lang.String new_name)
Sets the name of the fleet that should be shown in the UI. |
boolean |
transitWormhole(Wormhole wormhole)
This method transits the fleet through the specified wormhole through the end-point at the current location and though to the star system on the other side. |
Methods inherited from class org.gjt.universe.DBItem |
specificDisplayDebug |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static FleetID currentID
private FleetID ID
private CivID owner
private java.lang.String name
private VectorShipID ships
private Location location
Constructor Detail |
protected FleetBase(CivID AID, java.lang.String in_name, Location loc)
AID
- The unique ID of the civ who owns the fleet.in_name
- The name of the fleet (as shown in the UI)loc
- The initial location of the fleet.protected FleetBase()
Method Detail |
protected void announceCreation()
public FleetID getID()
public Index getIndex()
getIndex
in class DBItem
public static FleetID getID(java.lang.String in_name)
public java.lang.String getName()
getName
in class DBItem
public void setName(java.lang.String new_name)
public CivID getOwner()
getOwner
in class DBItem
public Location getLocation()
getLocation
in class DBItem
public void setLocation(Location newValue)
newValue
- The new location of the fleet.public VectorShipID getShips()
public void addShip(ShipID HID)
HID
- The ID of the ship to be inserted.public void removeShip(ShipID HID)
HID
- The unique ID of the ship to be removed from the fleet.public int getSize()
public SpeedBase getSpeed()
public boolean move(Location destination)
public boolean transitWormhole(Wormhole wormhole)
wormhole
- The wormhole to be transited.
public boolean isColonizable()
public boolean colonize(PlanetID PID)
PID
- The unique ID of the planet to be colonized.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |