Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: Elementarization of Unit Properties
Home

[Freeciv-Dev] Re: Elementarization of Unit Properties

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Andrew Sutton <ansutton@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Elementarization of Unit Properties
From: Jörg Zuther <zuther.joerg@xxxxxxxxx>
Date: Thu, 17 Jan 2002 22:38:09 +0100

On Mon, 14 Jan 2002 09:46:19 -0500, Andrew Sutton wrote:
> 
> > 1. Elementarization of unit poperties:
> >
> >    Many properties/abilities are organized as a bunch, i.e.
> >    (see unittype.h/enum unit_flag_id)
> >    F_SETTLERS (contains all the worker abilities like irrigation,
> >                roads, mines, removing pollution, etc.)
> >    F_CARAVAN (contains helping wonders, establishing trade routes)
> >    F_DIPLOMAT (contains all diplomatic abilities)
> 
> i wrote a patch some time ago that implemented a framework for doing this.
> actually, its primary purpose was to address the eventual lack of bit space
> in the unit flags field. it wasn't accepted because a) it was "too OO" - IIRC
> and b) because i never wrote any code that actually used it. it was just
> supposed to coexist.

I accept the second reason. The first one is not encouraging :-(

> it can be used to exactly what you're talking about. it changes the bit field
> describing unit capabilities into an array. each byte in the array describes
> some segment of capabilities/properties (like settler properties or diplomat
> properties). each element of the array is a bit field describing the various
> capabilities in the segment.
> 
> i also wrote code to load to the bit fields from the rulesets and xmit over
> the network so there shouldn't be too much work there.

I should have a look on your patch.

 ,,
Jorg


[Prev in Thread] Current Thread [Next in Thread]