Polyphase Game Engine
Loading...
Searching...
No Matches
CommandHistory.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "document.h"
6
7#include <deque>
8#include <string>
9
17class CommandHistory
18{
19public:
21 void Add(const std::string& cmd);
22
24 const std::string* Prev();
25
27 const std::string* Next();
28
30 void ResetCursor() { mCursor = -1; }
31
33 void SaveTo(rapidjson::Value& arr, rapidjson::Document::AllocatorType& alloc) const;
34
36 void LoadFrom(const rapidjson::Value& arr);
37
38private:
39 std::deque<std::string> mItems;
40 int mCursor = -1;
41 static const size_t kMaxItems = 256;
42};
43
44#endif
Definition JsonHelpers.h:14