On 13.08.2013 12:02, Michael T. Pope wrote:
> How should we handle backward compatibility for the roles?
> Specifications in saved games from<= 0.10.5 will not have a<roles>
> section.>= 0.10.6 have a roles section with two bugs: omitted
> model.role.default and model.role.scout does not include the
> captureUnits ability. I can not think of anything better than just
> brutally checking if each role exists or not and doing a hardwired add
> like we do with new options, e.g.
>
> if (spec.getRole("model.role.soldier") == null) {
> Role role = new Role("model.role.soldier", spec);
> role.set...stuff
> spec.addRole(role);
> }
>
> Did you have anything better in mind?
>
> Cheers,
> Mike Pope
>
Unfortunately, I haven't got a better idea, either. However, in the case
of a specification with no roles at all, we could load the roles section
from a spec fragment. That should save some work.
Regards
Michael
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers