Advertisement
Guest User

Untitled

a guest
Apr 12th, 2018
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. /*-----------------------------------------------------------------
  2. System Name: Zoinkers!
  3. Artifact Name: Zoinkers.h
  4. Create Date: March 25, 2018
  5. Author: Shah Ohm, oshah@kent.edu
  6. Version: 2.0
  7. ------------------------------------------------------------------*/
  8.  
  9. #ifndef Zoinkers_hpp
  10. #define Zoinkers_hpp
  11.  
  12. #include <stdio.h>
  13. #include <iostream>
  14. #include <vector>
  15. #include <ctime>
  16. #include <string>
  17. #include <sstream>
  18. #include <algorithm>
  19.  
  20. class Animal;
  21. class Exhibit;
  22. class Schedule;
  23. class User;
  24. class Auth;
  25. class Zoink;
  26. class Favorability;
  27.  
  28.  
  29. class Favorability{
  30. public:
  31. Favorability(int tmpID, int tmpFav) {ID = tmpID; fav = tmpFav;};
  32. bool operator<(const Favorability& tmp){return fav < tmp.fav;};
  33. //acessors
  34. int returnID(){return ID;};
  35. int returnFav(){return fav;};
  36. private:
  37. int ID;
  38. int fav;
  39. };
  40.  
  41. class Animal{
  42. public:
  43. Animal(int ID, int AniID, std::string str);
  44. void displayInfo(int);
  45. void addAnimal();
  46. void remAnimal();
  47. int returnAID(){return AID;};
  48. private:
  49. int indivFav;
  50. int AID;
  51. int EID;
  52. std::string name;
  53. };
  54.  
  55. class Exhibit{
  56. public:
  57. //needs constructor
  58. Exhibit(Animal test){animals.push_back(test);};
  59. Exhibit(int,std::string,int,std::vector<Animal>);
  60. void addAnimal(Animal);
  61. std::vector<int> getAnimalWithinExibit();
  62. int returnEID(){return EID;};
  63. int getPrice(){return price;};
  64. std::string getName(){return exhibitName;};
  65.  
  66. private:
  67. int EID;
  68. std::string exhibitName;
  69. std::vector<Animal> animals; // Animals in current exhibit
  70. int price;
  71. };
  72.  
  73. class Schedule{
  74. public:
  75. void displayOpts();
  76. void displaySchedule();
  77.  
  78. private:
  79. };
  80.  
  81. class User{
  82. public:
  83. User(std::string user, std::string pass, int tmpRole);
  84. void displayOptions(User,Zoink&);
  85. User createUser(std::string name, std::string pass);
  86. bool checkUser(std::string, std::string);
  87. void avgFavExhibit(Zoink& zoinker);
  88. int getExhibitFav(int i){return exhibitFav[i].returnFav();};
  89. int getExhibitSize(){return exhibitFav.size();};
  90. std::string generateSched(User userone, Zoink& zoinker);
  91.  
  92. void dateParse();
  93. void checkBudget();
  94. void checkDiscount();
  95. void updateFav();
  96. private:
  97. std::string username;
  98. std::string password;
  99. std::string userID;
  100. Schedule userSchedule;
  101. int role;
  102. //Happiness rating
  103. int happiness;
  104.  
  105. //Info
  106. int day, month, year;
  107. std::string date;
  108. int budget;
  109.  
  110. //Discount Code Vector
  111. std::vector<std::string> DiscountCodes;
  112.  
  113. //Hardcoded User
  114. std::string testUser = "WARPIGS";
  115. std::string testPass = "SABBATH";
  116.  
  117. std::vector<Favorability> favanimal; // per animal
  118. std::vector<Favorability> exhibitFav; // per exhibit
  119. std::vector<int> testFavorability {1, 4, 5, 3, 2}; //Hardcoded case for TestUser
  120. };
  121.  
  122. class Auth{
  123. public:
  124. Auth(User user1);
  125. void authSucess(){authenicated = true;};
  126. void authFailure(){authenicated = false;};
  127. bool isAuth(){return authenicated;};
  128. private:
  129. bool authenicated;
  130. };
  131.  
  132. class Zoink{
  133. public:
  134. Zoink();
  135. std::vector<int> getAnimalWithEID(int ExID);
  136. void Login();
  137. bool isLogin();
  138. int getNumExhib(){return exhibits.size();};
  139. int getPriceByEID(int);
  140. void getNameByEID(std::vector<int>);
  141. private:
  142. std::vector<Exhibit> exhibits;
  143. std::vector<User> userList;
  144. std::vector<Animal> animalList;
  145. };
  146. #endif /* Zoinkers_hpp */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement