BsPlatformInfoRTTI.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsRTTIType.h"
  4. #include "BsPlatformInfo.h"
  5. namespace BansheeEngine
  6. {
  7. class BS_ED_EXPORT PlatformInfoRTTI : public RTTIType <PlatformInfo, IReflectable, PlatformInfoRTTI>
  8. {
  9. private:
  10. WString& getDefines(PlatformInfo* obj) { return obj->defines; }
  11. void setDefines(PlatformInfo* obj, WString& val) { obj->defines = val; }
  12. PlatformType& getType(PlatformInfo* obj) { return obj->type; }
  13. void setType(PlatformInfo* obj, PlatformType& val) { obj->type = val; }
  14. public:
  15. PlatformInfoRTTI()
  16. {
  17. addPlainField("defines", 0, &PlatformInfoRTTI::getDefines, &PlatformInfoRTTI::setDefines);
  18. addPlainField("type", 1, &PlatformInfoRTTI::getType, &PlatformInfoRTTI::setType);
  19. }
  20. virtual const String& getRTTIName()
  21. {
  22. static String name = "PlatformInfo";
  23. return name;
  24. }
  25. virtual UINT32 getRTTIId()
  26. {
  27. return TID_PlatformInfo;
  28. }
  29. virtual std::shared_ptr<IReflectable> newRTTIObject()
  30. {
  31. return bs_shared_ptr<PlatformInfo>();
  32. }
  33. };
  34. class BS_ED_EXPORT WinPlatformInfoRTTI : public RTTIType <WinPlatformInfo, PlatformInfo, WinPlatformInfoRTTI>
  35. {
  36. private:
  37. bool& getIs32Bit(WinPlatformInfo* obj) { return obj->is32bit; }
  38. void setIs32Bit(WinPlatformInfo* obj, bool& val) { obj->is32bit = val; }
  39. public:
  40. WinPlatformInfoRTTI()
  41. {
  42. addPlainField("is32bit", 0, &WinPlatformInfoRTTI::getIs32Bit, &WinPlatformInfoRTTI::setIs32Bit);
  43. }
  44. virtual const String& getRTTIName()
  45. {
  46. static String name = "WinPlatformInfo";
  47. return name;
  48. }
  49. virtual UINT32 getRTTIId()
  50. {
  51. return TID_WinPlatformInfo;
  52. }
  53. virtual std::shared_ptr<IReflectable> newRTTIObject()
  54. {
  55. return bs_shared_ptr<WinPlatformInfo>();
  56. }
  57. };
  58. }