Entity work

- Add in bool cheks
- Fix component class files so they compile and link
- Fin inheritance
This commit is contained in:
David Markowitz
2023-06-25 21:47:35 -07:00
parent fee1025982
commit 9121bf41c5
14 changed files with 327 additions and 308 deletions

View File

@@ -1,5 +1,5 @@
#include "BaseRacingControlComponent.h"
BaseRacingControlComponent::BaseRacingControlComponent(Entity* parent) : Component(parent) {
BaseRacingControlComponent::BaseRacingControlComponent(Entity* parent, int32_t componentId) : ScriptedActivityComponent(parent, componentId) {
}

View File

@@ -9,7 +9,7 @@ class Entity;
class BaseRacingControlComponent : public ScriptedActivityComponent {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL;
BaseRacingControlComponent(Entity* parent);
BaseRacingControlComponent(Entity* parent, int32_t componentId);
};

View File

@@ -11,6 +11,7 @@ set(DGAME_DCOMPONENTS_SOURCES "AchievementVendorComponent.cpp"
"ControllablePhysicsComponent.cpp"
"DestroyableComponent.cpp"
"DonationVendorComponent.cpp"
"GateRushControlComponent.cpp"
"InventoryComponent.cpp"
"ItemComponent.cpp"
"LevelProgressionComponent.cpp"

View File

@@ -1,5 +1,5 @@
#include "GateRushControlComponent.h"
GateRushControlComponent::GateRushControlComponent(Entity* parent) : BaseRacingControlComponent(parent) {
GateRushControlComponent::GateRushControlComponent(Entity* parent, int32_t componentId) : BaseRacingControlComponent(parent, componentId) {
}

View File

@@ -9,7 +9,7 @@ class Entity;
class GateRushControlComponent : public BaseRacingControlComponent {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::GATE_RUSH_CONTROL;
GateRushControlComponent(Entity* parent);
GateRushControlComponent(Entity* parent, int32_t componentId);
};
#endif //!__GATERUSHCONTROLCOMPONENT__H__

View File

@@ -4,12 +4,12 @@
ItemComponent::ItemComponent(Entity* parent) : Component(parent) {
m_Parent = parent;
m_ParentEntity = parent;
m_DirtyItemInfo = false;
m_UgId = m_Parent->GetVarAs<LWOOBJID>(u"userModelID");
if (m_UgId == LWOOBJID_EMPTY) m_UgId = m_Parent->GetObjectID();
m_UgId = m_ParentEntity->GetVarAs<LWOOBJID>(u"userModelID");
if (m_UgId == LWOOBJID_EMPTY) m_UgId = m_ParentEntity->GetObjectID();
m_UgModerationStatus = eUgcModerationStatus::NoStatus;

View File

@@ -2,6 +2,6 @@
#include "Entity.h"
MinigameControlComponent::MinigameControlComponent(Entity* parent) : Component(parent) {
MinigameControlComponent::MinigameControlComponent(Entity* parent) : ActivityComponent(parent) {
}

View File

@@ -13,7 +13,7 @@ class Entity;
*/
class MutableModelBehaviorComponent : public Component {
public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL_BEHAVIOR;
MutableModelBehaviorComponent(Entity* parent);

View File

@@ -25,7 +25,7 @@
#include "CppScripts.h"
QuickBuildComponent::QuickBuildComponent(Entity* entity, uint32_t componentId) : Component(entity) {
QuickBuildComponent::QuickBuildComponent(Entity* entity, uint32_t componentId) : ActivityComponent(entity) {
m_ComponentId = componentId;
std::u16string checkPreconditions = entity->GetVar<std::u16string>(u"CheckPrecondition");

View File

@@ -29,7 +29,7 @@
#define M_PI 3.14159265358979323846264338327950288
#endif
RacingControlComponent::RacingControlComponent(Entity* parent) : BaseRacingControlComponent(parent) {
RacingControlComponent::RacingControlComponent(Entity* parent, int32_t componentId) : BaseRacingControlComponent(parent, componentId) {
m_PathName = u"MainPath";
m_RemainingLaps = 3;
m_LeadingPlayer = LWOOBJID_EMPTY;

View File

@@ -107,7 +107,7 @@ class RacingControlComponent : public BaseRacingControlComponent {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::RACING_CONTROL;
RacingControlComponent(Entity* parentEntity);
RacingControlComponent(Entity* parentEntity, int32_t componentId);
~RacingControlComponent();
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);

View File

@@ -0,0 +1,5 @@
#include "RacingSoundTriggerComponent.h"
RacingSoundTriggerComponent::RacingSoundTriggerComponent(Entity* parent) : SoundTriggerComponent(parent) {
}

View File

@@ -53,12 +53,6 @@ public:
m_DirtyVendor = true;
}
/**
* Gets the list if items the vendor sells.
* @return the list of items.
*/
std::map<LOT, int>& GetInventory();
/**
* Refresh the inventory of this vendor.
*/