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

[Freeciv-Dev] Re: Hello; Elementarization of Unit Properties; New/Improv

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jörg Zuther <zuther.joerg@xxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Hello; Elementarization of Unit Properties; New/Improved Info Screens
From: Andrew Sutton <ansutton@xxxxxxx>
Date: Mon, 14 Jan 2002 09:46:19 -0500

> 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.

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.

On Monday 14 January 2002 03:08 am, Raimar Falke wrote:
> While you are at a redesign: what about compound units (from AC)?

it could probably be used to solve this issue too, although somebody from the 
AC team would have to look at it.

andy


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