ResourceNode

public class ResourceNode extends Target implements Cloneable

A subtype of Target that contains all information of a resource.

Constructors

ResourceNode

public ResourceNode(Type type, int xPosition, int yPosition, int initialAmount, int ID)

Methods

clone

protected Object clone()

copyOf

public ResourceNode copyOf()

deepEquals

public boolean deepEquals(Object other)

equals

public boolean equals(Object o)

getAmountRemaining

public int getAmountRemaining()

getID

public int getID()

getResourceType

public ResourceType getResourceType()

getType

public Type getType()

getView

public ResourceView getView()

getxPosition

public int getxPosition()

getyPosition

public int getyPosition()

hashCode

public int hashCode()

reduceAmountRemaining

public int reduceAmountRemaining(int amount)

Try to pick some resources out of this node

Parameters:
  • amount
Returns:

The amount of resources successfully removed from the node