mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
extend user block fields check
This commit is contained in:
parent
0ad588fd33
commit
ab53922474
6 changed files with 63 additions and 13 deletions
|
|
@ -81,6 +81,18 @@ namespace data {
|
|||
/// @brief Byte size of the field
|
||||
int size;
|
||||
|
||||
Field(
|
||||
FieldType type,
|
||||
std::string name,
|
||||
int elements,
|
||||
FieldConvertStrategy strategy=FieldConvertStrategy::RESET
|
||||
) : type(type),
|
||||
name(std::move(name)),
|
||||
elements(elements),
|
||||
convertStrategy(strategy),
|
||||
offset(0),
|
||||
size(0) {}
|
||||
|
||||
bool operator==(const Field& o) const {
|
||||
return type == o.type &&
|
||||
name == o.name &&
|
||||
|
|
@ -233,6 +245,14 @@ namespace data {
|
|||
return totalSize;
|
||||
}
|
||||
|
||||
[[nodiscard]] const auto begin() const {
|
||||
return fields.begin();
|
||||
}
|
||||
|
||||
[[nodiscard]] const auto end() const {
|
||||
return fields.end();
|
||||
}
|
||||
|
||||
/// @brief Convert structure data from srcLayout to this layout.
|
||||
/// @param srcLayout source structure layout
|
||||
/// @param src source data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue