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

enum {
    kFundGroup0,
    kFundGroup1,
    kFundGroup2,
    kFundGroup3,
    kFundGroup4,
    kFundGroup5,
    kFundGroup6,
};

enum {
    kTimeLimitTypeNone,
    kTimeLimitTypeTool,
    kTimeLimitTypeCategory
};

enum {
    kTimeLimitLengthNone,
    kTimeLimitLength3Min,
    kTimeLimitLength30Min,
    kTimeLimitLength1Month
};

class AFX_CLASS_EXPORT T2Settlement {
public:
	T2Settlement(T2TowerDoc* towerDoc, int funds);
	T2Settlement(T2TowerDoc* towerDoc, T2Archive&);
	~T2Settlement();
	T2Archive& Write(T2Archive&) const;
	void DoPay(int funds, short fundGroup);
	void DoPayTool(int funds, short fundGroup, T2ToolDef* inToolDef);
	void EmitPayToolMessage(T2TowerDoc*, T2ToolDef*, const CString&, int length, int);
	int GetCurrentFunds() const;
	int GetPreviousFunds() const;
	int GetTotalSettlement(short) const;
	int GetToolSettlement(T2ToolDef*) const;
	int GetCategorySettlement(int) const;
    void Update();

protected:
    T2DateTime* GetTimeLimitOfMessage(T2TowerDoc*, T2ToolDef*, int);
    void SetTimeLimitOfMessage(T2TowerDoc*, T2ToolDef*, int, T2DateTime*);
    T2DateTime* FindCategoryTimeLimit(T2TowerDoc*, T2ToolDef*);
    void LinkCategoryTimeLimit(T2TowerDoc*, T2ToolDef*, T2DateTime*);
	void Initialize(T2TowerDoc* towerDoc, int funds);

    static T2DateTime* CalcTimeLimitOfMessage(T2DateTime*, int);

    T2TowerDoc *mDocument;
    int mCurrentFunds;
    int mPreviousFunds;
    int mC;
    int m10;
    int m14;
    int m18;
    int m1C;
    LArray *mCategoryTimeLimitList;
};