data containers

Moritz mpipahl at gspgmbh.com
Thu Jul 3 09:04:47 PDT 2008


Thx for all your replies, but I hoped for a hint on how to implement it, 
since Im new to D.

@Lars Igesund: I considered Tango, but I had some issues with derelict, 
so I stopped the installation and decided to give phobos a closer look. 
But I bought the tango book, and will surely try tango out after I got 
some of my game ported and running in D.

@Steven: Ill try to use arrays first (for the sake of simplicity and to 
understand a bit more about D), and Ill try your collection afterwards 
(supplying the missing data containers in a project is surely a great 
idea, thank you!)

And pls forgive me if Im asking silly questions, but thats what 
beginners usually do :-)

Moritz schrieb:
> Hello,
> 
> Im currently working on a gui framework for my game, and Im trying to 
> find a versatile way to build my screens.
> 
> I thought about a generic "Screen" class, which has functions like 
> "add_element()" to insert a sprite or text into a layer on the screen.
> 
> Rendering is then done from the lowest layer to the highest one.
> My question is now how I can implement these Layers, since I didnt find 
> LikedLists or Hastables in Phobos.
> 
> My Idea in C++ would be to have a hashtable int to linked list, which 
> gives me the linked list for a layer upon inserting the layer number, 
> and the linked list then contains my ScreenObjects (a base class for 
> images, text, buttons and so on).
> What would be the best way to do this in D?


More information about the Digitalmars-d-learn mailing list