richelbilderbeek / djog_unos_2018

Project by the Uno's at DJOG 2018-2019: Nature Zen
GNU General Public License v3.0
6 stars 2 forks source link

Nicely align 'contains' #559

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago

Is your feature request related to a problem? Please describe.

Currently, we can read:

bool operator==(const tile& lhs, const tile& rhs) noexcept {
  return
       lhs.m_depth    == rhs.m_depth
    && lhs.m_dx       == rhs.m_dx
    && lhs.m_dy       == rhs.m_dy
    && lhs.m_dz       == rhs.m_dz
    && lhs.m_locked   == rhs.m_locked
    && lhs.m_rotation == rhs.m_rotation
    && lhs.m_type     == rhs.m_type
    && lhs.m_x        == rhs.m_x
    && lhs.m_y        == rhs.m_y
    && lhs.m_z        == rhs.m_z
  ;
}

bool contains(const tile& t, double x, double y) noexcept {
  return x > t.get_x() - 5 && x < t.get_x() + t.get_width() + 5 && y > t.get_y() - 5 &&
         y < t.get_y() + t.get_height() + 5;
}

The first function nicely aligns its 'and's, the second does not.

Describe the solution you'd like

Align the text of the second function to resemble the first.

All tests should keep passing.

Describe alternatives you've considered

None.

Additional context

None.