Class Unit

java.lang.Object
  |
  +--Unit
Direct Known Subclasses:
Charactr, MilitaryUnit, Spaceship

public class Unit
extends java.lang.Object

Unit class


Field Summary
protected  int combat
           
protected  Environ environ
           
protected  Group group
           
protected  char groupType
           
protected  boolean isChar
           
protected  boolean moved
           
protected  java.lang.String name
           
protected  Orbit orbit
           
protected  char side
           
protected  char unitType
           
 
Constructor Summary
Unit()
          Constructor Methods
Unit(char s, java.lang.String n, int com, Environ env, Group g)
           
Unit(char side, java.lang.String name, int combat, int nada)
           
 
Method Summary
 int getCombat()
          getCombat() returns the combat ability (int) of the unit
 Environ getEnviron()
          getEnviron() returns the current Environ that the unit is located on
 char getGroupType()
           
 boolean getMoved()
          getMoved() returns true if the unit has moved; false otherwise
 java.lang.String getName()
          getName() returns the name (String) of the unit
 Orbit getOrbit()
          getEnviron() returns the current Environ that the unit is located on
 char getSide()
          getSide() returns the loyalty (char) of the unit
 char getUnitType()
           
 boolean moveFromOrbitBox(Charactr c, Environ newEnv, Group dest)
          moveFromOrbitBox() This method moves a Charactr from an orbit box to an environ.
 boolean moveFromOrbitBox(Charactr c, Orbit newEnv, Group dest)
          moveFromOrbitBox() This method moves a Charactr from an orbit box to another orbit box.
 boolean moveFromOrbitBox(MilitaryUnit m, Environ newEnv)
          moveFromOrbitBox() This moveTo() method moves a military unit from an orbit box to environ.
 boolean moveFromOrbitBox(MilitaryUnit m, Orbit newEnv)
          moveFromOrbitBox() This moveTo() method moves a military unit from an orbit box to another.
 boolean moveFromOrbitBox(Spaceship ship, Environ newEnv, Group dest)
          moveFromOrbitBox() This method moves a spaceship from an orbit box to an environ.
 boolean moveFromOrbitBox(Spaceship ship, Orbit newEnv, Group dest)
          moveFromOrbitBox() This method moves a spaceship from an orbit box to another orbit box.
 boolean moveShip(Spaceship ship, Environ newEnv, Group dest)
          moveShip() The moveShip() method moves a spaceship from one environ to another.
 boolean moveTo(Charactr c, Environ newEnv, Group dest)
          moveTo() This moveTo() method moves a Charactr from one environ to another.
 boolean moveTo(MilitaryUnit m, Environ newEnv)
          moveTo() This moveTo() method moves a military unit from one environ to another.
 boolean moveToOrbitBox(Charactr c, Orbit newEnv, Group dest)
          moveToOrbitBox() This method moves a Charactr from an environ to an orbit box.
 boolean moveToOrbitBox(MilitaryUnit m, Orbit newEnv)
          moveToOrbitBox() This method moves a military unit from an environ to an orbit box.
 boolean moveToOrbitBox(Spaceship ship, Orbit newEnv, Group dest)
          moveToOrbitBox() This method moves a spaceship from an environ to an orbit box.
 boolean reactionMove(Charactr c, Environ newEnv, Group dest)
          reactionMove() This method moves a charactr from one environ to another using the rules for reaction moves.
 boolean reactionMove(MilitaryUnit m, Environ newEnv)
          reactionMove() This method moves a military unit from one environ to another using the rules for reaction moves.
 void setEnviron(Environ newEnv)
           
 void setGroupType(char c)
           
 void setOrbit(Orbit newOrb)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

side

protected char side

groupType

protected char groupType

unitType

protected char unitType

name

protected java.lang.String name

combat

protected int combat

environ

protected Environ environ

orbit

protected Orbit orbit

group

protected Group group

moved

protected boolean moved

isChar

protected boolean isChar
Constructor Detail

Unit

public Unit()
Constructor Methods


Unit

public Unit(char side,
            java.lang.String name,
            int combat,
            int nada)

Unit

public Unit(char s,
            java.lang.String n,
            int com,
            Environ env,
            Group g)
Method Detail

getSide

public char getSide()
getSide() returns the loyalty (char) of the unit


getName

public java.lang.String getName()
getName() returns the name (String) of the unit


getMoved

public boolean getMoved()
getMoved() returns true if the unit has moved; false otherwise


getCombat

public int getCombat()
getCombat() returns the combat ability (int) of the unit


getEnviron

public Environ getEnviron()
getEnviron() returns the current Environ that the unit is located on


getOrbit

public Orbit getOrbit()
getEnviron() returns the current Environ that the unit is located on


setEnviron

public void setEnviron(Environ newEnv)

setOrbit

public void setOrbit(Orbit newOrb)

getGroupType

public char getGroupType()

getUnitType

public char getUnitType()

setGroupType

public void setGroupType(char c)

moveShip

public boolean moveShip(Spaceship ship,
                        Environ newEnv,
                        Group dest)
moveShip() The moveShip() method moves a spaceship from one environ to another. takes a spaceship, a destination environ, and a destination group returns true if move successful; false otherwise


moveTo

public boolean moveTo(MilitaryUnit m,
                      Environ newEnv)
moveTo() This moveTo() method moves a military unit from one environ to another. takes a military unit and destination environ returns true if move successful; false otherwise


moveTo

public boolean moveTo(Charactr c,
                      Environ newEnv,
                      Group dest)
moveTo() This moveTo() method moves a Charactr from one environ to another. takes a Charactr, destination environ, destination Group returns true if move successful; false otherwise


reactionMove

public boolean reactionMove(MilitaryUnit m,
                            Environ newEnv)
reactionMove() This method moves a military unit from one environ to another using the rules for reaction moves. The environ being moved to must be on the same planet as the unit's current environ. Takes a military unit and an environ. returns true if move successful; false otherwise


reactionMove

public boolean reactionMove(Charactr c,
                            Environ newEnv,
                            Group dest)
reactionMove() This method moves a charactr from one environ to another using the rules for reaction moves. The environ being moved to must be on the same planet as the unit's current environ. Takes a charactr, an environ, and a Group. returns true if move successful; false otherwise


moveFromOrbitBox

public boolean moveFromOrbitBox(MilitaryUnit m,
                                Environ newEnv)
moveFromOrbitBox() This moveTo() method moves a military unit from an orbit box to environ. takes a military unit and destination environ returns true if move successful; false otherwise


moveFromOrbitBox

public boolean moveFromOrbitBox(Charactr c,
                                Environ newEnv,
                                Group dest)
moveFromOrbitBox() This method moves a Charactr from an orbit box to an environ. takes a Charactr, destination environ, destination Group returns true if move successful; false otherwise


moveFromOrbitBox

public boolean moveFromOrbitBox(Spaceship ship,
                                Environ newEnv,
                                Group dest)
moveFromOrbitBox() This method moves a spaceship from an orbit box to an environ. takes a spaceship, a destination environ, and a destination group returns true if move successful; false otherwise


moveFromOrbitBox

public boolean moveFromOrbitBox(MilitaryUnit m,
                                Orbit newEnv)
moveFromOrbitBox() This moveTo() method moves a military unit from an orbit box to another. orbit box. takes a military unit and destination orbit returns true if move successful; false otherwise


moveFromOrbitBox

public boolean moveFromOrbitBox(Charactr c,
                                Orbit newEnv,
                                Group dest)
moveFromOrbitBox() This method moves a Charactr from an orbit box to another orbit box. takes a Charactr, destination orbit, destination Group returns true if move successful; false otherwise


moveFromOrbitBox

public boolean moveFromOrbitBox(Spaceship ship,
                                Orbit newEnv,
                                Group dest)
moveFromOrbitBox() This method moves a spaceship from an orbit box to another orbit box. takes a spaceship, a destination orbit, and a destination group returns true if move successful; false otherwise


moveToOrbitBox

public boolean moveToOrbitBox(MilitaryUnit m,
                              Orbit newEnv)
moveToOrbitBox() This method moves a military unit from an environ to an orbit box. orbit box. takes a military unit and destination orbit returns true if move successful; false otherwise


moveToOrbitBox

public boolean moveToOrbitBox(Charactr c,
                              Orbit newEnv,
                              Group dest)
moveToOrbitBox() This method moves a Charactr from an environ to an orbit box. takes a Charactr, destination orbit, destination Group returns true if move successful; false otherwise


moveToOrbitBox

public boolean moveToOrbitBox(Spaceship ship,
                              Orbit newEnv,
                              Group dest)
moveToOrbitBox() This method moves a spaceship from an environ to an orbit box. takes a spaceship, a destination orbit, and a destination group returns true if move successful; false otherwise