public ConstructionCopy(ProceduralRoom room, RoomRemapper remapper = null) { Logger = room.Owner.Logger.Root().CreateProxy(GetType().Name); var i = room.Part.PrimaryGrid; var o = new MyObjectBuilder_CubeGrid { GridSizeEnum = i.GridSizeEnum, IsStatic = true, DampenersEnabled = true, Handbrake = true, DisplayName = room.Owner.Seed.Name, DestructibleBlocks = true, IsRespawnGrid = false, Editable = true, PersistentFlags = MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene | MyPersistentEntityFlags2.CastShadows, PositionAndOrientation = new MyPositionAndOrientation(GridCreator.WorldTransformFor(room.Owner)) }; BoundingBox = BoundingBoxD.CreateInvalid(); Construction = room.Owner; PrimaryGrid = o; AuxGrids = new List <MyObjectBuilder_CubeGrid>(); m_remapper = remapper ?? new RoomRemapper(Logger.Root()); var iwatch = new Stopwatch(); m_remapper.Remap(room, this); Logger.Debug("Added room {3} of {0} blocks with {1} aux grids in {2}", room.Part.PrimaryGrid.CubeBlocks.Count, room.Part.Prefab.CubeGrids.Length - 1, iwatch.Elapsed, room.Part.Name); }
public ProceduralConstruction(ILogging logBase, ProceduralConstructionSeed seed) { Logger = logBase.Root().CreateProxy(GetType().Name); m_roomTree = new MyDynamicAABBTree(Vector3.Zero); m_rooms = new Dictionary <int, ProceduralRoom>(); m_mountPoints = new Dictionary <Vector3I, ProceduralMountPoint>(); m_roomsSafeOrder = new List <ProceduralRoom>(); Seed = seed; BlockSetInfo = new BlockSetInfo(); }