SMUDGE.H 4.3 KB

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