LOADDLG.H 3.6 KB

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