Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
[Freeciv-Dev] should ruleset items have defaults?
Home

[Freeciv-Dev] should ruleset items have defaults?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] should ruleset items have defaults?
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Tue, 10 Aug 1999 23:29:47 +1000 (EST)

I've been wondering whether ruleset items (individual units, 
buildings etc) should have default field values.  These could
be implicit (default hardwired in executable) or explicit
(default specified elsewhere in ruleset file).  Implicit is 
probably a bad idea because it makes it harder to understand
(and thus to modify) the ruleset files.  For explicit, could 
have a section like:

  [units_default]
  transport_capacity = 0
  fuel = 0

and then the sections for individual units would not have to 
mention those fields except where the values were different.
So if most (or all) items in a ruleset take the default value
for some field, you would only have to specify the non-default 
cases.  This may be especially useful if there are lots of 
fields, only a few of which are used per iterm (eg, maybe a 
likely case for generalized buildings).

The _disadvantage_ though, it that things become slightly
less explicit, and you no longer find out everything about 
a single item in one place (one of the advantages of the 
new non-tabular format).  As well as the section for that 
item, you would also have to keep in mind the defaults.  
It may also make customising items slightly harder, because 
you may have to add extra lines corresponding to defaulted 
fields.

Regards,
-- David

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] should ruleset items have defaults?, David Pfitzner <=