From 7bdf82ace49b5f64bc9eef46b1cd9b4139678ab7 Mon Sep 17 00:00:00 2001 From: Massimiliano Ghilardi Date: Mon, 3 Apr 2023 19:38:42 +0200 Subject: [PATCH] fix formatting of src/expandoracommon/room.h and src/mapdata/ExitFieldVariant.h --- src/expandoracommon/room.h | 60 +++++++--------------------------- src/mapdata/ExitFieldVariant.h | 10 ++---- 2 files changed, 14 insertions(+), 56 deletions(-) diff --git a/src/expandoracommon/room.h b/src/expandoracommon/room.h index c5127d7e..2e4b9b43 100644 --- a/src/expandoracommon/room.h +++ b/src/expandoracommon/room.h @@ -150,20 +150,11 @@ class NODISCARD Room final : public std::enable_shared_from_this 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); @@ -200,33 +191,18 @@ class NODISCARD Room final : public std::enable_shared_from_this 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" @@ -236,10 +212,7 @@ class NODISCARD Room final : public std::enable_shared_from_this 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 @@ -257,18 +230,9 @@ class NODISCARD Room final : public std::enable_shared_from_this 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 createPermanentRoom(RoomModificationTracker &tracker); diff --git a/src/mapdata/ExitFieldVariant.h b/src/mapdata/ExitFieldVariant.h index 3fc1b008..4dd9c08e 100644 --- a/src/mapdata/ExitFieldVariant.h +++ b/src/mapdata/ExitFieldVariant.h @@ -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(m_data); \ - } + const CamelCase &get##CamelCase() const { return std::get(m_data); } X_FOREACH_EXIT_FIELD(DEFINE_CTOR_AND_GETTER, NOP) #undef DEFINE_CTOR_AND_GETTER #undef NOP @@ -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); } };