00001 #include "Room.h" 00002 #include "ObjectArray.h" 00003 00004 //---- Room --------------------------------------------------------- 00005 00006 Room::Room(int roomNo) : MapSite() 00007 { 00008 this->_roomNumber = roomNo; 00009 this->_sides = new ObjectArray(); 00010 } 00011 00012 Room::~Room() 00013 { 00014 delete this->_sides; 00015 } 00016 00017 class MapSite* Room::GetSide(Direction d) const { 00018 return (MapSite *) this->_sides->GetAt(d); 00019 } 00020 00021 int Room::GetRoomNo() const { 00022 return this->_roomNumber; 00023 } 00024 00025 void Room::SetSide(Direction d, class MapSite *ms) { 00026 this->_sides->PutAt(d,ms); 00027 } 00028 00029 void Room::Enter() { 00030 /* Um Code erweitern, falls Maze fuer Spiel verwendet wird */ 00031 } 00032 00033 void Room::Print(int indent) { 00034 PrintIndent(indent); 00035 printf("Room:\n"); 00036 00037 PrintIndent(indent+2); 00038 printf("_roomNumber = %d\n",this->_roomNumber); 00039 00040 PrintIndent(indent+2); 00041 if(this->_sides) { 00042 printf("_sides:\n"); 00043 this->_sides->Print(indent+2); 00044 } else { 00045 printf("_sides = NULL\n"); 00046 } 00047 00048 MapSite::Print(indent+2); 00049 }