Пример #1
0
        /*-----Constructor-----*/

        /// <summary>
        /// A new gemstone
        /// Any value not provided is randomly generated
        /// </summary>
        public Gem(GemstoneEnum?type = null, GemstoneCutEnum?cut = null, double?clarityGrade = null, double?colorGrade = null, double?cutGrade = null, double?size = null, GemColor?color = null)
        {
            ID = Guid.NewGuid();

            Type = type ?? ValueGenerator.GetRandomGemstoneType();

            if (GemstoneAdditions.UncutStones.Contains(Type))
            {
                Cut = GemstoneCutEnum.Uncut;
            }
            else
            {
                Cut = cut ?? ValueGenerator.GetRandomGemstoneCut();
            }

            Color = color ?? ValueGenerator.GetRandomGemstoneColor(Type);

            ClarityGrade = clarityGrade ?? ValueGenerator.GetCommonRandomVariable();
            ColorGrade   = colorGrade ?? ValueGenerator.GetCommonRandomVariable();
            CutGrade     = cutGrade ?? ValueGenerator.GetCommonRandomVariable();
            Size         = size ?? ValueGenerator.GetRandomSizeValue();

            SetGemTypeValues();
        }