From: Erik V. <eri...@hc...> - 2007-12-21 23:32:12
|
I have implemented the 18AL named trains (a special ability of the M&C private). As usual, this addition of a new special ability has caused some significant side effects. 1. As I believe this ability is unique (or almost unique) to 18AL, I have taken the opportunity to make this the first game-specific extension that is not integrated in the generic code, but in game-specific subclasses. I have put these new subclasses in two new game-specific packages: rails.game.specific._18AL and rails.ui.swing.gamespecific._18AL. Looking back, I think the 1830 M&H/NYC swap is unique to that game, so it might be an idea to take it out of the generic code. I'll gladly leave that as an exercise for someone else. 2. Another new aspect is that the train naming ability does not disappear when the private closes. So I had to implement a new way to make it permanent by moving the special ability object from the private to the company portfolio. 3. Initially I had created a new Move subclass to move the ability object, but it occurred to me that undoable object moves are in fact pretty generic. The new class ObjectMove now handles both token and ability object moves. Perhaps other objects moves can be merged into this class as well. Two new interfaces Moveable and MoveableHolderI support this now generic mechanism. While testing this all, I also found and fixed two bugs in the public company flotation code. BTW I think the term (and class name) SpecialProperty should perhaps be replaced by SpecialAbility, as I find the latter a lot more descriptive. Erik Vos |