orator.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. *** 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 ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/orator.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 10/30/01 2:43p $*
  29. * *
  30. * $Revision:: 9 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __ORATOR_H
  39. #define __ORATOR_H
  40. #include "vector3.h"
  41. #include "gameobjref.h"
  42. ////////////////////////////////////////////////////////////////
  43. // Forward declarations
  44. ////////////////////////////////////////////////////////////////
  45. class ChunkSaveClass;
  46. class ChunkLoadClass;
  47. class PhysicalGameObj;
  48. class ActiveConversationClass;
  49. ////////////////////////////////////////////////////////////////
  50. //
  51. // OratorClass
  52. //
  53. ////////////////////////////////////////////////////////////////
  54. class OratorClass
  55. {
  56. public:
  57. ////////////////////////////////////////////////////////////////
  58. // Public flags
  59. ////////////////////////////////////////////////////////////////
  60. typedef enum
  61. {
  62. FLAG_DONT_MOVE = 0x00000001,
  63. FLAG_DONT_TURN_HEAD = 0x00000002,
  64. FLAG_TEMP_DONT_FACE = 0x00000004,
  65. FLAG_DONT_FACE = 0x00000008,
  66. } FLAGS;
  67. ////////////////////////////////////////////////////////////////
  68. // Public constructors/destructors
  69. ////////////////////////////////////////////////////////////////
  70. OratorClass (void);
  71. ~OratorClass (void);
  72. ////////////////////////////////////////////////////////////////
  73. // Public operators
  74. ////////////////////////////////////////////////////////////////
  75. bool operator== (const OratorClass &src) { return (ID == src.ID); }
  76. bool operator!= (const OratorClass &src) { return (ID != src.ID); }
  77. ////////////////////////////////////////////////////////////////
  78. // Public methods
  79. ////////////////////////////////////////////////////////////////
  80. //
  81. // Initialization
  82. //
  83. void Initialize (PhysicalGameObj *game_obj);
  84. //
  85. // Inline accessors
  86. //
  87. void Set_Position (const Vector3 &pos) { Position = pos; }
  88. const Vector3 & Get_Position (void) const { return Position; }
  89. void Set_Has_Arrived (bool has_arrived) { HasArrived = has_arrived; }
  90. bool Has_Arrived (void) const { return HasArrived; }
  91. PhysicalGameObj * Get_Game_Obj (void) const;
  92. int Get_Orator_Type (void) const { return OratorType; }
  93. void Set_Orator_Type (int type) { OratorType = type; }
  94. bool Is_Invisible (void) const { return IsInvisible; }
  95. void Set_Is_Invisible (bool onoff) { IsInvisible = onoff; }
  96. void Set_Look_At_Obj (int obj_id) { LookAtObjID = obj_id; }
  97. int Get_Look_At_Obj (void) const { return LookAtObjID; }
  98. //
  99. // Save/load methods
  100. //
  101. bool Save (ChunkSaveClass &csave);
  102. bool Load (ChunkLoadClass &cload);
  103. //
  104. // Identification
  105. //
  106. int Get_ID (void) const { return ID; }
  107. void Set_ID (int id) { ID = id; }
  108. //
  109. // Flags
  110. //
  111. void Set_Flags (int flags);
  112. void Set_Flag (int flag, bool onoff);
  113. bool Get_Flag (int flag);
  114. //
  115. // Conversation access
  116. //
  117. ActiveConversationClass * Peek_Conversation (void) const { return Conversation; }
  118. void Set_Conversation (ActiveConversationClass *conversation) { Conversation = conversation; }
  119. private:
  120. ////////////////////////////////////////////////////////////////
  121. // Private methods
  122. ////////////////////////////////////////////////////////////////
  123. void Load_Variables (ChunkLoadClass &cload);
  124. ////////////////////////////////////////////////////////////////
  125. // Private member data
  126. ////////////////////////////////////////////////////////////////
  127. ActiveConversationClass * Conversation;
  128. GameObjReference GameObj;
  129. Vector3 Position;
  130. bool HasArrived;
  131. int Flags;
  132. int ID;
  133. int OratorType;
  134. int LookAtObjID;
  135. bool IsInvisible;
  136. };
  137. #endif //__ORATOR_H