Fix method order (constants methods first)
This commit is contained in:
parent
69a4b4becc
commit
06afa3ae2e
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue