Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

galaxy.h

00001 // $Id: galaxy_8h-source.html,v 1.2 2002/06/20 17:09:51 mkrohn5 Exp $
00002 
00003 // Galaxy Header File
00004 // Written by: Marco Krohn, Simon Stich
00005 
00006 // Copyright (C) 1999 - 2001, Marco Krohn, <marco.krohn@gmx.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2, or (at your option)
00011 // any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 
00018 #ifndef __GALAXY_INCLUDED
00019 #define __GALAXY_INCLUDED
00020 
00021 #include <iostream>
00022 #include <string>
00023 #include <vector>
00024 
00025 #include "common/defs.h"
00026 #include "common/link.h"
00027 #include "common/point.h"
00028 #include "gamelogic/stolist.h"
00029 
00030 class TDataPackageList;
00031 class TObjectID;
00032 class TStellarObject;
00033 
00034 
00035 
00036 
00037 
00038 //----------------------------------------  class TGalaxy  ----------------------------------------
00039 
00060 class TGalaxy : public TLinkable
00061 {
00062   public:
00074     TGalaxy( const string& name="", const TPoint& Size=0,
00075       bool wrapX=false, bool wrapY=false, bool wrapZ =false);
00079     ~TGalaxy();
00080 
00089     bool addStellarObject( TStellarObject* obj );
00093     int2 getDimension() const;
00102     double getDistance( const TPoint& one,
00103                         const TPoint& two ) const;
00112     double getDistance( const TStellarObject* one,
00113                         const TStellarObject* two ) const;
00121     TPoint getDistanceVector( const TPoint& from,
00122                               const TPoint& to ) const;
00132     TPoint getDistanceVector( const TStellarObject* from,
00133                               const TStellarObject* to ) const;
00137     const string& getName() const;
00141     const TPoint& getSize() const;
00146     const TStellarObjectList& getStellarObjectList() const;
00150     int4 getTotalNumber() const;
00155     virtual int2 getType() const;
00161     virtual const string& getTypeName() const;
00169     virtual bool load( TDataPackageList* in );
00176     bool remove( TStellarObject* obj );
00184     virtual bool save( TDataPackageList* out ) const;
00196     bool transform( TPoint& point ) const;
00197 
00198   private:
00200     string fName;
00202     TPoint fSize;
00204     TStellarObjectList fStObj;
00206     bool fWrapX;
00208     bool fWrapY;
00210     bool fWrapZ;
00211 
00215     void removeAll();
00223     bool transformCoordinate( double& x, double max, bool wrap ) const;
00224 };
00225 
00226 
00227 
00228 
00229 
00230 #endif        // __GALAXY_INCLUDED

Generated on Thu Jun 20 18:13:15 2002 for Stellar Legacy by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001