Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
parameterlist.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/***********************************************************************************************
20 *** 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 ***
21 ***********************************************************************************************
22 * *
23 * Project Name : WWSaveLoad *
24 * *
25 * $Archive:: /Commando/Code/wwsaveload/parameterlist.h $*
26 * *
27 * Author:: Patrick Smith *
28 * *
29 * $Modtime:: 10/06/99 2:52p $*
30 * *
31 * $Revision:: 9 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42
43
44
45#ifndef __PARAMETER_LIST_H
46#define __PARAMETER_LIST_H
47
48#include "always.h"
49#include "vector.h"
50#include "parameter.h"
51#include "wwdebug.h"
52
54//
55// ParameterListClass
56//
58class ParameterListClass : public DynamicVectorClass<ParameterClass *>
59{
60public:
61
63 // Public constructurs/destructors
66
68 // Public methods
70 void Add (void *data, const char *param_name, ParameterClass::Type type);
71 void Add (ParameterClass *parameter);
72
73protected:
74
76 // Protected methods
78 void Free_Parameters (void);
79
80private:
81
83 // Private member data
85 //DynamicVectorClass<ParameterClass *> m_Parameters;
86};
87
88
90// ~ParameterListClass
92inline
98
100// Add
102inline void
103ParameterListClass::Add (void *data, const char *param_name, ParameterClass::Type type)
104{
105 //
106 // Create a new parameter object
107 //
108 ParameterClass *new_param = ParameterClass::Construct (type, data, param_name);
109
110 //
111 // Add the new paramter object to our list
112 //
113 WWASSERT (new_param != NULL);
114 if (new_param != NULL) {
116 }
117
118 return ;
119}
120
122// Add
124inline void
126{
127 //
128 // Add the new paramter object to our list
129 //
130 if (new_param != NULL) {
132 }
133
134 return ;
135}
136
138// Free_Parameters
140inline void
142{
143 for (int index = 0; index < Count (); index ++) {
144 ParameterClass *param = Vector[index];
145
146 //
147 // Free the parameter object
148 //
149 if (param != NULL) {
150 delete param;
151 }
152 }
153
154 Delete_All();
155// m_Parameters.Delete_All ();
156 return ;
157}
158
159
160#endif //__PARAMETER_LIST_H
161
#define NULL
Definition BaseType.h:92
#define WWASSERT
DynamicVectorClass(unsigned size=0, ParameterClass *const *array=0)
Definition Vector.H:587
bool Add(T const &object)
Definition Vector.H:671
static ParameterClass * Construct(ParameterClass::Type type, void *data, const char *param_name)
Definition parameter.cpp:56
void Free_Parameters(void)
void Add(void *data, const char *param_name, ParameterClass::Type type)
ParameterClass ** Vector
Definition Vector.H:114
else return(RetVal)