#include <universe.h>
Inheritance diagram for TUniverse:
Public Methods | |
virtual | ~TUniverse () |
bool | addGalaxy (TGalaxy *galaxy) |
bool | addItem (TItem *item) |
const list< TGalaxy *> & | getGalaxies () const |
const list< TItem *> & | getItems () const |
virtual void | reset () |
Static Public Methods | |
TUniverse * | instance () |
Protected Methods | |
TUniverse () | |
Private Attributes | |
list< TGalaxy *> | fGalaxies |
list< TItem *> | fItemList |
Static Private Attributes | |
TUniverse * | fInstance |
The universe object contains a list of all galaxies existing in this game. Also it offers a list of items which are available in this universe. All parts e.g. in ship designs (TShipDesign) refer to this list of items.
|
Deletes all children (galaxies, items etc.).
|
|
Constructor made protected to ensure that the users of this class can only create exactly one instance.
|
|
Adds a galaxy to the universe. This method checks if the galaxy does already belong to the universe (and will ignore the command in this case). Note that TUniverse takes over control of the object in the sense that is responsible for deleting the memory.
|
|
Adds an item to the list of available items. Note that there is no check against adding an item twice. Also note that TUniverse takes over control of the object in the sense that is responsible for deleting the memory.
|
|
|
|
|
|
|
|
This will reset the whole universe and delete all galaxies and everything else which belongs to the universe (e.g. the list of items). Use with care!!! Reimplemented from TLinkable. |
|
all galaxies in this universe |
|
The global (and unique) instance of TUniverse |
|
list of allowed items in this universe |