GroupControl.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. * GroupControl.h
  22. *
  23. * DESCRIPTION
  24. * Group controller definitions
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. *
  29. * VERSION INFO
  30. * $Author: Pat_p $
  31. * $Revision: 2 $
  32. * $Modtime: 4/26/00 10:32a $
  33. * $Archive: /Commando/Code/Scripts/GroupControl.h $
  34. *
  35. ******************************************************************************/
  36. #ifndef _GROUPCONTROL_H_
  37. #define _GROUPCONTROL_H_
  38. #include "scripts.h"
  39. #include "slist.h"
  40. class Group;
  41. class GroupController
  42. {
  43. public:
  44. // Retrieve pointer to the GroupController
  45. static GroupController* Instance(void);
  46. GroupController();
  47. ~GroupController();
  48. // Find a Group with the specified name.
  49. Group* FindGroup(const char* groupName);
  50. // Add a GameObject to the specified Group.
  51. bool AddToGroup(const char* groupName, GameObject* object);
  52. // Remove a GameObject from the specified Group,
  53. void RemoveFromGroup(const char* groupName, GameObject* object);
  54. // Send a Group a custom event.
  55. void SendGroupCustomEvent(const char* groupName, GameObject* from,
  56. int command, int data);
  57. protected:
  58. // Create a Group with the specified name.
  59. Group* FindOrCreateGroup(const char* groupName);
  60. private:
  61. // Instance pointer to GroupController
  62. static GroupController* _mInstance;
  63. // List of groups
  64. SList<Group> mGroups;
  65. };
  66. #endif // _GROUPCONTROL_H_