RADIO.H 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: /CounterStrike/RADIO.H 1 3/03/97 10:25a Joe_bostic $ */
  15. /***********************************************************************************************
  16. *** 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 ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : RADIO.H *
  22. * *
  23. * Programmer : Joe L. Bostic *
  24. * *
  25. * Start Date : April 23, 1994 *
  26. * *
  27. * Last Update : April 23, 1994 [JLB] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef RADIO_H
  33. #define RADIO_H
  34. #include "mission.h"
  35. class ObjectClass;
  36. class TechnoClass;
  37. /****************************************************************************
  38. ** Radio contact is controlled by this class. It handles the mundane chore
  39. ** of keeping the radio contact alive as well as broadcasting messages
  40. ** to the receiving radio. Radio contact is primarily used when one object
  41. ** is in "command" of another.
  42. */
  43. class RadioClass : public MissionClass {
  44. private:
  45. /*
  46. ** This is a record of the last message received by this receiver.
  47. */
  48. RadioMessageType Old[3];
  49. /*
  50. ** This is the object that radio communication has been established
  51. ** with. Although is is only a one-way reference, it is required that
  52. ** the receiving radio is also tuned to the object that contains this
  53. ** radio set.
  54. */
  55. RadioClass * Radio;
  56. /*
  57. ** This is a text representation of all the possible radio messages. This
  58. ** text is used for monochrome debug printing.
  59. */
  60. static char const * Messages[RADIO_COUNT];
  61. public:
  62. /*---------------------------------------------------------------------
  63. ** Constructors, Destructors, and overloaded operators.
  64. */
  65. RadioClass(RTTIType rtti, int id) : MissionClass(rtti, id), Radio(0) {};
  66. RadioClass(NoInitClass const & x) : MissionClass(x) {};
  67. virtual ~RadioClass(void) {Radio=0;};
  68. /*---------------------------------------------------------------------
  69. ** Member function prototypes.
  70. */
  71. bool In_Radio_Contact(void) const {return (Radio != 0);};
  72. void Radio_Off(void) {Radio = 0;};
  73. TechnoClass * Contact_With_Whom(void) const {return (TechnoClass *)Radio;};
  74. // Inherited from base class(es).
  75. virtual RadioMessageType Receive_Message(RadioClass * from, RadioMessageType message, long & param);
  76. virtual RadioMessageType Transmit_Message(RadioMessageType message, long & param=LParam, RadioClass * to=NULL);
  77. virtual RadioMessageType Transmit_Message(RadioMessageType message, RadioClass * to);
  78. #ifdef CHEAT_KEYS
  79. virtual void Debug_Dump(MonoClass *mono) const;
  80. #endif
  81. virtual bool Limbo(void);
  82. /*
  83. ** File I/O.
  84. */
  85. virtual void Code_Pointers(void);
  86. virtual void Decode_Pointers(void);
  87. };
  88. #endif