//TODO: Side를 체크해서 연결된 부분의 방향에 따라, 계단의 배치가 변경되도록 코딩할 필요가 있다. protected virtual void CreateFullstair(RelationLevel level) { //계단 생성을 위한 변수 Data.Cord location = new Data.Cord(); Data.Rot rotation = new Data.Rot(); int number = 7; double width = this.Size.Length / 2 - Data.Config.WallTickness; double length = (this.Size.Width - (width * 2)) / number; double height = (Data.Config.RoomHeight / 2) / 8; double foundation = 0; //처음 진입하는 계단 rotation = new Data.Rot(0, 0, 270); location = new Data.Cord( this.Location.X + Data.Config.WallTickness, this.Location.Y + this.Size.Width - width - 10, // -10은 Stair 모델에서 튀어나온 부분 때문에 겹치지 않도록 하느라... this.Location.Z + Data.Config.FloorTickness); this.Components.Add(new Model.Fullstair(location, rotation, number, length, width, height, foundation, Materials[Model.ModelType.Fullstair])); //2층 계단으로 진입하기 전, 평지 //오른쪽 foundation = (Data.Config.RoomHeight / 2) - height; location = new Data.Cord( this.Location.X + Data.Config.WallTickness, this.Location.Y + this.Size.Width - Data.Config.WallTickness, this.Location.Z + Data.Config.FloorTickness + foundation); this.Components.Add(new Model.Fullstair(location, rotation, 1, width, width, height, foundation, Materials[Model.ModelType.Fullstair])); //왼쪽 rotation = new Data.Rot(0, 0, 90); location = new Data.Cord(this.Location.X - Data.Config.WallTickness + this.Size.Length, this.Location.Y + this.Size.Width - Data.Config.WallTickness - width, this.Location.Z + Data.Config.FloorTickness + foundation); this.Components.Add(new Model.Fullstair(location, rotation, 1, width, width, height, foundation, Materials[Model.ModelType.Fullstair])); //2층 진입 계단 foundation = (Data.Config.RoomHeight / 2); location = new Data.Cord( this.Location.X + this.Size.Length - Data.Config.WallTickness, this.Location.Y + width - 10, this.Location.Z + Data.Config.FloorTickness + (Data.Config.RoomHeight / 2)); this.Components.Add(new Model.Fullstair(location, rotation, number, length, width, height, foundation, Materials[Model.ModelType.Fullstair])); //2층 계단과 연결되는 평지 foundation = 0; rotation = new Data.Rot(0, 0, 90); location = new Data.Cord(this.Location.X + this.Size.Length, this.Location.Y + Data.Config.WallTickness, this.Location.Z + Data.Config.FloorTickness + Data.Config.RoomHeight - Data.Config.FloorTickness); this.Components.Add(new Model.Fullstair(location, rotation, 1, width, width * 2, height, foundation, Materials[Model.ModelType.Fullstair])); }
public RoomRelationShip(Space.Room origin, RelationLevel level) { this.Origin = origin; this.Level = level; this.Relations = new Dictionary <Guid, ConnectionType>(); }
//방에 추가적인 물체를 둘 때는 이 함수를 활용할 것! (가구같은 것들) public virtual void CreateComponents(bool isFloor, bool isRoof, int cameraNumber, bool isStair, RelationLevel level) { this.Components.Clear(); if (isFloor) { this.CreateFloor(); } this.CreateWalls(); if (isRoof) { this.CreateRoof(); this.CreateLight(); } this.CreateCamera(cameraNumber); if (isStair) { this.CreateFullstair(level); } this.CreateFurniture(); }