Advertisement
Guest User

Components.h

a guest
Dec 11th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <string>
  4.  
  5. #include "SpriteHandler.h"
  6.  
  7. //-- Masks for each component type --//
  8. enum COMP_MASKS
  9. {
  10.     COMP_NONE     = 0,
  11.     COMP_ACTIVE   = 1,
  12.     COMP_INFO     = 1 << 1,
  13.     COMP_POSITION = 1 << 2,
  14.     COMP_SPEED    = 1 << 3,
  15.     COMP_SPRITE   = 1 << 4,
  16. };
  17.  
  18. //-- Component Definitions --//
  19. struct CompGeneric
  20. {
  21. };
  22.  
  23. struct CompInfo : CompGeneric
  24. {
  25.     int OwnerId = -1;
  26.     std::string Name = "MrBlank";
  27.     std::string Flavour = "I'm Blank.";
  28. };
  29.  
  30. struct CompPosition : CompGeneric
  31. {
  32.     int OwnerId = -1;
  33.     int X;
  34.     int Y;
  35. };
  36.  
  37. struct CompSpeed : CompGeneric
  38. {
  39.     int OwnerId = -1;
  40.     float Xspeed = 0;
  41.     float Yspeed = 0;
  42. };
  43.  
  44. struct CompSprite : CompGeneric
  45. {
  46.     int OwnerId = -1;
  47.     Sprite* Sprite;
  48. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement