Ejemplo n.º 1
0
 public ConfigurationGrid2D(RoomTemplateInstanceGrid2D shape, Vector2Int position, TEnergyData energyData, RoomNode <TNode> node)
 {
     RoomShape  = shape;
     Position   = position;
     EnergyData = energyData;
     Room       = node;
 }
        public ConfigurationSpace GetConfigurationSpaceOverCorridors(RoomTemplateInstanceGrid2D roomTemplateInstance, RoomTemplateInstanceGrid2D fixedRoomTemplateInstance, List <RoomTemplateInstanceGrid2D> corridors)
        {
            var configurationSpaceLines = new List <OrthogonalLineGrid2D>();

            foreach (var corridor in corridors)
            {
                var corridorConfigurationSpace = GetConfigurationSpaceOverCorridor(
                    roomTemplateInstance.RoomShape, roomTemplateInstance.DoorLines,
                    fixedRoomTemplateInstance.RoomShape, fixedRoomTemplateInstance.DoorLines,
                    corridor.RoomShape, corridor.DoorLines);

                configurationSpaceLines.AddRange(corridorConfigurationSpace.Lines);
            }

            configurationSpaceLines = lineIntersection.RemoveIntersections(configurationSpaceLines);

            return(new ConfigurationSpace()
            {
                Lines = configurationSpaceLines,
            });
        }
 public ConfigurationSpaceGrid2D GetConfigurationSpace(RoomTemplateInstanceGrid2D roomTemplateInstance, RoomTemplateInstanceGrid2D fixedRoomTemplateInstance, List <int> offsets = null)
 {
     return(GetConfigurationSpace(roomTemplateInstance.RoomShape, roomTemplateInstance.DoorLines,
                                  fixedRoomTemplateInstance.RoomShape, fixedRoomTemplateInstance.DoorLines, offsets));
 }