wavelength 1.0.0
Loading...
Searching...
No Matches
netgameparams.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/binstream.h"
4#include "os/prnstream.h"
5#include "os/string.h"
6
14public:
16 static constexpr int kDefaultSelection = 1;
17
19 static constexpr int kDefaultMaxPlayers = 4;
20
27 : mLoadRemix(0), mRemixReadOnly(0), mPracticeMode(0), mTutorial(0), mSkillLevel(0),
28 mPowerupLevel(kDefaultSelection), mRuleSet(kDefaultSelection),
29 mCommunity(kDefaultSelection), mMaxPlayers(kDefaultMaxPlayers) {
30 }
31
33 int GetCommunity() const {
34 return mCommunity;
35 }
36
38 void SetCommunity(int nCommunity) {
39 mCommunity = nCommunity;
40 }
41
43 int GetLoadRemix() const {
44 return mLoadRemix;
45 }
46
48 void SetLoadRemix(int nLoadRemix) {
49 mLoadRemix = nLoadRemix;
50 }
51
53 int GetMaxPlayers() const {
54 return mMaxPlayers;
55 }
56
58 void SetMaxPlayers(int nMaxPlayers) {
59 mMaxPlayers = nMaxPlayers;
60 }
61
63 int GetPowerupLevel() const {
64 return mPowerupLevel;
65 }
66
68 void SetPowerupLevel(int nPowerupLevel) {
69 mPowerupLevel = nPowerupLevel;
70 }
71
73 int GetPracticeMode() const {
74 return mPracticeMode;
75 }
76
78 void SetPracticeMode(int nPracticeMode) {
79 mPracticeMode = nPracticeMode;
80 }
81
83 const String &GetRemixName() const {
84 return mRemixName;
85 }
86
89 return mRemixName;
90 }
91
93 void SetRemixName(const char *pszRemixName) {
94 mRemixName = pszRemixName;
95 }
96
98 int GetRemixReadOnly() const {
99 return mRemixReadOnly;
100 }
101
103 void SetRemixReadOnly(int nRemixReadOnly) {
104 mRemixReadOnly = nRemixReadOnly;
105 }
106
108 int GetRuleSet() const {
109 return mRuleSet;
110 }
111
113 void SetRuleSet(int nRuleSet) {
114 mRuleSet = nRuleSet;
115 }
116
118 int GetSkillLevel() const {
119 return mSkillLevel;
120 }
121
123 void SetSkillLevel(int nSkillLevel) {
124 mSkillLevel = nSkillLevel;
125 }
126
128 const String &GetSong() const {
129 return mSong;
130 }
131
134 return mSong;
135 }
136
138 void SetSong(const char *pszSong) {
139 mSong = pszSong;
140 }
141
143 int GetTutorial() const {
144 return mTutorial;
145 }
146
148 void SetTutorial(int nTutorial) {
149 mTutorial = nTutorial;
150 }
151
152private:
153 String mSong;
154 int mLoadRemix;
155 int mRemixReadOnly;
156 String mRemixName;
157 int mPracticeMode;
158 int mTutorial;
159 int mSkillLevel;
160 int mPowerupLevel;
161 int mRuleSet;
162 int mCommunity;
163 int mMaxPlayers;
164};
165
176
187
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
The settings of an online game that the host publishes with its session.
Definition netgameparams.h:13
int GetMaxPlayers() const
Definition netgameparams.h:53
void SetPowerupLevel(int nPowerupLevel)
Definition netgameparams.h:68
void SetSkillLevel(int nSkillLevel)
Definition netgameparams.h:123
void SetLoadRemix(int nLoadRemix)
Definition netgameparams.h:48
String & GetSong()
Definition netgameparams.h:133
int GetSkillLevel() const
Definition netgameparams.h:118
int GetRuleSet() const
Definition netgameparams.h:108
const String & GetRemixName() const
Definition netgameparams.h:83
int GetCommunity() const
Definition netgameparams.h:33
void SetRemixName(const char *pszRemixName)
Definition netgameparams.h:93
String & GetRemixName()
Definition netgameparams.h:88
void SetSong(const char *pszSong)
Definition netgameparams.h:138
void SetMaxPlayers(int nMaxPlayers)
Definition netgameparams.h:58
void SetPracticeMode(int nPracticeMode)
Definition netgameparams.h:78
int GetPowerupLevel() const
Definition netgameparams.h:63
void SetTutorial(int nTutorial)
Definition netgameparams.h:148
void SetCommunity(int nCommunity)
Definition netgameparams.h:38
void SetRuleSet(int nRuleSet)
Definition netgameparams.h:113
int GetRemixReadOnly() const
Definition netgameparams.h:98
int GetPracticeMode() const
Definition netgameparams.h:73
int GetTutorial() const
Definition netgameparams.h:143
static constexpr int kDefaultSelection
The power-up level, the rule set, and the community of default settings.
Definition netgameparams.h:16
const String & GetSong() const
Definition netgameparams.h:128
static constexpr int kDefaultMaxPlayers
The number of players default settings take.
Definition netgameparams.h:19
int GetLoadRemix() const
Definition netgameparams.h:43
void SetRemixReadOnly(int nRemixReadOnly)
Definition netgameparams.h:103
NetGameParams()
Construct the settings of a game of the first rule set, for four players.
Definition netgameparams.h:26
Text output stream.
Definition prnstream.h:16
Growable text buffer that is also a PrnStream.
Definition string.h:19
PrnStream & operator<<(PrnStream &stream, const NetGameParams &params)
Write the settings of a game.
BinStream & operator>>(BinStream &stream, NetGameParams &params)
Read the settings operator<<() wrote.