Esempio n. 1
0
			public void Emain_Runda_Dungeon_G9_HolyKnights1()
			{
				var dg = new DungeonGenerator("Emain_Runda_Dungeon_G9_HolyKnights1", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
08 X X X X X X X X X 
07 X X X X X X X   X 
06 X X X X X X X S X 
05 X X X     X X   X 
04   X       X X X X 
03   X   B   X X X X 
02   X X X X X X X X 
01   X X X X X X X X 
00   X X X X X X X X 
maze gen
  000102030405060708
05     X       
04   X X       
03 X X X   B   
02 X X X   X X 
01 X X X S X X 
00 X X X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 2
0
		public DungeonFloor(DungeonGenerator dungeonGenerator, DungeonFloorData floorData, bool isLastFloor, DungeonFloor prevFloor)
		{
			_pos = new Position(0, 0);
			_startPos = new Position(0, 0);
			_startDirection = Direction.Down;
			this.Width = 1;
			this.Height = 1;
			this.MazeGenerator = new MazeGenerator();
			this.Sections = new List<DungeonFloorSection>();

			_dungeonGenerator = dungeonGenerator;
			_branchProbability = floorData.Branch;
			_coverageFactor = floorData.Coverage;
			this.IsLastFloor = isLastFloor;
			_prevFloor = prevFloor;

			this.HasBossRoom = floorData.HasBoss;
			this.Statue = floorData.Statue;

			this.CalculateSize(floorData);
			this.InitRoomtraits();
			this.GenerateMaze(floorData);
			this.GenerateRooms(floorData);
			this.InitSections(floorData);
		}
Esempio n. 3
0
			public void TirCho_Alby_DropTest_Dungeon()
			{
				var dg = new DungeonGenerator("TirCho_Alby_DropTest_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
05             
04             
03       B   X 
02     X X X X 
01     X X S   
00     X X     
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 4
0
			public void Gairech_Fiodh_Dungeon_Recover()
			{
				var dg = new DungeonGenerator("Gairech_Fiodh_Dungeon_Recover", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
07 X     X X X X X 
06 X X X X X X X X 
05 X X X X X X X X 
04 X X X X   X X X 
03 X X X       X   
02 X X X   B   X X 
01 X X X X X S X X 
00 X X X X     X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 5
0
			public void Dunbarton_Rabbie_High_2_Dungeon()
			{
				var dg = new DungeonGenerator("Dunbarton_Rabbie_High_2_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
07 X X S X X X X X 
06 X     X X X X X 
05 X X   X X X X X 
04   X X X X X X X 
03   X X X X X X X 
02   X X X X X X X 
01 B X X X X X X X 
00 X X X X X X X X 
maze gen
  000102030405060708
07   X X S X X X X 
06 X X X   X X X X 
05 X X X X X X X X 
04 X X X X X X X X 
03 X X       X X X 
02 X X   B X X X X 
01 X X X X X X X X 
00 X X X X X X X X 
maze gen
  000102030405060708
07 X S   X X X X X 
06 X X X X X X X X 
05 X   X X X X X X 
04       X X X X X 
03   B   X   X X X 
02 X X X X X X X X 
01 X X X   X X X X 
00 X X X X X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 6
0
			static string GetMazeAsString(DungeonGenerator dungeon)
			{
				var sw = new System.IO.StringWriter();

				for (int floorN = 0; floorN < dungeon.Floors.Count; ++floorN)
				{
					var floor = dungeon.Floors[floorN];
					var rooms = floor.MazeGenerator.Rooms;

					sw.WriteLine("maze gen");
					sw.WriteLine("  000102030405060708");
					for (int y = floor.MazeGenerator.Height - 1; y >= 0; --y)
					{
						var row = string.Format("{0,0:D2} ", y);
						for (int x = 0; x < floor.MazeGenerator.Width; ++x)
						{
							if (floor.MazeGenerator.StartPos.X == x && floor.MazeGenerator.StartPos.Y == y)
								row += "S ";
							else if (floor.MazeGenerator.EndPos.X == x && floor.MazeGenerator.EndPos.Y == y)
								row += "B ";
							else if (floor.MazeGenerator.Rooms[x][y].Visited)
								row += "X ";
							else
								row += "  ";
						}
						sw.WriteLine(row);
					}
				}

				var result = sw.ToString();
				sw.Close();
				return result.Trim();
			}
Esempio n. 7
0
			public void TirCho_Alby_G15_Price_Of_Love_High()
			{
				var dg = new DungeonGenerator("TirCho_Alby_G15_Price_Of_Love_High", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
05 S X X X B   
04   X   X X   
03   X   X X   
02   X X X X   
01             
00             
maze gen
  000102030405060708
05       B X   
04       X X   
03       X X X 
02       X X X 
01         S X 
00       X X X 
maze gen
  000102030405060708
05             
04 S           
03 X X X       
02 X X X X X X 
01 X X X X     
00 B           
maze gen
  000102030405060708
05   X X X     
04   X X X     
03     S X X   
02     X X X B 
01       X X   
00             
maze gen
  000102030405060708
05 X S X       
04 X   X X     
03 X   X X     
02 X   X       
01 X B X       
00 X X X       
maze gen
  000102030405060708
05         X X 
04         S X 
03           X 
02       X X X 
01 X X X X X X 
00 B   X X X X 
maze gen
  000102030405060708
05             
04             
03       X     
02   B   X     
01 X X X X S   
00   X X X X X     
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 8
0
			public void Bangor_Barri_Low_Dungeon()
			{
				var dg = new DungeonGenerator("Bangor_Barri_Low_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
05 X X X X X B 
04 X X X X     
03 X S X X X   
02 X   X X X X 
01 X X X X   X 
00   X X X     
maze gen
  000102030405060708
06         X X   
05         X X   
04 X X X X X X   
03 X X   X X X X 
02 X X X X   X X 
01 X     X X X X 
00 B           S 
maze gen
  000102030405060708
06 X X X X X X   
05 X X X X X X X 
04 X X X X X X X 
03 X X X X X X X 
02     S X X X   
01       X B     
00               
maze gen
  000102030405060708
06 X X X X       
05 X X X X X     
04 X     X X X X 
03 X X B X X X X 
02 X X X X X X X 
01 X X X X X   S 
00   X X X X X X 
maze gen
  000102030405060708
06 X X X X X X   
05 X X X X X     
04 X X X X X X X 
03 X X     X X X 
02 X       X X X 
01 S   B   X X X 
00     X X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 9
0
			public void G1_39_Tirnanog_Dungeon()
			{
				var dg = new DungeonGenerator("G1_39_Tirnanog_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
06 X X X S       
05 X X X         
04 X X X X       
03 X X X X B X   
02 X X X X X X   
01 X X X X X X   
00 X X X X X X   
maze gen
  000102030405060708
07           X X X 
06       B   X X X 
05 S X X X X X X X 
04   X X X X X X X 
03   X X X X X X X 
02     X X X X X X 
01     X X X X X X 
00   X X X X X X   
maze gen
  000102030405060708
06   X X         
05   B X         
04 X X X         
03 X X X X X     
02 X X X X X X   
01 X   S X X X X 
00 X X X X X   X 
maze gen
  000102030405060708
06 X S       B   
05 X X       X   
04 X X X     X X 
03 X X X X X X X 
02   X X X X X   
01 X X   X X X X 
00 X X X X X X X 
maze gen
  000102030405060708
06         X X X 
05 X S   X X   X 
04 X   X X X X X 
03 X X X X X     
02 X X X X X X X 
01 X X X X   X X 
00 X X       B X 
maze gen
  000102030405060708
08 X X     X X X X X 
07 X X X     X X X X 
06 X   X         X X 
05 X X X X       X X 
04 X X X X   B   X X 
03 S   X X X X   X X 
02 X X X X X X X X X 
01 X X X X X X X X X 
00 X X X X X X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 10
0
			public void Senmag_Peaca_Middle_Dungeon()
			{
				var dg = new DungeonGenerator("Senmag_Peaca_Middle_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
06 S X X X X X X 
05   X X X X X X 
04 X X X X X X X 
03 X X X X X X X 
02 X X X X X X   
01 X X   B X X   
00 X X X X X X   
maze gen
  000102030405060708
06 X X X X X X X 
05 X X X X X X X 
04 X X X X X X X 
03 X   X X X S   
02 X X X X X B X 
01 X X   X X   X 
00 X X   X X X X 
maze gen
  000102030405060708
06 X X B X X X   
05 X X   X X X X 
04 X X X X   X X 
03 X X X X S X X 
02 X X X X X X X 
01   X X X X X X 
00   X X X X X X 
maze gen
  000102030405060708
06 X X X X X X   
05 X X X X X X   
04 X X X X   X   
03 X X X X S X X 
02 X X X X X X X 
01 X X X X X X X 
00 X B X X X X X 
maze gen
  000102030405060708
06 X X X X X X   
05 X X X   X X X 
04 X X X S X X X 
03 X X     X X X 
02 X       X X X 
01 X   B   X X X 
00 X X X X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 11
0
			public void SAO_Gairech_Fiodh_5()
			{
				var dg = new DungeonGenerator("SAO_Gairech_Fiodh_5", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
05 X X X X X   
04 X X X X X   
03 X X X   X S 
02 X X X B X   
01 X X X   X X 
00 X X X X X X 
maze gen
  000102030405060708
05     X X B   
04 S X X X     
03 X X X X X X 
02 X   X X X X 
01 X X X X X X 
00 X X X X X X 
maze gen
  000102030405060708
05 X X X X X X 
04 X X X X X   
03 X X X X X X 
02   S X X X X 
01 X X X X B   
00   X X X     
maze gen
  000102030405060708
05 X X X       
04 X   X X X S 
03 X B X X X X 
02     X X X X 
01 X X X X X X 
00 X X X X X X 
maze gen
  000102030405060708
05 X X X X X X 
04 X   X X   X 
03 X X X       
02 X X X   B   
01 S X X   X X 
00     X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 12
0
			public void SAO_TirCho_Alby_5()
			{
				var dg = new DungeonGenerator("SAO_TirCho_Alby_5", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
05       X X   
04 X X X X X X 
03 X X X     X 
02 X   X     X 
01 X S     B X 
00             
maze gen
  000102030405060708
05 X X X X     
04 X B X X     
03 X   X S     
02 X X X       
01   X X       
00     X X X   
maze gen
  000102030405060708
05         X B 
04 X X   X X   
03 X X X X     
02 X X X X X   
01   X X       
00     X S     
maze gen
  000102030405060708
05         X   
04 B X   X X   
03   X X X     
02     X X     
01 X X X X S   
00 X X X X     
maze gen
  000102030405060708
05 S X X X X   
04   X X X X   
03   X X X     
02   X X       
01     X   B   
00     X X X   
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 13
0
			public void Emain_Runda_Low_Dungeon()
			{
				var dg = new DungeonGenerator("Emain_Runda_Low_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
07 X X S X X X X X 
06 X X   X X X X X 
05 X X   X X X X X 
04 X X X X X X X X 
03 X X X X X X X   
02 X X X X X X X   
01   X       X X X 
00 B X           X 
maze gen
  000102030405060708
06 X X X X X X X   
05 X X X X   X X X 
04 X X   X X X B X 
03 X X X X X X   X 
02 X X X X X X X X 
01   S X X X X X X 
00     X X X X X X 
maze gen
  000102030405060708
06 X X X X X X X   
05 X X X X     X   
04 X X X X     X X 
03 X X X       X X 
02 X X X   B   X   
01 X X X X X   X S 
00 X X X X X X X X 
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 14
0
			public void JG_Neko_Dungeon3()
			{
				var dg = new DungeonGenerator("JG_Neko_Dungeon3", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
13 X X X X X                   
12 X X X X X     X X X X       
11 X S X X X X X X X X X       
10 X   X X X X X X X X X X     
09 X X X X X X X X X X X X     
08 X X X X X X X X X X X   X   
07 X X X X X X X X X X     X X 
06     X X X X X X X     X X X 
05       X X X X X X     X X X 
04         X     X   X X X     
03         X B   X   X         
02               X X X         
01               X X           
00                             
maze gen
  000102030405060708
06               
05               
04               
03           X X 
02         X X S 
01   B     X X   
00 X X X X X X   
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}
Esempio n. 15
0
			public void TirCho_Ciar_Low_Hardmode_Dungeon()
			{
				var dg = new DungeonGenerator("TirCho_Ciar_Low_Hardmode_Dungeon", 2000, 370545889, 0, "");

				var correct = @"
maze gen
  000102030405060708
05 X S         
04 X   X X X X 
03 X X X X X X 
02 X X X X X X 
01 X X X X X   
00 X X X X B   
maze gen
  000102030405060708
06 X X           
05 X X X         
04 X X X X     S 
03 X X X X     X 
02 X X X X B X X 
01 X X X     X X 
00     X X X X   
maze gen
  000102030405060708
07   X X X X X X   
06   X X X   X X   
05   X X X   X X X 
04 B X     X X X X 
03 X X X X X X X X 
02 X X X   X X X X 
01 X X X S X X X   
00 X X X X X X     
maze gen
  000102030405060708
07 X X X X X X X   
06 X X X X X X X   
05 X X X X X X X   
04 X X X X X X X X 
03 X X X X   X X X 
02 X X X       X   
01     S   B   X   
00       X X X X   
".Trim();

				Assert.Equal(correct, GetMazeAsString(dg));
			}