mapgen.hpp

Go to the documentation of this file.
00001 /* $Id: mapgen.hpp 23842 2008-02-16 08:47:16Z mordante $ */
00002 /*
00003    Copyright (C) 2003 - 2008 by David White <dave@whitevine.net>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License version 2
00008    or at your option any later version.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details.
00013 */
00014 
00015 //! @file mapgen.hpp
00016 //!
00017 
00018 #ifndef MAP_GEN_HPP_INCLUDED
00019 #define MAP_GEN_HPP_INCLUDED
00020 
00021 class config;
00022 class display;
00023 
00024 #include "map.hpp"
00025 
00026 #include <map>
00027 #include <string>
00028 #include <vector>
00029 
00030 class map_generator
00031 {
00032 public:
00033     virtual ~map_generator() {}
00034 
00035     //! Returns true iff the map generator has an interactive screen,
00036     //! which allows the user to modify how the generator behaves.
00037     virtual bool allow_user_config() const = 0;
00038 
00039     //! Display the interactive screen, which allows the user
00040     //! to modify how the generator behaves.
00041     //! (This function will not be called if allow_user_config() returns false).
00042     virtual void user_config(display& disp) = 0;
00043 
00044     //! Returns a string identifying the generator by name.
00045     //! The name should not contain spaces.
00046     virtual std::string name() const = 0;
00047 
00048     //! Creates a new map and returns it.
00049     //! args may contain arguments to the map generator.
00050     virtual std::string create_map(const std::vector<std::string>& args) = 0;
00051 
00052     virtual config create_scenario(const std::vector<std::string>& args);
00053 };
00054 
00055 std::string default_generate_map(size_t width, size_t height, size_t island_size, size_t island_off_center,
00056                                  size_t iterations, size_t hill_size,
00057                                  size_t max_lakes, size_t nvillages, size_t castle_size, size_t nplayers,
00058                                  bool roads_between_castles, std::map<gamemap::location,std::string>* labels,
00059                                  const config& cfg);
00060 
00061 #endif

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs