feat: add incoming messages to bot
This commit is contained in:
@@ -13,6 +13,10 @@ namespace L2Bot::Domain::Entities
|
||||
{
|
||||
m_IsAutoused = enabled;
|
||||
}
|
||||
const bool IsAutoused() const
|
||||
{
|
||||
return m_IsAutoused;
|
||||
}
|
||||
|
||||
void Update(const EntityInterface* other) override
|
||||
{
|
||||
|
62
L2BotCore/Domain/Serializers/IncomingMessage.h
Normal file
62
L2BotCore/Domain/Serializers/IncomingMessage.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace L2Bot::Domain::Serializers
|
||||
{
|
||||
class IncomingMessage
|
||||
{
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
none,
|
||||
invalidate,
|
||||
move,
|
||||
acquireTarget,
|
||||
attack,
|
||||
pickup,
|
||||
useSkill,
|
||||
useItem,
|
||||
toggleSoulshot,
|
||||
sit,
|
||||
stand
|
||||
};
|
||||
|
||||
const Type GetType() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const auto GetContent() const
|
||||
{
|
||||
return std::static_pointer_cast<T>(m_Content);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const T GetRawContent() const
|
||||
{
|
||||
return *std::static_pointer_cast<T>(m_Content).get();
|
||||
}
|
||||
|
||||
IncomingMessage(Type type, std::shared_ptr<void> content) :
|
||||
m_Type(type),
|
||||
m_Content(content)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
IncomingMessage(Type type) :
|
||||
m_Type(type)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
IncomingMessage() = default;
|
||||
virtual ~IncomingMessage() = default;
|
||||
|
||||
private:
|
||||
Type m_Type = Type::none;
|
||||
std::shared_ptr<void> m_Content;
|
||||
};
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "IncomingMessage.h"
|
||||
|
||||
namespace L2Bot::Domain::Serializers
|
||||
{
|
||||
class IncomingMessageFactoryInterface
|
||||
{
|
||||
public:
|
||||
virtual const IncomingMessage CreateMessage(std::wstring data) const = 0;
|
||||
};
|
||||
}
|
@@ -5,15 +5,15 @@
|
||||
|
||||
namespace L2Bot::Domain::Services
|
||||
{
|
||||
class ChatMessageService
|
||||
class ChatMessageHandler
|
||||
{
|
||||
public:
|
||||
ChatMessageService(Repositories::ChatMessageRepositoryInterface& repository) : m_Repository(repository)
|
||||
ChatMessageHandler(Repositories::ChatMessageRepositoryInterface& repository) : m_Repository(repository)
|
||||
{
|
||||
|
||||
}
|
||||
ChatMessageService() = delete;
|
||||
virtual ~ChatMessageService() = default;
|
||||
ChatMessageHandler() = delete;
|
||||
virtual ~ChatMessageHandler() = default;
|
||||
|
||||
virtual const std::vector<ValueObjects::ChatMessage> GetMessages()
|
||||
{
|
@@ -9,15 +9,15 @@
|
||||
|
||||
namespace L2Bot::Domain::Services
|
||||
{
|
||||
class EntityService
|
||||
class EntityHandler
|
||||
{
|
||||
public:
|
||||
EntityService(Repositories::EntityRepositoryInterface& repository) : m_Repository(repository)
|
||||
EntityHandler(Repositories::EntityRepositoryInterface& repository) : m_Repository(repository)
|
||||
{
|
||||
|
||||
}
|
||||
EntityService() = delete;
|
||||
virtual ~EntityService() = default;
|
||||
EntityHandler() = delete;
|
||||
virtual ~EntityHandler() = default;
|
||||
|
||||
virtual const std::vector<std::shared_ptr<DTO::EntityState>> GetEntities()
|
||||
{
|
22
L2BotCore/Domain/Services/HeroServiceInterface.h
Normal file
22
L2BotCore/Domain/Services/HeroServiceInterface.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "../DTO/EntityState.h"
|
||||
#include "../ValueObjects/Vector3.h"
|
||||
|
||||
namespace L2Bot::Domain::Services
|
||||
{
|
||||
class HeroServiceInterface
|
||||
{
|
||||
public:
|
||||
virtual void Move(ValueObjects::Vector3 location) const = 0;
|
||||
virtual void AcquireTarget(int objectId) const = 0;
|
||||
virtual void Attack(int objectId) const = 0;
|
||||
virtual void Pickup(int objectId) const = 0;
|
||||
virtual void UseSkill(int skillId, bool isForced, bool isShiftPressed) const = 0;
|
||||
virtual void UseItem(int objectId) const = 0;
|
||||
virtual void ToggleAutouseSoulshot(int objectId) const = 0;
|
||||
virtual void Sit() const = 0;
|
||||
virtual void Stand() const = 0;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user