PoolArrays.hpp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. #ifndef POOLARRAYS_H
  2. #define POOLARRAYS_H
  3. #if defined(_WIN32)
  4. # ifdef _GD_CPP_CORE_API_IMPL
  5. # define GD_CPP_CORE_API __declspec(dllexport)
  6. # else
  7. # define GD_CPP_CORE_API __declspec(dllimport)
  8. # endif
  9. #else
  10. # define GD_CPP_CORE_API
  11. #endif
  12. #include "Defs.hpp"
  13. #include "String.hpp"
  14. #include "Color.hpp"
  15. #include "Vector2.hpp"
  16. #include "Vector3.hpp"
  17. #include <godot/godot_pool_arrays.h>
  18. namespace godot {
  19. class Array;
  20. class GD_CPP_CORE_API PoolByteArray {
  21. godot_pool_byte_array _godot_array;
  22. public:
  23. PoolByteArray();
  24. PoolByteArray(const Array& array);
  25. void append(const uint8_t data);
  26. void append_array(const PoolByteArray& array);
  27. int insert(const int idx, const uint8_t data);
  28. void invert();
  29. void push_back(const uint8_t data);
  30. void remove(const int idx);
  31. void resize(const int size);
  32. void set(const int idx, const uint8_t data);
  33. uint8_t operator [](const int idx);
  34. int size();
  35. ~PoolByteArray();
  36. };
  37. class GD_CPP_CORE_API PoolIntArray {
  38. godot_pool_int_array _godot_array;
  39. public:
  40. PoolIntArray();
  41. PoolIntArray(const Array& array);
  42. void append(const int data);
  43. void append_array(const PoolIntArray& array);
  44. int insert(const int idx, const int data);
  45. void invert();
  46. void push_back(const int data);
  47. void remove(const int idx);
  48. void resize(const int size);
  49. void set(const int idx, const int data);
  50. int operator [](const int idx);
  51. int size();
  52. ~PoolIntArray();
  53. };
  54. class GD_CPP_CORE_API PoolRealArray {
  55. godot_pool_real_array _godot_array;
  56. public:
  57. PoolRealArray();
  58. PoolRealArray(const Array& array);
  59. void append(const real_t data);
  60. void append_array(const PoolRealArray& array);
  61. int insert(const int idx, const real_t data);
  62. void invert();
  63. void push_back(const real_t data);
  64. void remove(const int idx);
  65. void resize(const int size);
  66. void set(const int idx, const real_t data);
  67. real_t operator [](const int idx);
  68. int size();
  69. ~PoolRealArray();
  70. };
  71. class GD_CPP_CORE_API PoolStringArray {
  72. godot_pool_string_array _godot_array;
  73. public:
  74. PoolStringArray();
  75. PoolStringArray(const Array& array);
  76. void append(const String& data);
  77. void append_array(const PoolStringArray& array);
  78. int insert(const int idx, const String& data);
  79. void invert();
  80. void push_back(const String& data);
  81. void remove(const int idx);
  82. void resize(const int size);
  83. void set(const int idx, const String& data);
  84. String operator [](const int idx);
  85. int size();
  86. ~PoolStringArray();
  87. };
  88. class GD_CPP_CORE_API PoolVector2Array {
  89. godot_pool_vector2_array _godot_array;
  90. public:
  91. PoolVector2Array();
  92. PoolVector2Array(const Array& array);
  93. void append(const Vector2& data);
  94. void append_array(const PoolVector2Array& array);
  95. int insert(const int idx, const Vector2& data);
  96. void invert();
  97. void push_back(const Vector2& data);
  98. void remove(const int idx);
  99. void resize(const int size);
  100. void set(const int idx, const Vector2& data);
  101. Vector2 operator [](const int idx);
  102. int size();
  103. ~PoolVector2Array();
  104. };
  105. class GD_CPP_CORE_API PoolVector3Array {
  106. godot_pool_vector3_array _godot_array;
  107. public:
  108. PoolVector3Array();
  109. PoolVector3Array(const Array& array);
  110. void append(const Vector3& data);
  111. void append_array(const PoolVector3Array& array);
  112. int insert(const int idx, const Vector3& data);
  113. void invert();
  114. void push_back(const Vector3& data);
  115. void remove(const int idx);
  116. void resize(const int size);
  117. void set(const int idx, const Vector3& data);
  118. Vector3 operator [](const int idx);
  119. int size();
  120. ~PoolVector3Array();
  121. };
  122. class GD_CPP_CORE_API PoolColorArray {
  123. godot_pool_color_array _godot_array;
  124. public:
  125. PoolColorArray();
  126. PoolColorArray(const Array& array);
  127. void append(const Color& data);
  128. void append_array(const PoolColorArray& array);
  129. int insert(const int idx, const Color& data);
  130. void invert();
  131. void push_back(const Color& data);
  132. void remove(const int idx);
  133. void resize(const int size);
  134. void set(const int idx, const Color& data);
  135. Color operator [](const int idx);
  136. int size();
  137. ~PoolColorArray();
  138. };
  139. }
  140. #endif // POOLARRAYS_H