コード例 #1
0
 private void AssignSTL(int[,] matrix, uint endX, uint endY)
 {
     if (randBase.Probability(probabilityValue))
     {
         matrix[endY, endX] = this.drawValue;
     }
 }
コード例 #2
0
        public bool Draw(int[,] matrix)
        {
            DTLDelegate.VoronoiDiagramDelegate voronoiDiagramDelegate =
                (ref Pair point, ref int color, uint startX, uint startY, uint w, uint h) => {
                if (rand.Probability((this.probabilityValue)))
                {
                    color = this.trueColor;
                }
                else
                {
                    color = this.falseColor;
                }
            };

            voronoiDiagram.Draw(matrix, voronoiDiagramDelegate);
            return(true);
        }
コード例 #3
0
        public bool Draw(int[,] matrix)
        {
            DTLDelegate.VoronoiDiagramDelegate voronoiDiagramDelegate =
                (ref Pair point, ref int color, uint startX, uint startY, uint w, uint h) => {
                if ((this.isIsland(point, startX, startY, w, h, 2, 5) ||
                     this.isIsland(point, startX, startY, w, h, 1, 5)) &&
                    rand.Probability((this.probability)))
                {
                    color = this.landValue;
                }
                else
                {
                    color = this.seaValue;
                }
            };

            return(this.voronoiDiagram.Draw(matrix, voronoiDiagramDelegate));
        }