-
Notifications
You must be signed in to change notification settings - Fork 0
/
AIGUARD.HXX
60 lines (50 loc) · 1.53 KB
/
AIGUARD.HXX
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
/* ========================================================================
Copyright (c) 1990,1996 Synergistic Software
All Rights Reserved
========================================================================
Filename: aiguard.hxx
Author: Greg Hightower
======================================================================== */
#ifndef _AIGUARD_H
#define _AIGUARD_H
/* -----------------------------------------------------------------
class definition
----------------------------------------------------------------- */
class GUARDPT_DATA
{
public:
// Write to Scene File
void mfWriteData(FILE *fp);
// Read from Scene File
LONG mfReadData(FILE * fp);
LONG X;
LONG Y;
LONG StandAsideX;
LONG StandAsideY;
LONG GuardPositionAngle;
SHORT Wave;
protected:
private:
};
/* -----------------------------------------------------------------
inline member functions
----------------------------------------------------------------- */
// write member data to scene file on disk
inline void GUARDPT_DATA::mfWriteData(FILE *fp)
{
fprintf(fp, "%ld %ld %ld %ld\n", X, Y, StandAsideX, StandAsideY);
}
// read member data from scene file off disk
inline LONG GUARDPT_DATA::mfReadData(FILE * fp)
{
char cpBuffer[80];
LONG Result = GetNextLine(fp, cpBuffer, sizeof(cpBuffer));
if (Result != EOF)
{
Result = ( (4 == sscanf(cpBuffer, "%ld %ld %ld %ld",
&X, &Y, &StandAsideX, &StandAsideY) ) ?
Result : EOF);
}
return Result;
}
#endif