Skip to content

地形配列(Dungeon Matrix)

Kasuga Chiyo edited this page Mar 2, 2019 · 5 revisions

地形配列(Dungeon Matrix)

ダンジョンの地形データを格納する配列。 多くの場合、STLを使用する。

記事ではmatrixという名前で宣言する。 また、引数に使う場合はmatrix_という名前で統一されている。

使用例(固定長配列)

std::array<std::array<dungeon_t, dungeon_size_x>, dungeon_size_y> dungeon{ {} };

使用例(可変長配列)

std::vector<std::vector<dungeon_t>> dungeon(dungeon_size_y, std::vector<dungeon_t>(dungeon_size_x, 0));

Clone this wiki locally