diff --git a/include/aoc/GuardGallivant.hpp b/include/aoc/GuardGallivant.hpp index b1224cf..fdd8110 100644 --- a/include/aoc/GuardGallivant.hpp +++ b/include/aoc/GuardGallivant.hpp @@ -27,10 +27,10 @@ class GuardGallivant virtual void finish() override; private: Point2 start_{}; - void visitPosition(const Point2& current); - size_t turnDirection(const size_t current) const; const size_t getStartDirectionIndex() const; const char getStartChar() const; const char getVisitedChar() const; const char getObstructionChar() const; + void visitPosition(const Point2& current); + size_t turnDirection(const size_t current) const; }; diff --git a/src/GuardGallivant.cpp b/src/GuardGallivant.cpp index b14cfc8..d8bbbb9 100644 --- a/src/GuardGallivant.cpp +++ b/src/GuardGallivant.cpp @@ -56,20 +56,6 @@ void GuardGallivant::finish() } } -void GuardGallivant::visitPosition(const Point2& current) -{ - if (getPosition(current) != getVisitedChar()) - { - setPosition(current, getVisitedChar()); - part1++; - } -} - -size_t GuardGallivant::turnDirection(const size_t current) const -{ - return current == 0 ? 3 : current - 1; -} - const size_t GuardGallivant::getStartDirectionIndex() const { return 2; @@ -89,3 +75,17 @@ const char GuardGallivant::getObstructionChar() const { return '#'; } + +void GuardGallivant::visitPosition(const Point2& current) +{ + if (getPosition(current) != getVisitedChar()) + { + setPosition(current, getVisitedChar()); + part1++; + } +} + +size_t GuardGallivant::turnDirection(const size_t current) const +{ + return current == 0 ? 3 : current - 1; +}