STAGE.H 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. ** Command & Conquer Red Alert(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. /* $Header: /CounterStrike/STAGE.H 1 3/03/97 10:25a Joe_bostic $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : STAGE.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : June 17, 1994 *
  30. * *
  31. * Last Update : June 17, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef STAGE_H
  37. #define STAGE_H
  38. class StageClass {
  39. /*
  40. ** This handles the animation stage of the object. This includes smoke, walking,
  41. ** flapping, and rocket flames.
  42. */
  43. unsigned Stage;
  44. /*
  45. ** This is the countdown timer for stage animation. When this counts down
  46. ** to zero, then the stage increments by one and the time cycle starts
  47. ** over again.
  48. */
  49. CDTimerClass<FrameTimerClass> Timer;
  50. /*
  51. ** This is the value to assign the StageTimer whenever it needs to be reset. Thus,
  52. ** this value is the control of how fast the stage value increments.
  53. */
  54. int Rate;
  55. public:
  56. StageClass(void) : Stage(0), Timer(0), Rate(0) {};
  57. StageClass(NoInitClass const & x) : Timer(x) {};
  58. int Fetch_Stage(void) const {return(Stage);};
  59. int Fetch_Rate(void) const {return(Rate);};
  60. void Set_Stage(int stage) {Stage = stage;};
  61. void Set_Rate(int rate) {Timer = rate; Rate = rate;};
  62. void AI(void) {};
  63. bool About_To_Change(void) const {return(Timer == 0 && Rate != 0);}
  64. bool Graphic_Logic(void) {
  65. if (About_To_Change()) {
  66. Stage++;
  67. Timer = Rate;
  68. return(true);
  69. }
  70. return(false);
  71. };
  72. };
  73. #endif