CnC_Remastered_Collection

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

SMUDGE.H (4363B)


      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/SMUDGE.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 : SMUDGE.H                                                     *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : August 9, 1994                                               *
     28  *                                                                                             *
     29  *                  Last Update : August 9, 1994   [JLB]                                       *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef SMUDGE_H
     36 #define SMUDGE_H
     37 
     38 #include	"object.h"
     39 #include	"type.h"
     40 
     41 
     42 /******************************************************************************
     43 **	This is the transitory form for smudges. They exist as independent objects
     44 **	only in the transition stage from creation to placement upon the map. Once
     45 **	they are placed on the map, they merely become 'smudges' in the cell data. This
     46 **	object is then destroyed.
     47 */
     48 class SmudgeClass : public ObjectClass
     49 {
     50 	public:
     51 		/*
     52 		**	This is a pointer to the template object's class.
     53 		*/
     54 		CCPtr<SmudgeTypeClass> Class;
     55 
     56 		/*-------------------------------------------------------------------
     57 		**	Constructors and destructors.
     58 		*/
     59 		static void * operator new(size_t size);
     60 		static void * operator new(size_t , void * ptr) {return(ptr);};
     61 		static void operator delete(void *ptr);
     62 		SmudgeClass(SmudgeType type, COORDINATE pos=0xFFFFFFFFUL, HousesType house = HOUSE_NONE);
     63 		SmudgeClass(NoInitClass const & x) : ObjectClass(x), Class(x) {};
     64 		operator SmudgeType(void) const {return Class->Type;};
     65 		virtual ~SmudgeClass(void) {if (GameActive) SmudgeClass::Limbo();Class=0;};
     66 
     67 		static void Init(void);
     68 
     69 		/*
     70 		**	File I/O.
     71 		*/
     72 		static void Read_INI(CCINIClass & ini);
     73 		static void Write_INI(CCINIClass & ini);
     74 		static char *INI_Name(void) {return "SMUDGE";};
     75 		bool Load(Straw & file);
     76 		bool Save(Pipe & file) const;
     77 
     78 		virtual ObjectTypeClass const & Class_Of(void) const {return *Class;};
     79 		virtual bool Mark(MarkType);
     80 		virtual void Draw_It(int , int , WindowNumberType ) const {};
     81 
     82 		void Disown(CELL cell);
     83 
     84 	private:
     85 
     86 		static HousesType ToOwn;
     87 
     88 
     89 		/*
     90 		** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load
     91 		*/
     92 		unsigned char SaveLoadPadding[8];
     93 
     94 };
     95 
     96 #endif