Пример #1
0
		public void ThreadProc() 
		{
			while (true)
			{
				foreach (difficulty d in Enum.GetValues(typeof(difficulty)))
				{
					Queue q = MazeQueue(d);
					if (q.Count < 3)
					{
						SquareMaze m = new SquareMaze();
						m.CreateMaze(DesiredMapSize(d));
						q.Enqueue(m);
					}
				}
				Thread.Sleep(100);
			}
		}
Пример #2
0
		public void TestSquareMazeCreate()
		{
			SquareMaze m = new SquareMaze();
			m.CreateMaze(10);
			Assert.AreEqual(100,m.Rooms.Length);
			Assert.AreEqual(2,m.Rooms.Rank);
			AssertMazeCreationTime(m.Rooms.GetLength(0),60,m.AlogorithmTime.Milliseconds);

			m.CreateMaze(20);
			Assert.AreEqual(400,m.Rooms.Length);
			Assert.AreEqual(2,m.Rooms.Rank);
			AssertMazeCreationTime(m.Rooms.GetLength(0),1000,m.AlogorithmTime.Milliseconds);

			Console.WriteLine("Bounds: {0}",m.Bounds);
			Console.WriteLine("FinishRoom: {0}",m.FinishRoom);
			Console.WriteLine("StartRoom: {0}",m.StartRoom);
			Console.WriteLine("PassCount: {0}",m.PassCount);
			
		}