public class Target extends LocationObject
Modifier and Type | Field and Description |
---|---|
protected int |
capacity
The actual available capacity.
|
protected static int |
cnt
A static instance count.
|
protected int |
initialcapacity
The max.
|
protected boolean |
marked
Was the target visited.
|
protected int |
ore
The currently available ore amount.
|
id, location
Constructor and Description |
---|
Target()
Create a new target.
|
Target(Location loc,
int initialcapacity)
Create a new target.
|
Modifier and Type | Method and Description |
---|---|
int |
getCapacity()
Getter for capacity
|
int |
getInitialcapacity()
Getter for initialcapacity
|
int |
getOre()
Get the amount of ore.
|
int |
getOreCapacity()
Get the capacity of ore.
|
boolean |
isMarked()
Test if target was visited.
|
boolean |
isOre()
Test if target can produce some ore.
|
void |
produceOre(int ore)
Change the amount of ore at the Location
|
int |
retrieveOre(int amount)
Retrieve some ore amount.
|
void |
setCapacity(int capacity)
Setter for capacity.
|
void |
setInitialcapacity(int initialcapacity)
Setter for initialcapacity.
|
void |
setMarked()
Mark this target as visited.
|
void |
setMarked(boolean marked)
Setter for marked.
|
void |
setOre(int ore)
Setter for ore.
|
java.lang.String |
toString()
Convert the Location to a string representation.
|
equals, getId, getLocation, hashCode, setId, setLocation
protected int ore
protected int initialcapacity
protected int capacity
protected boolean marked
protected static int cnt
public Target()
public Target(Location loc, int initialcapacity)
public void produceOre(int ore)
ore
- The produced ore.public int retrieveOre(int amount)
amount
- The amount.public int getOreCapacity()
public int getOre()
public void setMarked()
public boolean isMarked()
public boolean isOre()
public int getCapacity()
public void setCapacity(int capacity)
capacity
- The Target.java value to setpublic int getInitialcapacity()
public void setInitialcapacity(int initialcapacity)
initialcapacity
- The Target.java value to setpublic void setMarked(boolean marked)
marked
- The Target.java value to setpublic void setOre(int ore)
ore
- The Target.java value to setpublic java.lang.String toString()
toString
in class LocationObject