// Use this for initialization void Start() { X = new IntegerArray[SizeX]; for (int i = 0; i < SizeX; i++) { X[i] = new IntegerArray(); X[i].Z = new int[SizeZ]; for (int j = 0; j < SizeZ; j++) { X[i][j] = 5; } } BuildOuterWall(); CarveRooms(); ArrangeGrid(); FloorBuilder fb = gameObject.AddComponent <FloorBuilder>(); int[,] grid = new int[SizeX, SizeZ]; for (int i = 0; i < SizeX; i++) { for (int j = 0; j < SizeZ; j++) { grid[i, j] = X[i][j]; // Debug.Log(i + ", " + j); // This checks out fine } } fb.BuildFloor(grid, parent); }
public void BuildFloorTest() { var expectedNumberOfRooms = 5; var floor = _floorBuilder.BuildFloor(expectedNumberOfRooms); Assert.IsNotNull(floor); Assert.AreEqual(floor.Rooms, expectedNumberOfRooms); }
private Menu_Floor NewFloorMenu(int seed = 1) { RogueSharp.Random.IRandom iRand = new RogueSharp.Random.DotNetRandom(seed); var player = EntityBuilder.BuildPlayerEntity(); var dungeon = new DungeonState(player); dungeon.AddFloor(FloorBuilder.BuildFloor(dungeon, Config.FloorWidth, Config.FloorHeight, iRand.Next(Int16.MaxValue).ToString(), 0, player)); dungeon.AddFloor(FloorBuilder.BuildFloor(dungeon, Config.FloorWidth, Config.FloorHeight, iRand.Next(Int16.MaxValue).ToString(), 1)); dungeon.AddFloor(FloorBuilder.BuildFloor(dungeon, Config.FloorWidth, Config.FloorHeight, iRand.Next(Int16.MaxValue).ToString(), 2)); dungeon.FinalizeConstruction(); this.floorMenu = new Menu_Floor(this, dungeon); return(this.floorMenu); }
public void AddFloor() { GameObject newFloor = floorBuilder.BuildFloor(floorPrefab, Position, Rotation, Scale, parent); floorParts.Add(newFloor.GetComponent <FloorController>()); }