summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2GuestroomTable.h
blob: 045cd9261b546a202e07b9aa0cb62ce5e2dcc988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include "common.h"
#include "LArray.h"
#include "T2VerticalTable.h"

class AFX_CLASS_EXPORT T2GuestroomTable : T2VerticalTable {
public:
	T2GuestroomTable(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalette* inPalette);
	virtual ~T2GuestroomTable();
	virtual void Add(T2GuestroomItem* inItem);
	virtual void AddList(T2Tenant* inTenant, int inRoomNumber);
	virtual void SetFront(unsigned int inFront) { mFront = inFront; }
	virtual void ResetRoomList(int inRoomType);
	virtual void ValidRelation();
	virtual void RevertRelation();
	virtual int CountRooms(int inRoomType, int inRoomStatus);
	virtual void ToggleRelation(const TableCellT& inCell, int inMoneyIndex);
	virtual void SetInMoneyIndex(int inMoneyIndex);
	virtual int GetInMoneyIndex(int inRoomType);
	virtual int CalcInMoney(int inRoomType);
	void UpdateTenantEstimation(T2TowerDoc* inDoc, int inRoomType);

protected:
	virtual int OnT2DlgItemCreate(CREATESTRUCT* cs);
	virtual void DrawCellSelf(CDC* pDC, const TableCellT& inCell, BOOL inSelected);
	virtual void DrawCell(CDC* pDC, const TableCellT& inCell);
	virtual void ClickCell(const TableCellT& inCell, const CPoint& inPt);
	virtual void OnT2DlgItemLButtonDown(UINT inFlags, CPoint inPt);
	virtual BOOL OnT2DlgItemEraseBkgnd(CDC* pDC);

	unsigned int mFront;
	LArray mArray;
	DWORD mClickTime;
};

class AFX_CLASS_EXPORT T2GuestroomItem {
public:
	T2GuestroomItem(T2Tenant* inTenant, int inSaveTenantID, long inRoomNumber);
	int GetRoomNumber();
	int GetRoomStatus();
	int GetCapacity();
	int GetRoomType();
	static int GetRoomType(T2Tenant* inTenant);
	void ToggleRelation(int inMoneyIndex);
	BOOL IsRelation();
	BOOL WasRelation();
	void ValidRelation();
	void InvalidRelation();
	void RevertRelation();
	BOOL IsFreeRelation();
	BOOL IsStay();
	void SetInMoneyIndex(int inIndex);
	int GetInMoneyIndex();
	int GetInMoney();
	int GetOutMoney();
	void UpdateTenantEstimation(T2TowerDoc* inDoc);

	T2Tenant* GetTenant() { return mTenant; }

protected:
	T2Tenant *mTenant;
	unsigned int mSaveTenantID;
	int mRoomNumber;
	BOOL mRelation;
	int mDefaultInMoneyIndex;
};