summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2TenantArray.h
blob: aef2cd0b71997b3e69b100532c28d7e232e1e8eb (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
#pragma once
#include "common.h"
#include "T2ObjectArray.h"

class AFX_CLASS_EXPORT T2TenantArray : public T2ObjectArray {
public:
    enum { kGroupSize = 128 };

    T2TenantArray(unsigned int startID = 1000);
	virtual ~T2TenantArray();
    virtual void DispatchIdle(T2TowerDoc*, int);
	T2Tenant* FindUnusedTenant();
	int CalcMentenanceCost(T2TowerDoc*) const;
	void TenantRemoved(unsigned int);
	T2Tenant* GetTenantByPID(DWORD);
	void BreakoutEmergency(T2TowerDoc*);
	void RecoverRelatedTenantList(T2RegistedTenantDB*);
	void Read(T2Archive&, T2TowerDoc*);
	void Write(T2Archive&);

	T2Tenant* GetIndexTenant(int i) { return &mTenants[i]; }

protected:
    friend class T2TenantArrayList;

    T2Tenant *mTenants;
};