-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAIFOLID.HXX
56 lines (46 loc) · 1.43 KB
/
AIFOLID.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
/* ========================================================================
Copyright (c) 1990,1996 Synergistic Software
All Rights Reserved
========================================================================
Filename: aifolid.hxx
Author: Greg Hightower
======================================================================== */
#ifndef _AIFOLID_H
#define _AIFOLID_H
#if !defined(_FILEUTIL_H)
#include "fileutil.h"
#endif
/* -----------------------------------------------------------------
class definition
----------------------------------------------------------------- */
class FOLLOW_ID_DATA
{
public:
// Write to Scene File
void mfWriteData(FILE *fp);
// Read from Scene File
LONG mfReadData(FILE *fp);
LONG Id; // who I follow
LONG Rate; // My speed to keep up with him
LONG NewX; // where I try to move to
LONG NewY;
LONG NewA;
};
/* -----------------------------------------------------------------
inline member functions
----------------------------------------------------------------- */
inline void FOLLOW_ID_DATA::mfWriteData(FILE *fp)
{
fprintf(fp, "%ld\n", Id);
}
inline LONG FOLLOW_ID_DATA::mfReadData(FILE *fp)
{
char cpBuffer[80];
LONG Result = GetNextLine(fp, cpBuffer, sizeof (cpBuffer));
if (Result != EOF)
{
Result = ( (1 ==sscanf(cpBuffer, "%ld", &Id) ? Result : EOF));
}
return Result;
}
#endif