#pragma once #include #include #include #include "ClientState.h" // NetworkInterface.h - »нтерфейс дл¤ разных типов соединений namespace ZL { struct ProjectileInfo { int shooterId = -1; uint64_t clientTime = 0; Eigen::Vector3f position = Eigen::Vector3f::Zero(); //Eigen::Vector3f direction = Eigen::Vector3f::Zero(); Eigen::Matrix3f rotation = Eigen::Matrix3f::Identity(); float velocity = 0; }; struct DeathInfo { int targetId = -1; uint64_t serverTime = 0; Eigen::Vector3f position = Eigen::Vector3f::Zero(); int killerId = -1; }; struct BoxDestroyedInfo { int boxIndex = -1; uint64_t serverTime = 0; Eigen::Vector3f position = Eigen::Vector3f::Zero(); int destroyedBy = -1; }; class INetworkClient { public: virtual ~INetworkClient() = default; virtual void Connect(const std::string& host, uint16_t port) = 0; virtual void Send(const std::string& message) = 0; virtual bool IsConnected() const = 0; virtual void Poll() = 0; // ƒл¤ обработки вход¤щих пакетов virtual std::unordered_map getRemotePlayers() = 0; virtual std::vector> getServerBoxes() = 0; virtual std::vector getPendingProjectiles() = 0; virtual std::vector getPendingDeaths() = 0; virtual std::vector getPendingRespawns() = 0; virtual int GetClientId() const { return -1; } virtual std::vector getPendingBoxDestructions() = 0; virtual int64_t getTimeOffset() const { return 0; } }; }