Advertisement
Cinestra

Project 3 StudentWorld.h Part 1 (Finished)

May 29th, 2023
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #ifndef STUDENTWORLD_H_
  2. #define STUDENTWORLD_H_
  3.  
  4. #include "GameWorld.h"
  5. #include "Board.h"
  6. #include <string>
  7.  
  8. #include "Actor.h"
  9. #include <vector>
  10.  
  11. // Students: Add code to this file, StudentWorld.cpp, Actor.h, and Actor.cpp
  12.  
  13. class StudentWorld : public GameWorld
  14. {
  15. public:
  16. StudentWorld(std::string assetPath);
  17. ~StudentWorld();
  18.  
  19. void add_actor(Actor* actor)
  20. {
  21. m_actors.push_back(actor);
  22. }
  23.  
  24. bool is_empty_square(int x, int y)
  25. {
  26. return m_board->getContentsOf(x/SPRITE_WIDTH, y/SPRITE_HEIGHT) == Board::empty;
  27. }
  28.  
  29. virtual int init();
  30. virtual int move();
  31. virtual void cleanUp();
  32.  
  33. private:
  34. std::vector<Actor*> m_actors;
  35. Board* m_board;
  36. Player* m_peach;
  37. };
  38.  
  39. #endif // STUDENTWORLD_H_
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement