From: John D. G. <jd...@di...> - 2012-09-03 01:27:15
|
On 2012-09-02 15:18, Erik Vos wrote: > Your way, nothing should happen if a wallet gets a negative amount. You can > no longer do this check at the lowest level, because the bank only breaks > if the total amount of all its wallets becomes negative, not if any one of > these does. So that kind of check must always be done at a higher (the > owner's) level, as a separate action after each move at a lower level. Not > sure how you are going to manage that. I've been assuming that if you attempt a money move that would make a Wallet negative, it would throw an exception; but the bank's Wallet would be a special case, and would allow the move but set a BankHasBroken flag. |