chore: Update render component and delete unused code (#1429)

* Update a few components to use smart pointers for memory management

* 'final' keyword added to classes

* removed duplicate 'const'

* removed unused code

* Updated render component to store effects directly in a vector

* Use move instead of copy

* make pointers const

* attribute tags

* nitpicking

* delete default effect constructor

* Added a vector size check to the RemoveEffect() function

* use empty() instead of size()
This commit is contained in:
jadebenn
2024-01-31 08:38:38 -06:00
committed by GitHub
parent d78b50874c
commit b23981e591
5 changed files with 46 additions and 125 deletions

View File

@@ -1,34 +1,22 @@
/*
* Darkflame Universe
* Copyright 2018
* Copyright 2024
*/
#ifndef PROPERTYCOMPONENT_H
#define PROPERTYCOMPONENT_H
#include "BitStream.h"
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
struct PropertyState {
LWOOBJID ownerID;
LWOOBJID propertyID;
bool rented;
};
/**
* This component is unused and has no functionality
*/
class PropertyComponent final : public Component {
public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY;
explicit PropertyComponent(Entity* parentEntity);
~PropertyComponent() override;
[[nodiscard]] PropertyState* GetPropertyState() const { return m_PropertyState; };
private:
PropertyState* m_PropertyState;
std::string m_PropertyName;
explicit PropertyComponent(Entity* const parentEntity) noexcept : Component{ parentEntity } {}
};
#endif // PROPERTYCOMPONENT_H
#endif // !PROPERTYCOMPONENT_H