RADIO.H (4762B)
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 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /* $Header: F:\projects\c&c\vcs\code\radio.h_v 2.15 16 Oct 1995 16:45:32 JOE_BOSTIC $ */ 17 /*********************************************************************************************** 18 *** 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 *** 19 *********************************************************************************************** 20 * * 21 * Project Name : Command & Conquer * 22 * * 23 * File Name : RADIO.H * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : April 23, 1994 * 28 * * 29 * Last Update : April 23, 1994 [JLB] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 34 35 #ifndef RADIO_H 36 #define RADIO_H 37 38 //#include "object.h" 39 #include "mission.h" 40 //#include "flasher.h" 41 42 class ObjectClass; 43 class TechnoClass; 44 45 46 /**************************************************************************** 47 ** Radio contact is controlled by this class. It handles the mundane chore 48 ** of keeping the radio contact alive as well as broadcasting messages 49 ** to the receiving radio. Radio contact is primarily used when one object 50 ** is in "command" of another. 51 */ 52 class RadioClass : public MissionClass { 53 private: 54 55 /* 56 ** This is a record of the last message received by this receiver. 57 */ 58 RadioMessageType LastMessage; 59 60 /* 61 ** This is the object that radio communication has been established 62 ** with. Although is is only a one-way reference, it is required that 63 ** the receiving radio is also tuned to the object that contains this 64 ** radio set. 65 */ 66 RadioClass * Radio; 67 68 /* 69 ** This is a text representation of all the possible radio messages. This 70 ** text is used for monochrome debug printing. 71 */ 72 static char const * Messages[RADIO_COUNT]; 73 74 public: 75 76 /*--------------------------------------------------------------------- 77 ** Constructors, Destructors, and overloaded operators. 78 */ 79 RadioClass(void) {Radio = 0;LastMessage = RADIO_STATIC;}; 80 virtual ~RadioClass(void) {}; 81 82 /*--------------------------------------------------------------------- 83 ** Member function prototypes. 84 */ 85 bool In_Radio_Contact(void) const {return (Radio != 0);}; 86 void Radio_Off(void) {Radio = 0;}; 87 TechnoClass * Contact_With_Whom(void) const {return (TechnoClass*)Radio;}; 88 89 // Inherited from base class(es). 90 virtual RadioMessageType Receive_Message(RadioClass * from, RadioMessageType message, long & param); 91 virtual RadioMessageType Transmit_Message(RadioMessageType message, long & param=LParam, RadioClass * to=NULL); 92 virtual RadioMessageType Transmit_Message(RadioMessageType message, RadioClass * to); 93 #ifdef CHEAT_KEYS 94 virtual void Debug_Dump(MonoClass *mono) const; 95 #endif 96 virtual bool Limbo(void); 97 98 /* 99 ** File I/O. 100 */ 101 virtual void Code_Pointers(void); 102 virtual void Decode_Pointers(void); 103 }; 104 105 #endif