コード例 #1
0
 public void WriteSize(Data.Size size)
 {
     Writer.WriteStartElement("Size");
     Writer.WriteElementString("l", XmlConvert.ToString(size.Length));
     Writer.WriteElementString("w", XmlConvert.ToString(size.Width));
     Writer.WriteElementString("h", XmlConvert.ToString(size.Height));
     Writer.WriteEndElement();
 }
コード例 #2
0
        public RoomSize(double maxSpace, int bedNum, int resNum)
        {
            //현관
            EnterenceSize = new Data.Size(250, 240, Data.Config.RoomHeight);

            //거실
            double ratioLiving = 0.3;

            int select = rnd.Next(Ratio.Length);

            double multiple = Math.Sqrt((maxSpace * ratioLiving) / (Ratio[select].Item1 * Ratio[select].Item2));

            double livingLength = multiple * Ratio[select].Item1;
            double livingWidth  = multiple * Ratio[select].Item2;

            //테스트를 위해, 고정값을 입력
            //LivingSize = new Data.Size(livingLength, livingWidth, Data.Config.RoomHeight);
            LivingSize = new Data.Size(700, 800, Data.Config.RoomHeight);

            //주방
            double ratioKitchen = 0.2;

            select = rnd.Next(Ratio.Length);

            multiple = Math.Sqrt((maxSpace * ratioKitchen) / (Ratio[select].Item1 * Ratio[select].Item2));

            double KitchenLength = multiple * Ratio[select].Item1;
            double KitchenWidth  = multiple * Ratio[select].Item2;

            //테스트를 위해, 고정값을 입력
            //KitchenSize = new Data.Size(KitchenLength, KitchenWidth, Data.Config.RoomHeight);
            KitchenSize = new Data.Size(400, 500, Data.Config.RoomHeight);

            //침실
            BedSizes = new List <Data.Size>();
            for (int i = 1; i <= bedNum; i++)
            {
                select = rnd.Next(Roomspace.Length);
                BedSizes.Add(new Data.Size(Roomspace[select].Item1, Roomspace[select].Item2, Data.Config.RoomHeight));
            }

            //화장실
            RestSizes = new List <Data.Size>();
            for (int i = 1; i <= resNum; i++)
            {
                RestSizes.Add(new Data.Size(260, 300, Data.Config.RoomHeight));
            }
        }