-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTD2GAME.HPP
127 lines (112 loc) · 2.63 KB
/
TD2GAME.HPP
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//GMON TD2Game
//Copyright 1996 Aaron Brinton
//#define cScreenNameColor WHITE
//#define cHeadingColor LIGHTGREEN
//#define cDataColor YELLOW
class TD2Game
{
void RefreshData(void);
void RefreshList(void);
void RefreshGame(void);
public:
TD2Game(void);
~TD2Game(void);
void Startup(void);
void Run(void);
void SetSocket(int iSocket);
void DrawList(void);
void DrawGame(void);
private:
Tdpack *DPack;
struct time UpdateTime;
int iTimer;
int iUpdate;
int iCurrentView;
int iCurrentSocket;
};
TD2Game::TD2Game(void)
{
iTimer = 0;
iUpdate = 5;
}
TD2Game::~TD2Game(void)
{
// delete(DPack);
}
void TD2Game::Startup(void)
{
// DPack = new Tdpack;
// DPack->Start(0);
}
void TD2Game::Run(void)
{
// DPack->EnterIdle();
gettime(&UpdateTime);
if (iTimer != UpdateTime.ti_sec)
iUpdate++;
iTimer = UpdateTime.ti_sec;
// if(iUpdate >= cUpdateInterval) RefreshData();
}
void TD2Game::SetSocket(int iSocket)
{
iCurrentSocket = iSocket;
}
void TD2Game::DrawList(void)
{
/* int wx = wherex();
int wy = wherey();
NewScreen();
iCurrentView = 1;
PutString(53, 2, "* Game List *", cScreenNameColor);
PutChar(67, 1, cDblHorzSglBottom, cLineColor);
PutChar(67, 2, cSglVert, cLineColor);
PutChar(67, 3, cDblHorzSglTop, cLineColor);
PutString(68, 2, "Socket:", cScreenNameColor);
PutString(2, 4, "# Title Type Diff Status P CLS MAP Mission Lvl", cHeadingColor);
PutChar(1, 5, cDblVertSglRight, cLineColor);
HorzSglLine(2, 79, 5);
PutChar(80, 5, cDblVertSglLeft, cLineColor);
PutChar(2, 6, 0x31, cHeadingColor);
PutChar(2, 7, 0x32, cHeadingColor);
PutChar(2, 8, 0x33, cHeadingColor);
PutChar(2, 9, 0x34, cHeadingColor);
PutChar(2, 10, 0x35, cHeadingColor);
PutChar(2, 11, 0x36, cHeadingColor);
PutChar(2, 12, 0x37, cHeadingColor);
PutChar(2, 13, 0x38, cHeadingColor);
PutChar(1, 14, cDblVertDblRight, cLineColor);
HorzDblLine(2, 79, 14);
PutChar(80, 14, cDblVertDblLeft, cLineColor);
//asdf
gotoxy(wx, wy);
*/ }
void TD2Game::RefreshList(void)
{
/* PutString(76, 2, " ", cDataColor);
window(4, 6, 79, 9);
clrscr();
window(1, 1, 80, 50);
char sTemp[6];
if(iCurrentSocket > 0) sprintf(sTemp, "+%d", iCurrentSocket);
if(iCurrentSocket <= 0) sprintf(sTemp, "%d", iCurrentSocket);
RightJustify(sTemp, 4);
PutString(76, 2, sTemp, cDataColor);
*/ }
void TD2Game::DrawGame(void)
{
iCurrentView = 2;
}
void TD2Game::RefreshGame(void)
{
}
void TD2Game::RefreshData(void)
{
iUpdate = 0;
int wx = wherex();
int wy = wherey();
if (iCurrentView == 1)
RefreshList();
//asdf
gotoxy(wx, wy);
DPack->Refresh();
}