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

Door.hpp

00001 #if   !defined( __DOOR_HPP)
00002 #define  __DOOR_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 #if   !defined(__COMMON_HPP)
00025 #include <Common.hpp>
00026 #endif
00027 
00028 #if   !defined(__MAPSITE_HPP)
00029 #include <MapSite.hpp>
00030 #endif
00031 
00032 enum DoorState
00033 {
00034    DOOROPEN=0,
00035    DOORCLOSED
00036 };
00037 
00038 
00039 DECLARE_CLASS( Room );
00040 DECLARE_CLASS( Door );
00041 
00046 class Door : public MapSite
00047 {
00048 
00049 public:
00050 
00051    //
00052    // Constructor and destructor
00053    //
00054 
00062                         Door( RoomPtr = NULLPTR, RoomPtr = NULLPTR );
00063 
00065 
00066                         Door( DoorCref );
00067 
00069 
00070    virtual              ~Door( void );
00071 
00072    //
00073    // Operator overloads
00074    //
00075 
00077 
00078             DoorRef  operator=( DoorCref ) throw(CORELINUX(Assertion));
00079 
00081 
00082             bool  operator==( DoorCref aRef ) const;
00083 
00084    //
00085    // Accessors
00086    //
00088 
00089             bool  isOpen( void ) const;
00090 
00092 
00093             bool  isClosed( void ) const;
00094 
00096 
00097             RoomPtr  getFirstRoom( void ) const;
00098 
00100 
00101             RoomPtr  getSecondRoom( void ) const;
00102 
00104 
00105             RoomPtr  otherSideFrom( RoomPtr ) const throw(CORELINUX(Assertion));
00106    //
00107    // Mutator
00108    //
00109 
00111 
00112             void     setOpen( void );
00113 
00115 
00116             void     setClosed( void );
00117 
00119 
00120             void     setFirstRoom( RoomPtr ) throw(CORELINUX(Assertion));
00121 
00123 
00124             void     setSecondRoom( RoomPtr ) throw(CORELINUX(Assertion));
00125    //
00126    // Pure virtual
00127    //
00134    virtual void enter( void );
00135 
00136 private:
00137 
00138             RoomPtr     theFirstRoom;
00139 
00140             RoomPtr     theSecondRoom;
00141 
00142             DoorState   theDoorState;
00143 };
00144 
00145 #endif // if !defined(__DOOR_HPP)
00146 
00147 /*
00148    Common rcs information do not modify
00149    $Author: frankc $
00150    $Revision: 1.1 $
00151    $Date: 2000/04/21 02:38:47 $
00152    $Locker:  $
00153 */
00154 

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