private Space.RoomRelationShip PlanSecondLevel(Space.RoomRelationShip connRel) { //계단 정의 Space.Room stair = new Space.Stair(connRel.Origin.Size, connRel.Origin.Materials, Conditions.StaticComponents); Space.RoomRelationShip stairRel = new Space.RoomRelationShip(stair, Space.RelationLevel.Second); this.ConnectRelation(stairRel, connRel, Space.ConnectionType.Level); this.Register(stairRel); //가족실(거실) 정의 Space.Room family = new Space.Living(new Data.Size(360, 400, Data.Config.RoomHeight), GetMaterials(Space.RoomType.Living), Conditions.StaticComponents); Space.RoomRelationShip familyRel = new Space.RoomRelationShip(family, Space.RelationLevel.Second); this.ConnectRelation(stairRel, familyRel, Space.ConnectionType.Open); this.Register(familyRel); //침실 정의 Space.Room bed = new Space.Bed(new Data.Size(350, 380, Data.Config.RoomHeight), GetMaterials(Space.RoomType.Bed), Conditions.StaticComponents); Space.RoomRelationShip bedRel = new Space.RoomRelationShip(bed, Space.RelationLevel.Second); this.ConnectRelation(bedRel, familyRel, Space.ConnectionType.Door); this.Register(bedRel); //화장실 정의 Space.Room rest = new Space.Rest(new Data.Size(260, 300, Data.Config.RoomHeight), GetMaterials(Space.RoomType.Rest), Conditions.StaticComponents); Space.RoomRelationShip restRel = new Space.RoomRelationShip(rest, Space.RelationLevel.Second); this.ConnectRelation(restRel, familyRel, Space.ConnectionType.Door); this.Register(restRel); return(stairRel); }
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); }