wavelength 1.0.0
Loading...
Searching...
No Matches
playerinfo.h
Go to the documentation of this file.
1#pragma once
2
3#include "game/campaign.h"
4
12public:
21 PlayerInfo(int nLocal, int nSlot, const Campaign &profile, int nNetOrder)
22 : mLocal(nLocal), mSlot(nSlot), mScore(0), mRank(-1), mProfile(profile),
23 mNetOrder(nNetOrder) {
24 }
25
27 int GetLocal() const {
28 return mLocal;
29 }
30
36 void SetLocal(int nLocal) {
37 mLocal = nLocal;
38 }
39
41 int GetSlot() const {
42 return mSlot;
43 }
44
50 void SetSlot(int nSlot) {
51 mSlot = nSlot;
52 }
53
55 int GetScore() const {
56 return mScore;
57 }
58
64 void SetScore(int nScore) {
65 mScore = nScore;
66 }
67
69 int GetRank() const {
70 return mRank;
71 }
72
78 void SetRank(int nRank) {
79 mRank = nRank;
80 }
81
84 return mProfile;
85 }
86
88 const Campaign &GetProfile() const {
89 return mProfile;
90 }
91
97 void SetProfile(const Campaign &profile) {
98 mProfile = profile;
99 }
100
102 int GetNetOrder() const {
103 return mNetOrder;
104 }
105
111 void SetNetOrder(int nNetOrder) {
112 mNetOrder = nNetOrder;
113 }
114
115private:
116 int mLocal;
117 int mSlot;
118 int mScore;
119 int mRank;
120 Campaign mProfile;
121 int mNetOrder;
122};
Saved settings and progress of one player, among them the controller bindings.
Definition campaign.h:20
void SetScore(int nScore)
Set the score of the player.
Definition playerinfo.h:64
void SetNetOrder(int nNetOrder)
Set the position in the order of the online session.
Definition playerinfo.h:111
void SetLocal(int nLocal)
Set whether the player is on this console.
Definition playerinfo.h:36
void SetRank(int nRank)
Set the rank of the player.
Definition playerinfo.h:78
int GetScore() const
Definition playerinfo.h:55
Campaign & GetProfile()
Definition playerinfo.h:83
int GetNetOrder() const
Definition playerinfo.h:102
int GetLocal() const
Definition playerinfo.h:27
void SetProfile(const Campaign &profile)
Replace the copy of the profile.
Definition playerinfo.h:97
void SetSlot(int nSlot)
Set the slot of the player.
Definition playerinfo.h:50
int GetRank() const
Definition playerinfo.h:69
PlayerInfo(int nLocal, int nSlot, const Campaign &profile, int nNetOrder)
Construct a player with no score and no rank.
Definition playerinfo.h:21
const Campaign & GetProfile() const
Definition playerinfo.h:88
int GetSlot() const
Definition playerinfo.h:41