-
-
Notifications
You must be signed in to change notification settings - Fork 81
dtl::XX::YY::setValue (形状描画)
Kasugaccho edited this page Aug 13, 2019
·
3 revisions
constexpr auto setValue(const T& draw_value_) noexcept;
描画値を設定する。
戻り値の型は 当クラスの参照値
である。
投げない
定数時間
#include <DTL.hpp>
#include <iostream>
#include <cstddef>
#include <cstdint>
int main() {
using shape_t = std::uint_fast8_t;
constexpr std::size_t width{ 16 };
constexpr std::size_t height{ 8 };
shape_t matrix[height * width]{};
dtl::shape::Border<shape_t> border;
border.setValue(2).drawArray(matrix, width, height);
std::cout << "Value:" << static_cast<int>(border.getValue()) << '\n';
dtl::console::OutputNumber<shape_t>(",").drawArray(matrix, width, height);
dtl::console::OutputString<shape_t>("//", "##", "%%").drawArray(matrix, width, height);
return 0;
}
Value:2
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%////////////////////////////%%
%%////////////////////////////%%
%%////////////////////////////%%
%%////////////////////////////%%
%%////////////////////////////%%
%%////////////////////////////%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) 2018-2021 As Project.
Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)