mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 15:57:13 +00:00
refactor(component): the client's component lifecycle
Components get the client's per-component functions: LoadDataFromTemplate, PrepareConfigData, LoadConfigData, LoadFromSaveData, Startup, Run, OnEnterScope, OnLeaveScope, Preshutdown and Shutdown, called by the entity in the client's order. Update is renamed Run, LoadFromXml LoadFromSaveData and UpdateXml WriteSaveData. Nothing sent changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -70,7 +70,7 @@ ControllablePhysicsComponent::~ControllablePhysicsComponent() {
|
||||
}
|
||||
}
|
||||
|
||||
void ControllablePhysicsComponent::Update(float deltaTime) {
|
||||
void ControllablePhysicsComponent::Run(float deltaTime) {
|
||||
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bo
|
||||
}
|
||||
}
|
||||
|
||||
void ControllablePhysicsComponent::LoadFromXml(const tinyxml2::XMLDocument& doc) {
|
||||
void ControllablePhysicsComponent::LoadFromSaveData(const tinyxml2::XMLDocument& doc) {
|
||||
auto* character = doc.FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
LOG("Failed to find char tag!");
|
||||
@@ -186,7 +186,7 @@ void ControllablePhysicsComponent::LoadFromXml(const tinyxml2::XMLDocument& doc)
|
||||
m_DirtyPosition = true;
|
||||
}
|
||||
|
||||
void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument& doc) {
|
||||
void ControllablePhysicsComponent::WriteSaveData(tinyxml2::XMLDocument& doc) {
|
||||
tinyxml2::XMLElement* character = doc.FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
LOG("Failed to find char tag while updating XML!");
|
||||
|
||||
Reference in New Issue
Block a user