Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2598) Increase leader limit
Home

[Freeciv-Dev] (PR#2598) Increase leader limit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#2598) Increase leader limit
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Sat, 11 Jan 2003 01:36:53 -0800
Reply-to: rt@xxxxxxxxxxxxxx

[rfalke - Wed Jan  8 10:18:43 2003]:

> On Tue, Dec 17, 2002 at 11:26:12PM -0800, Jason Short via RT wrote:
> >
> > [rfalke - Tue Dec 17 22:54:08 2002]:
> >
> > >
> > > To take use of the extra leader in the american ruleset you need
> the
> > > attached patch.
> >
> > 62 nations * 48 leaders/nation * 8 bytes/leader = 24k of extra
> memory
> > this change will take.  IMO it is better to dynamically allocate
> this
> > array on a per-nation basis.
> 
> And the patch. It is this big because I took the liberty to change
>   char *leader_name[MAX_NUM_LEADERS];
>   bool  leader_is_male[MAX_NUM_LEADERS];
> to a more OO like
>   struct leader *leaders;
> This way we can stick a picture to a leader or a description or
> something else.

If you introduce struct leader *, then get_nation_leader_names should be
changed to get_nation_leaders.  This is a generally more useful
function, and avoids the _ugly_ hack that is otherwise required.

OTOH, an array of leaders will generally take up more space than having
two separate arrays of leader and gender (particularly when bool is a
char value).

I'm also not too happy with keeping around MAX_NUM_LEADERS in any
capacity.  Don't tempt people to use it!

jason



[Prev in Thread] Current Thread [Next in Thread]