-
Notifications
You must be signed in to change notification settings - Fork 0
/
AISTUN.HXX
70 lines (57 loc) · 1.76 KB
/
AISTUN.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
61
62
63
64
65
66
67
68
69
70
/* ========================================================================
Copyright (c) 1990,1996 Synergistic Software
All Rights Reserved
========================================================================
Filename: aifirebl.hxx
Author: Lan Zhou
======================================================================== */
#if !defined(_AISTUN_HXX)
#define _AISTUN_HXX
#if !defined(_AVATAR_HXX)
#include "avatar.hxx"
#endif
/* -----------------------------------------------------------------
class definition
----------------------------------------------------------------- */
class STUNNED_DATA
{
public:
void mfInitVals();
static void mfSwitchToStunned(LONG hAvatar);
// Write to Scene File
void mfWriteData(FILE *fp) const;
// Read from Scene File
const LONG mfReadData(FILE *fp);
VECTOR_3D Movement;
POINT_3D Home;
POINT_3D Target;
SHORT hWhoCast; // To hand back experience pts.
};
/* -----------------------------------------------------------------
inline member functions
----------------------------------------------------------------- */
// Initialize the values to something reasonable.
// To be called if created on the fly by the scene file.
inline void STUNNED_DATA::mfInitVals()
{
Movement.dx = 0;
Movement.dy = 0;
Movement.dz = 0;
}
// write member data to scene file
inline void STUNNED_DATA::mfWriteData(FILE *fp) const
{
fprintf(fp, "%ld %ld\n", Movement.dx, Movement.dy);
}
// read member data from scene file
inline const LONG STUNNED_DATA::mfReadData(FILE *fp)
{
char cpBuffer[80];
LONG Result = GetNextLine(fp, cpBuffer, sizeof(cpBuffer));
if (Result != EOF)
{
Result = ( (2 == sscanf(cpBuffer, "%ld %ld", &Movement.dx, &Movement.dy) ) ? Result : EOF);
}
return Result;
}
#endif