-
Notifications
You must be signed in to change notification settings - Fork 0
/
SignupMessage.hh
43 lines (32 loc) · 1.05 KB
/
SignupMessage.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "Faction.hh"
#include "Uuid.hh"
#include "ValidatableMessage.hh"
#include <optional>
#include <string>
namespace bsgo {
class SignupMessage : public ValidatableMessage
{
public:
SignupMessage();
SignupMessage(const std::string &name, const std::string &password, const Faction &faction);
SignupMessage(const std::string &name,
const std::string &password,
const Faction &faction,
const std::optional<Uuid> &playerDbId);
~SignupMessage() override = default;
auto getUserName() const -> std::string;
auto getUserPassword() const -> std::string;
auto getFaction() const -> Faction;
bool successfullySignedup() const;
auto getPlayerDbId() const -> std::optional<Uuid>;
auto serialize(std::ostream &out) const -> std::ostream & override;
bool deserialize(std::istream &in) override;
auto clone() const -> IMessagePtr override;
private:
std::string m_name{};
std::string m_password{};
Faction m_faction{};
std::optional<Uuid> m_playerDbId{};
};
} // namespace bsgo