From: Stefan F. <ste...@we...> - 2012-09-02 13:59:24
|
Erik, thanks, quick replies below. Stefan On 09/02/2012 12:34 PM, Erik Vos wrote: > Hi Stefan, > > A few minor comments: > >> This easily allows to store all kind of CountableItems, for which money is > only >> one example (so in principle it is easy that Rails supports several > currencies). > > Ah good. We still had no way to handle the Tresham-style Company Credits > (1825 et al.). I suppose we now have. This is one possibility: Model the Company Credits as another currency. It is easy to identify for each transaction which currency to use. However I still believe that the easiest way is to use one joint currency and simply modify the end-of-game condition by adding all company treasuries to the bank and check if the bank is broken. If I remember correctly there is no other real game effect from using those Company Credits (all transactions between players and companies are forbidden anyway). > >> To move money from one owner to the other the following static methods >> are used: >> >> Currency.wire(MoneyOwner from, int amount, MoneyOwner to) >> Currency.fromBank(int amount, MoneyOwner to) >> Currency.toBank(MoneyOwner from, int amount) > > I hope the Bank is also a MoneyOwner? Sure Bank is a MoneyOwner (but not the BankPortfolios like IPO). The latter are only short cuts, which do not require a reference to bank to be used. However it might make the code easier to assume that IPO/Pool etc. have their own cash wallet to make the item buying code easier: Then the counterparty of the item transaction is identical to the counterparty of the accompanying cash transaction. A BankMoneyModel would then aggregate the sub-wallets for display and checking the game end condition. I will reconsider that as soon as I break up the Round classes into smaller units. |