Forest.h

00001 // This file may be redistributed and modified only under the terms of
00002 // the GNU General Public License (See COPYING for details).
00003 // Copyright (C) 2004 Alistair Riddoch
00004 
00005 #ifndef MERCATOR_FOREST_H
00006 #define MERCATOR_FOREST_H
00007 
00008 #include <Mercator/RandCache.h>
00009 
00010 #include <wfmath/axisbox.h>
00011 #include <wfmath/polygon.h>
00012 
00013 #include <map>
00014 
00015 namespace Mercator {
00016 
00017 class Plant;
00018 class Area;
00019 
00026 class Forest {
00027   public:
00031     typedef std::map<int, Plant> PlantColumn;
00036     typedef std::map<int, PlantColumn> PlantStore;
00037   private:
00038     Area* m_area;
00039     
00041     PlantStore m_plants;
00043     unsigned long m_seed;
00045     RandCache m_randCache;
00046 
00047   public:
00048     explicit Forest(unsigned long seed = 0);
00049     ~Forest();
00050 
00052     Area* getArea() const {
00053         return m_area;
00054     }
00055 
00058     const PlantStore & getPlants() const {
00059         return m_plants;
00060     }
00061 
00062     void setArea(Area* a);
00063 
00064     void populate();
00065 };
00066 
00067 }
00068 
00069 #endif // MERCATOR_FOREST_H

Generated on Mon Aug 20 15:36:04 2007 for Mercator by  doxygen 1.5.2