コード例 #1
0
        protected override AbstractRuleSet CreateRules(bool useDefault)
        {
            MazeRuleSet mazeRuleSet = new MazeRuleSet();
            List <MazeRuleSetGenerator.MazePoint> list = new List <MazeRuleSetGenerator.MazePoint>();

            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 6; j++)
                {
                    list.Add(new MazeRuleSetGenerator.MazePoint(i, j));
                }
            }
            MakeMazes(mazeRuleSet, list);
            return(mazeRuleSet);
        }
コード例 #2
0
 public void MakeMazes(MazeRuleSet mazeRuleSet, List <MazeRuleSetGenerator.MazePoint> list = null)
 {
     for (int k = 0; k < 9; k++)
     {
         Maze maze = MazeBuilder.BuildMaze(6, this.rand);
         mazeRuleSet.AddMaze(maze);
         if (list != null)
         {
             MazeRuleSetGenerator.MazePoint mazePoint = list[this.rand.Next(list.Count)];
             list.Remove(mazePoint);
             MazeRuleSetGenerator.MazePoint mazePoint2 = list[this.rand.Next(list.Count)];
             list.Remove(mazePoint2);
             maze.SetIndicators(mazePoint.x, mazePoint.y, mazePoint2.x, mazePoint2.y);
         }
         else
         {
             rand.Next();
             rand.Next();
         }
     }
 }