On 8 February 2013 22:44, Imhotep <jmho...@slehr.de> wrote:
> Hi there,
> after trying the wiki and the forum, I'm finally trolling here.
> (Not that I intend to troll but, the reactions (or the lack of) make me feel
> like that).
> I have recently managed to make a first version of the gameloss_style
> (See my posts on the forum and the wiki.)
It's a bit hard to comment on code one doesn't see ;-)
> Depending on bit 2¹ there is civil war when a GameLoss figure is killed.
> Depending on bit 2⁰ the remaining cities fall to the barbarians or
> completely vanish without a trace.
> (Units go along with their cities, the rest is killed.)
> That's all for now, because I'm quite new to the code and I want to
> consolidate what I've coded before I make more extensions
> (like random benefits for the player that killed the enemy leader or tech
> losses for the resulting new AI).
Note that we (or at least I) prefer contributions in small steps one
can easily validate. It's hard to see from big patch that every part
works as expected. It's much easier if you see each separate step to
get there. No step should break freeciv, though, so they must work on
> For example, to create the barbarians in plrhand.c I had not only to include
> but also I introduced a new function create_barbarian_player_land() in
> The reason I introduced a new function was that the
> create_barbarian_palyer(enum barbarian_type type)
> is static, and I have no idea how to find out if this has a solid reason or
> might be only out of cautiousness,
> as it is generally a good idea to keep as many functions as possible static.
As it has not been needed outside the module before, we have wanted
to keep interface minimal. It's probably better to make it non-static
than to add new wrapper function.
IIRC, despite the name create_barbarian_player() does not necessarily
create a new player, but might return the existing one as there's at
most 1 barbarian players of each type. Maybe the function name should
be changed when its made non-static so that it would not be so
confusing in the interface.
Freeciv-dev mailing list