Skip to content

Commit

Permalink
Make some RoomDAta methods const
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Mar 27, 2018
1 parent aa30abe commit e79f694
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions src/NetworkSyncManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,6 @@ void ETTProtocol::Update(NetworkSyncManager* n, float fDeltaTime)
}
}
}
break;
case ettps_startselection:

break;
case ettps_newroom:
try {
Expand Down Expand Up @@ -400,11 +397,11 @@ void ETTProtocol::Update(NetworkSyncManager* n, float fDeltaTime)
auto updated = jsonToRoom((*it)["room"]);
auto roomIt = find_if(n->m_Rooms.begin(), n->m_Rooms.end(),
[&](RoomData const & room) {
return room.Name() == updated.Name
return room.Name() == updated.Name();
}
);
if(roomIt != n->m_Rooms.end()) {
roomIt->SetDesc(updated.Desc());
roomIt->SetDescription(updated.Description());
roomIt->SetState(updated.State());
roomIt->players = updated.players;
SCREENMAN->SendMessageToTopScreen(ETTP_RoomsChange);
Expand Down
8 changes: 4 additions & 4 deletions src/RoomWheel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class RoomData {
void SetDescription(const std::string& desc) { m_description = desc; }
void SetState(unsigned int state) { m_state = state; }
void SetFlags(unsigned int iFlags) { m_iFlags = iFlags; }
inline std::string Name() { return m_name; }
inline std::string Description() { return m_description; }
inline unsigned int State() { return m_state; }
inline unsigned int GetFlags() { return m_iFlags; }
inline std::string Name() const { return m_name; }
inline std::string Description() const { return m_description; }
inline unsigned int State() const { return m_state; }
inline unsigned int GetFlags() const { return m_iFlags; }
RoomData() { m_name=""; m_description=""; m_state=0; m_iFlags=0; }
vector<string> players;
private:
Expand Down

0 comments on commit e79f694

Please sign in to comment.