transitiongameobj.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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/transitiongameobj.h $*
  25. * *
  26. * $Author:: Patrick $*
  27. * *
  28. * $Modtime:: 11/16/01 3:19p $*
  29. * *
  30. * $Revision:: 11 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef TRANSITIONGAMEOBJ_H
  36. #define TRANSITIONGAMEOBJ_H
  37. #ifndef ALWAYS_H
  38. #include "always.h"
  39. #endif
  40. #ifndef BASEGAMEOBJ_H
  41. #include "basegameobj.h"
  42. #endif
  43. #ifndef TRANSITION_H
  44. #include "transition.h"
  45. #endif
  46. /*
  47. ** TransitionGameObjDef - Defintion class for a TransitionGameObj
  48. */
  49. class TransitionGameObjDef : public BaseGameObjDef
  50. {
  51. public:
  52. TransitionGameObjDef( void ) {};
  53. virtual ~TransitionGameObjDef( void );
  54. virtual uint32 Get_Class_ID( void ) const;
  55. virtual PersistClass * Create( void ) const ;
  56. virtual bool Save( ChunkSaveClass &csave );
  57. virtual bool Load( ChunkLoadClass &cload );
  58. virtual const PersistFactoryClass & Get_Factory( void ) const;
  59. TRANSITION_DATA_LIST * Get_Transition_List( void ) { return &Transitions; }
  60. const TRANSITION_DATA_LIST & Get_Transition_List( void ) const { return Transitions; }
  61. void Free_Transition_List( void );
  62. protected:
  63. TRANSITION_DATA_LIST Transitions;
  64. friend class TransitionGameObj;
  65. };
  66. /*
  67. **
  68. */
  69. class TransitionGameObj : public BaseGameObj {
  70. public:
  71. TransitionGameObj();
  72. ~TransitionGameObj();
  73. // Definitions
  74. virtual void Init( void );
  75. void Init( const TransitionGameObjDef & definition );
  76. const TransitionGameObjDef & Get_Definition( void ) const ;
  77. // Save / Load / Construction Factory
  78. virtual bool Save( ChunkSaveClass & csave );
  79. virtual bool Load( ChunkLoadClass & cload );
  80. virtual const PersistFactoryClass & Get_Factory( void ) const;
  81. virtual void On_Post_Load( void );
  82. // Physics
  83. void Set_Transform(const Matrix3D & tm);
  84. const Matrix3D & Get_Transform(void) const;
  85. // Transition access
  86. void Create_Transitions( void );
  87. void Destroy_Transitions( void );
  88. void Update_Transitions( void );
  89. int Get_Transition_Count( void ) const { return TransitionInstances.Count(); }
  90. TransitionInstanceClass * Get_Transition( int index ) { return TransitionInstances[index]; }
  91. //
  92. // Ladder support
  93. //
  94. int Get_Ladder_Index( void ) { return LadderIndex; }
  95. void Set_Ladder_Index( int ladder_index );
  96. protected:
  97. DynamicVectorClass<TransitionInstanceClass *> TransitionInstances;
  98. Matrix3D TM;
  99. int LadderIndex;
  100. };
  101. #endif // TRANSITIONGAMEOBJ_H