whoa/src/object/client/CGUnit.cpp
fallenoak e5150d7d21
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
feat(object): add CGUnit_C::GetFacing
2026-02-27 20:35:12 -06:00

48 lines
1015 B
C++

#include "object/client/CGUnit.hpp"
#include "object/client/CGObject.hpp"
#include "object/client/CMovement_C.hpp"
uint32_t CGUnit::GetBaseOffset() {
return CGObject::TotalFields();
}
uint32_t CGUnit::GetBaseOffsetSaved() {
return CGObject::TotalFieldsSaved();
}
uint32_t CGUnit::GetDataSize() {
return CGUnit::TotalFields() * sizeof(uint32_t);
}
uint32_t CGUnit::GetDataSizeSaved() {
return CGUnit::TotalFieldsSaved() * sizeof(uint32_t);
}
uint32_t CGUnit::TotalFields() {
return CGUnit::GetBaseOffset() + 142;
}
uint32_t CGUnit::TotalFieldsSaved() {
return CGUnit::GetBaseOffsetSaved() + 123;
}
int32_t CGUnit::GetDisplayID() const {
return this->Unit()->displayID;
}
float CGUnit::GetFacing() const {
return this->m_move->GetFacing();
}
int32_t CGUnit::GetNativeDisplayID() const {
return this->Unit()->nativeDisplayID;
}
C3Vector CGUnit::GetPosition() const {
return this->m_move->GetPosition();
}
CGUnitData* CGUnit::Unit() const {
return this->m_unit;
}