Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MAP_GEN_HPP_INCLUDED
00019 #define MAP_GEN_HPP_INCLUDED
00020
00021 class config;
00022 class display;
00023
00024 #include "exceptions.hpp"
00025 #include "map_location.hpp"
00026
00027 #include <map>
00028
00029 struct mapgen_exception : public game::error
00030 {
00031 mapgen_exception(const std::string& msg)
00032 : game::error(msg)
00033 {}
00034 };
00035
00036 class map_generator
00037 {
00038 public:
00039 virtual ~map_generator() {}
00040
00041
00042
00043
00044
00045 virtual bool allow_user_config() const = 0;
00046
00047
00048
00049
00050
00051
00052 virtual void user_config(display& disp) = 0;
00053
00054
00055
00056
00057
00058 virtual std::string name() const = 0;
00059
00060
00061
00062
00063
00064 virtual std::string config_name() const = 0;
00065
00066
00067
00068
00069
00070 virtual std::string create_map(const std::vector<std::string>& args) = 0;
00071
00072 virtual config create_scenario(const std::vector<std::string>& args);
00073 };
00074
00075
00076 std::string default_generate_map(size_t width, size_t height, size_t island_size, size_t island_off_center,
00077 size_t iterations, size_t hill_size,
00078 size_t max_lakes, size_t nvillages, size_t castle_size, size_t nplayers,
00079 bool roads_between_castles, std::map<map_location,std::string>* labels,
00080 const config& cfg);
00081
00082 #endif