Re: Restricted use mana
Yew, ManaPool has an ArrayList of Mana but the program often uses a String representation of the cost.ArsenalNut wrote:I am confused. The ManaPool already keeps an ArrayList of Mana objects i.e. floatingMana. ManaPool is the only class that creates Mana objects and all of the methods in Manapool add and remove Mana objects without creating new ones. It's not clear to me how your objects are losing their restrictions.
It would really help if you could share out the code base you're using. Is there something preventing you from posting a patch or checking it into a branch?
What I'm saying is that this should be avoided in favor of a Mana ArrayList for every mana recipient.
In a specific case, when A.I. uses ComputerUtil class to test for its SpellAbility's to be castable checking its mana cost, it substracts the Mana from the player.manapool instance.
This is ok but, when the test is over, ComputerUtil rollbacks this mana recreating the pool, and so each Mana loses any previous restricion.
I'd like to check my code into a branch but I still haven't exactly understood how to
with no restrictions on it in your mana pool and
,