2023-07-08 08:31:26 +00:00
|
|
|
#ifndef __MODULEASSEMBLYCOMPONENT__H__
|
|
|
|
#define __MODULEASSEMBLYCOMPONENT__H__
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Component.h"
|
2023-03-04 07:16:37 +00:00
|
|
|
#include "eReplicaComponentType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-08 08:31:26 +00:00
|
|
|
namespace RakNet {
|
|
|
|
class BitStream;
|
|
|
|
};
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
/**
|
|
|
|
* Component that belongs to an object that may be modularly built, like cars and rockets. Note that this is not the
|
|
|
|
* same as having said items in your inventory (the subkey for this component) this component is the one that
|
|
|
|
* renders the entity into the world.
|
|
|
|
*/
|
2023-07-10 02:48:23 +00:00
|
|
|
class ModuleAssemblyComponent final : public Component {
|
2021-12-05 17:54:36 +00:00
|
|
|
public:
|
2023-06-09 08:22:45 +00:00
|
|
|
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::MODULE_ASSEMBLY;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-05-03 21:38:32 +00:00
|
|
|
ModuleAssemblyComponent(Entity* parent);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the subkey of this entity
|
|
|
|
* @param value the subkey to set
|
|
|
|
*/
|
2023-07-08 08:31:26 +00:00
|
|
|
void SetSubKey(const LWOOBJID& value) { m_SubKey = value; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the subkey for this entity
|
|
|
|
* @return the subkey for this entity
|
|
|
|
*/
|
2023-07-08 08:31:26 +00:00
|
|
|
LWOOBJID GetSubKey() const { return m_SubKey; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the optional parts value
|
|
|
|
* @param value the value to set
|
|
|
|
*/
|
2023-07-08 08:31:26 +00:00
|
|
|
void SetUseOptionalParts(bool value) { m_UseOptionalParts = value; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the optional parts value
|
|
|
|
* @return the value to set
|
|
|
|
*/
|
2023-07-08 08:31:26 +00:00
|
|
|
bool GetUseOptionalParts() const { return m_UseOptionalParts; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the assembly part lots (the subsections of this modular build)
|
|
|
|
* @param value the assembly part lots to set
|
|
|
|
*/
|
|
|
|
void SetAssemblyPartsLOTs(const std::u16string& value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the assembly part lots (the subsections of this modular build)
|
|
|
|
* @return
|
|
|
|
*/
|
2023-07-08 08:31:26 +00:00
|
|
|
const std::u16string& GetAssemblyPartsLOTs() const { return m_AssemblyPartsLOTs; };
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The sub key is the entity that this entity is an instance of. E.g. the item in the inventory. If a car for
|
|
|
|
* example is to be rendered, this sub key refers to the car item that was used to build this entity.
|
|
|
|
*/
|
|
|
|
LWOOBJID m_SubKey;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to use optional parts, currently unused
|
|
|
|
*/
|
|
|
|
bool m_UseOptionalParts;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The sub items that this entity is made of
|
|
|
|
*/
|
|
|
|
std::u16string m_AssemblyPartsLOTs;
|
|
|
|
};
|
2023-07-08 08:31:26 +00:00
|
|
|
|
|
|
|
#endif //!__MODULEASSEMBLYCOMPONENT__H__
|