resonance 1.0.1
Loading...
Searching...
No Matches
gameparams.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "os/hxstr.h"
6#include "stream/ibstream.h"
7#include "stream/obstream.h"
8
43public:
51
63 GameParams(const GameParams &other) = default;
64
75 virtual ~GameParams();
76
86 virtual void Save(OBStream *pStream) const;
87
98 virtual void Load(IBStream *pStream);
99
111
124 bool operator==(const GameParams &other) const;
125
139 void Print(std::ostream &stream) const;
140
148
155
156private:
157 // Labelled `friends=` by Print(). +0x10
158 int mFriends;
159 // Neither saved, loaded, assigned, nor compared. Only the copy constructor and the destructor
160 // touch it. +0x14
161 HxStr mUnsavedString;
162
163public:
166
167private:
168 // Labelled ` constrain-jam` by Print() when set. Load() normalises the transferred word to 0
169 // or 1, and every access to this member and the three below, the constructor's clears
170 // included, is a full word (sw/lw). +0x24
171 int mConstrainJam;
172
173public:
179
187
196};
197
211
223void SetDoWinSequence(int nDoWinSequence);
GameParams(const GameParams &other)=default
Copy every member in declaration order.
virtual void Load(IBStream *pStream)
Read the settings back from a stream.
int mPlayMode
Definition gameparams.h:164
int mLoadingGame
Set while a saved game is loading, labelled loadinggame= by Print().
Definition gameparams.h:186
virtual void Save(OBStream *pStream) const
Write the settings to a stream.
HxStr mLevelName
The level the session plays.
Definition gameparams.h:147
void Print(std::ostream &stream) const
Write the settings to a diagnostic stream on one line, ending it with a newline.
int mDifficulty
Definition gameparams.h:165
int mNetGame
Written by GameManagerImpl::SetGameMode() as the test for net, 0 or 1, and labelled netgame= by Print...
Definition gameparams.h:178
int mJukeboxMode
Set for a jukebox session.
Definition gameparams.h:195
virtual ~GameParams()
Release the three strings.
HxStr mArenaName
The arena the session plays in.
Definition gameparams.h:154
bool operator==(const GameParams &other) const
Compare every member except mUnsavedString with another instance, the set operator=() copies.
GameParams()
Start with every member clear.
GameParams & operator=(const GameParams &other)
Copy every member except mUnsavedString from another instance.
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Input half of the byte stream interface.
Definition ibstream.h:36
Output half of the byte stream interface.
Definition obstream.h:25
void SetDoWinSequence(int nDoWinSequence)
Enable or disable the win sequence.
int GetDoWinSequence()
Report whether a won game plays the win sequence.