space-game001/src/network/NetworkInterface.h
2026-01-27 19:38:18 +06:00

31 lines
1.0 KiB
C++

#pragma once
#include <string>
#include <unordered_map>
#include <vector>
#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();
};
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<int, ClientStateInterval> getRemotePlayers() = 0;
virtual std::vector<std::pair<Eigen::Vector3f, Eigen::Matrix3f>> getServerBoxes() = 0;
virtual std::vector<ProjectileInfo> getPendingProjectiles() = 0;
};
}