On Sat, 10 Aug 2013 09:35:32 +0200 Michael Vehrs <michael.bursc...@gmx.de> wrote: > Recently, I attempted replacing the current equipment-based model with a > role-based model. The required changes are pervasive and are certain to > introduce any number of bugs. Therefore, I propose a gradual migration. > As a first step, the Role enum could be replaced with a Role class. This > is not too difficult, but provides no immediate benefits. The next step > would be to introduce methods to convert between equipment and roles, so > that all methods getting and setting equipment could be gradually > migrated, starting with the combat model, for example. Does that sound > reasonable?
Perfectly, and it needs to be done as the Unit.Role enum is pretty hacky. Unfortunately I have been making things harder lately by adding new routines therein. Hopefully the results are at least cleaner and expose underlying assumptions. A further change I have in mind is to drop the "equipUnit" message (which does arbitrary equipment changes) in favour of a "changeRole" message which would confine itself to changes between the known role-equipments. The intent being to make role changes effectively atomic to the client, avoiding the possibility of partial equipment changes and then allowing some AI code cleanup. Cheers, Mike Pope
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________ Freecol-developers mailing list Freecol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freecol-developers