Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

mapmaker.h

00001 /***************************************************************************
00002                         mapmaker.h    -  description
00003                             -------------------
00004     begin                : july 2nd, 2006
00005     copyright            : (C) 2006 by Frédéric RODRIGO
00006     email                : f.rodrigo free.fr
00007     
00008     $Id: mapmaker.h 83 2006-11-05 20:46:42Z neoneurone $
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   any later version.                                                    *
00017  *                                                                         *
00018  ***************************************************************************/
00019 
00020 #ifndef _OPENCITY_MAPMAKER_H_
00021 #define _OPENCITY_MAPMAKER_H_ 1
00022 
00023 #include "map.h"
00024 
00025 #include "generator/generator.h"
00026 #include "filter/filter.h"
00027 #include <vector>
00028 using std::vector;
00029 
00030 namespace MapGen
00031 {
00032 
00036 class MapMaker {
00037 public:
00038     enum MAP_TYPE {
00039         PLAIN = 0,
00040         HILL,
00041         MOUNTAIN
00042     };
00043 
00044     enum WATER_TYPE {
00045         DRY = 0,
00046         LAKE,
00047         COAST,
00048         ISLAND
00049     };
00050 
00051     enum TREE_DENSITY_TYPE {
00052         SPARSE = 0,
00053         NORMAL,
00054         DENSE
00055     };
00056 
00057     MapMaker(
00058         const uint w,
00059         const uint h,
00060         const MAP_TYPE mapType,
00061         const WATER_TYPE waterType,
00062         const TREE_DENSITY_TYPE treeDensityType );
00063 
00064     ~MapMaker();
00065 
00066     int* getMap();
00067     int* getTreeDensity();
00068 
00069 private:
00070     uint        _w;
00071     uint        _h;
00072 
00073     MAP_TYPE    _mapType;
00074     WATER_TYPE  _waterType;
00075     Map*        _map;
00076 
00077     TREE_DENSITY_TYPE   _treeDensityType;
00078     Map*        _treeDensity;
00079 
00080 
00081    /*=====================================================================*/
00082    /*                         PRIVATE     METHODS                         */
00083    /*=====================================================================*/
00084     Map* _generate(
00085             const Generator* generator,
00086             vector<Filter*> filters ) const;
00087 
00088     void _generateMap();
00089 
00090     void _generateTreeDensity();
00091 
00092 };
00093 
00094 }
00095 
00096 #endif

Generated on Sat Nov 11 10:21:10 2006 for OpenCity by  doxygen 1.4.2