WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. Source
  4. SaveMessage.h
Mission NodeSDK 6.2C++savemessage.h

SaveMessage.h

SDK Source File: SaveMessage.h

Source / SDK 6.2 / C++ / Core

SaveMessage.h

SaveMessage.h
CPP
1/* Copyright Statement:
2 *
3 * (C) 2021-2024 Cubios Inc. All rights reserved.
4 */
5
6#ifndef WASMLIBS_CPP_SAVEMESSAGE_H_
7#define WASMLIBS_CPP_SAVEMESSAGE_H_
8#include <memory>
9#include <vector>
10#include "native.h"
11
12namespace Cubios
13{
14class SaveMessage
15{
16 public:
17 SaveMessage(uint8_t* data=NULL,int length=GAME_SAVE_SIZE);
18 virtual ~SaveMessage();
19
20 void Print();
21
22 void WriteInt(int value, int bits);
23 void WriteByte(uint8_t value);
24 void WriteSignedInt(int value, int bits);
25 void WriteBool(bool value);
26 void WriteFloat(float value);
27
28 int ReadInt(int bits);
29 int ReadSignedInt(int bits);
30 uint8_t ReadByte();
31 bool ReadBool();
32 float ReadFloat();
33
34 uint8_t* GetData(int& length);
35 void SetData(uint8_t* data, int length);
36
37 inline void Reset(bool zero=false) { this->m_curPos = 0; this->m_usedBits = 0; this->m_numBytes = GAME_SAVE_SIZE; if(zero) memset(this->m_bytes,0x00,GAME_SAVE_SIZE);}
38
39 private:
40 int m_numBytes;
41 int m_usedBits;
42 int m_curPos;
43 uint8_t m_bytes[GAME_SAVE_SIZE];
44
45 bool checkOverflow(int bits);
46
47 inline int curByte() { return m_curPos / 8;}
48 inline int curBit() { return m_curPos % 8; }
49
50};
51
52}
53#endif /* WASMLIBS_CPP_SAVEMESSAGE_H_ */
54
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.
Context Rail

Related nodes

AppManager.cpp
Source / SDK 6.2 / C++ / Core
AppManager.h
Source / SDK 6.2 / C++ / Core
Gfx.h
Source / SDK 6.2 / C++ / Core
native access.h
Source / SDK 6.2 / C++ / Core
Previous Node
SaveMessage.cpp
Source / SDK 6.2 / C++ / Core
Next Node
Scene.cpp
Source / SDK 6.2 / C++ / Core