DOOR.H 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. ** Command & Conquer(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: F:\projects\c&c\vcs\code\door.h_v 1.8 16 Oct 1995 16:47:54 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 : DOOR.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : 06/11/95 *
  30. * *
  31. * Last Update : June 11, 1995 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef DOOR_H
  37. #define DOOR_H
  38. class DoorClass
  39. {
  40. private:
  41. /*
  42. ** This is the animation control handler.
  43. */
  44. StageClass Control;
  45. /*
  46. ** This is the recorded number of stages of the current
  47. ** door animation process.
  48. */
  49. unsigned char Stages;
  50. /*
  51. ** This is the door state.
  52. */
  53. enum {
  54. IS_CLOSED, // Door is closed.
  55. IS_OPENING, // Door is in the process of opening.
  56. IS_OPEN, // Door is fully open.
  57. IS_CLOSING // Door is in the process of closing.
  58. } State;
  59. /*
  60. ** If the animation for this door indicates that the object it is
  61. ** attached to should be redrawn, then this flag will be true.
  62. */
  63. unsigned IsToRedraw:1;
  64. public:
  65. DoorClass(void);
  66. bool Time_To_Redraw(void) {return(IsToRedraw);};
  67. void Clear_Redraw_Flag(void) {IsToRedraw = false;};
  68. void AI(void);
  69. int Door_Stage(void) const;
  70. bool Is_Door_Opening(void) {return(State == IS_OPENING);};
  71. bool Is_Door_Closing(void) {return(State == IS_CLOSING);};
  72. bool Open_Door(int rate, int stages);
  73. bool Close_Door(int rate, int stages);
  74. bool Is_Door_Open(void) {return(State == IS_OPEN);};
  75. bool Is_Door_Closed(void) {return(State == IS_CLOSED);};
  76. bool Is_Ready_To_Open(void);
  77. /*
  78. ** File I/O.
  79. */
  80. void Code_Pointers(void) { return; }
  81. void Decode_Pointers(void) { return; }
  82. };
  83. #endif