public override object Clone() { Entrance clone = new Entrance(Size, Materials, StaticComponents); clone.Location = (Data.Cord) this.Location.Clone(); clone.id = this.id; Dictionary <Data.SideCardinalDirection, List <Data.Side> > tempSides = new Dictionary <Data.SideCardinalDirection, List <Data.Side> >(); foreach (Data.SideCardinalDirection sidePosition in Enum.GetValues(typeof(Data.SideCardinalDirection))) { tempSides[sidePosition] = new List <Data.Side>(); foreach (Data.Side part in Sides[sidePosition]) { tempSides[sidePosition].Add((Data.Side)part.Clone()); } } clone.Sides = tempSides; return(clone); }
private Space.RoomRelationShip PlanFirstLevel() { //현관 정의 Space.Room enterence = new Space.Entrance(Conditions.RoomSize.EnterenceSize, GetMaterials(Space.RoomType.Entrance), Conditions.StaticComponents); Space.RoomRelationShip enterenceRel = new Space.RoomRelationShip(enterence, Space.RelationLevel.First); this.Register(enterenceRel); //거실 정의 Space.Room living = new Space.Living(Conditions.RoomSize.LivingSize, GetMaterials(Space.RoomType.Living), Conditions.StaticComponents); Space.RoomRelationShip livingRel = new Space.RoomRelationShip(living, Space.RelationLevel.First); //거실 남향을 통창으로 바꿈 living.Sides[Data.SideCardinalDirection.South][0].Type = Data.SideType.WindowWall; this.ConnectRelation(livingRel, enterenceRel, Space.ConnectionType.Door); this.Register(livingRel); //주방 정의 Space.Room kitchen = new Space.Kitchen(Conditions.RoomSize.KitchenSize, GetMaterials(Space.RoomType.Kitchen), Conditions.StaticComponents); Space.RoomRelationShip kitchenRel = new Space.RoomRelationShip(kitchen, Space.RelationLevel.First); this.ConnectRelation(livingRel, kitchenRel, Space.ConnectionType.Open); this.Register(kitchenRel); //침실 정의 List <Space.Room> beds = new List <Space.Room>(); foreach (Data.Size size in Conditions.RoomSize.BedSizes) { Space.Room bed = new Space.Bed(size, GetMaterials(Space.RoomType.Bed), Conditions.StaticComponents); Space.RoomRelationShip bedRel = new Space.RoomRelationShip(bed, Space.RelationLevel.First); this.ConnectRelation(livingRel, bedRel, Space.ConnectionType.Door); this.Register(bedRel); beds.Add(bed); } beds.Sort(); //침실을 크기에 따라 정렬 //화장실 정의 for (int i = 0; i < Conditions.RoomSize.RestSizes.Count; i++) { Space.Room rest = new Space.Rest(Conditions.RoomSize.RestSizes[i], GetMaterials(Space.RoomType.Rest), Conditions.StaticComponents); Space.RoomRelationShip restRel = new Space.RoomRelationShip(rest, Space.RelationLevel.First); if (i == 0) { this.ConnectRelation(livingRel, restRel, Space.ConnectionType.Door); } else { if (beds.Count != 0) { Space.Room target = beds.First(); this.ConnectRelation(this.Relationships[target.id], restRel, Space.ConnectionType.Door); beds.Remove(target); } } this.Register(restRel); } //계단 정의 Space.Room stair = new Space.Stair(new Data.Size(260, 400, Data.Config.RoomHeight), GetMaterials(Space.RoomType.Stair), Conditions.StaticComponents); Space.RoomRelationShip stairRel = new Space.RoomRelationShip(stair, Space.RelationLevel.First); this.ConnectRelation(livingRel, stairRel, Space.ConnectionType.Open); this.Register(stairRel); return(stairRel); }