CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

RADIO.H (4767B)


      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: /CounterStrike/RADIO.H 1     3/03/97 10:25a 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	"mission.h"
     39 
     40 class ObjectClass;
     41 class TechnoClass;
     42 
     43 
     44 /****************************************************************************
     45 **	Radio contact is controlled by this class. It handles the mundane chore
     46 **	of keeping the radio contact alive as well as broadcasting messages
     47 **	to the receiving radio. Radio contact is primarily used when one object
     48 **	is in "command" of another.
     49 */
     50 class RadioClass : public MissionClass {
     51 	private:
     52 
     53 		/*
     54 		**	This is a record of the last message received by this receiver.
     55 		*/
     56 		RadioMessageType Old[3];
     57 
     58 		/*
     59 		**	This is the object that radio communication has been established
     60 		**	with. Although is is only a one-way reference, it is required that
     61 		**	the receiving radio is also tuned to the object that contains this
     62 		**	radio set.
     63 		*/
     64 		RadioClass * Radio;
     65 
     66 		/*
     67 		**	This is a text representation of all the possible radio messages. This
     68 		**	text is used for monochrome debug printing.
     69 		*/
     70 		static char const * Messages[RADIO_COUNT];
     71 
     72 	public:
     73 
     74 		/*---------------------------------------------------------------------
     75 		**	Constructors, Destructors, and overloaded operators.
     76 		*/
     77 		RadioClass(RTTIType rtti, int id) : MissionClass(rtti, id), Radio(0) {};
     78 		RadioClass(NoInitClass const & x) : MissionClass(x) {};
     79 		virtual ~RadioClass(void) {Radio=0;};
     80 
     81 		/*---------------------------------------------------------------------
     82 		**	Member function prototypes.
     83 		*/
     84 		bool In_Radio_Contact(void) const {return (Radio != 0);};
     85 		void Radio_Off(void) {Radio = 0;};
     86 		TechnoClass * Contact_With_Whom(void) const {return (TechnoClass *)Radio;};
     87 
     88 		// Inherited from base class(es).
     89 		virtual RadioMessageType Receive_Message(RadioClass * from, RadioMessageType message, long & param);
     90 		virtual RadioMessageType Transmit_Message(RadioMessageType message, long & param=LParam, RadioClass * to=NULL);
     91 		virtual RadioMessageType Transmit_Message(RadioMessageType message, RadioClass * to);
     92 		#ifdef CHEAT_KEYS
     93 		virtual void Debug_Dump(MonoClass *mono) const;
     94 		#endif
     95 		virtual bool Limbo(void);
     96 
     97 		/*
     98 		**	File I/O.
     99 		*/
    100 		virtual void Code_Pointers(void);
    101 		virtual void Decode_Pointers(void);
    102 };
    103 
    104 #endif