sphere.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: sphere.h
  4. *
  5. * DESCRIPTION:
  6. * This module contains functions for maintaining & moving the spheres of
  7. * annihilation.
  8. *
  9. * =============================================================================
  10. * EXPORTED VARIABLES
  11. *
  12. * None
  13. *
  14. * =============================================================================
  15. * EXPORTED FUNCTIONS
  16. *
  17. * rmsphere : Remove a sphere from a location on the map
  18. * newsphere : Create a new sphere
  19. * movsphere : Move a sphere
  20. * free_spheres : Free all allocated spheres
  21. * write_spheres : Write the spheres to the save file
  22. * read_spheres : Read the spheres from the save file
  23. *
  24. * =============================================================================
  25. */
  26. #ifndef __SPHERE_H
  27. #define __SPHERE_H
  28. #include <stdio.h>
  29. /* =============================================================================
  30. * FUNCTION: rmsphere
  31. *
  32. * DESCRIPTION:
  33. * Function to delete a sphere of annihilation from list.
  34. *
  35. * PARAMETERS:
  36. *
  37. * x : The map x coordinate from which the sphere is to be deleted
  38. *
  39. * y : The map y coordinate from which the sphere is to be deleted
  40. *
  41. * RETURN VALUE:
  42. *
  43. * None.
  44. */
  45. void rmsphere(int x, int y);
  46. /* =============================================================================
  47. * FUNCTION: newsphere
  48. *
  49. * DESCRIPTION:
  50. * Function to create a new sphere of annihilation.
  51. *
  52. * PARAMETERS:
  53. *
  54. * x : The x coordinate of the new sphere
  55. *
  56. * y : The y coordinate of the new sphere
  57. *
  58. * dir : The initial direction of travel for the sphere in diroff format
  59. *
  60. * lifetime : The number of turns the sphere is last.
  61. *
  62. * RETURN VALUE:
  63. *
  64. * None.
  65. */
  66. void newsphere(int x, int y, int dir, int life);
  67. /* =============================================================================
  68. * FUNCTION: movsphere
  69. *
  70. * DESCRIPTION:
  71. * Function to look for and move spheres of annihilation.
  72. *
  73. * PARAMETERS:
  74. *
  75. * None.
  76. *
  77. * RETURN VALUE:
  78. *
  79. * None.
  80. */
  81. void movsphere(void);
  82. /* =============================================================================
  83. * FUNCTION: free_spheres
  84. *
  85. * DESCRIPTION:
  86. * Function to free all spheres of annihilation.
  87. * This needs to be called before exitting the game.
  88. *
  89. * PARAMETERS:
  90. *
  91. * None.
  92. *
  93. * RETURN VALUE:
  94. *
  95. * None.
  96. */
  97. void free_spheres(void);
  98. /* =============================================================================
  99. * FUNCTION: write_spheres
  100. *
  101. * DESCRIPTION:
  102. * Function to write the spheres of annihilation to the save file.
  103. *
  104. * PARAMETERS:
  105. *
  106. * fp : A pointer to the save file being written.
  107. *
  108. * RETURN VALUE:
  109. *
  110. * None.
  111. */
  112. void write_spheres(FILE *fp);
  113. /* =============================================================================
  114. * FUNCTION: read_spheres
  115. *
  116. * DESCRIPTION:
  117. * Function to read the spheres of annihilation from the save file.
  118. *
  119. * PARAMETERS:
  120. *
  121. * fp : A pointer to the save file currently being read.
  122. *
  123. * RETURN VALUE:
  124. *
  125. * None.
  126. */
  127. void read_spheres(FILE *fp);
  128. #endif