AnnounceEvent.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/commando/AnnounceEvent.h $
  22. *
  23. * DESCRIPTION
  24. * Client announcement
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. * $Author: Patrick $
  29. *
  30. * VERSION INFO
  31. * $Revision: 5 $
  32. * $Modtime: 11/28/01 4:22p $
  33. *
  34. ******************************************************************************/
  35. #ifndef __ANNOUNCEEVENT_H__
  36. #define __ANNOUNCEEVENT_H__
  37. #include "NetEvent.h"
  38. #include "NetClassIDs.h"
  39. enum AnnouncementEnum
  40. {
  41. ANNOUNCEMENT_PUBLIC = 0,
  42. ANNOUNCEMENT_TEAM,
  43. ANNOUNCEMENT_PRIVATE,
  44. };
  45. class CSAnnouncement :
  46. public cNetEvent
  47. {
  48. public:
  49. CSAnnouncement();
  50. virtual ~CSAnnouncement();
  51. void Init(int to_id, int announcementID, AnnouncementEnum type, int radio_cmd_id = -1);
  52. virtual void Export_Creation(BitStreamClass& packet);
  53. virtual void Import_Creation(BitStreamClass& packet);
  54. virtual uint32 Get_Network_Class_ID(void) const
  55. {return NETCLASSID_CSANNOUNCEMENT;}
  56. protected:
  57. CSAnnouncement(const CSAnnouncement&);
  58. const CSAnnouncement& operator=(const CSAnnouncement&);
  59. virtual void Act(void);
  60. int mToID;
  61. int mFromID;
  62. int mAnnouncementID;
  63. int mRadioCmdID;
  64. AnnouncementEnum mType;
  65. };
  66. class SCAnnouncement :
  67. public cNetEvent
  68. {
  69. public:
  70. SCAnnouncement();
  71. virtual ~SCAnnouncement();
  72. void Init(int to_id, int from_id, int announcementID, AnnouncementEnum type, int radio_cmd_id = -1);
  73. virtual void Export_Creation(BitStreamClass& packet);
  74. virtual void Import_Creation(BitStreamClass& packet);
  75. virtual uint32 Get_Network_Class_ID(void) const
  76. {return NETCLASSID_SCANNOUNCEMENT;}
  77. protected:
  78. SCAnnouncement(const SCAnnouncement&);
  79. const SCAnnouncement& operator=(const SCAnnouncement&);
  80. virtual void Act(void);
  81. void Set_Dirty_Bit_For_Team(DIRTY_BIT bit, int team);
  82. int mToID;
  83. int mFromID;
  84. int mAnnouncementID;
  85. int mRadioCmdID;
  86. AnnouncementEnum mType;
  87. };
  88. #endif // __ANNOUNCEEVENT_H__