1 ///////////////////////////////////////////////////////////
2 // Softwarebauelemente II, Aufgabe O2.1
3 //
4 // author: Stephan Brumme
5 // last changes: February 26, 2001
6
7 #if !defined(AFX_ROOM_H__34138CE0_E97C_11D4_9BB7_8BA1BD2C3421__INCLUDED_)
8 #define AFX_ROOM_H__34138CE0_E97C_11D4_9BB7_8BA1BD2C3421__INCLUDED_
9
10 #if _MSC_VER > 1000
11 #pragma once
12 #endif // _MSC_VER > 1000
13
14
15 // for basic class behaviour
16 #include "BasicClass.h"
17
18
19 // declare class CRoom
20 class CRoom : public CBasicClass
21 {
22 public:
23 // constructor (former Init)
24 CRoom(int nNumberOfRoom, int nArea);
25
26 // return class name
27 static char* ClassnameOf() { return "CRoom"; }
28
29 // display the attributes
30 friend ostream& operator<<(ostream &mystream, const CRoom& room);
31
32 // compare two rooms
33 bool operator==(const CRoom &room) const;
34 virtual bool EqualValue(const CRoom* room) const;
35
36 // copy one room to another one
37 CRoom& operator=(const CRoom &room);
38 virtual bool Copy(const CRoom* room);
39
40 // access m_nNumberOfRoom
41 int GetNumberOfRoom() const;
42 void SetNumberOfRoom(const int nNumberOfRoom);
43
44 // retrieve covered area
45 int GetArea() const;
46
47 protected:
48 // used to perform proper display in derived classes
49 virtual ostream& OutStream(ostream& mystream, bool bDebug=false) const;
50
51 private:
52 // hide the member variables
53 int m_nNumberOfRoom;
54 int m_nArea;
55 };
56
57 #endif // !defined(AFX_ROOM_H__34138CE0_E97C_11D4_9BB7_8BA1BD2C3421__INCLUDED_)
58