Skip to content

Commit

Permalink
fix formatting of src/expandoracommon/room.h and src/mapdata/ExitFiel…
Browse files Browse the repository at this point in the history
…dVariant.h
  • Loading branch information
cosmos72 committed Apr 3, 2023
1 parent f8e898b commit 7bdf82a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 56 deletions.
60 changes: 12 additions & 48 deletions src/expandoracommon/room.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,11 @@ class NODISCARD Room final : public std::enable_shared_from_this<Room>
bool m_borked = true;

private:
NODISCARD Exit &exit(ExitDirEnum dir)
{
return m_exits[dir];
}
NODISCARD Exit &exit(ExitDirEnum dir) { return m_exits[dir]; }

public:
NODISCARD const Exit &exit(ExitDirEnum dir) const
{
return m_exits[dir];
}
NODISCARD const ExitsList &getExitsList() const
{
return m_exits;
}
NODISCARD const Exit &exit(ExitDirEnum dir) const { return m_exits[dir]; }
NODISCARD const ExitsList &getExitsList() const { return m_exits; }

public:
void setExitsList(const ExitsList &newExits);
Expand Down Expand Up @@ -200,33 +191,18 @@ class NODISCARD Room final : public std::enable_shared_from_this<Room>
void setId(RoomId id);
void setServerId(RoomServerId id);
void setPosition(const Coordinate &c);
NODISCARD RoomId getId() const
{
return m_id;
}
NODISCARD RoomServerId getServerId() const
{
return m_serverid;
}
NODISCARD const Coordinate &getPosition() const
{
return m_position;
}
NODISCARD RoomId getId() const { return m_id; }
NODISCARD RoomServerId getServerId() const { return m_serverid; }
NODISCARD const Coordinate &getPosition() const { return m_position; }
// Temporary rooms are created by the path machine during experimentation.
// It's not clear why it can't track their "temporary" status itself.
NODISCARD bool isTemporary() const
{
return m_status == RoomStatusEnum::Temporary;
}
NODISCARD bool isTemporary() const { return m_status == RoomStatusEnum::Temporary; }
void setPermanent();

void setAboutToDie();

// "isn't suspected of being borked?"
NODISCARD bool isUpToDate() const
{
return !m_borked;
}
NODISCARD bool isUpToDate() const { return !m_borked; }
// "setNotProbablyBorked"
void setUpToDate();
// "setProbablyBorked"
Expand All @@ -236,10 +212,7 @@ class NODISCARD Room final : public std::enable_shared_from_this<Room>

public:
#define DECL_GETTERS_AND_SETTERS(_Type, _Prop, _OptInit) \
NODISCARD inline const _Type &get##_Prop() const \
{ \
return m_fields._Prop; \
} \
NODISCARD inline const _Type &get##_Prop() const { return m_fields._Prop; } \
void set##_Prop(_Type value);
XFOREACH_ROOM_PROPERTY(DECL_GETTERS_AND_SETTERS)
#undef DECL_GETTERS_AND_SETTERS
Expand All @@ -257,18 +230,9 @@ class NODISCARD Room final : public std::enable_shared_from_this<Room>

public:
NODISCARD std::string toStdString() const;
NODISCARD QString toQString() const
{
return ::toQStringLatin1(toStdString());
}
explicit operator QString() const
{
return toQString();
}
friend QDebug operator<<(QDebug os, const Room &r)
{
return os << r.toQString();
}
NODISCARD QString toQString() const { return ::toQStringLatin1(toStdString()); }
explicit operator QString() const { return toQString(); }
friend QDebug operator<<(QDebug os, const Room &r) { return os << r.toQString(); }

public:
NODISCARD static std::shared_ptr<Room> createPermanentRoom(RoomModificationTracker &tracker);
Expand Down
10 changes: 2 additions & 8 deletions src/mapdata/ExitFieldVariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ class NODISCARD ExitFieldVariant final
explicit ExitFieldVariant(CamelCase val) \
: m_data{std::move(val)} \
{} \
const CamelCase &get##CamelCase() const \
{ \
return std::get<CamelCase>(m_data); \
}
const CamelCase &get##CamelCase() const { return std::get<CamelCase>(m_data); }
X_FOREACH_EXIT_FIELD(DEFINE_CTOR_AND_GETTER, NOP)
#undef DEFINE_CTOR_AND_GETTER
#undef NOP
Expand Down Expand Up @@ -101,8 +98,5 @@ class NODISCARD ExitFieldVariant final
{
return m_data == other.m_data;
}
NODISCARD bool operator!=(const ExitFieldVariant &other) const
{
return !operator==(other);
}
NODISCARD bool operator!=(const ExitFieldVariant &other) const { return !operator==(other); }
};

0 comments on commit 7bdf82a

Please sign in to comment.