-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAIHHOUND.HXX
74 lines (61 loc) · 1.89 KB
/
AIHHOUND.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
71
72
73
74
/* ========================================================================
Copyright (c) 1990,1996 Synergistic Software
All Rights Reserved
========================================================================
Filename: AiHHound.hxx
Author: Greg Hightower & Gary Powell & Wes Cumberland
======================================================================== */
#ifndef _AIPONG_H
#define _AIPONG_H
#if !defined(_ATHING_HXX)
#include "athing.hxx"
#endif
#if !defined(_AVATAR_HXX)
#include "avatar.hxx"
#endif
typedef SHORT HDL_AVATAR;
/* -----------------------------------------------------------------
class definition
----------------------------------------------------------------- */
// This AI is to start out inside a MonsterBox.
class HELLHOUND_DATA
{
public:
void mfInitVals();
// Write to Scene File
void mfWriteData(FILE *fp) const;
// Read from Scene File
const LONG mfReadData(FILE *fp);
VECTOR Movement;
LONG HomeX;
LONG HomeY;
LONG HomeZ;
LONG HomeA;
};
/* -----------------------------------------------------------------
inline member functions
----------------------------------------------------------------- */
// Initialize the values to something reasonable.
// To be called if created on the fly by the scene file.
inline void HELLHOUND_DATA::mfInitVals()
{
Movement.dx = 0;
Movement.dy = 0;
}
// write member data to scene file
inline void HELLHOUND_DATA::mfWriteData(FILE *fp) const
{
fprintf(fp, "%ld %ld\n", Movement.dx, Movement.dy);
}
// read member data from scene file
inline const LONG HELLHOUND_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