BsPlatformInfoRTTI.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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() override
  21. {
  22. static String name = "PlatformInfo";
  23. return name;
  24. }
  25. virtual UINT32 getRTTIId() override
  26. {
  27. return TID_PlatformInfo;
  28. }
  29. virtual std::shared_ptr<IReflectable> newRTTIObject() override
  30. {
  31. return bs_shared_ptr_new<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. HTexture& getIcon16(WinPlatformInfo* obj) { return obj->icon16; }
  40. void setIcon16(WinPlatformInfo* obj, HTexture& val) { obj->icon16 = val; }
  41. HTexture& getIcon32(WinPlatformInfo* obj) { return obj->icon32; }
  42. void setIcon32(WinPlatformInfo* obj, HTexture& val) { obj->icon32 = val; }
  43. HTexture& getIcon48(WinPlatformInfo* obj) { return obj->icon48; }
  44. void setIcon48(WinPlatformInfo* obj, HTexture& val) { obj->icon48 = val; }
  45. HTexture& getIcon64(WinPlatformInfo* obj) { return obj->icon64; }
  46. void setIcon64(WinPlatformInfo* obj, HTexture& val) { obj->icon64 = val; }
  47. HTexture& getIcon96(WinPlatformInfo* obj) { return obj->icon96; }
  48. void setIcon96(WinPlatformInfo* obj, HTexture& val) { obj->icon96 = val; }
  49. HTexture& getIcon128(WinPlatformInfo* obj) { return obj->icon128; }
  50. void setIcon128(WinPlatformInfo* obj, HTexture& val) { obj->icon128 = val; }
  51. HTexture& getIcon192(WinPlatformInfo* obj) { return obj->icon192; }
  52. void setIcon192(WinPlatformInfo* obj, HTexture& val) { obj->icon192 = val; }
  53. HTexture& getIcon256(WinPlatformInfo* obj) { return obj->icon256; }
  54. void setIcon256(WinPlatformInfo* obj, HTexture& val) { obj->icon256 = val; }
  55. public:
  56. WinPlatformInfoRTTI()
  57. {
  58. addPlainField("is32bit", 0, &WinPlatformInfoRTTI::getIs32Bit, &WinPlatformInfoRTTI::setIs32Bit);
  59. addReflectableField("icon16", 1, &WinPlatformInfoRTTI::getIcon16, &WinPlatformInfoRTTI::setIcon16);
  60. addReflectableField("icon32", 2, &WinPlatformInfoRTTI::getIcon32, &WinPlatformInfoRTTI::setIcon32);
  61. addReflectableField("icon48", 3, &WinPlatformInfoRTTI::getIcon48, &WinPlatformInfoRTTI::setIcon48);
  62. addReflectableField("icon64", 4, &WinPlatformInfoRTTI::getIcon64, &WinPlatformInfoRTTI::setIcon64);
  63. addReflectableField("icon96", 5, &WinPlatformInfoRTTI::getIcon96, &WinPlatformInfoRTTI::setIcon96);
  64. addReflectableField("icon128", 6, &WinPlatformInfoRTTI::getIcon128, &WinPlatformInfoRTTI::setIcon128);
  65. addReflectableField("icon192", 7, &WinPlatformInfoRTTI::getIcon192, &WinPlatformInfoRTTI::setIcon192);
  66. addReflectableField("icon256", 8, &WinPlatformInfoRTTI::getIcon256, &WinPlatformInfoRTTI::setIcon256);
  67. }
  68. virtual const String& getRTTIName() override
  69. {
  70. static String name = "WinPlatformInfo";
  71. return name;
  72. }
  73. virtual UINT32 getRTTIId() override
  74. {
  75. return TID_WinPlatformInfo;
  76. }
  77. virtual std::shared_ptr<IReflectable> newRTTIObject() override
  78. {
  79. return bs_shared_ptr_new<WinPlatformInfo>();
  80. }
  81. };
  82. }