Files
Tower-Defense2/include/td/simulation/GameHistory.h

32 lines
692 B
C++

#pragma once
#include <optional>
#include <td/protocol/command/Commands.h>
#include <td/protocol/packet/Packets.h>
namespace td {
namespace game {
class GameHistory {
private:
using HistorySizeType = StepsType;
std::vector<std::optional<protocol::LockStep>> m_History;
public:
GameHistory();
void SetLockStep(HistorySizeType a_Index, protocol::LockStep&& a_LockStep);
const protocol::LockStep& GetLockStep(HistorySizeType a_Index) const;
bool HasLockStep(HistorySizeType a_Index) const;
void FromPacket(td::protocol::pdata::LockSteps&& a_Steps);
td::protocol::packets::LockStepsPacket ToPacket(HistorySizeType a_StartIndex);
};
} // namespace game
} // namespace td