Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2005:
[Freeciv-Dev] using OR in requirements
Home

[Freeciv-Dev] using OR in requirements

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] using OR in requirements
From: Per Inge Mathisen <per@xxxxxxxxxxx>
Date: Fri, 2 Dec 2005 10:53:53 +0000 (GMT)

I find that very commonly we want effects that have the same requirement
for several cases of the same requirement type. For instance,
Martial_Law_Each is the same for Anarchy, Despotism and Monarchy; and now
we must define this as:

[effect_martial_law_each_0]
name    = "Martial_Law_Each"
value   = 1
reqs  =
    { "type",       "name",      "range"
      "Gov", "Anarchy",   "Player"
    }

[effect_martial_law_each_1]
name    = "Martial_Law_Each"
value   = 1
reqs  =
    { "type",       "name",      "range"
      "Gov", "Despotism", "Player"
    }

[effect_martial_law_each_2]
name    = "Martial_Law_Each"
value   = 1
reqs  =
    { "type",       "name",      "range"
      "Gov", "Monarchy",  "Player"
    }

could we perhaps add two kinds of reqs, one for ANDs and one for ORs? Such
as one_of_req (or) and all_of_reqs (and), as in:

[effect_martial_law_each_0]
name    = "Martial_Law_Each"
value   = 1
one_of_req  =
    { "type",       "name",      "range"
      "Gov", "Anarchy",   "Player"
      "Gov", "Despotism", "Player"
      "Gov", "Monarchy",  "Player"
    }

The effects loading code could translate these into the same effects
system as we use now (by splitting any one_of_req effect definitions in to
multiple effects), so the this change would be one of appearance only.

  - Per




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