feat: change dtos to entities
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include "WorldObject.h"
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct BaseItem
|
||||
{
|
||||
public:
|
||||
const uint32_t itemId = 0;
|
||||
const uint32_t amount = 0;
|
||||
const bool isEquipped = 0;
|
||||
const uint16_t enchantLevel = 0;
|
||||
const int32_t mana = -1;
|
||||
const std::string name = "";
|
||||
const std::string iconName = "";
|
||||
const std::string description = "";
|
||||
const uint16_t weight = 0;
|
||||
};
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include "WorldObject.h"
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct Drop : public WorldObject
|
||||
{
|
||||
public:
|
||||
const uint32_t itemId = 0;
|
||||
const uint32_t amount = 0;
|
||||
const std::string name = "";
|
||||
const std::string iconName = "";
|
||||
};
|
||||
}
|
43
L2BotCore/Domain/DTO/EntityState.h
Normal file
43
L2BotCore/Domain/DTO/EntityState.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Entities/EntityInterface.h"
|
||||
#include "../Enums/EntityStateEnum.h"
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
class EntityState
|
||||
{
|
||||
public:
|
||||
Entities::EntityInterface* GetEntity() const
|
||||
{
|
||||
return m_Entity;
|
||||
}
|
||||
const Enums::EntityStateEnum GetState() const
|
||||
{
|
||||
return m_State;
|
||||
}
|
||||
void UpdateState(const Enums::EntityStateEnum state)
|
||||
{
|
||||
m_State = state;
|
||||
}
|
||||
|
||||
EntityState(Entities::EntityInterface* object, Enums::EntityStateEnum state) :
|
||||
m_Entity(object),
|
||||
m_State(state)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
EntityState() = default;
|
||||
virtual ~EntityState()
|
||||
{
|
||||
if (m_Entity != nullptr)
|
||||
{
|
||||
delete m_Entity;
|
||||
}
|
||||
}
|
||||
private:
|
||||
Entities::EntityInterface* m_Entity = nullptr;
|
||||
Enums::EntityStateEnum m_State = Enums::EntityStateEnum::none;
|
||||
};
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
#include "WorldObject.h"
|
||||
#include "../ValueObjects/FullName.h"
|
||||
#include "../ValueObjects/VitalStats.h"
|
||||
#include "../ValueObjects/Phenotype.h"
|
||||
#include "../ValueObjects/ExperienceInfo.h"
|
||||
#include "../ValueObjects/PermanentStats.h"
|
||||
#include "../ValueObjects/VariableStats.h"
|
||||
#include "../ValueObjects/Reputation.h"
|
||||
#include "../ValueObjects/InventoryInfo.h"
|
||||
#include <cstdint>
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct Hero : public WorldObject
|
||||
{
|
||||
public:
|
||||
const ValueObjects::FullName fullName = ValueObjects::FullName();
|
||||
const ValueObjects::VitalStats vitalStats = ValueObjects::VitalStats();
|
||||
const ValueObjects::Phenotype phenotype = ValueObjects::Phenotype();
|
||||
const ValueObjects::ExperienceInfo experienceInfo = ValueObjects::ExperienceInfo();
|
||||
const ValueObjects::PermanentStats permanentStats = ValueObjects::PermanentStats();
|
||||
const ValueObjects::VariableStats variableStats = ValueObjects::VariableStats();
|
||||
const ValueObjects::Reputation reputation = ValueObjects::Reputation();
|
||||
const ValueObjects::InventoryInfo inventoryInfo = ValueObjects::InventoryInfo();
|
||||
const uint32_t targetId = 0;
|
||||
const bool isStanding = true;
|
||||
};
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include "WorldObject.h"
|
||||
#include "../ValueObjects/FullName.h"
|
||||
#include "../ValueObjects/VitalStats.h"
|
||||
#include "../Enums/SpoilStateEnum.h"
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct NPC : public WorldObject
|
||||
{
|
||||
public:
|
||||
const bool isHostile = false;
|
||||
const uint32_t npcId = 0;
|
||||
const Enums::SpoilStateEnum spoilState = Enums::SpoilStateEnum::none;
|
||||
const ValueObjects::FullName fullName = ValueObjects::FullName();
|
||||
const ValueObjects::VitalStats vitalStats = ValueObjects::VitalStats();
|
||||
};
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
#include "../Enums/ObjectStateEnum.h"
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
template <typename T>
|
||||
struct ObjectState
|
||||
{
|
||||
public:
|
||||
T object;
|
||||
Enums::ObjectStateEnum state = Enums::ObjectStateEnum::none;
|
||||
};
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
#include "WorldObject.h"
|
||||
#include "../ValueObjects/FullName.h"
|
||||
#include "../ValueObjects/VitalStats.h"
|
||||
#include "../ValueObjects/Phenotype.h"
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct Player : public WorldObject
|
||||
{
|
||||
public:
|
||||
const ValueObjects::FullName fullName = ValueObjects::FullName();
|
||||
const ValueObjects::Phenotype phenotype = ValueObjects::Phenotype();
|
||||
};
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct Skill
|
||||
{
|
||||
public:
|
||||
const uint32_t skillId = 0;
|
||||
const uint8_t level = 0;
|
||||
const bool isActive = false;
|
||||
const uint8_t cost = 0;
|
||||
const int16_t range = 0;
|
||||
const std::string name = "";
|
||||
const std::string description = "";
|
||||
const std::string iconName = "";
|
||||
const bool isToggled = false;
|
||||
const bool isCasting = false;
|
||||
const bool isReloading = false;
|
||||
};
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include "../ValueObjects/Transform.h"
|
||||
|
||||
namespace L2Bot::Domain::DTO
|
||||
{
|
||||
struct WorldObject
|
||||
{
|
||||
public:
|
||||
const uint32_t id = 0;
|
||||
const ValueObjects::Transform transform = ValueObjects::Transform();
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user