2
0

conversation.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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/conversation.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 10/29/01 10:23p $*
  29. * *
  30. * $Revision:: 8 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __CONVERSATION_H
  39. #define __CONVERSATION_H
  40. #include "wwstring.h"
  41. #include "vector.h"
  42. #include "refcount.h"
  43. #include "orator.h"
  44. #include "soldier.h"
  45. #include "conversationremark.h"
  46. ////////////////////////////////////////////////////////////////
  47. // Forward declarations
  48. ////////////////////////////////////////////////////////////////
  49. class ChunkSaveClass;
  50. class ChunkLoadClass;
  51. ////////////////////////////////////////////////////////////////
  52. //
  53. // ConversationClass
  54. //
  55. ////////////////////////////////////////////////////////////////
  56. class ConversationClass : public RefCountClass
  57. {
  58. public:
  59. ////////////////////////////////////////////////////////////////
  60. // Public constructors/destructors
  61. ////////////////////////////////////////////////////////////////
  62. ConversationClass (void);
  63. ConversationClass (const ConversationClass &src);
  64. virtual ~ConversationClass (void);
  65. ////////////////////////////////////////////////////////////////
  66. // Public operators
  67. ////////////////////////////////////////////////////////////////
  68. const ConversationClass & operator= (const ConversationClass &src);
  69. ////////////////////////////////////////////////////////////////
  70. // Public methods
  71. ////////////////////////////////////////////////////////////////
  72. //
  73. // Save/load methods
  74. //
  75. bool Save (ChunkSaveClass &csave);
  76. bool Load (ChunkLoadClass &cload);
  77. //
  78. // Identification methods
  79. //
  80. int Get_ID (void) const { return ID; }
  81. void Set_ID (int id) { ID = id; }
  82. const char * Get_Name (void) const { return Name; }
  83. void Set_Name (const char *name) { Name = name; }
  84. //
  85. // Orator information
  86. //
  87. int Get_Orator_Count (void) const;
  88. OratorClass * Get_Orator (int index);
  89. OratorClass * Find_Orator (int orator_id);
  90. void Add_Orator (const OratorClass &orator);
  91. void Clear_Orators (void);
  92. //
  93. // State requirements
  94. //
  95. SoldierAIState Get_AI_State( void ) const { return AIState; }
  96. void Set_AI_State( SoldierAIState state ) { AIState = state; }
  97. //
  98. // Remark access
  99. //
  100. int Get_Remark_Count (void) const { return RemarkList.Count (); }
  101. bool Get_Remark_Info (int index, ConversationRemarkClass &remark);
  102. void Add_Remark (const ConversationRemarkClass &remark);
  103. void Clear_Remarks (void);
  104. //
  105. // Accessors
  106. //
  107. bool Is_Innate (void) const { return IsInnate; }
  108. void Set_Is_Innate (bool is_innate) { IsInnate = is_innate; }
  109. bool Is_Key (void) const { return IsKey; }
  110. void Set_Is_Key (bool is_key) { IsKey = is_key; }
  111. float Get_Probability (void) const { return Probability; }
  112. void Set_Probability (float percent) { Probability = percent; }
  113. int Get_Category_ID (void) const { return CategoryID; }
  114. void Set_Category_ID (int id) { CategoryID = id; }
  115. int Get_Look_At_Obj_ID (void) const { return LookAtObjID; }
  116. void Set_Look_At_Obj_ID (int id) { LookAtObjID = id; }
  117. int Get_Priority (void) const { return Priority; }
  118. void Set_Priority (int priority) { Priority = priority; }
  119. float Get_Max_Dist (void) const { return MaxDist; }
  120. void Set_Max_Dist (float max_dist) { MaxDist = max_dist; }
  121. bool Is_Interruptable (void) const { return IsInterruptable; }
  122. void Set_Is_Interruptable (bool onoff) { IsInterruptable = onoff; }
  123. protected:
  124. ////////////////////////////////////////////////////////////////
  125. // Protected methods
  126. ////////////////////////////////////////////////////////////////
  127. void Load_Variables (ChunkLoadClass &cload);
  128. ////////////////////////////////////////////////////////////////
  129. // Protected member data
  130. ////////////////////////////////////////////////////////////////
  131. StringClass Name;
  132. int ID;
  133. DynamicVectorClass<ConversationRemarkClass> RemarkList;
  134. DynamicVectorClass<OratorClass> OratorList;
  135. SoldierAIState AIState;
  136. bool IsInnate;
  137. bool IsKey;
  138. float Probability;
  139. int CategoryID;
  140. int LookAtObjID;
  141. int Priority;
  142. float MaxDist;
  143. bool IsInterruptable;
  144. };
  145. #endif //__CONVERSATION_H