simplegameobj.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. ** Command & Conquer Renegade(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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/simplegameobj.h $*
  25. * *
  26. * $Author:: Byon_g $*
  27. * *
  28. * $Modtime:: 12/17/01 8:06p $*
  29. * *
  30. * $Revision:: 22 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef SIMPLEGAMEOBJ_H
  36. #define SIMPLEGAMEOBJ_H
  37. #ifndef ALWAYS_H
  38. #include "always.h"
  39. #endif
  40. #ifndef PHYSICALGAMEOBJ_H
  41. #include "physicalgameobj.h"
  42. #endif
  43. #include "playerterminal.h"
  44. /*
  45. ** SimpleGameObjDef - Defintion class for a SimpleGameObj
  46. */
  47. class SimpleGameObjDef : public PhysicalGameObjDef
  48. {
  49. public:
  50. SimpleGameObjDef( void );
  51. virtual uint32 Get_Class_ID( void ) const;
  52. virtual PersistClass * Create( void ) const ;
  53. virtual bool Save( ChunkSaveClass &csave );
  54. virtual bool Load( ChunkLoadClass &cload );
  55. virtual const PersistFactoryClass & Get_Factory( void ) const;
  56. DECLARE_EDITABLE( SimpleGameObjDef, PhysicalGameObjDef );
  57. // Accessors
  58. PlayerTerminalClass::TYPE Get_Player_Terminal_Type( void ) const { return PlayerTerminalType; }
  59. bool Get_Is_Editor_Object( void ) const { return IsEditorObject; }
  60. protected:
  61. bool IsEditorObject;
  62. bool IsHiddenObject;
  63. friend class SimpleGameObj;
  64. // See playerterminal.h
  65. PlayerTerminalClass::TYPE PlayerTerminalType;
  66. };
  67. /*
  68. **
  69. */
  70. class SimpleGameObj : public PhysicalGameObj {
  71. public:
  72. SimpleGameObj();
  73. virtual ~SimpleGameObj();
  74. // Definitions
  75. virtual void Init( void );
  76. void Init( const SimpleGameObjDef & definition );
  77. const SimpleGameObjDef & Get_Definition( void ) const ;
  78. // RTTI
  79. virtual SimpleGameObj *As_SimpleGameObj( void ) { return this; }
  80. // SimpleGameObj interface
  81. bool Is_Hidden_Object(void) { return Get_Definition().IsHiddenObject; }
  82. // Save / Load / Construction Factory
  83. virtual bool Save( ChunkSaveClass & csave );
  84. virtual bool Load( ChunkLoadClass & cload );
  85. virtual const PersistFactoryClass & Get_Factory( void ) const;
  86. virtual void On_Post_Load( void );
  87. // Network support - TSS091901
  88. virtual bool Is_Always_Dirty( void ) { return false; }
  89. };
  90. #endif // SIMPLEGAMEOBJ_H