This repository was archived by the owner on Feb 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 511
/
Copy pathBASE.H
127 lines (108 loc) · 5.01 KB
/
BASE.H
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
/*
** Command & Conquer(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* $Header: F:\projects\c&c\vcs\code\base.h_v 1.12 16 Oct 1995 16:46:38 JOE_BOSTIC $ */
/***********************************************************************************************
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
***********************************************************************************************
* *
* Project Name : Command & Conquer *
* *
* File Name : BASE.H *
* *
* Programmer : Bill Randolph *
* *
* Start Date : 03/27/95 *
* *
* Last Update : March 27, 1995 *
* *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef BASE_H
#define BASE_H
/****************************************************************************
** This class defines one "node" in the pre-built base list. Each node
** contains a type of building to build, and the COORD to build it at.
*/
class BaseNodeClass
{
public:
BaseNodeClass(void) {};
int operator == (BaseNodeClass const & node);
int operator != (BaseNodeClass const & node);
int operator > (BaseNodeClass const & node);
StructType Type;
COORDINATE Coord;
};
/****************************************************************************
** This is the class that defines a pre-built base for the computer AI.
** (Despite its name, this is NOT the "base" class for C&C's class hierarchy!)
*/
class BaseClass
{
public:
/**********************************************************************
** Constructor/Destructor
*/
BaseClass(void) {};
virtual ~BaseClass() {Nodes.Clear();}
/**********************************************************************
** Initialization
*/
void Init(void) {Nodes.Clear();}
/**********************************************************************
** The standard suite of load/save support routines
*/
void Read_INI(char *buffer);
void Write_INI(char *buffer);
static char *INI_Name(void) {return "Base";}
bool Load(FileClass & file);
bool Save(FileClass & file);
virtual void Code_Pointers(void) {};
virtual void Decode_Pointers(void) {};
/**********************************************************************
** Tells if the given node has been built or not
*/
bool Is_Built(int index);
/**********************************************************************
** Returns a pointer to the object for the given node
*/
BuildingClass * Get_Building(int index);
/**********************************************************************
** Tells if the given building ptr is a node in this base's list.
*/
bool Is_Node (BuildingClass *obj);
/**********************************************************************
** Returns a pointer to the requested node.
*/
BaseNodeClass * Get_Node(BuildingClass *obj);
BaseNodeClass * Get_Node(int index) { return (&Nodes[index]); }
/**********************************************************************
** Returns a pointer to the next "hole" in the Nodes list.
*/
BaseNodeClass * Next_Buildable(StructType type = STRUCT_NONE);
/**********************************************************************
** This is the list of "nodes" that define the base. Portions of this
** list can be pre-built by simply saving those buildings in the INI
** along with non-base buildings, so Is_Built will return true for them.
*/
DynamicVectorClass<BaseNodeClass> Nodes;
/**********************************************************************
** This is the house this base belongs to.
*/
HousesType House;
};
#endif