Advertisement
Guest User

Untitled

a guest
Aug 30th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. //the room manager... manages rooms
  2. //specifically, it calls their methods (init, update, draw)
  3. //at the appropriate times
  4. //additionally, it handles transitions from one to another
  5. //and provides a way to goto a different room
  6.  
  7. #ifndef ROOMMANAGER_H
  8. #define ROOMMANAGER_H
  9.  
  10. #include <SFML/Graphics.hpp>
  11. #include <vector>
  12. #include "Rooms.h"
  13. #include "EventQueue.h"
  14. #include "AudioPlayer.h"
  15.  
  16. class Room;
  17.  
  18. class RoomManager
  19. {
  20. friend int main();
  21.  
  22. Room * currentRoom;
  23. Room * nextRoom;
  24.  
  25. bool transitioningOut;
  26. bool transitioningIn;
  27.  
  28. //all transition times are in seconds
  29. float transitioningInTime;
  30. float transitioningOutTime;
  31.  
  32. sf::Clock clock;
  33.  
  34. Room * getRoomByEnum(Rooms room);
  35.  
  36. void update(sf::RenderWindow & window, AudioPlayer & audioPlayer);
  37.  
  38. void draw(sf::RenderWindow & window);
  39.  
  40. public:
  41. RoomManager(Rooms startRoom);
  42.  
  43. bool isTransitioningOut();
  44. bool isTransitioningIn();
  45.  
  46. //both [0, 1]
  47. float getTransitioningOutPercent();
  48. float getTransitoningInPercent();
  49.  
  50. void setRoom(Rooms room);
  51. };
  52.  
  53. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement