CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

LOADDLG.H (3649B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /* $Header: /CounterStrike/LOADDLG.H 1     3/03/97 10:25a Joe_bostic $ */
     17 /***********************************************************************************************
     18  ***              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               ***
     19  ***********************************************************************************************
     20  *                                                                         						  *
     21  *                 Project Name : Command & Conquer                        						  *
     22  *                                                                         						  *
     23  *                    File Name : LOADDLG.H 	                              						  *
     24  *                                                                         						  *
     25  *                   Programmer : Maria Legg, Joe Bostic, Bill Randolph     						  *
     26  *                                                                         						  *
     27  *                   Start Date : March 19, 1995															  *
     28  *                                                                         						  *
     29  *                  Last Update : March 19, 1995															  *
     30  *                                                                         						  *
     31  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     32 
     33 #ifndef LOADDLG_H
     34 #define LOADDLG_H
     35 
     36 class FileEntryClass {
     37 	public:
     38 		char Descr[80];				// save-game description
     39 		unsigned Scenario;			// scenario #
     40 		HousesType House;				// house
     41 		int Num;							// save file number (from the extension)
     42 		unsigned long DateTime;		// date/time stamp of file
     43 		bool Valid;						// Is the scenario valid?
     44 };
     45 
     46 class LoadOptionsClass
     47 {
     48 	public:
     49 		/*
     50 		** This defines the style of the dialog
     51 		*/
     52 		typedef enum OperationModeEnum {
     53 			NONE = 0,
     54 			LOAD,
     55 			SAVE,
     56 			WWDELETE
     57 		} LoadStyleType;
     58 
     59 		LoadOptionsClass (LoadStyleType style = LoadOptionsClass::NONE);
     60 		~LoadOptionsClass ();
     61 		int Process (void);
     62 
     63 
     64 	protected:
     65 		/*
     66 		** Internal routines
     67 		*/
     68 		void Clear_List (ListClass *list);		// clears the list & game # array
     69 		void Fill_List (ListClass *list);		// fills the list & game # array
     70 		int Num_From_Ext (char *fname);			// translates filename to file #
     71 		static int Compare(const void *p1, const void *p2); // for qsort()
     72 
     73 		/*
     74 		** This is the requested style of the dialog
     75 		*/
     76 		LoadStyleType Style;
     77 
     78 		/*
     79 		** This is an array of pointers to FileEntryClass objects.  These objects
     80 		** are allocated on the fly as files are found, and pointers to them are
     81 		** added to the vector list.  Thus, all the objects must be free'd before
     82 		** the vector list is cleared.  This list is used for sorting the files
     83 		** by date/time.
     84 		*/
     85 		DynamicVectorClass<FileEntryClass *> Files;
     86 };
     87 
     88 
     89 #endif
     90