Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] [RFC] Method names
Home

[Freeciv-Dev] [RFC] Method names

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] [RFC] Method names
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Sep 2001 17:11:09 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

Looking at common/unittype.h methods and their usage I would like to
make the following change

$ grep -Ir unit_flag .|wc -l
  275
$ grep -Ir unit_flag .|grep -- "->type" |wc -l
  196

Which means unit_flag() is used mostly as in "unit_flag(punit->type)".

The existing
  int unit_flag(Unit_Type_id id, int flag);
is changed to 
  int unit_flag(struct unit *punit, int flag);
and a new method
  int unit_type_flag(Unit_Type_id id, int flag);
is added.

I would like to make the same changes to
 int unit_value(Unit_Type_id id);
 int unit_pop_value(Unit_Type_id id);
 char *unit_name(Unit_Type_id id);
This would end up in:
 int unit_value(struct unit *punit);
 int unit_type_value(Unit_Type_id id);

 int unit_pop_value(struct unit *punit);
 int unit_type_pop_value(Unit_Type_id id);

 char *unit_name(struct unit *punit);
 char *unit_type_name(Unit_Type_id id);

Comments?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Understanding is a three-edged sword; 
  your side, their side, and the truth."
    -- a well-known Vorlon



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [RFC] Method names, Raimar Falke <=