Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#12958) RFC: Change the interface for building a city
Home

[Freeciv-Dev] (PR#12958) RFC: Change the interface for building a city

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12958) RFC: Change the interface for building a city
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 2 May 2005 10:24:05 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12958 >

Currently there is one function, handle_unit_build_city.  This
automatically builds a new city or adds to an existing one.

There are two basic problems.

1.  There's no way for the caller to choose whether to build or add to
city.  For instance with the build-city order you have to be careful not
to choose the same tile with two settlers or you'll get one size 2
cities instead of 2 size 1 cities.  You have to be careful not to press
the 'b' button at all times in the client or your settler unit will be
immediately and irrevocably lost.  The AI has to assume the settler does
the right thing; if it does not then the AI may become confused.

2.  There's no way to tell if the build succeeded.  The caller must
figure this out manually with a find_unit_by_id call.  This is the
result of some bugs (PR#10021) as well as some ugliness in coding (like
with the build-city order).

In my proposed new design the add-to-city and build-city actions will be
separated at every step.

1.  Separate server functions for building or adding (actually these
functions already exist, as helpers for handle_unit_build_city).

2.  These functions returning a bool indicating success or failure.

3.  Separate orders for build-city or add-city.

4.  Separate client commands for build-city or add-city.  'b' should
only build-city.  build-city requires a parameter (the name, optional),
but add-city requires no such parameter (we can just use orders for it).

-jason





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12958) RFC: Change the interface for building a city, Jason Short <=