[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Aug 21, 2001 at 07:56:29PM -0400, Ross W. Wetmore wrote:
> This may not be applicable to a lot of lists, but there will be subtle
> effects on game play and AI moves if for example it always processes
> its unit_list in a fixed order. Or always evaluates city actions in a
> NW to SE (i.e. 0,0 to map.xsize,map.ysize) direction.
>
> It is actually better to have a stack or circular list for a lot of
> game objects where if one accesses them they get put back at the head
> or tail. If one needs to push/pop them for some reason, like filling
> up a transport then having it be the next unit to move, one uses stack
> like operations, but if one is presumably done processing it, it goes
> to the end. If one awakens a stack of caravnns to be sent to Wonderland
> in Tobruk, it is *very* irritating to not have moves stacked and have
> the move selection bounce all around the map before it gets back to the
> next one (because the unit sort order was by home city or something).
>
> This order has a play pattern, which may be appreciated by humans but it
> is not a rigorous mechanical sort based on some obscure computer thingie
> and can be changed as units are awakened for out-of-list-order events.
Since a speclist insert() has no position argument it is unknown how
many callers really want the entry inserted at the head and how many
would be happy if the entry is just inserted somewhere. IMHO the
sorting should just be removed from the sortlist.
> I'd like to know exactly which lists are to be sorted and why before any
> CVS code changes are made.
$ grep _sort */*.c */*/*.c|grep -v gtk_clist_sort|grep -v g_list_sort|grep -v
gtk_clist_set
client/helpdata.c: for genlist_sort(); sort by topic via compare_strings()
client/helpdata.c: genlist_sort(&category_nodes, help_item_compar);
common/genlist.c:void genlist_sort(struct genlist *pgenlist,
common/unit.c: Comparison function for genlist_sort, sorting by ord_map:
common/unit.c: Comparison function for genlist_sort, sorting by ord_city: see
above.
common/unit.c:void unit_list_sort_ord_map(struct unit_list *This)
common/unit.c: genlist_sort(&This->list, compar_unit_ord_map);
common/unit.c:void unit_list_sort_ord_city(struct unit_list *This)
common/unit.c: genlist_sort(&This->list, compar_unit_ord_city);
server/savegame.c: unit_list_sort_ord_city(&pcity->units_supported);
server/savegame.c: unit_list_sort_ord_map(&map_get_tile(x,y)->units);
client/gui-mui/citydlg.c:static void city_list_sort(struct MinList *list)
client/gui-mui/citydlg.c: city_list_sort(&list);
So no big deal here.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
(On the statement print "42 monkeys"+"1 snake"): BTW, both perl and Python
get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when
the answer is clearly "41 monkeys and 1 fat snake".
-- Jim Fulton, 10 Aug 1999
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, (continued)
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Justin Moore, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Justin Moore, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Justin Moore, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Justin Moore, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Trent Piepho, 2001/08/22
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Justin Moore, 2001/08/23
- Message not available
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Ross W. Wetmore, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand,
Raimar Falke <=
[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Markus Linnala, 2001/08/20
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/20
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Trent Piepho, 2001/08/20
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Trent Piepho, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Trent Piepho, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Raimar Falke, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Trent Piepho, 2001/08/21
- [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand, Kevin Brown, 2001/08/22
|
|