Skip to content

DTL.Shape.ClusteringMaze (形状クラス)

sitRyo edited this page Jan 15, 2020 · 8 revisions

バージョン 0.1.0以降

namespace DTL.Shape {
    public class ClusteringMaze
}

概要

ClusteringMazeとは "Matrixに迷路を生成する" 機能を持つクラスである。

描画範囲の全てを必ず塗りつぶす。

継承

DTL.Base.RectBaseWithValue<TDerived>DTL.Shape.AscendingOrder

インターフェース

IDrawer<int>

コンストラクタ

Constructors Descriptions Version
ClusteringMaze() Matrixの内容をそのまま出力するClusteringMazeのインスタンスを生成します。 v0.1.0
ClusteringMaze(int drawValue) 描画値を指定したClusteringMazeのインスタンスを生成します。 v0.1.0
ClusteringMaze(int drawValue, DTL.Base.Coordinate2DimensionalAndLength2DimensionalmatrixRange matrixRange) 描画範囲と描画値を指定したClusteringMazeのインスタンスを生成します。 v0.1.0
ClusteringMaze(int drawValue, uint startX, uint startY, uint width, uint height) 描画範囲と描画値を指定したClusteringMazeのインスタンスを生成します。 v0.1.0

プロパティ

Name Accessibility Descriptions Version
int DrawValue public get, protected set Matrixに描画する値 v0.1.0
uint startX public get, protected set 描画の開始点X v0.1.0
uint startY public get, protected set 描画の開始点Y v0.1.0
uint width public get, protected set 描画横幅W v0.1.0
uint height public get, protected set 描画縦幅H v0.1.0

メソッド

描画範囲取得/描画値取得

Name Descriptions Version
GetPointX 描画始点座標Xを取得 v0.1.0
GetPointY 描画始点座標Yを取得 v0.1.0
GetWidth 描画横幅Wを取得 v0.1.0
GetHeight 描画縦幅Hを取得 v0.1.0
GetPoint 描画始点を取得 v0.1.0
GetValue 描画値を取得 v0.1.0

描画範囲指定/描画値指定

Name Descriptions Version
SetPointX 描画始点座標Xを指定 v0.1.0
SetPointY 描画始点座標Yを指定 v0.1.0
SetWidth 描画横幅Wを指定 v0.1.0
SetHeight 描画縦幅Hを指定 v0.1.0
SetPoint 描画始点座標(X,Y)を指定 v0.1.0
SetRange 描画範囲(X,Y,W,H)を指定 v0.1.0
SetValue 描画値を指定 v0.1.0

描画範囲消去/描画値消去

名前 説明 対応バージョン
ClearPointX 描画始点座標Xを消去 v0.1.0
ClearPointY 描画始点座標Yを消去 v0.1.0
ClearWidth 描画横幅Wを消去 v0.1.0
ClearHeight 描画縦幅Hを消去 v0.1.0
ClearPoint 描画始点座標(X,Y)を消去 v0.1.0
ClearRange 描画範囲(X,Y,W,H)を消去 v0.1.0
ClearValue 描画値を消去 v0.1.0
Clear 描画範囲と描画値を消去 v0.1.0

インターフェースの実装

Name Descriptions Version
Draw(int[,]) Matrixに描画する v0.1.0
Create(int[,]) Matrixに描画してMatrixを返す v0.1.0

Examples (C#)

public class ClusteringMazeGenerator : MonoBehaviour {

    public int height = 21;
    public int width = 15;
    private ClusteringMaze clusteringMaze;

    void Start () {
        var matrix = new int[height, width];
	clusteringMaze = new ClusteringMaze(1);
        clusteringMaze.Draw(matrix);
        new OutputConsole().Draw(matrix);
    }
}

Output

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 1 1 1 1 1 1 1 0 1 0 1 1 1 0 
0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 
0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 
0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 
0 1 0 1 0 1 0 1 1 1 1 1 1 1 0 
0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 
0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 
0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 
0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 
0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 
0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 
0 1 0 1 0 1 1 1 1 1 1 1 0 1 0 
0 1 0 0 0 0 0 1 0 0 0 1 0 1 0 
0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 
0 1 0 1 0 0 0 0 0 1 0 0 0 1 0 
0 1 0 1 1 1 1 1 1 1 0 1 1 1 0 
0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 
0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
ApiClusteringMaze1

ClusteringMaze1

Clone this wiki locally