mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 02:35:28 +00:00
refactor(component): the render component loads its animation groups in LoadDataFromTemplate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,10 +19,14 @@ std::unordered_map<int32_t, float> RenderComponent::m_DurationCache{};
|
|||||||
|
|
||||||
RenderComponent::RenderComponent(Entity* const parentEntity, const int32_t componentID) : Component{ parentEntity, componentID } {
|
RenderComponent::RenderComponent(Entity* const parentEntity, const int32_t componentID) : Component{ parentEntity, componentID } {
|
||||||
m_LastAnimationName = "";
|
m_LastAnimationName = "";
|
||||||
if (componentID == -1) return;
|
}
|
||||||
|
|
||||||
|
// The RenderComponent row: its animation groups
|
||||||
|
void RenderComponent::LoadDataFromTemplate() {
|
||||||
|
if (m_ComponentID == -1) return;
|
||||||
|
|
||||||
auto query = CDClientDatabase::CreatePreppedStmt("SELECT * FROM RenderComponent WHERE id = ?;");
|
auto query = CDClientDatabase::CreatePreppedStmt("SELECT * FROM RenderComponent WHERE id = ?;");
|
||||||
query.bind(1, componentID);
|
query.bind(1, m_ComponentID);
|
||||||
auto result = query.execQuery();
|
auto result = query.execQuery();
|
||||||
|
|
||||||
if (!result.eof()) {
|
if (!result.eof()) {
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ public:
|
|||||||
|
|
||||||
RenderComponent(Entity* const parentEntity, const int32_t componentID);
|
RenderComponent(Entity* const parentEntity, const int32_t componentID);
|
||||||
|
|
||||||
|
void LoadDataFromTemplate() override;
|
||||||
|
|
||||||
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
void Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) override;
|
||||||
void Run(float deltaTime) override;
|
void Run(float deltaTime) override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user