.. _program_listing_file_gui_Entities_E_Coms.hpp: Program Listing for File E_Coms.hpp =================================== |exhale_lsh| :ref:`Return to documentation for file ` (``gui/Entities/E_Coms.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include "API/API.hpp" #include "ArgsParser.hpp" #include "Demeter/Entity.hpp" #include "Network/Network.hpp" #include "logging/Logger.hpp" class E_Coms : public Dem::IEntity { public: std::shared_ptr api = nullptr; // NOLINT private: Network network; public: E_Coms(Args ¶ms) : api(std::make_shared()), network(params.GetPort(), params.GetHost(), api) { } bool Init(Dem::Demeter &) override { Log::inf << "Network started."; return true; } ~E_Coms() override { network.RequestStop(); } bool Update(Dem::Demeter &) override { network.Run(); return true; } bool Draw(Dem::Demeter &) override { return true; } std::shared_ptr GetApi() const { return api; } };