Skip to content

Commit

Permalink
add class const
Browse files Browse the repository at this point in the history
  • Loading branch information
AsPJT committed Mar 14, 2019
1 parent ac03137 commit 6980bfb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions DungeonTemplateLibrary/Beta_BoardGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ namespace dtl::generator::boardGame {
create(matrix_, black_, white_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const Matrix_Int_ black_ = 2, const Matrix_Int_ white_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const Matrix_Int_ black_ = 2, const Matrix_Int_ white_ = 1) const noexcept {
createReversi(matrix_, black_, white_);
}
};
Expand Down Expand Up @@ -346,7 +346,7 @@ namespace dtl::generator::boardGame {
create(matrix_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_) noexcept {
constexpr void create(Matrix_& matrix_) const noexcept {
dtl::generator::boardGame::stl::createChess(matrix_);
}
};
Expand Down Expand Up @@ -391,7 +391,7 @@ namespace dtl::generator::boardGame {
create(matrix_, x_, y_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const std::size_t x_, const std::size_t y_) noexcept {
constexpr void create(Matrix_& matrix_, const std::size_t x_, const std::size_t y_) const noexcept {
dtl::generator::boardGame::normal::createChess(matrix_, x_, y_);
}
};
Expand Down Expand Up @@ -419,7 +419,7 @@ namespace dtl::generator::puzzle::tool {
bool visited{};
std::vector<std::shared_ptr<KnightTourNode>> next{};

KnightTourNode(const std::int_fast32_t row_, const std::int_fast32_t col_) noexcept : row(row_), col(col_), visited(false) {}
explicit KnightTourNode(const std::int_fast32_t row_, const std::int_fast32_t col_) noexcept : row(row_), col(col_), visited(false) {}
};

class KnightTourIsUnvisited {
Expand All @@ -436,7 +436,7 @@ namespace dtl::generator::puzzle::tool {
private:
std::size_t counter{};
public:
KnightTourNotEqualUnvisited(const std::shared_ptr<KnightTourNode>& node_) noexcept : counter(static_cast<std::size_t>(std::count_if(node_->next.begin(), node_->next.end(), KnightTourIsUnvisited()))) { }
explicit KnightTourNotEqualUnvisited(const std::shared_ptr<KnightTourNode>& node_) noexcept : counter(static_cast<std::size_t>(std::count_if(node_->next.begin(), node_->next.end(), KnightTourIsUnvisited()))) { }
bool operator()(const std::shared_ptr<KnightTourNode>& node_) const noexcept {
return static_cast<std::size_t>(std::count_if(node_->next.begin(), node_->next.end(), KnightTourIsUnvisited())) != counter;
}
Expand Down
16 changes: 8 additions & 8 deletions DungeonTemplateLibrary/Generator_Common_OneLine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace dtl::generator::common::stl {
create(matrix_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineDown(matrix_, value_);
}
};
Expand All @@ -97,7 +97,7 @@ namespace dtl::generator::common::stl {
create(matrix_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineUp(matrix_, value_);
}
};
Expand All @@ -112,7 +112,7 @@ namespace dtl::generator::common::stl {
create(matrix_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineLeft(matrix_, value_);
}
};
Expand All @@ -127,7 +127,7 @@ namespace dtl::generator::common::stl {
create(matrix_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineRight(matrix_, value_);
}
};
Expand Down Expand Up @@ -437,7 +437,7 @@ namespace dtl::generator::common::layer::stl {
create(matrix_, layer_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineDown(matrix_, layer_, value_);
}
};
Expand All @@ -452,7 +452,7 @@ namespace dtl::generator::common::layer::stl {
create(matrix_, layer_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineUp(matrix_, layer_, value_);
}
};
Expand All @@ -467,7 +467,7 @@ namespace dtl::generator::common::layer::stl {
create(matrix_, layer_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineLeft(matrix_, layer_, value_);
}
};
Expand All @@ -482,7 +482,7 @@ namespace dtl::generator::common::layer::stl {
create(matrix_, layer_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const Matrix_Int_ value_ = 1) const noexcept {
createOneLineRight(matrix_, layer_, value_);
}
};
Expand Down
2 changes: 1 addition & 1 deletion DungeonTemplateLibrary/Generator_Common_PointGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ namespace dtl::generator::common::layer::normal {
create(matrix_, layer_, x_, y_, value_);
}
template<typename Matrix_>
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const std::size_t x_, const std::size_t y_, const Matrix_Int_ value_ = 1) noexcept {
constexpr void create(Matrix_& matrix_, const std::size_t layer_, const std::size_t x_, const std::size_t y_, const Matrix_Int_ value_ = 1) const noexcept {
createPointGrid(matrix_, layer_, x_, y_, value_);
}
};
Expand Down

0 comments on commit 6980bfb

Please sign in to comment.