Class Planet

java.lang.Object
  |
  +--Planet

public class Planet
extends java.lang.Object


Constructor Summary
Planet(int i, java.lang.String nam, char p, int sr, int a, int n, Environ[] environList, Orbit orbit)
          Constructor Method
Planet(int i, java.lang.String nam, java.lang.String r, int sr, int a, int n, Environ[] environList, Orbit orbit)
          Constructor Method
 
Method Summary
 void checkActualControl()
          checkActualControl() Checks and Modifies which Player has Actual Control
 void checkPlanetControl()
          checkPlanetControl() Checks and Modifies which Player has Planet Control
 java.util.Vector ChoiceList(java.util.Vector availablePlanets, int shift)
          ChoiceList(Vector, int)
 void deLoyalty(int shift)
          deLoyalty(int) Applies Domino Effect if Loyalty Shift is more then 2
static Planet get(int id)
          get(int) Returns Planet with matching ID
static Planet get(java.lang.String s)
          get(String) Returns Planet matching Name
 int getActualControl()
          getActualControl() returns who actually controls the planet
 boolean getdeAvailable()
          getdeAvailable() Returns if able to apply Domino Effect
 java.util.Vector getEnvirons()
          getEnvirons() returns a vector containing all the environs on the lanet
 int getID()
          getID() returns the ID number
 boolean getisPDBUp()
          getPDBState() returns whether the PDB is up or down
 int getLoyalty()
          getLoyalty() returns the loyalty level of the planet
 java.lang.String getName()
          getPlanet() returns the Planet name
 int getNumEnvirons()
          numEnvirons() returns the number of environs (int) on the planet
 Orbit getOrbit()
           
 int getPDBLevel()
          getPDBLevel() returns the PDB level of the planet
 int getPlanetControl()
          getPlanetControl() returns the planet's state
 Environ[] getPlanetEnvirons()
          getPlanetEnvirons() returns an array (as opposed to a vector) of contained environs
 java.util.Vector getPlanetStarFaringRaces()
          getPlanetStarFaringRaces() Returns a list of StarFaring Races on Planet
 int getRebellionState()
          getRebellionState() returns the Rebellion state
 StarSystem getSystem()
          getSystem() returns the Planet's StarSystem
 boolean hasMissionChars(char side)
          hasMissionChars() decides whether the planet has characters on it on the selected side
 boolean hasRace(java.lang.String race)
          hasRace(String) Returns if a race is on a planet
static void imperialControl()
           
static void init()
          init() Intializes all planets
 void isInSystem(StarSystem s)
          StarSystem calls this when it is being created, please do not call it!
 boolean PDBdetectionRoutine(Spaceship ship)
           
static void rebelControl()
           
static void rebellionStoppedControl()
           
 void setActualControl(int newActualControl)
          setActualControl(int) Sets new actual control
 void setdeAvailable(boolean change)
          setdeAvailable() Returns if able to apply Domino Effect
static void setisPDBUp(boolean newPDBState)
          setPDBState(boolean) Raises or lowers the PDB
 void setLoyalty(int newLoyalty)
          setLoyalty(int) sets the loyalty level of the planet
static void setPDBLevel(int newPDBLevel)
          setPDBLevel(int) sets the PDB level of the planet
 void setPlanetControl(int newPlanetControl)
          setPlanetControl(int) sets new control of planet
 void setRebellion()
          setRebellion(); sets a planets state such that the planet is in rebellion
 void setRebellionState(int newRebellionState)
          setRebellionState(int) sets the Rebellion state
static void startRebellionControl()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Planet

public Planet(int i,
              java.lang.String nam,
              java.lang.String r,
              int sr,
              int a,
              int n,
              Environ[] environList,
              Orbit orbit)
Constructor Method

Parameters:
i - Planet ID
nam - Planet Name
a - Armagedon Loyalty
n - No. of Environ

Planet

public Planet(int i,
              java.lang.String nam,
              char p,
              int sr,
              int a,
              int n,
              Environ[] environList,
              Orbit orbit)
Constructor Method

Parameters:
i - Planet ID
nam - Planet Name
p - Political Status
a - Armagedon Loyalty
n - No. of Environ
Method Detail

get

public static Planet get(int id)
get(int) Returns Planet with matching ID

Parameters:
id - Planet's ID Number
Returns:
Matching Planet

get

public static Planet get(java.lang.String s)
get(String) Returns Planet matching Name

Parameters:
s - Planet Name
Returns:
Planet

getName

public java.lang.String getName()
getPlanet() returns the Planet name

Returns:
Planet's Name

getID

public int getID()
getID() returns the ID number

Returns:
Planet's ID Number

getNumEnvirons

public int getNumEnvirons()
numEnvirons() returns the number of environs (int) on the planet

Returns:
Number of Environs on Planet

getEnvirons

public java.util.Vector getEnvirons()
getEnvirons() returns a vector containing all the environs on the lanet

Returns:
Vector of Environs

getPlanetEnvirons

public Environ[] getPlanetEnvirons()
getPlanetEnvirons() returns an array (as opposed to a vector) of contained environs


getSystem

public StarSystem getSystem()
getSystem() returns the Planet's StarSystem

Returns:
Planet's StarSystem

getOrbit

public Orbit getOrbit()

isInSystem

public void isInSystem(StarSystem s)
StarSystem calls this when it is being created, please do not call it!


imperialControl

public static void imperialControl()

startRebellionControl

public static void startRebellionControl()

rebelControl

public static void rebelControl()

rebellionStoppedControl

public static void rebellionStoppedControl()

getPlanetControl

public int getPlanetControl()
getPlanetControl() returns the planet's state

Returns:
0 - Imperial Control, 1 - Rebellion, 2 - Rebel Control, 3 - Rebellion Stopped

getActualControl

public int getActualControl()
getActualControl() returns who actually controls the planet

Returns:
0 - Imperial, 1 - Neither, 2 - Rebel

getLoyalty

public int getLoyalty()
getLoyalty() returns the loyalty level of the planet

Returns:
-2 Patriotic, -1 Loyal, 0 Neutral, 1 Dissent, 2 Unrest

getPDBLevel

public int getPDBLevel()
getPDBLevel() returns the PDB level of the planet

Returns:
Negative - Imperial Controlled PDB, Positive - Rebel Controlled PDB

getisPDBUp

public boolean getisPDBUp()
getPDBState() returns whether the PDB is up or down

Returns:
True - PDB Raised, False - PDB Lowered

getRebellionState

public int getRebellionState()
getRebellionState() returns the Rebellion state

Returns:
0 - None, 1 - Rebellion Start, 2 - Rebellion Stopped

getdeAvailable

public boolean getdeAvailable()
getdeAvailable() Returns if able to apply Domino Effect

Returns:
True - Available, False - Unavailable

setPlanetControl

public void setPlanetControl(int newPlanetControl)
setPlanetControl(int) sets new control of planet


setActualControl

public void setActualControl(int newActualControl)
setActualControl(int) Sets new actual control


setLoyalty

public void setLoyalty(int newLoyalty)
setLoyalty(int) sets the loyalty level of the planet


setPDBLevel

public static void setPDBLevel(int newPDBLevel)
setPDBLevel(int) sets the PDB level of the planet

Parameters:
newPDBLevel - New PDB Level

setisPDBUp

public static void setisPDBUp(boolean newPDBState)
setPDBState(boolean) Raises or lowers the PDB

Parameters:
newPDBState - True - Raise Shield, False - Lower Shield

setRebellionState

public void setRebellionState(int newRebellionState)
setRebellionState(int) sets the Rebellion state

Parameters:
newRebellionState - 0 - None, 1 - Rebellion Start, 2 - Rebellion Stopped

setRebellion

public void setRebellion()
setRebellion(); sets a planets state such that the planet is in rebellion


setdeAvailable

public void setdeAvailable(boolean change)
setdeAvailable() Returns if able to apply Domino Effect

Returns:
True - Available, False - Unavailable

checkPlanetControl

public void checkPlanetControl()
checkPlanetControl() Checks and Modifies which Player has Planet Control


checkActualControl

public void checkActualControl()
checkActualControl() Checks and Modifies which Player has Actual Control


deLoyalty

public void deLoyalty(int shift)
deLoyalty(int) Applies Domino Effect if Loyalty Shift is more then 2

Parameters:
shift - -1 - Imperial Favored Shift, 1 - Rebel Favored Shift

ChoiceList

public java.util.Vector ChoiceList(java.util.Vector availablePlanets,
                                   int shift)
ChoiceList(Vector, int)

Parameters:
availablePlanets - List (Vector) of planets available for Domino Effect
shift - -1 Imperial Favor, 1 Rebel Favor
Returns:
List (Vector) of choices for DominoGUI

getPlanetStarFaringRaces

public java.util.Vector getPlanetStarFaringRaces()
getPlanetStarFaringRaces() Returns a list of StarFaring Races on Planet

Returns:
Vector of StarFaring Races

hasRace

public boolean hasRace(java.lang.String race)
hasRace(String) Returns if a race is on a planet

Parameters:
race - Race searching for
Returns:
True - On Planet, False - Not on Planet

hasMissionChars

public boolean hasMissionChars(char side)
hasMissionChars() decides whether the planet has characters on it on the selected side


init

public static void init()
init() Intializes all planets


PDBdetectionRoutine

public boolean PDBdetectionRoutine(Spaceship ship)