MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / side

Method side

utilities/olcUTIL_Geometry2D.h:688–695  ·  view source on GitHub ↗

Get a line from an indexed side, starting top, going clockwise

Source from the content-addressed store, hash-verified

686
687 // Get a line from an indexed side, starting top, going clockwise
688 inline line<T> side(const size_t i) const
689 {
690 if ((i & 0b11) == 0) return top();
691 if ((i & 0b11) == 1) return right();
692 if ((i & 0b11) == 2) return bottom();
693 //if ((i & 0b11) == 3) return left(); // Dumb compilers cant fathom this
694 return left();
695 }
696
697 // Get area of rectangle
698 inline constexpr T area() const

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected