mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 00:35:27 +00:00
refactor(component): the quickbuild is an activity component, as in the client
LWOQuickBuildComponent uses the activity component's functions; DLU's QuickBuildComponent now derives ActivityComponent. Its RebuildComponent row (the activity among it) loads in LoadDataFromTemplate and the level's overrides in LoadConfigData, out of Entity::Initialize. It still writes its own replica data (same construction and update bytes) and spawns its activator as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
#include "dCommonVars.h"
|
||||
#include "NiPoint3.h"
|
||||
#include "ActivityComponent.h"
|
||||
#include "ScriptedActivityComponent.h"
|
||||
#include "Preconditions.h"
|
||||
#include "Component.h"
|
||||
@@ -20,12 +21,13 @@ enum class eQuickBuildFailReason : uint32_t;
|
||||
* consists of an activator that shows a popup and then the actual entity that the bricks are built into. Note
|
||||
* that quick builds are also scripted activities so this shared some logic with the ScriptedActivityComponent.
|
||||
*/
|
||||
class QuickBuildComponent final : public Component {
|
||||
class QuickBuildComponent final : public ActivityComponent {
|
||||
public:
|
||||
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD;
|
||||
|
||||
QuickBuildComponent(Entity* const entity, const int32_t componentID);
|
||||
|
||||
void LoadDataFromTemplate() override;
|
||||
void LoadConfigData() override;
|
||||
~QuickBuildComponent() override;
|
||||
|
||||
@@ -361,6 +363,9 @@ private:
|
||||
*/
|
||||
int32_t m_ActivityId = 0;
|
||||
|
||||
// Whether the RebuildComponent row was found (the level's settings only apply over a row)
|
||||
bool m_HasRow = false;
|
||||
|
||||
/**
|
||||
* Currently unused
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user