|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoc.game.SOCResourceSet
This represents a collection of clay, ore, sheep, wheat, and wood resources.
Field Summary | |
static SOCResourceSet |
EMPTY_SET
|
Constructor Summary | |
SOCResourceSet()
Make an empty resource set |
|
SOCResourceSet(int cl,
int or,
int sh,
int wh,
int wo,
int uk)
Make a resource set with stuff in it |
Method Summary | |
void |
add(int amt,
int rtype)
add an amount to a resource |
void |
add(SOCResourceSet rs)
add an entire resource set |
void |
clear()
set the number of resources to zero |
boolean |
contains(SOCResourceSet sub)
|
SOCResourceSet |
copy()
|
boolean |
equals(java.lang.Object anObject)
|
int |
getAmount(int rtype)
|
int |
getTotal()
|
static boolean |
gte(SOCResourceSet a,
SOCResourceSet b)
|
int |
hashCode()
|
static boolean |
lte(SOCResourceSet a,
SOCResourceSet b)
|
void |
setAmount(int amt,
int rtype)
set the amount of a resource |
void |
setAmounts(SOCResourceSet set)
copy a resource set into this one |
void |
subtract(int amt,
int rtype)
subtract an amount from a resource |
void |
subtract(SOCResourceSet rs)
subtract an entire resource set |
java.lang.String |
toShortString()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final SOCResourceSet EMPTY_SET
Constructor Detail |
public SOCResourceSet()
public SOCResourceSet(int cl, int or, int sh, int wh, int wo, int uk)
cl
- number of clay resourcesor
- number of ore resourcessh
- number of sheep resourceswh
- number of wheat resourceswo
- number of wood resourcesuk
- number of unknown resourcesMethod Detail |
public void clear()
public int getAmount(int rtype)
rtype
- the type of resource
public int getTotal()
public void setAmount(int amt, int rtype)
rtype
- the type of resourceamt
- the amountpublic void add(int amt, int rtype)
rtype
- the type of resourceamt
- the amountpublic void subtract(int amt, int rtype)
rtype
- the type of resourceamt
- the amountpublic void add(SOCResourceSet rs)
rs
- the resource setpublic void subtract(SOCResourceSet rs)
rs
- the resource setpublic static boolean gte(SOCResourceSet a, SOCResourceSet b)
a
- set Ab
- set B
public static boolean lte(SOCResourceSet a, SOCResourceSet b)
a
- set Ab
- set B
public java.lang.String toString()
public java.lang.String toShortString()
public boolean contains(SOCResourceSet sub)
sub
- the sub set
public boolean equals(java.lang.Object anObject)
anObject
- the object in question
public int hashCode()
public SOCResourceSet copy()
public void setAmounts(SOCResourceSet set)
set
- the set to copy
|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |