Click here to Skip to main content
15,884,629 members
Articles / Programming Languages / JScript .NET

Star Trek "Galactic Conquest" Game Contest Submission (Java)

Rate me:
Please Sign up or sign in to vote.
4.27/5 (6 votes)
6 Aug 2008CPOL3 min read 53.2K   951   25  
Star Trek "Galactic Conquest" Game Contest Submission (Java)
/**
 * 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Nottawasaga Valley Conservation Authority
Canada Canada
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.

Comments and Discussions