Example #1
0
        private static void InsertAparment(InDoorGeneratorSettings settings, Floor floor, FloorContext context,
                                           List <Wall> extrudedWalls, Vector2d outerWallSplitPoint, Vector2d transitWallSplitPoint,
                                           ref int lastOuterIndex, ref int lastTransitIntex)
        {
            var apartment = new Apartment(settings.ObjectPool);

            AddOuterWalls(settings, floor, context, apartment, extrudedWalls,
                          outerWallSplitPoint, lastOuterIndex);

            AddTransitWalls(settings, floor, context, apartment, extrudedWalls,
                            transitWallSplitPoint, lastTransitIntex);

            if (outerWallSplitPoint != Vector2d.Empty)
            {
                floor.PartitionWalls.Add(new LineSegment2d(outerWallSplitPoint, transitWallSplitPoint));
            }

            floor.Apartments.Add(apartment);

            lastOuterIndex   = context.OuterWallIndex;
            lastTransitIntex = context.TransitWallIndex;
        }
Example #2
0
 private static void AddTransitWall(Floor floor, Apartment apartment, Vector2d start, Vector2d end)
 {
     floor.TransitWalls.Add(new LineSegment2d(start, end));
     apartment.TransitWalls.Add(floor.TransitWalls.Count - 1);
 }