Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
Home

[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]
To: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Cc: Trent Piepho <xyzzy@xxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Small improvement at genlist and maphand
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 09:27:21 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Aug 21, 2001 at 11:45:21PM -0700, Kevin Brown wrote:
> Trent Piepho <xyzzy@xxxxxxxxxxxxx> wrote:
> > On Tue, 21 Aug 2001, Raimar Falke wrote:
> > > There are further optimizations possible:
> > >  - what about passing struct tile * instead of (int x, int y)?
> > >  - what about using pointers instead of ids in structs?
> > 
> > Those are probably good ideas.  One thing you have to watch out for is
> > dangling pointers.  When a unit is deleted, you're not allowed to have any
> > pointers to it anymore.  The main purpose of the function game_remove_unit()
> > is to find all these pointers in the various lists and remove them.
> > 
> > If you stick pointers in other places, you need to be assured that you can
> > remove them when the unit/city goes away.  In some cases, like the GUI code,
> > this is very hard to do.  So you don't do it, and use an ID instead.
> 
> The scary thing is that this is a very strong justification for using
> C++, with its automatic constructors and destructors.  But I don't
> imagine anyone is interested in rewriting Freeciv in C++.  :-)

A project names ObjectCiv was started. The project is still accessible
at SF.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Microsoft does have a year 2000 problem. I'm part of it. I'm running Linux.


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