feat(gx): add equality operator to CGxStateBom

This commit is contained in:
fallenoak committed 2023-04-15 09:16:59 -05:00
1 parent 317d94cd1a
commit 36fa30eba8
2 files changed
+34 -6

No files matched your search

+28 -6
View File
@@ -33,20 +33,42 @@ const CGxStateBom& CGxStateBom::operator=(C3Vector& value) {
return *this;
}
bool CGxStateBom::operator!=(int32_t value) {
return this->m_data.i[0] != value;
bool CGxStateBom::operator==(float value) {
return this->m_data.f[0] == value;
}
bool CGxStateBom::operator!=(uint32_t value) {
return this->m_data.i[0] != value;
bool CGxStateBom::operator==(int32_t value) {
return this->m_data.i[0] == value;
}
bool CGxStateBom::operator==(uint32_t value) {
return this->m_data.u[0] == value;
}
bool CGxStateBom::operator==(void* value) {
return this->m_data.p == value;
}
bool CGxStateBom::operator==(C3Vector& value) {
return this->m_data.f[0] == value.x
|| this->m_data.f[1] == value.y
|| this->m_data.f[2] == value.z;
}
bool CGxStateBom::operator!=(float value) {
return this->m_data.f[0] != value;
return !(*this == value);
}
bool CGxStateBom::operator!=(int32_t value) {
return !(*this == value);
}
bool CGxStateBom::operator!=(uint32_t value) {
return !(*this == value);
}
bool CGxStateBom::operator!=(void* value) {
return this->m_data.p != value;
return !(*this == value);
}
bool CGxStateBom::operator!=(C3Vector& value) {
+6
View File
@@ -11,6 +11,7 @@ class CGxStateBom {
// Member variables
union {
int32_t i[3];
uint32_t u[3];
float f[3];
void* p;
} m_data;
@@ -23,6 +24,11 @@ class CGxStateBom {
const CGxStateBom& operator=(uint32_t);
const CGxStateBom& operator=(void*);
const CGxStateBom& operator=(C3Vector&);
bool operator==(float);
bool operator==(int32_t);
bool operator==(uint32_t);
bool operator==(void*);
bool operator==(C3Vector&);
bool operator!=(float);
bool operator!=(int32_t);
bool operator!=(uint32_t);