Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: unit flags/capabilities

[Freeciv-Dev] Re: unit flags/capabilities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: unit flags/capabilities
From: Andrew Sutton <ansutton@xxxxxxx>
Date: Thu, 29 Nov 2001 00:56:28 -0500

On Wednesday 28 November 2001 06:20 pm, Paul Zastoupil wrote:
> > That's a great idea.  In fact, similar generalizations are needed for
> > techs/buildings as well to better accomodate different rulesets.  I
> > wonder what happened to the generalized city improvement patch and what
> > exactly it did.  Maybe it's a good time to dig it up and take a look at
> > it.
> I think its a great idea too.

okay. i'll implement the new framework so that it runs paralell to the older 
framework. that will save us the hassle of having to re-code everything in 
one shot. stuff can be rolled over as its needed.

actually, this might be a good way to deal with this stuff... replace older 
code gradually by obsoleting, but still allowing older calls.

this modification can elimnate the need for the unit class - which seems to 
duplicate some information in the movement type. i'm going to roll it all 
into a single queriable field. there will be plenty of thorough documentation 
for it, don't worry :)

can somebody supply me with a list of possible categories and values for each 
of those categories? so far for categories i've got:
        - unit class (determine's movement type)
        - combat class (determine's combat capabilities)
        - combat ops (possible combat operations)
        - construction ops (things to build)
        - improvement ops (tile improvements)
        - any other essential information we can put here?

the basic idea is that the category defines some simple rules for behavior 
and properties of a unit. for example, a unit class can only have one flag 
set from the unit class. however, it can combine flags from other classes 
like combat ops (can bomb, can do air superiority).

the api will be a single method called unit_test that takes 3 parameters, a 
pointer to a unit, a category id and a flag to test for (or a set of flags).

i'll post the code back tomorrow as a patch.


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