games.strategy.engine.data
Class ResourceCollection

java.lang.Object
  extended by games.strategy.engine.data.GameDataComponent
      extended by games.strategy.engine.data.ResourceCollection
All Implemented Interfaces:
java.io.Serializable

public class ResourceCollection
extends GameDataComponent

Version:
1.0
Author:
Sean Bridges
See Also:
Serialized Form

Constructor Summary
ResourceCollection(GameData data)
          Creates new ResourceCollection
 
Method Summary
 void addResource(Resource resource, int quantity)
           
 int getQuantity(Resource resource)
           
 int getQuantity(java.lang.String name)
           
 boolean has(IntegerMap<Resource> map)
           
 void removeResource(Resource resource, int quantity)
          You cannot remove more than the collection contains.
 
Methods inherited from class games.strategy.engine.data.GameDataComponent
getData, readInternal, writeInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCollection

public ResourceCollection(GameData data)
Creates new ResourceCollection

Method Detail

addResource

public void addResource(Resource resource,
                        int quantity)

removeResource

public void removeResource(Resource resource,
                           int quantity)
You cannot remove more than the collection contains.


getQuantity

public int getQuantity(Resource resource)

getQuantity

public int getQuantity(java.lang.String name)

has

public boolean has(IntegerMap<Resource> map)