Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: curiosity
Home

[Freeciv-Dev] Re: curiosity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Andrew Sutton <ansutton@xxxxxxx>
Cc: Paul Zastoupil <paulz@xxxxxxxxxxxx>, Reinier Post <rp@xxxxxxxxxx>, Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: curiosity
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 1 Dec 2001 16:12:10 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Dec 01, 2001 at 09:18:41AM -0500, Andrew Sutton wrote:
> On Saturday 01 December 2001 04:41 am, Raimar Falke wrote:
> > And this is the next major design issue: which features of C++ you
> > want to use.
> 
> good question. i think inheritance - at some level will be an important 
> property of the language for the implementation of freeciv 2. maybe not for 
> unis, specifically, but other aspects of the game - like everything that can 
> be put on the map.
> 
> > > e.g. take SGI's STL. it works on tons of systems with tons of compilers.
> >
> > Isn't STL now part of the C++ standard?
> 
> yup. actually STL is one of major features c++ that would be readily taken 
> advantage. in the current version of freeciv, game objects are stored in 
> lists. when you need to look up an object, you have to iterate thru the list 
> until you find it... what is that? average search time = O(n/2) or something 
> like that?
> 
> compare that with std::map<> where lookup times are constant (although 
> insertion is pretty bad when the map is resized). that's okay though... 

First: searching a list of 10 players isn't slow. Complexity kicks in
latter.

Second: we have also hashs. See common/game:struct unit
*find_unit_by_id(int id) and struct city *find_city_by_id(int id);

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Just because you put a flag on the moon doesn't make it yours, it just
  puts a hole in the moon."


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