Advertisement
Guest User

CPP

a guest
Dec 8th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. BLOCK.H
  2. #pragma once
  3. #include "pch.h"
  4. #include "EnumClassBlockType.h"
  5.  
  6. class Block
  7. {
  8. public:
  9.     Block(Point2f pos, BlockType blockType);
  10. private:
  11.     Point2f m_Pos;
  12.     BlockType m_BlockType;
  13. };
  14.  
  15. BLOCK.CPP
  16. #include "pch.h"
  17. #include "Blocks.h"
  18.  
  19. Block::Block(Point2f pos, float blockSize) : m_Pos(pos),
  20.                                             m_BlockType(BlockType::noPlayArea)
  21. {}
  22.  
  23. PlayArea.h
  24. #pragma once
  25. #include "pch.h"
  26. #include "Block.h"
  27. class PlayArea
  28. {public:
  29.     void InitPlayArea();
  30. private:
  31.     Block m_PlayArea[24][13];
  32. };
  33.  
  34. PlayArea.cpp
  35. #include "pch.h"
  36. #include "PlayArea.h"
  37.  
  38.  
  39. void PlayArea::InitPlayArea()
  40. {
  41.     for (int y{0}; y<13;y++)
  42.     {
  43.         for (int x{0};x<24;x++)
  44.         {
  45.             m_PlayArea[y][x] = Block{ Point2f{0,0},BlockType::noPlayArea };
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement