public void GivenIfcFile_WhenGettingData_ThenReturnsExpectedData()
        {
            var structure = new HouseStructure("TestFiles/SampleHouse4.ifc");
            var result    = structure.GetStructureData();

            Assert.That(result, Is.Not.Null);
            Assert.Greater(result.Doors, 0);
            Assert.Greater(result.Windows, 0);
            Assert.Greater(result.Walls, 0);
        }
        public void GivenIfcFile_WhenGettingRooms_ThenReturnsExpectedRooms()
        {
            var structure = new HouseStructure("TestFiles/SampleHouse4.ifc");

            var result = structure.GetStructureRooms();
            var room   = result.First();

            Assert.That(result, Is.Not.Null);
            Assert.That(room.Name, Is.Not.EqualTo(string.Empty));
            Assert.That(room.FloorSpace, Is.GreaterThan(0));
        }
Esempio n. 3
0
 void InstantiateRooms(HouseStructure h)
 {
     for (int i = 0; i < h.size; i++)
     {
         for (int j = 0; j < h.size; j++)
         {
             Vector2            pos  = new Vector2(j - (int)(h.size / 2), (int)(h.size / 2) - i) * new Vector2(RoomWidth, RoomWidth - 1);
             RoomStructure      rs   = h.roomStructures[i * h.size + j];
             GameObject         room = Instantiate(roomPrefab, pos, Quaternion.identity);
             RoomTileController rtc  = room.GetComponent <RoomTileController>();
             rtc.TilePalette       = TilePalettes[Random.Range(0, TilePalettes.Length)];
             rtc.TilePaletteName   = rtc.TilePalette.name;
             rtc.Structure         = rs;
             rtc.RoomStructureName = rs.name;
             rtc.LayoutIndex       = Random.Range(0, rtc.Layouts.Length);
             NetworkServer.Spawn(room);
         }
     }
 }