Snapshot.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. ** Command & Conquer Generals(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) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: Snapshot.h ///////////////////////////////////////////////////////////////////////////////
  24. // Author: Colin Day, February 2002
  25. // Desc: The Snapshot object is the base class interface for data structures that will
  26. // be considered during game saves, loads, and CRC checks.
  27. ///////////////////////////////////////////////////////////////////////////////////////////////////
  28. #pragma once
  29. #ifndef __SNAPSHOT_H_
  30. #define __SNAPSHOT_H_
  31. // USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
  32. #include "Common/AsciiString.h"
  33. // FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
  34. class Xfer;
  35. //-------------------------------------------------------------------------------------------------
  36. //-------------------------------------------------------------------------------------------------
  37. class Snapshot
  38. {
  39. friend class GameState;
  40. friend class XferLoad;
  41. friend class XferSave;
  42. friend class XferCRC;
  43. public:
  44. Snapshot( void );
  45. ~Snapshot( void );
  46. protected:
  47. /// run the "light" crc check on this data structure
  48. virtual void crc( Xfer *xfer ) = 0;
  49. /** run save, load, or deep CRC check on this data structure, the type depends on the
  50. setup of the Xfer pointer */
  51. virtual void xfer( Xfer *xfer ) = 0;
  52. /** post process phase for loading save games. All save systems have their xfer
  53. run using XferLoad mode, and then all systems each have their post process run */
  54. virtual void loadPostProcess( void ) = 0;
  55. };
  56. #endif // __SNAPSHOT_H_