|
/**
* Smallest part of the Galaxy is the Sector.
*
* @author Robert Bettinelli
* @version 1.0.0
*/
public class Sector
{
// Sector Info.
private String sector;
private int sheild;
private boolean isEnemy;
/**
* Sector Defualts to '.' (Empty Space)
*/
public Sector()
{
// initialise instance variables
sector = ".";
isEnemy = false;
sheild = 75;
}
/**
* getSector - Whats in space.
*
* @return Sector - Contents of Sector in space.
*/
public String getSector()
{
return sector;
}
/**
* getSheild - Strength of Sheild of Enemy @ Location
*
* @return sheild
*/
public int getSheild()
{
return sheild;
}
/**
* setSheild - Strength of Sheild of Enemy @ Location
*
* @param sheildValue
*/
public void setSheild(int sheildValue)
{
sheild = sheildValue;
}
/**
* hitSheild - Reduce strength of Sheild of Enemy @ Location
*
* @param hitSheild
*/
public void hitSheild(int hitSheild)
{
sheild -= hitSheild;
}
/**
* isEnemy - space occupied by Enemy
*
* @return isEnemy
*/
public boolean isEnemy()
{
return isEnemy;
}
/**
* setSector - Change contents of sector in space.
*
* @param space Contents of space.
*/
public void setSector(String space)
{
sector = space;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have background in programming(many languages), web design, hardware and software. Currently I hold a lead database programming position for the Nottawasaga Valley Conservation Authority... Programming in vb.net and java comes 2nd nature to me and of course I do this for fun. I also used to design in cobol and pascal and run a BBS(anyone remember what this was?). Anyways, drop me a line maybe I can help you.