On Thu, 15 Aug 2013 17:39:37 +0200
Michael Vehrs <michael.bursc...@gmx.de> wrote:
> Alright. Let's get rid of them. I suggest we split the work along 
> packages. A quick grep shows that there are about 150 call sites, about 
> half of them in the model package. Shall I tackle the model?

Go for it.  I only had a brief look at it today, I think we can cut down
the pain of fixing all the "if (unit.getRole() == Role.SCOUT)..." code by
converting Role.SCOUT et al into String constants
("model.role.scout") and implementing Unit.hasRole(String), turning the
above into "if (unit.hasRole(Role.SCOUT))...".

I reckon a lot of the uses of Role outside the model can get by with just
the role id (all the icon lookup for instance).  Similarly, I think we can
demote Role inside AbstractUnit to just the id, and defer turning it into
a real Role until the AbstractUnit is instantiated.  That gets us around
a really nasty use of the static role to provide a Specification during
input serialization.

Cheers,
Mike Pope

Attachment: 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

Reply via email to