Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] [john.thingstad@xxxxxxxxx: parsing the buildings file]
Home

[Freeciv-Dev] [john.thingstad@xxxxxxxxx: parsing the buildings file]

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Cc: John Thingstad <john.thingstad@xxxxxxxxx>
Subject: [Freeciv-Dev] [john.thingstad@xxxxxxxxx: parsing the buildings file]
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 29 Jan 2003 15:08:35 +0100

If I understood this correctly general improvements/effects are the
answer we came up for this problem. Mike and Ben can tell you more.

        Raimar

----- Forwarded message from John Thingstad <john.thingstad@xxxxxxxxx> -----

To: rf13@xxxxxxxxxxxxxxxxx
Subject: parsing the buildings file
From: John Thingstad <john.thingstad@xxxxxxxxx>
Organization: private
Date: Wed, 29 Jan 2003 13:22:27 +0100
User-Agent: Opera M2 7.0 build 2345


I have looked at the code for buildings.
I have noticed that the matrix solution for processing these attributes is 
extremeley ad hoc.
Altso half is hardcoded and the other half data.
Rather than extend the matrix conditionals why not use a embedded language 
and write the coditionals there?
I might suggest lua for the following reasons.

1. It is designed to be embedded in C code.
2. It is freely available.
3. It is small and compact yet complete.
4. Written fully in ANSI C it compiles on any platform

Writing it in lua you would do the following:

1: make the variables used by buildings visible in lua
2. in the buildings code add the lua code for conditionally setting the 
variables as text strings
3. on reading the file interpreting the lua strings


Just a friendly suggestion that might save time and give you greater 
flexibillity.
lua is available at www.lua.org if you want mare information

-- 
John Thingstad

----- End forwarded message -----



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [john.thingstad@xxxxxxxxx: parsing the buildings file], Raimar Falke <=