예제 #1
0
        private PreGarment CreatePreGarment(Silouhette s, ColorFamily cf, PatternType pt)
        {
            PreGarment g = new PreGarment();

            g.PreSilouhette = s.PreSilouhette;
            g.ColorFamily   = cf;
            g.PatternType   = pt;

            return(g);
        }
예제 #2
0
 /// <summary>
 /// Determines if a garment is an accessory
 /// </summary>
 /// <param name="garment">Garment</param>
 /// <returns>True if it is an accessory</returns>
 public static bool IsAccessory(PreGarment pregarment)
 {
     return(pregarment.Silouhette.Layers.Contains(LayerCode.ACC1) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC2) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC3) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC4) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC5) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC6) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC7) ||
            pregarment.Silouhette.Layers.Contains(LayerCode.ACC8));
 }
예제 #3
0
        public Garment CreateGarment(PreGarment pregarment)
        {
            Garment g = new Garment();

            SharpArch.Testing.EntityIdSetter.SetIdOf <int>(g, pregarment.Id);

            g.Tags.Silouhette = new Silouhette {
                PreSilouhette = pregarment.PreSilouhette
            };
            g.Tags.Pattern = new Pattern {
                Type = pregarment.PatternType
            };
            g.Tags.Colors.Add(new Color {
                Family = pregarment.ColorFamily
            });

            g.Tags.Seasons.Add(Season.Summer);
            g.Tags.EventTypes.Add(CreateEventTypes()[0]);
            g.PreGarment = pregarment;

            //if (rnd.Next(0, 5) != 0) // Some could be for all seasons.
            //{
            //    // Most logically they will be used on two seasons.
            //    if (rnd.Next(0, 2) == 0)
            //    {
            //        g.Tags.Seasons.Add(Season.Summer);
            //        g.Tags.Seasons.Add(Season.Spring);
            //    }
            //    else
            //    {
            //        g.Tags.Seasons.Add(Season.Winter);
            //        g.Tags.Seasons.Add(Season.Fall);
            //    }
            //}
            //else
            //{
            //foreach (Season season in Enum.GetValues(typeof(Season)))
            //    g.Tags.Seasons.Add(season);
            //}

            //if (rnd.Next(0, 5) != 0) // Some could be for all seasons.
            //{
            //    g.Tags.EventTypes.Add(GetRandomEventType());
            //    g.Tags.EventTypes.Add(GetRandomEventType());
            //}
            //else
            //{
            //foreach (EventType eventType in CreateEventTypes())
            //    g.Tags.EventTypes.Add(eventType);
            //}

            return(g);
        }
예제 #4
0
        public IList <PreGarment> CreatePreGarments()
        {
            int i = 1;
            IList <PreGarment> lstGarments = new List <PreGarment>();

            foreach (Silouhette sl in CreateSilouhettes())
            {
                foreach (ColorFamily color in CreateColorFamilies())
                {
                    if (sl.Layers.Contains(LayerCode.ACC1) ||
                        sl.Layers.Contains(LayerCode.ACC2) ||
                        sl.Layers.Contains(LayerCode.ACC3) ||
                        sl.Layers.Contains(LayerCode.ACC4) ||
                        sl.Layers.Contains(LayerCode.ACC5) ||
                        sl.Layers.Contains(LayerCode.ACC6) ||
                        sl.Layers.Contains(LayerCode.ACC7) ||
                        sl.Layers.Contains(LayerCode.ACC8))
                    {
                        PreGarment g = CreatePreGarment(sl, color, PatternType.Solid);
                        SharpArch.Testing.EntityIdSetter.SetIdOf <int>(g, i);
                        i++;
                        lstGarments.Add(g);
                        continue;
                    }

                    foreach (PatternType patternType in Enum.GetValues(typeof(PatternType)))
                    {
                        PreGarment g = CreatePreGarment(sl, color, patternType);
                        SharpArch.Testing.EntityIdSetter.SetIdOf <int>(g, i);
                        i++;
                        lstGarments.Add(g);
                    }
                }
            }

            return(lstGarments);
        }