[Freeciv-Dev] Re: unit flags/capabilities
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Reinier Post wrote:
On Thu, Nov 29, 2001 at 08:51:25AM -0500, Andrew Sutton wrote:
if you really want to add a new unit that defines a new field, say fuel (for
aircraft), then the correct thing to do would be to "derive" a new structure
for it. you'd end up with this:
struct unit
{
unit_type type;
unit_flags flags;
// other generic information
};
struct aircraft
{
struct unit base;
unsigned fuel;
};
So now, at every place in the code where units are used, we need to expect
a whole set of possible unit subtypes and test for the type with a case
construct? You can write wrappers to take care of this, but it's going
to make the code much slower. And I can't see much practical benefit:
adding a new property and associated behaviour will be *more* work than
it was before.
Are you sure this is what you intend to do?
How would this proposed inheritence system handle flying settlers?
We're not talking about a system with a fixed list of units for the
ruleset to pick from (or, at least IMO, we shouldn't be). Ultimately a
more flexible system that allows the ruleset to specify every property
of the unit would be better. This would also allow SMAC-style units
with a minimum of fuss.
jason
- [Freeciv-Dev] Re: unit flags/capabilities, (continued)
- [Freeciv-Dev] Re: unit flags/capabilities, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: unit flags/capabilities, Raimar Falke, 2001/11/29
- [Freeciv-Dev] Re: unit flags/capabilities, Reinier Post, 2001/11/30
- [Freeciv-Dev] Re: unit flags/capabilities, Raimar Falke, 2001/11/30
- [Freeciv-Dev] Re: unit flags/capabilities, Andrew Sutton, 2001/11/30
- [Freeciv-Dev] Re: unit flags/capabilities, Reinier Post, 2001/11/30
- [Freeciv-Dev] Re: unit flags/capabilities, Andrew Sutton, 2001/11/29
- [Freeciv-Dev] Re: unit flags/capabilities, Raimar Falke, 2001/11/29
- [Freeciv-Dev] Re: unit flags/capabilities, Andrew Sutton, 2001/11/29
- [Freeciv-Dev] Re: unit flags/capabilities, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: unit flags/capabilities,
vze2zq63 <=
- [Freeciv-Dev] Re: unit flags/capabilities, Andrew Sutton, 2001/11/29
- Message not available
- [Freeciv-Dev] Re: unit flags/capabilities, Andrew Sutton, 2001/11/29
|
|