org.deken.game.map
Class GameLocation

java.lang.Object
  extended by org.deken.game.map.GameLocation

public class GameLocation
extends java.lang.Object

Title: GameLocation

Description: This holds the X and Y location of a Sprite, and it layer (or depth). The layer is used to set which game pieces are draw first, image below others, and which is drawn last, image on top, for a given map location.

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Gary Deken

Field Summary
 int layer
           
 double x
           
 int xOffset
           
 double y
           
 int yOffset
           
 
Constructor Summary
GameLocation()
          GameLocation
GameLocation(double x, double y)
           
GameLocation(double x, double y, int layer)
           
 
Method Summary
 void adjust(double adjX, double adjY, int adjLayer)
           
 void adjustLayer(int adjLayer)
          Change the Layer by adjLayer amount.
 void adjustX(double adjX)
          Change the X by adjX amount
 void adjustY(double adjY)
          Change the Y by adjY amount
 GameLocation copy()
           
 boolean equals(java.lang.Object obj)
           
 int getLayer()
          getLayer
 double getX()
           
 int getXOffset()
           
 double getY()
          getY
 int getYOffset()
           
 int hashCode()
           
 void setLayer(int layer)
          setLayer
 void setLocation(double x, double y, int layer)
          Sets all three locations.
 void setX(double x)
          setX
 void setXOffset(int xOffset)
           
 void setY(double y)
          setY
 void setYOffset(int yOffset)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

layer

public int layer

x

public double x

y

public double y

xOffset

public int xOffset

yOffset

public int yOffset
Constructor Detail

GameLocation

public GameLocation()
GameLocation


GameLocation

public GameLocation(double x,
                    double y)
Parameters:
x - double
y - double

GameLocation

public GameLocation(double x,
                    double y,
                    int layer)
Parameters:
x - double
y - double
layer - int
Method Detail

adjust

public void adjust(double adjX,
                   double adjY,
                   int adjLayer)

adjustLayer

public void adjustLayer(int adjLayer)
Change the Layer by adjLayer amount.

Parameters:
adjLayer -

adjustX

public void adjustX(double adjX)
Change the X by adjX amount

Parameters:
adjX -

adjustY

public void adjustY(double adjY)
Change the Y by adjY amount

Parameters:
adjY -

copy

public GameLocation copy()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getX

public double getX()
Returns:
double

getY

public double getY()
getY

Returns:
double

getLayer

public int getLayer()
getLayer

Returns:
int

getXOffset

public int getXOffset()

getYOffset

public int getYOffset()

setX

public void setX(double x)
setX

Parameters:
x - double

setY

public void setY(double y)
setY

Parameters:
y - double

setLayer

public void setLayer(int layer)
setLayer

Parameters:
layer - int

setLocation

public void setLocation(double x,
                        double y,
                        int layer)
Sets all three locations.

Parameters:
x -
y -
layer -

setXOffset

public void setXOffset(int xOffset)

setYOffset

public void setYOffset(int yOffset)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object