-
-
Notifications
You must be signed in to change notification settings - Fork 86
[CPP14] リファレンス [v0.2.X]
Kasuga Chiyo edited this page Feb 8, 2019
·
8 revisions
地形データの変数。
ここではdungeon_t
と記載する。
using dungeon_t = std::uint_fast8_t;
名前の通り地形を生成するクラスである。
例えばRogueLike
クラスやSimple Voronoi Island
クラスのことを指す。
地形変数をテンプレートに指定して宣言する。
dtl::generator::dungeon::stl::RogueLike<dungeon_t> generation;
宣言時にコンストラクタで"地形配列"と"各地形生成クラスのパラメータ"を指定する。
dtl::generator::dungeon::stl::RogueLike<dungeon_t> generation(matrix, 50);
create関数で"地形配列"と"各地形生成クラスのパラメータ"を指定する。
generation.create(matrix, 50);
ダンジョンの地形データを格納する配列。 多くの場合、STLを使用する。
記事ではmatrixという名前で宣言する。
std::array<std::array<dungeon_t, dungeon_size_x>, dungeon_size_y> matrix{ {} };
std::vector<std::vector<dungeon_t>> matrix(dungeon_size_y, std::vector<dungeon_t>(dungeon_size_x, 0));
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)