Guest User

Untitled

a guest
Nov 29th, 2011
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1.  
  2. #ifndef HEADER_H
  3. #define HEADER_H
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. const int MAX = 25;
  8. const int Size = 10;
  9.  
  10. class Lunch;
  11. class janitor;
  12.  
  13. class school
  14. {
  15. public:
  16. school(int gridSize = MAX)//sets grid size to const MAX
  17. {
  18. SetSize(getSize());
  19. clear(School);
  20. // build(gridSize, School);
  21. // print(gridSize, School);
  22. }
  23.  
  24. school(); //default constructor
  25.  
  26. //friend class Lunch;
  27. //friend functions allow lunch and janitor to be placed within the school class
  28. friend void place_me(school & skool, Lunch & lunch, const int Size);
  29. friend void place_Janitor (school & escuela, janitor & Willie, const int Size);
  30. friend void random_move(school & skool, Lunch & lunch);
  31. friend void rand_walk (school & escuela, janitor & Willie);
  32. void print(const int Size, const char School[MAX][MAX]);
  33. void clear(char School[MAX][MAX]);
  34. void build(const int Size, school & skool, Lunch & lunch, janitor & Jan);
  35. //Get function
  36. int getSize()const {return Size;}
  37.  
  38. //Set function
  39. void SetSize(const int n);
  40.  
  41. private:
  42. char School[MAX][MAX];
  43. short ActualSize;
  44. };
  45.  
  46. class Lunch
  47. {
  48. public:
  49. Lunch(int X = -1, int Y = -1);
  50. // place me and random move output the results for location and random movement to school
  51. friend void place_me(school & skool, Lunch & lunch, const int Size);
  52. friend void random_move(school & skool, Lunch & lunch);
  53. friend bool Collision(Lunch & lunch, janitor & Jan, int & DayCounter);
  54. private:
  55. int Xpos, Ypos;
  56. char LunchRep;
  57. };
  58.  
  59.  
  60. class janitor
  61. {
  62. public:
  63. janitor (char janchar = 'J')
  64. {
  65. jancharacter = janchar;//sets the default janitor characteristics
  66. bac = .5;
  67. bruisecount = 0;
  68. sober = true;
  69. dead = false;
  70. m_xval = -1;
  71. m_yval = -1;
  72. }
  73. //places janitor in the school and allows rand-walk to move him within school
  74. friend void place_Janitor(school & escuela, janitor & Willie, const int Size);
  75. friend void rand_walk (school & escuela, janitor & Willie);
  76. friend bool Collision(Lunch & lunch, janitor & Jan, int & DayCounter);
  77. private:
  78. float bac;
  79. int bruisecount;
  80. int m_xval;
  81. int m_yval;
  82. char jancharacter;
  83. bool sober;
  84. bool drunk;
  85. bool dead;
  86. string jan_name;
  87. };
  88.  
  89. #endif
  90.  
  91.  
Advertisement
Add Comment
Please, Sign In to add comment