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:
Aaron Kimbrell
2026-10-01 07:45:16 -05:00
parent e8406cc829
commit 50bfa623ca
58 changed files with 181 additions and 132 deletions

View File

@@ -14,7 +14,7 @@ LevelProgressionComponent::LevelProgressionComponent(Entity* parent, const int32
m_CharacterVersion = eCharacterVersion::LIVE;
}
void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument& doc) {
void LevelProgressionComponent::WriteSaveData(tinyxml2::XMLDocument& doc) {
tinyxml2::XMLElement* level = doc.FirstChildElement("obj")->FirstChildElement("lvl");
if (!level) {
LOG("Failed to find lvl tag while updating XML!");
@@ -25,7 +25,7 @@ void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument& doc) {
level->SetAttribute("cv", static_cast<uint32_t>(m_CharacterVersion));
}
void LevelProgressionComponent::LoadFromXml(const tinyxml2::XMLDocument& doc) {
void LevelProgressionComponent::LoadFromSaveData(const tinyxml2::XMLDocument& doc) {
auto* level = doc.FirstChildElement("obj")->FirstChildElement("lvl");
if (!level) {
LOG("Failed to find lvl tag while loading XML!");