GekkoNet
1.0
C/C++ Peer to Peer Game Networking SDK
Loading...
Searching...
No Matches
storage.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
gekko_types.h
"
4
#include "
input.h
"
5
6
#include <memory>
7
#include <vector>
8
9
namespace
Gekko
{
10
struct
StateEntry
{
11
Frame
frame
=
GameInput::NULL_FRAME
;
12
std::unique_ptr<u8[]>
state
;
13
u32
state_len
= 0;
14
u32
checksum
= 0;
15
};
16
17
class
StateStorage
{
18
public
:
19
StateStorage
();
20
21
void
Init
(
u32
num_states,
u32
state_size,
bool
limited);
22
23
StateEntry
*
GetState
(
Frame
frame);
24
25
StateEntry
*
GetRunaheadState
();
26
27
private
:
28
u32
_max_num_states
;
29
30
std::vector<std::unique_ptr<StateEntry>>
_states
;
31
32
StateEntry
_runahead_state
;
33
};
34
}
Gekko::StateStorage::_max_num_states
u32 _max_num_states
Definition
storage.h:28
Gekko::StateStorage::GetRunaheadState
StateEntry * GetRunaheadState()
Definition
storage.cpp:25
Gekko::StateStorage::GetState
StateEntry * GetState(Frame frame)
Definition
storage.cpp:30
Gekko::StateStorage::_states
std::vector< std::unique_ptr< StateEntry > > _states
Definition
storage.h:30
Gekko::StateStorage::StateStorage
StateStorage()
Definition
storage.cpp:3
Gekko::StateStorage::Init
void Init(u32 num_states, u32 state_size, bool limited)
Definition
storage.cpp:9
Gekko::StateStorage::_runahead_state
StateEntry _runahead_state
Definition
storage.h:32
gekko_types.h
Frame
int32_t Frame
Definition
gekko_types.h:18
u32
uint32_t u32
Definition
gekko_types.h:7
input.h
Gekko
Definition
backend.h:18
Gekko::GameInput::NULL_FRAME
static const i32 NULL_FRAME
Definition
input.h:21
Gekko::StateEntry
Definition
storage.h:10
Gekko::StateEntry::frame
Frame frame
Definition
storage.h:11
Gekko::StateEntry::state
std::unique_ptr< u8[]> state
Definition
storage.h:12
Gekko::StateEntry::state_len
u32 state_len
Definition
storage.h:13
Gekko::StateEntry::checksum
u32 checksum
Definition
storage.h:14
include
private
storage.h
Generated by
1.15.0