com.TeamHEC.LocomotionCommotion.Resource
Class Resource

java.lang.Object
  extended by com.TeamHEC.LocomotionCommotion.Resource.Resource
Direct Known Subclasses:
Fuel, Gold, Score

public abstract class Resource
extends java.lang.Object

Author:
Matthew Taylor The Resource class for which all Resources inherit from (not including Cards).

Constructor Summary
Resource(int value, java.lang.String type)
          The initialiser for Resource.
 
Method Summary
 void addValue(int addVal)
          Adds to value using an integer
 void addValue(Resource addResource)
          Adds to value using another Resource object.
 java.lang.String getType()
           
 int getValue()
           
 void setValue(int value)
           
 void subValue(int subVal)
          Subtracts from value using an integer
 void subValue(Resource subResource)
          Subtracts from value using another Resource object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource(int value,
                java.lang.String type)
The initialiser for Resource.

Parameters:
value - The initial value of the object.
type - The type of resource as a String.
Method Detail

getValue

public int getValue()
Returns:
the amount of the resource

getType

public java.lang.String getType()
Returns:
the type of that resource

setValue

public void setValue(int value)
Parameters:
value - the new value that the resource will be set to

subValue

public void subValue(int subVal)
Subtracts from value using an integer

Parameters:
subVal - An integer representing the amount to subtract from value.

subValue

public void subValue(Resource subResource)
Subtracts from value using another Resource object.

Parameters:
subResource - A Resource object whose value is subtracted from this object's value.

addValue

public void addValue(int addVal)
Adds to value using an integer

Parameters:
addVal - An integer representing the amount to add to value.

addValue

public void addValue(Resource addResource)
Adds to value using another Resource object.

Parameters:
addResource - A Resource object whose value is added to this object's value.