Class Package

java.lang.Object
  |
  +--IdentifiedWithPosition
        |
        +--Package

public class Package
extends IdentifiedWithPosition

This class is the abstraction of a game package


Field Summary
private  int w
          The weight of the pack
 
Fields inherited from class IdentifiedWithPosition
id, x_pos, y_pos
 
Constructor Summary
Package()
          Default constructor
Package(int id, int weight)
          makes a package with given id and weight
Package(int id, int x, int y, int weight)
          makes a new package with the given parameters
 
Method Summary
 void setWeight(int weight)
          sets the weight of the package
 int weight()
          Returns the weight of the package
 
Methods inherited from class IdentifiedWithPosition
id, setId, setPos, setX, setY, x, y
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

w

private int w
The weight of the pack
Constructor Detail

Package

public Package(int id,
               int x,
               int y,
               int weight)
makes a new package with the given parameters
Parameters:
id - identifier asociated
x - x position of package's destination
y - y position of package's destination
weight - weight of the package

Package

public Package(int id,
               int weight)
makes a package with given id and weight
Parameters:
id - identifier
weight - weight asociated

Package

public Package()
Default constructor
Method Detail

setWeight

public void setWeight(int weight)
sets the weight of the package
Parameters:
weight - the new weight

weight

public int weight()
Returns the weight of the package
Returns:
the weight of the package