refactor: switch to wide string
This commit is contained in:
@@ -43,14 +43,14 @@ namespace L2Bot::Domain::Entities
|
||||
{
|
||||
std::vector<Serializers::Node> result;
|
||||
|
||||
result.push_back({ "skillId", std::to_string(m_SkillId) });
|
||||
result.push_back({ "level", std::to_string(m_Level) });
|
||||
result.push_back({ L"skillId", std::to_wstring(m_SkillId) });
|
||||
result.push_back({ L"level", std::to_wstring(m_Level) });
|
||||
|
||||
if (m_IsNewState)
|
||||
{
|
||||
result.push_back({ "name", m_Name });
|
||||
result.push_back({ "iconName", m_IconName });
|
||||
result.push_back({ "description", m_Description });
|
||||
result.push_back({ L"name", m_Name });
|
||||
result.push_back({ L"iconName", m_IconName });
|
||||
result.push_back({ L"description", m_Description });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -59,9 +59,9 @@ namespace L2Bot::Domain::Entities
|
||||
AbnormalEffect(
|
||||
const uint32_t skillId,
|
||||
const uint8_t level,
|
||||
const std::string& name,
|
||||
const std::string& description,
|
||||
const std::string& iconName
|
||||
const std::wstring& name,
|
||||
const std::wstring& description,
|
||||
const std::wstring& iconName
|
||||
) :
|
||||
m_SkillId(skillId),
|
||||
m_Level(level),
|
||||
@@ -87,9 +87,9 @@ namespace L2Bot::Domain::Entities
|
||||
private:
|
||||
uint32_t m_SkillId = 0;
|
||||
uint8_t m_Level = 0;
|
||||
std::string m_Name = "";
|
||||
std::string m_Description = "";
|
||||
std::string m_IconName = "";
|
||||
std::wstring m_Name = L"";
|
||||
std::wstring m_Description = L"";
|
||||
std::wstring m_IconName = L"";
|
||||
bool m_IsNewState = true;
|
||||
};
|
||||
}
|
||||
|
@@ -60,28 +60,28 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "armorType", std::to_string(static_cast<uint8_t>(m_ArmorType)) });
|
||||
result.push_back({ "crystalType", std::to_string(static_cast<int8_t>(m_CrystalType)) });
|
||||
result.push_back({ "setEffect", m_SetEffect });
|
||||
result.push_back({ "addSetEffect", m_AddSetEffect });
|
||||
result.push_back({ "enchantEffect", m_EnchantEffect });
|
||||
result.push_back({ L"armorType", std::to_wstring(static_cast<uint8_t>(m_ArmorType)) });
|
||||
result.push_back({ L"crystalType", std::to_wstring(static_cast<int8_t>(m_CrystalType)) });
|
||||
result.push_back({ L"setEffect", m_SetEffect });
|
||||
result.push_back({ L"addSetEffect", m_AddSetEffect });
|
||||
result.push_back({ L"enchantEffect", m_EnchantEffect });
|
||||
}
|
||||
|
||||
if (m_PrevState.isNewState || m_IsEquipped != m_PrevState.isEquipped)
|
||||
{
|
||||
result.push_back({ "isEquipped", std::to_string(m_IsEquipped) });
|
||||
result.push_back({ L"isEquipped", std::to_wstring(m_IsEquipped) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_EnchantLevel != m_PrevState.enchantLevel)
|
||||
{
|
||||
result.push_back({ "enchantLevel", std::to_string(m_EnchantLevel) });
|
||||
result.push_back({ L"enchantLevel", std::to_wstring(m_EnchantLevel) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_PDefense != m_PrevState.pDefense)
|
||||
{
|
||||
result.push_back({ "pDefense", std::to_string(m_PDefense) });
|
||||
result.push_back({ L"pDefense", std::to_wstring(m_PDefense) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_MDefense != m_PrevState.mDefense)
|
||||
{
|
||||
result.push_back({ "mDefense", std::to_string(m_MDefense) });
|
||||
result.push_back({ L"mDefense", std::to_wstring(m_MDefense) });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -91,9 +91,9 @@ namespace L2Bot::Domain::Entities
|
||||
const uint32_t objectId,
|
||||
const uint32_t itemId,
|
||||
const int32_t mana,
|
||||
const std::string& name,
|
||||
const std::string& iconName,
|
||||
const std::string& description,
|
||||
const std::wstring& name,
|
||||
const std::wstring& iconName,
|
||||
const std::wstring& description,
|
||||
const uint16_t weight,
|
||||
const bool isEquipped,
|
||||
const uint16_t enchantLevel,
|
||||
@@ -101,9 +101,9 @@ namespace L2Bot::Domain::Entities
|
||||
const Enums::CrystalTypeEnum crystalType,
|
||||
const uint32_t pDefense,
|
||||
const uint32_t mDefense,
|
||||
const std::string& setEffect,
|
||||
const std::string& addSetEffect,
|
||||
const std::string& enchantEffect
|
||||
const std::wstring& setEffect,
|
||||
const std::wstring& addSetEffect,
|
||||
const std::wstring& enchantEffect
|
||||
) :
|
||||
BaseItem
|
||||
(
|
||||
@@ -163,9 +163,9 @@ namespace L2Bot::Domain::Entities
|
||||
Enums::CrystalTypeEnum m_CrystalType = Enums::CrystalTypeEnum::none;
|
||||
uint32_t m_PDefense = 0;
|
||||
uint32_t m_MDefense = 0;
|
||||
std::string m_SetEffect = "";
|
||||
std::string m_AddSetEffect = "";
|
||||
std::string m_EnchantEffect = "";
|
||||
std::wstring m_SetEffect = L"";
|
||||
std::wstring m_AddSetEffect = L"";
|
||||
std::wstring m_EnchantEffect = L"";
|
||||
GetState m_PrevState = GetState();
|
||||
};
|
||||
}
|
||||
|
@@ -58,24 +58,24 @@ namespace L2Bot::Domain::Entities
|
||||
{
|
||||
std::vector<Serializers::Node> result;
|
||||
|
||||
result.push_back({ "objectId", std::to_string(m_ObjectId) });
|
||||
result.push_back({ "itemId", std::to_string(m_ItemId) });
|
||||
result.push_back({ L"objectId", std::to_wstring(m_ObjectId) });
|
||||
result.push_back({ L"itemId", std::to_wstring(m_ItemId) });
|
||||
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "type", std::to_string(static_cast<int8_t>(m_Type))});
|
||||
result.push_back({ "name", m_Name });
|
||||
result.push_back({ "iconName", m_IconName });
|
||||
result.push_back({ "description", m_Description });
|
||||
result.push_back({ L"type", std::to_wstring(static_cast<int8_t>(m_Type))});
|
||||
result.push_back({ L"name", m_Name });
|
||||
result.push_back({ L"iconName", m_IconName });
|
||||
result.push_back({ L"description", m_Description });
|
||||
}
|
||||
|
||||
if (m_PrevState.isNewState || m_Mana != m_PrevState.mana)
|
||||
{
|
||||
result.push_back({ "mana", std::to_string(m_Mana) });
|
||||
result.push_back({ L"mana", std::to_wstring(m_Mana) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_Weight != m_PrevState.weight)
|
||||
{
|
||||
result.push_back({ "weight", std::to_string(m_Weight) });
|
||||
result.push_back({ L"weight", std::to_wstring(m_Weight) });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -85,9 +85,9 @@ namespace L2Bot::Domain::Entities
|
||||
const uint32_t objectId,
|
||||
const uint32_t itemId,
|
||||
const int32_t mana,
|
||||
const std::string& name,
|
||||
const std::string& iconName,
|
||||
const std::string& description,
|
||||
const std::wstring& name,
|
||||
const std::wstring& iconName,
|
||||
const std::wstring& description,
|
||||
const uint16_t weight,
|
||||
const Enums::ItemTypeEnum type
|
||||
) :
|
||||
@@ -130,9 +130,9 @@ namespace L2Bot::Domain::Entities
|
||||
uint32_t m_ObjectId = 0;
|
||||
uint32_t m_ItemId = 0;
|
||||
int32_t m_Mana = -1;
|
||||
std::string m_Name = "";
|
||||
std::string m_IconName = "";
|
||||
std::string m_Description = "";
|
||||
std::wstring m_Name = L"";
|
||||
std::wstring m_IconName = L"";
|
||||
std::wstring m_Description = L"";
|
||||
uint16_t m_Weight = 0;
|
||||
Enums::ItemTypeEnum m_Type = Enums::ItemTypeEnum::none;
|
||||
GetState m_PrevState = GetState();
|
||||
|
@@ -38,10 +38,10 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_IsNewState)
|
||||
{
|
||||
result.push_back({ "itemId", std::to_string(m_ItemId) });
|
||||
result.push_back({ "amount", std::to_string(m_Amount) });
|
||||
result.push_back({ "name", m_Name });
|
||||
result.push_back({ "iconName", m_IconName });
|
||||
result.push_back({ L"itemId", std::to_wstring(m_ItemId) });
|
||||
result.push_back({ L"amount", std::to_wstring(m_Amount) });
|
||||
result.push_back({ L"name", m_Name });
|
||||
result.push_back({ L"iconName", m_IconName });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -52,8 +52,8 @@ namespace L2Bot::Domain::Entities
|
||||
const ValueObjects::Transform transform,
|
||||
const uint32_t itemId,
|
||||
const uint32_t amount,
|
||||
const std::string& name,
|
||||
const std::string& iconName
|
||||
const std::wstring& name,
|
||||
const std::wstring& iconName
|
||||
) :
|
||||
WorldObject(id, transform),
|
||||
m_ItemId(itemId),
|
||||
@@ -69,8 +69,8 @@ namespace L2Bot::Domain::Entities
|
||||
private:
|
||||
uint32_t m_ItemId = 0;
|
||||
uint32_t m_Amount = 0;
|
||||
std::string m_Name = "";
|
||||
std::string m_IconName = "";
|
||||
std::wstring m_Name = L"";
|
||||
std::wstring m_IconName = L"";
|
||||
bool m_IsNewState = true;
|
||||
};
|
||||
}
|
||||
|
@@ -49,16 +49,16 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "isQuest", std::to_string(m_IsQuest) });
|
||||
result.push_back({ L"isQuest", std::to_wstring(m_IsQuest) });
|
||||
}
|
||||
|
||||
if (m_PrevState.isNewState || m_Amount != m_PrevState.amount)
|
||||
{
|
||||
result.push_back({ "amount", std::to_string(m_Amount) });
|
||||
result.push_back({ L"amount", std::to_wstring(m_Amount) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_IsAutoused != m_PrevState.isAutoused)
|
||||
{
|
||||
result.push_back({ "isAutoused", std::to_string(m_IsAutoused) });
|
||||
result.push_back({ L"isAutoused", std::to_wstring(m_IsAutoused) });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -68,9 +68,9 @@ namespace L2Bot::Domain::Entities
|
||||
const uint32_t objectId,
|
||||
const uint32_t itemId,
|
||||
const int32_t mana,
|
||||
const std::string& name,
|
||||
const std::string& iconName,
|
||||
const std::string& description,
|
||||
const std::wstring& name,
|
||||
const std::wstring& iconName,
|
||||
const std::wstring& description,
|
||||
const uint16_t weight,
|
||||
const uint32_t amount,
|
||||
const bool isQuest
|
||||
|
@@ -70,43 +70,43 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState || !m_FullName.IsEqual(&m_PrevState.fullName))
|
||||
{
|
||||
result.push_back({ "fullName", m_FullName.BuildSerializationNodes() });
|
||||
result.push_back({ L"fullName", m_FullName.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_VitalStats.IsEqual(&m_PrevState.vitalStats))
|
||||
{
|
||||
result.push_back({ "vitalStats", m_VitalStats.BuildSerializationNodes() });
|
||||
result.push_back({ L"vitalStats", m_VitalStats.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_Phenotype.IsEqual(&m_PrevState.phenotype))
|
||||
{
|
||||
result.push_back({ "phenotype", m_Phenotype.BuildSerializationNodes() });
|
||||
result.push_back({ L"phenotype", m_Phenotype.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_ExperienceInfo.IsEqual(&m_PrevState.experienceInfo))
|
||||
{
|
||||
result.push_back({ "experienceInfo", m_ExperienceInfo.BuildSerializationNodes() });
|
||||
result.push_back({ L"experienceInfo", m_ExperienceInfo.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_PermanentStats.IsEqual(&m_PrevState.permanentStats))
|
||||
{
|
||||
result.push_back({ "permanentStats", m_PermanentStats.BuildSerializationNodes() });
|
||||
result.push_back({ L"permanentStats", m_PermanentStats.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_VariableStats.IsEqual(&m_PrevState.variableStats))
|
||||
{
|
||||
result.push_back({ "variableStats", m_VariableStats.BuildSerializationNodes() });
|
||||
result.push_back({ L"variableStats", m_VariableStats.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_Reputation.IsEqual(&m_PrevState.reputation))
|
||||
{
|
||||
result.push_back({ "reputation", m_Reputation.BuildSerializationNodes() });
|
||||
result.push_back({ L"reputation", m_Reputation.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_InventoryInfo.IsEqual(&m_PrevState.inventoryInfo))
|
||||
{
|
||||
result.push_back({ "inventoryInfo", m_InventoryInfo.BuildSerializationNodes() });
|
||||
result.push_back({ L"inventoryInfo", m_InventoryInfo.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_TargetId != m_PrevState.targetId)
|
||||
{
|
||||
result.push_back({ "targetId", std::to_string(m_TargetId) });
|
||||
result.push_back({ L"targetId", std::to_wstring(m_TargetId) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_IsStanding != m_PrevState.isStanding)
|
||||
{
|
||||
result.push_back({ "isStanding", std::to_string(m_IsStanding) });
|
||||
result.push_back({ L"isStanding", std::to_wstring(m_IsStanding) });
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -49,20 +49,20 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState || !m_FullName.IsEqual(&m_PrevState.fullName))
|
||||
{
|
||||
result.push_back({ "fullName", m_FullName.BuildSerializationNodes() });
|
||||
result.push_back({ L"fullName", m_FullName.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "isHostile", std::to_string(m_IsHostile) });
|
||||
result.push_back({ "npcId", std::to_string(m_NpcId) });
|
||||
result.push_back({ L"isHostile", std::to_wstring(m_IsHostile) });
|
||||
result.push_back({ L"npcId", std::to_wstring(m_NpcId) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_SpoilState != m_PrevState.spoilState)
|
||||
{
|
||||
result.push_back({ "spoilState", std::to_string(static_cast<uint32_t>(m_SpoilState)) });
|
||||
result.push_back({ L"spoilState", std::to_wstring(static_cast<uint32_t>(m_SpoilState)) });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_VitalStats.IsEqual(&m_PrevState.vitalStats))
|
||||
{
|
||||
result.push_back({ "vitalStats", m_VitalStats.BuildSerializationNodes() });
|
||||
result.push_back({ L"vitalStats", m_VitalStats.BuildSerializationNodes() });
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -40,11 +40,11 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState || !m_FullName.IsEqual(&m_PrevState.fullName))
|
||||
{
|
||||
result.push_back({ "fullName", m_FullName.BuildSerializationNodes() });
|
||||
result.push_back({ L"fullName", m_FullName.BuildSerializationNodes() });
|
||||
}
|
||||
if (m_PrevState.isNewState || !m_Phenotype.IsEqual(&m_PrevState.phenotype))
|
||||
{
|
||||
result.push_back({ "phenotype", m_Phenotype.BuildSerializationNodes() });
|
||||
result.push_back({ L"phenotype", m_Phenotype.BuildSerializationNodes() });
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -52,22 +52,22 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "crystalType", std::to_string(static_cast<int8_t>(m_CrystalType)) });
|
||||
result.push_back({ "evasion", std::to_string(m_Evasion) });
|
||||
result.push_back({ "defRate", std::to_string(m_DefRate) });
|
||||
result.push_back({ L"crystalType", std::to_wstring(static_cast<int8_t>(m_CrystalType)) });
|
||||
result.push_back({ L"evasion", std::to_wstring(m_Evasion) });
|
||||
result.push_back({ L"defRate", std::to_wstring(m_DefRate) });
|
||||
}
|
||||
|
||||
if (m_PrevState.isNewState || m_IsEquipped != m_PrevState.isEquipped)
|
||||
{
|
||||
result.push_back({ "isEquipped", std::to_string(m_IsEquipped) });
|
||||
result.push_back({ L"isEquipped", std::to_wstring(m_IsEquipped) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_EnchantLevel != m_PrevState.enchantLevel)
|
||||
{
|
||||
result.push_back({ "enchantLevel", std::to_string(m_EnchantLevel) });
|
||||
result.push_back({ L"enchantLevel", std::to_wstring(m_EnchantLevel) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_PDefense != m_PrevState.pDefense)
|
||||
{
|
||||
result.push_back({ "pDefense", std::to_string(m_PDefense) });
|
||||
result.push_back({ L"pDefense", std::to_wstring(m_PDefense) });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -77,9 +77,9 @@ namespace L2Bot::Domain::Entities
|
||||
const uint32_t objectId,
|
||||
const uint32_t itemId,
|
||||
const int32_t mana,
|
||||
const std::string& name,
|
||||
const std::string& iconName,
|
||||
const std::string& description,
|
||||
const std::wstring& name,
|
||||
const std::wstring& iconName,
|
||||
const std::wstring& description,
|
||||
const uint16_t weight,
|
||||
const bool isEquipped,
|
||||
const uint16_t enchantLevel,
|
||||
|
@@ -90,43 +90,43 @@ namespace L2Bot::Domain::Entities
|
||||
{
|
||||
std::vector<Serializers::Node> result;
|
||||
|
||||
result.push_back({ "skillId", std::to_string(m_SkillId) });
|
||||
result.push_back({ "level", std::to_string(m_Level) });
|
||||
result.push_back({ L"skillId", std::to_wstring(m_SkillId) });
|
||||
result.push_back({ L"level", std::to_wstring(m_Level) });
|
||||
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "isActive", std::to_string(m_IsActive) });
|
||||
result.push_back({ "name", m_Name });
|
||||
result.push_back({ "iconName", m_IconName });
|
||||
result.push_back({ L"isActive", std::to_wstring(m_IsActive) });
|
||||
result.push_back({ L"name", m_Name });
|
||||
result.push_back({ L"iconName", m_IconName });
|
||||
}
|
||||
|
||||
if (m_PrevState.isNewState || m_Description != m_PrevState.description)
|
||||
{
|
||||
result.push_back({ "description", m_Description });
|
||||
result.push_back({ L"description", m_Description });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_Cost != m_PrevState.cost)
|
||||
{
|
||||
result.push_back({ "cost", std::to_string(m_Cost) });
|
||||
result.push_back({ L"cost", std::to_wstring(m_Cost) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_Range != m_PrevState.range)
|
||||
{
|
||||
result.push_back({ "range", std::to_string(m_Range) });
|
||||
result.push_back({ L"range", std::to_wstring(m_Range) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_IsToggled != m_PrevState.isToggled)
|
||||
{
|
||||
result.push_back({ "isToggled", std::to_string(m_IsToggled) });
|
||||
result.push_back({ L"isToggled", std::to_wstring(m_IsToggled) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_IsCasting != m_PrevState.isCasting)
|
||||
{
|
||||
result.push_back({ "isCasting", std::to_string(m_IsCasting) });
|
||||
result.push_back({ L"isCasting", std::to_wstring(m_IsCasting) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_IsReloading != m_PrevState.isReloading)
|
||||
{
|
||||
result.push_back({ "isReloading", std::to_string(m_IsReloading) });
|
||||
result.push_back({ L"isReloading", std::to_wstring(m_IsReloading) });
|
||||
}
|
||||
if (m_PrevState.isNewState || IsReadyToUse() != m_PrevState.isReadyToUse)
|
||||
{
|
||||
result.push_back({ "isReadyToUse", std::to_string(IsReadyToUse()) });
|
||||
result.push_back({ L"isReadyToUse", std::to_wstring(IsReadyToUse()) });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -138,9 +138,9 @@ namespace L2Bot::Domain::Entities
|
||||
const bool isActive,
|
||||
const uint8_t cost,
|
||||
const int16_t range,
|
||||
const std::string& name,
|
||||
const std::string& description,
|
||||
const std::string& iconName,
|
||||
const std::wstring& name,
|
||||
const std::wstring& description,
|
||||
const std::wstring& iconName,
|
||||
const bool isToggled,
|
||||
const bool isCasting,
|
||||
const bool isReloading
|
||||
@@ -183,7 +183,7 @@ namespace L2Bot::Domain::Entities
|
||||
{
|
||||
uint8_t cost = 0;
|
||||
int16_t range = 0;
|
||||
std::string description = "";
|
||||
std::wstring description = L"";
|
||||
bool isToggled = false;
|
||||
bool isCasting = false;
|
||||
bool isReloading = false;
|
||||
@@ -198,9 +198,9 @@ namespace L2Bot::Domain::Entities
|
||||
bool m_IsActive = false;
|
||||
uint8_t m_Cost = 0;
|
||||
int16_t m_Range = 0;
|
||||
std::string m_Name = "";
|
||||
std::string m_Description = "";
|
||||
std::string m_IconName = "";
|
||||
std::wstring m_Name = L"";
|
||||
std::wstring m_Description = L"";
|
||||
std::wstring m_IconName = L"";
|
||||
bool m_IsToggled = false;
|
||||
bool m_IsCasting = false;
|
||||
bool m_IsReloading = false;
|
||||
|
@@ -68,32 +68,32 @@ namespace L2Bot::Domain::Entities
|
||||
|
||||
if (m_PrevState.isNewState)
|
||||
{
|
||||
result.push_back({ "weaponType", std::to_string(static_cast<uint8_t>(m_WeaponType)) });
|
||||
result.push_back({ "crystalType", std::to_string(static_cast<int8_t>(m_CrystalType)) });
|
||||
result.push_back({ "rndDamage", std::to_string(m_RndDamage) });
|
||||
result.push_back({ "critical", std::to_string(m_Critical) });
|
||||
result.push_back({ "hitModify", std::to_string(m_HitModify) });
|
||||
result.push_back({ "attackSpeed", std::to_string(m_AttackSpeed) });
|
||||
result.push_back({ "mpConsume", std::to_string(m_MpConsume) });
|
||||
result.push_back({ "soulshotCount", std::to_string(m_SoulshotCount) });
|
||||
result.push_back({ "spiritshotCount", std::to_string(m_SpiritshotCount) });
|
||||
result.push_back({ L"weaponType", std::to_wstring(static_cast<uint8_t>(m_WeaponType)) });
|
||||
result.push_back({ L"crystalType", std::to_wstring(static_cast<int8_t>(m_CrystalType)) });
|
||||
result.push_back({ L"rndDamage", std::to_wstring(m_RndDamage) });
|
||||
result.push_back({ L"critical", std::to_wstring(m_Critical) });
|
||||
result.push_back({ L"hitModify", std::to_wstring(m_HitModify) });
|
||||
result.push_back({ L"attackSpeed", std::to_wstring(m_AttackSpeed) });
|
||||
result.push_back({ L"mpConsume", std::to_wstring(m_MpConsume) });
|
||||
result.push_back({ L"soulshotCount", std::to_wstring(m_SoulshotCount) });
|
||||
result.push_back({ L"spiritshotCount", std::to_wstring(m_SpiritshotCount) });
|
||||
}
|
||||
|
||||
if (m_PrevState.isNewState || m_IsEquipped != m_PrevState.isEquipped)
|
||||
{
|
||||
result.push_back({ "isEquipped", std::to_string(m_IsEquipped) });
|
||||
result.push_back({ L"isEquipped", std::to_wstring(m_IsEquipped) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_EnchantLevel != m_PrevState.enchantLevel)
|
||||
{
|
||||
result.push_back({ "enchantLevel", std::to_string(m_EnchantLevel) });
|
||||
result.push_back({ L"enchantLevel", std::to_wstring(m_EnchantLevel) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_PAttack != m_PrevState.pAttack)
|
||||
{
|
||||
result.push_back({ "pAttack", std::to_string(m_PAttack) });
|
||||
result.push_back({ L"pAttack", std::to_wstring(m_PAttack) });
|
||||
}
|
||||
if (m_PrevState.isNewState || m_MAttack != m_PrevState.mAttack)
|
||||
{
|
||||
result.push_back({ "mAttack", std::to_string(m_MAttack) });
|
||||
result.push_back({ L"mAttack", std::to_wstring(m_MAttack) });
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -103,9 +103,9 @@ namespace L2Bot::Domain::Entities
|
||||
const uint32_t objectId,
|
||||
const uint32_t itemId,
|
||||
const int32_t mana,
|
||||
const std::string& name,
|
||||
const std::string& iconName,
|
||||
const std::string& description,
|
||||
const std::wstring& name,
|
||||
const std::wstring& iconName,
|
||||
const std::wstring& description,
|
||||
const uint16_t weight,
|
||||
const bool isEquipped,
|
||||
const uint16_t enchantLevel,
|
||||
|
@@ -34,10 +34,10 @@ namespace L2Bot::Domain::Entities
|
||||
{
|
||||
std::vector<Serializers::Node> result;
|
||||
|
||||
result.push_back({ "id", std::to_string(GetId()) });
|
||||
result.push_back({ L"id", std::to_wstring(GetId()) });
|
||||
if (m_PrevState.isNewState || !m_Transform.IsEqual(&m_PrevState.transform))
|
||||
{
|
||||
result.push_back({ "transform", m_Transform.BuildSerializationNodes() });
|
||||
result.push_back({ L"transform", m_Transform.BuildSerializationNodes() });
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -7,18 +7,18 @@ namespace L2Bot::Domain::Serializers
|
||||
{
|
||||
struct Node
|
||||
{
|
||||
const std::string name = "";
|
||||
const std::string value = "";
|
||||
const std::wstring name = L"";
|
||||
const std::wstring value = L"";
|
||||
const std::vector<Node> children;
|
||||
const bool isArray = false;
|
||||
const bool isContainer = false;
|
||||
|
||||
Node() = delete;
|
||||
Node(const std::string& name, const std::string& value) :
|
||||
Node(const std::wstring& name, const std::wstring& value) :
|
||||
name(name), value(value)
|
||||
{
|
||||
}
|
||||
Node(const std::string& name, const std::vector<Node> children, const bool isArray = false) :
|
||||
Node(const std::wstring& name, const std::vector<Node> children, const bool isArray = false) :
|
||||
name(name), children(children), isArray(isArray), isContainer(true)
|
||||
{
|
||||
}
|
||||
|
@@ -14,21 +14,21 @@ namespace L2Bot::Domain::Serializers
|
||||
|
||||
for (const auto& kvp : m_Objects)
|
||||
{
|
||||
std::string operationName = "";
|
||||
std::wstring operationName = L"";
|
||||
switch (kvp->GetState())
|
||||
{
|
||||
case Enums::EntityStateEnum::created:
|
||||
operationName = "created";
|
||||
operationName = L"created";
|
||||
break;
|
||||
case Enums::EntityStateEnum::updated:
|
||||
operationName = "updated";
|
||||
operationName = L"updated";
|
||||
break;
|
||||
case Enums::EntityStateEnum::deleted:
|
||||
operationName = "deleted";
|
||||
operationName = L"deleted";
|
||||
break;
|
||||
}
|
||||
|
||||
if (operationName != "")
|
||||
if (operationName != L"")
|
||||
{
|
||||
result.push_back(
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace L2Bot::Domain::Serializers
|
||||
return result;
|
||||
}
|
||||
|
||||
SerializableStateContainer(const std::vector<std::shared_ptr<DTO::EntityState>> objects, const std::string& containerName) :
|
||||
SerializableStateContainer(const std::vector<std::shared_ptr<DTO::EntityState>> objects, const std::wstring& containerName) :
|
||||
m_Objects(objects), m_ContainerName(containerName)
|
||||
{
|
||||
|
||||
@@ -51,6 +51,6 @@ namespace L2Bot::Domain::Serializers
|
||||
virtual ~SerializableStateContainer() = default;
|
||||
private:
|
||||
const std::vector<std::shared_ptr<DTO::EntityState>> m_Objects;
|
||||
const std::string m_ContainerName;
|
||||
const std::wstring m_ContainerName;
|
||||
};
|
||||
}
|
@@ -8,6 +8,6 @@ namespace L2Bot::Domain::Serializers
|
||||
class SerializerInterface
|
||||
{
|
||||
public:
|
||||
virtual const std::string Serialize(std::vector<Node> nodes, const bool isArray = false) const = 0;
|
||||
virtual const std::wstring Serialize(std::vector<Node> nodes, const bool isArray = false) const = 0;
|
||||
};
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ namespace L2Bot::Domain::Transports
|
||||
public:
|
||||
virtual const bool Connect() = 0;
|
||||
virtual const bool IsConnected() const = 0;
|
||||
virtual const void Send(const std::string& data) = 0;
|
||||
virtual const std::string Receive() = 0;
|
||||
virtual const void Send(const std::wstring& data) = 0;
|
||||
virtual const std::wstring Receive() = 0;
|
||||
};
|
||||
}
|
||||
|
@@ -13,18 +13,18 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "objectId", std::to_string(m_ObjectId) },
|
||||
{ "channel", std::to_string(static_cast<uint8_t>(m_Channel)) },
|
||||
{ "name", m_Name },
|
||||
{ "text", m_Text }
|
||||
{ L"objectId", std::to_wstring(m_ObjectId) },
|
||||
{ L"channel", std::to_wstring(static_cast<uint8_t>(m_Channel)) },
|
||||
{ L"name", m_Name },
|
||||
{ L"text", m_Text }
|
||||
};
|
||||
}
|
||||
|
||||
ChatMessage(
|
||||
const uint32_t objectId,
|
||||
const Enums::ChatChannelEnum channel,
|
||||
const std::string& name,
|
||||
const std::string& text
|
||||
const std::wstring& name,
|
||||
const std::wstring& text
|
||||
) :
|
||||
m_ObjectId(objectId),
|
||||
m_Channel(channel),
|
||||
@@ -39,7 +39,7 @@ namespace L2Bot::Domain::ValueObjects
|
||||
private:
|
||||
uint32_t m_ObjectId = 0;
|
||||
Enums::ChatChannelEnum m_Channel = Enums::ChatChannelEnum::all;
|
||||
std::string m_Name = "";
|
||||
std::string m_Text = "";
|
||||
std::wstring m_Name = L"";
|
||||
std::wstring m_Text = L"";
|
||||
};
|
||||
}
|
||||
|
@@ -28,9 +28,9 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "level", std::to_string(m_Level) },
|
||||
{ "exp", std::to_string(m_Exp) },
|
||||
{ "sp", std::to_string(m_Sp) }
|
||||
{ L"level", std::to_wstring(m_Level) },
|
||||
{ L"exp", std::to_wstring(m_Exp) },
|
||||
{ L"sp", std::to_wstring(m_Sp) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -7,11 +7,11 @@ namespace L2Bot::Domain::ValueObjects
|
||||
class FullName : public Serializers::Serializable
|
||||
{
|
||||
public:
|
||||
const std::string& GetNickname() const
|
||||
const std::wstring& GetNickname() const
|
||||
{
|
||||
return m_Nickname;
|
||||
}
|
||||
const std::string& GetTitle() const
|
||||
const std::wstring& GetTitle() const
|
||||
{
|
||||
return m_Title;
|
||||
}
|
||||
@@ -24,14 +24,14 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "nickname", m_Nickname },
|
||||
{ "title", m_Title }
|
||||
{ L"nickname", m_Nickname },
|
||||
{ L"title", m_Title }
|
||||
};
|
||||
}
|
||||
|
||||
FullName(
|
||||
const std::string& nickname,
|
||||
const std::string& title
|
||||
const std::wstring& nickname,
|
||||
const std::wstring& title
|
||||
) :
|
||||
m_Nickname(nickname),
|
||||
m_Title(title)
|
||||
@@ -41,7 +41,7 @@ namespace L2Bot::Domain::ValueObjects
|
||||
FullName() = default;
|
||||
virtual ~FullName() = default;
|
||||
private:
|
||||
std::string m_Nickname = "";
|
||||
std::string m_Title = "";
|
||||
std::wstring m_Nickname = L"";
|
||||
std::wstring m_Title = L"";
|
||||
};
|
||||
}
|
||||
|
@@ -34,9 +34,9 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "maxWeight", std::to_string(m_MaxWeight) },
|
||||
{ "weight", std::to_string(m_Weight) },
|
||||
{ "slots", std::to_string(m_Slots) }
|
||||
{ L"maxWeight", std::to_wstring(m_MaxWeight) },
|
||||
{ L"weight", std::to_wstring(m_Weight) },
|
||||
{ L"slots", std::to_wstring(m_Slots) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -45,12 +45,12 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "str", std::to_string(m_Str) },
|
||||
{ "dex", std::to_string(m_Dex) },
|
||||
{ "con", std::to_string(m_Con) },
|
||||
{ "int", std::to_string(m_Int) },
|
||||
{ "men", std::to_string(m_Men) },
|
||||
{ "wit", std::to_string(m_Wit) }
|
||||
{ L"str", std::to_wstring(m_Str) },
|
||||
{ L"dex", std::to_wstring(m_Dex) },
|
||||
{ L"con", std::to_wstring(m_Con) },
|
||||
{ L"int", std::to_wstring(m_Int) },
|
||||
{ L"men", std::to_wstring(m_Men) },
|
||||
{ L"wit", std::to_wstring(m_Wit) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -40,10 +40,10 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "race", std::to_string(static_cast<uint8_t>(m_Race)) },
|
||||
{ "isMale", std::to_string(m_IsMale) },
|
||||
{ "class", std::to_string(static_cast<uint8_t>(m_Class)) },
|
||||
{ "activeClass", std::to_string(static_cast<uint8_t>(m_ActiveClass)) }
|
||||
{ L"race", std::to_wstring(static_cast<uint8_t>(m_Race)) },
|
||||
{ L"isMale", std::to_wstring(m_IsMale) },
|
||||
{ L"class", std::to_wstring(static_cast<uint8_t>(m_Class)) },
|
||||
{ L"activeClass", std::to_wstring(static_cast<uint8_t>(m_ActiveClass)) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -44,11 +44,11 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "karma", std::to_string(m_Karma) },
|
||||
{ "pkKills", std::to_string(m_PkKills) },
|
||||
{ "pvpKills", std::to_string(m_PvpKills) },
|
||||
{ "recRemaining", std::to_string(m_RecRemaining) },
|
||||
{ "evalScore", std::to_string(m_EvalScore) }
|
||||
{ L"karma", std::to_wstring(m_Karma) },
|
||||
{ L"pkKills", std::to_wstring(m_PkKills) },
|
||||
{ L"pvpKills", std::to_wstring(m_PvpKills) },
|
||||
{ L"recRemaining", std::to_wstring(m_RecRemaining) },
|
||||
{ L"evalScore", std::to_wstring(m_EvalScore) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -43,10 +43,10 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "position", m_Position.BuildSerializationNodes() },
|
||||
{ "rotation", m_Rotation.BuildSerializationNodes() },
|
||||
{ "velocity", m_Velocity.BuildSerializationNodes() },
|
||||
{ "acceleration", m_Acceleration.BuildSerializationNodes() }
|
||||
{ L"position", m_Position.BuildSerializationNodes() },
|
||||
{ L"rotation", m_Rotation.BuildSerializationNodes() },
|
||||
{ L"velocity", m_Velocity.BuildSerializationNodes() },
|
||||
{ L"acceleration", m_Acceleration.BuildSerializationNodes() }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -60,15 +60,15 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "accuracy", std::to_string(m_Accuracy) },
|
||||
{ "critRate", std::to_string(m_CritRate) },
|
||||
{ "pAttack", std::to_string(m_PAttack) },
|
||||
{ "attackSpeed", std::to_string(m_AttackSpeed) },
|
||||
{ "pDefense", std::to_string(m_PDefense) },
|
||||
{ "evasion", std::to_string(m_Evasion) },
|
||||
{ "mAttack", std::to_string(m_MAttack) },
|
||||
{ "mDefense", std::to_string(m_MDefense) },
|
||||
{ "castingSpeed", std::to_string(m_CastingSpeed) }
|
||||
{ L"accuracy", std::to_wstring(m_Accuracy) },
|
||||
{ L"critRate", std::to_wstring(m_CritRate) },
|
||||
{ L"pAttack", std::to_wstring(m_PAttack) },
|
||||
{ L"attackSpeed", std::to_wstring(m_AttackSpeed) },
|
||||
{ L"pDefense", std::to_wstring(m_PDefense) },
|
||||
{ L"evasion", std::to_wstring(m_Evasion) },
|
||||
{ L"mAttack", std::to_wstring(m_MAttack) },
|
||||
{ L"mDefense", std::to_wstring(m_MDefense) },
|
||||
{ L"castingSpeed", std::to_wstring(m_CastingSpeed) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -42,9 +42,9 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "x", std::to_string(m_X) },
|
||||
{ "y", std::to_string(m_Y) },
|
||||
{ "z", std::to_string(m_Z) }
|
||||
{ L"x", std::to_wstring(m_X) },
|
||||
{ L"y", std::to_wstring(m_Y) },
|
||||
{ L"z", std::to_wstring(m_Z) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -49,12 +49,12 @@ namespace L2Bot::Domain::ValueObjects
|
||||
{
|
||||
return std::vector<Serializers::Node>
|
||||
{
|
||||
{ "maxHp", std::to_string(m_MaxHp) },
|
||||
{ "hp", std::to_string(m_Hp) },
|
||||
{ "maxMp", std::to_string(m_MaxMp) },
|
||||
{ "mp", std::to_string(m_Mp) },
|
||||
{ "maxCp", std::to_string(m_MaxCp) },
|
||||
{ "cp", std::to_string(m_Cp) }
|
||||
{ L"maxHp", std::to_wstring(m_MaxHp) },
|
||||
{ L"hp", std::to_wstring(m_Hp) },
|
||||
{ L"maxMp", std::to_wstring(m_MaxMp) },
|
||||
{ L"mp", std::to_wstring(m_Mp) },
|
||||
{ L"maxCp", std::to_wstring(m_MaxCp) },
|
||||
{ L"cp", std::to_wstring(m_Cp) }
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user