objects
Class Star

java.lang.Object
  |
  +--objects.DrawableGameObject
        |
        +--objects.Star

public final class Star
extends DrawableGameObject

A star. For user defined clients, stars are probably unimportant.

If you write a user defined client, you should not try change this object by calling any of it's setter methods, as it will make your view of the game different from all the other players' views.

Also note that for clients, not all getter methods return usable results, as the server doesn't send everything across. The following information is, however, updated and usable for this class:

Author:
Sverre H. Huseby <shh@thathost.com>

Field Summary
 
Fields inherited from class objects.DrawableGameObject
bounds, dir, loc
 
Constructor Summary
Star()
          Constructs a new star with a random color, and no position.
Star(int x, int y)
          Constructs a new star with random color, and the given position.
Star(int x, int y, java.awt.Color col)
          Constructs a new star with the given position and color.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws the object in the given graphic context.
 java.awt.Color getColor()
          Returns the main color used for drawing this object.
 
Methods inherited from class objects.DrawableGameObject
getBounds, getDirection, getDirectionAsShort, getId, getLocation, setDirection, setDirectionFromShort, setId, setLocation, setLocation, updateBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Star

public Star()
Constructs a new star with a random color, and no position.


Star

public Star(int x,
            int y)
Constructs a new star with random color, and the given position.

Parameters:
x - the x-coordinate.
y - the y-coordinate.

Star

public Star(int x,
            int y,
            java.awt.Color col)
Constructs a new star with the given position and color.

Parameters:
x - the x-coordinate.
y - the y-coordinate.
col - the color.
Method Detail

getColor

public final java.awt.Color getColor()
Returns the main color used for drawing this object.

Returns:
the color.

draw

public final void draw(java.awt.Graphics g)
Description copied from class: DrawableGameObject
Draws the object in the given graphic context. The graphic context controls an Image with the size of the entire world, so the drawing routine doesn't need to displace it's coordinates.

Specified by:
draw in class DrawableGameObject
Parameters:
g - the graphic context.
See Also:
DrawableGameObject