Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

Maze.hpp

00001 #if   !defined(__MAZE_HPP)
00002 #define  __MAZE_HPP
00003 
00004 /*
00005   CoreLinux++ 
00006   Copyright (C) 2000 CoreLinux Consortium
00007   
00008    The CoreLinux++ Library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public License as
00010    published by the Free Software Foundation; either version 2 of the
00011    License, or (at your option) any later version.
00012 
00013    The CoreLinux++ Library Library is distributed in the hope that it will 
00014    be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public
00019    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00020    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021    Boston, MA 02111-1307, USA.  
00022 */   
00023 
00024 
00025 #if   !defined(__COMMON_HPP)
00026 #include <Common.hpp>
00027 #endif
00028 
00029 #if   !defined(__MAP_HPP)
00030 #include <Map.hpp>
00031 #endif
00032 
00033 #if   !defined(__ROOM_HPP)
00034 #include <Room.hpp>
00035 #endif
00036 
00037 
00038 CORELINUX_MAP(  RoomNumber,  RoomPtr,  less<RoomNumber> ,  RoomMap );
00039 
00040 DECLARE_CLASS( MazeBuilder );
00041 
00042 DECLARE_CLASS( Maze );
00043 
00049 class Maze
00050 {
00051 
00052    friend   class MazeBuilder;
00053 
00054 public:
00055 
00056    //
00057    // Constructors and destructor
00058    //
00059 
00061             
00062                         Maze( RoomPtr aPtr );
00063 
00065 
00066    virtual              ~Maze( void );
00067 
00068    //
00069    // Operator overload
00070    //
00071 
00073 
00074             bool  operator==( MazeCref ) const;
00075 
00076    //
00077    // Accessors
00078    //
00079 
00081 
00082             RoomCref    getStartLocation( void ) const;
00083 
00085 
00086             RoomCref    getCurrentLocation( void ) const;
00087 
00088    //
00089    // Mutators
00090    //
00091 
00093 
00094             void        walkInDirection( Direction );
00095 
00096 
00097 protected:
00098 
00099    //
00100    // Constructors
00101    //
00102 
00104 
00105                         Maze( void ) throw( CORELINUX(Assertion) );
00106 
00108 
00109                         Maze( MazeCref ) throw( CORELINUX(Assertion) );
00110 
00111    //
00112    // Operator overload
00113    //
00115 
00116             MazeRef  operator=( MazeCref ) throw( CORELINUX(Assertion) );
00117 
00118    //
00119    // Mutators
00120    //
00122 
00123             void        addRoom( RoomPtr );
00124 
00126 
00127             RoomMapRef  getRooms( void );
00128 private:
00129 
00130             RoomPtr     theStartRoom;
00131             RoomPtr     theCurrentRoom;
00132             Direction   theCurrentDirection;
00133             RoomMap     theRooms;
00134 };
00135 
00136 #endif // if   !defined(__MAZE_HPP)
00137 
00138 /*
00139    Common rcs information do not modify
00140    $Author: prudhomm $
00141    $Revision: 1.3 $
00142    $Date: 2000/08/31 22:50:31 $
00143    $Locker:  $
00144 */
00145 

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium