libcoyotl - A Library of C++ Tools

Created by Scott Robert Ladd at Coyote Gulch Productions.


maze_renderer.h

00001 //---------------------------------------------------------------------
00002 //  Algorithmic Conjurings @ http://www.coyotegulch.com
00003 //
00004 //  maze_renderer.h (libcoyotl)
00005 //
00006 //  Maze generation and exploration tools
00007 //-----------------------------------------------------------------------
00008 //
00009 //  Copyright 1990-2005 Scott Robert Ladd
00010 //
00011 //  This program is free software; you can redistribute it and/or modify
00012 //  it under the terms of the GNU General Public License as published by
00013 //  the Free Software Foundation; either version 2 of the License, or
00014 //  (at your option) any later version.
00015 //  
00016 //  This program is distributed in the hope that it will be useful,
00017 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 //  GNU General Public License for more details.
00020 //  
00021 //  You should have received a copy of the GNU General Public License
00022 //  along with this program; if not, write to the
00023 //      Free Software Foundation, Inc.
00024 //      59 Temple Place - Suite 330
00025 //      Boston, MA 02111-1307, USA.
00026 //
00027 //-----------------------------------------------------------------------
00028 //
00029 //  For more information on this software package, please visit
00030 //  Scott's web site, Coyote Gulch Productions, at:
00031 //
00032 //      http://www.coyotegulch.com
00033 //  
00034 //-----------------------------------------------------------------------
00035 
00036 #if !defined(LIBCOYOTL_MAZERENDERER_H)
00037 #define LIBCOYOTL_MAZERENDERER_H
00038 
00039 #include "maze.h"
00040 
00041 namespace libcoyotl
00042 {
00044 
00048     class maze_renderer
00049     {
00050     public:
00052 
00058         static void render(const libcoyotl::maze & a_source, const std::string & a_filename, size_t a_grid_size);
00059 
00060     private:
00061         // A type for handling mage images
00062         class image
00063         {
00064         public:
00065             // constructor
00066             image(const maze & source, size_t grid_size);
00067 
00068             // destructor
00069             ~image();
00070 
00071             // properties
00072             unsigned char ** get_bits() const
00073             {
00074                 return m_bits;
00075             }
00076 
00077             int get_width() const
00078             {
00079                 return m_width;
00080             }
00081 
00082             int get_height() const
00083             {
00084                 return m_height;
00085             }
00086 
00087         private:
00088             // maze width
00089             int  m_width;
00090 
00091             // naze height
00092             int  m_height;
00093 
00094             // bits representing the maze
00095             unsigned char ** m_bits;
00096         };
00097     };
00098 }
00099 
00100 #endif

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.