|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.action.context.ManaCost
public class ManaCost
The mana cost context : initial mana cost, mana paid, required mana
Field Summary | |
---|---|
int[] |
manaCost
The initial mana cost. |
int[] |
manaPaid
The mana paid. |
int[] |
requiredMana
The required mana. |
java.util.List<PairIntObject<Test>>[] |
restrictions
The restriction used to paid the mana. |
Constructor Summary | |
---|---|
ManaCost()
Create a new instance of this class. |
Method Summary | |
---|---|
void |
addManaCost(int[] manaCost)
Add a mana cost. |
void |
addRestriction(int color,
Test test,
int amount)
Add a restriction |
boolean |
isNullRequired()
Is the non required mana. |
void |
payMana(int paidColor,
int withColor,
int amount,
ManaPool manas)
Pay a required mana. |
void |
restoreMana(ManaPool manas)
Restore mana paid to the given mana pool |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int[] manaCost
public final int[] requiredMana
public final int[] manaPaid
public java.util.List<PairIntObject<Test>>[] restrictions
Constructor Detail |
---|
public ManaCost()
Method Detail |
---|
public boolean isNullRequired()
public void addRestriction(int color, Test test, int amount)
color
- the restricted colortest
- restriction test to saveamount
- amount of mana removepublic void payMana(int paidColor, int withColor, int amount, ManaPool manas)
paidColor
- the required manawithColor
- the used manaamount
- the amount of mana to removemanas
- the mana poolpublic void restoreMana(ManaPool manas)
manas
- is the mana pool receiving the restored manaspublic void addManaCost(int[] manaCost)
manaCost
- the mana cost to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |