// SPDX-FileCopyrightText: 2024 Yury Gubich // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include #include #include "component/core.h" #include "component/actor.h" #include "connection/connection.h" namespace Module { class Module { public: typedef std::vector Tokens; typedef std::vector List; typedef std::map Permissions; protected: Module(const std::shared_ptr& core, const std::shared_ptr& connection, const Permissions& permissions); bool hasPermission(const std::string& permission, const std::shared_ptr<::Actor>& actor) const; public: virtual ~Module() noexcept; static Tokens split(const std::string& string, const std::string& delimiter = " "); virtual void message(const std::shared_ptr<::Actor>& actor, const Tokens& args) = 0; protected: std::shared_ptr core; std::shared_ptr connection; Permissions permissions; }; }