include/subsector.hpp

00001 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
00002 /*
00003  * frpuniverse
00004  * Copyright (C) Peter L. Berghold 2008 <Peter@Berghold.net>
00005  * 
00006  * frpuniverse is free software.
00007  * 
00008  * You may redistribute it and/or modify it under the terms of the
00009  * GNU General Public License, as published by the Free Software
00010  * Foundation; either version 2 of the License, or (at your option)
00011  * any later version.
00012  * 
00013  * frpuniverse 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.
00016  * See the GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with frpuniverse.  If not, write to:
00020  *      The Free Software Foundation, Inc.,
00021  *      51 Franklin Street, Fifth Floor
00022  *      Boston, MA  02110-1301, USA.
00023  */
00024 #include "sparse-array.hpp"
00025 #include "parsec.hpp"
00026 
00027 
00028 #ifndef _SUBSECTOR_HPP_
00029 #define _SUBSECTOR_HPP_
00030 #include "parsecCoordinate.hpp"
00031 
00032 #define DENSITY_NORMAL 3
00033 
00034 
00035 
00041 class subsector: public sparseArray 
00042 {
00043 public:
00048         subsector();
00049         
00055         subsector(int position);
00056 
00063         void setDensity(int d);
00064         
00071         int getDensity();
00072         
00080         void addParsec(parsec* p);
00081         
00091         void addParsec(int row,int column,parsec* p);
00092         
00101         void addParsec(int row,int column);
00102         
00110         char* asText();
00111 protected:
00112 
00113 private:
00114         int density;
00115         
00116         parsecCoordinate parsecStart;
00117         parsecCoordinate parsecEnd;
00118         
00119         void populateGrid();
00120         int parsecPresenceCheck();
00121         
00122         
00123         
00124         
00125 };
00126 
00127 #endif // _SUBSECTOR_HPP_

Generated on Fri Mar 7 16:40:53 2008 for frpuniverse by  doxygen 1.4.7