[Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability a
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, 2 Dec 2001, Andrew Sutton wrote:
> an alternative would be to define a separate language that allowed the
> specification of the extensions and would compile directly into code.
> however, capabilties are pretty unique and it would probably be pretty hard
> to generalize. if you think you can figure out how to do it though, i won't
> complain ;)
This is what I meant with Simkin (simkin.co.uk). It's embeddable in XML
and has acces to your C++ or Java API.
Founding a city would be something like:
Here init_unit would be a callbackfunction.
<unit name=settler>
<function name="init" args="Unit u">
Capabillity c = new Capability();
Precondition p = new Precondition(u.position().distance(u.nearestCity)
< u.getGame().parameters().minDistance());
c.require(p);
Action a = new Action(fouundCity(u.position(); u.disband());
u.addCapability(c);
</function>
</unit>
I know it's not 100% correct Java code because I'd have to use inner
classes for the action and precondition, I think. But thats basically how
it works.
Because this looks almost as hard-coded I'd add another layer like
<unit name=setter>
<capabilities>
<found_city/>
</capabilities>
</unit>
and then transform via XSLT to the avove code. Its still extensable if you
add to the above code and then the xslt stylesheet. You still keep the
actual kernel clean.
--
Gregor Zeitlinger
gregor@xxxxxxxxxxxxx
- [Freeciv-Dev] Development Strategies [Was Documentation, Usability and Development], Ross W. Wetmore, 2001/12/01
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Gregor Zeitlinger, 2001/12/01
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/01
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Daniel L Speyer, 2001/12/01
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Gregor Zeitlinger, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development],
Gregor Zeitlinger <=
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Gregor Zeitlinger, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Gregor Zeitlinger, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/02
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Gregor Zeitlinger, 2001/12/03
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/03
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Petrus Viljoen, 2001/12/03
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Andrew Sutton, 2001/12/03
- [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development], Gregor Zeitlinger, 2001/12/04
|
|